Hey everyone. After making a CMS, I've gotten a lot better at working with the RGSS window class. In my project I've been using Ccoa's UMS, which is great, but there are a lot of aspects that it are clunky (and there are a few things I'd like to see differently in terms of features anyways). So before I get started, I wanted to know if anyone had some advice for me or knew about some pitfalls I should try and avoid. I may release this script to the public, if I decide it's good enough, so feel free to request a feature too (not saying it'll make it in, but advice is good)
Learn Regular Expressions. that's my advise. they can be a bitch to learn and implement properly and at the same time are the key to any system the interprets strings. I made a very tiny edit of Ccoa's CMS and it was a pain. before your start on the system it self plan out all the feature you wan and the key word your going to use then make sure you evaluate the message in an order that one message can't be mistaken for another. you can look at Ccoa's CMS for an examples of how certain things are done. for the most part Ccoa's system is great there are just some things that could be smoothed out in terms of layout and such
Oh, I wasn't saying the code is clunky. While I can see a lot of ways I'd do things differently upon looking through her code, it's still quite good. I just meant it's some times a pain to USE the UMS (especially if you're switching between fixed and fitted mode every few text boxes.) I'm just catoring it to the way I'd like to event my cutscenes.
But thanks for the advice, I wasn't sure where to start. I'll try everything how you suggested.
I love you. <3
Learning regex is a very good idea. If you need help with some aspects, you can always ask me.
I'm running into some trouble. I've been working on regular expressions, and have gotten them pretty much figured out. How I'm planning on optimizing the use of window commands is to have it go through the string being used for the message and use the scan function to return an array of the commands used. (it'll later do the appropriate actions with the commands0
However, rather than having to use a separate scan function for each command, I want to be able to have it check for different blocks of text
(sort of how the [abui|oxp] works, but for a block of text, like [face|name] (where it'll see if those particular BLOCKS of text are used). Anyone know how to do this?
Can you give me an example. (BTW, Regex is probably the most optimized way to find text patterns.)
How about:
0. Start scanning each character
1. Start scanning at "["
2. Scan blocks of text delimited by "|" into an array using the "split" function
3. Stop scanning at "]"
4. Go to 1 whenever "[" occurs
Don't know about the overhead, though.
would this work?
use Regex to find the first block of
- in a string pull the commands in the [] in to an array and pull the charters in front of the [] block so you know where in the array you found that command then remove the block from the string and scan the new sting for the next [] block and repeating un till there is no matches
Sure.