Chaos Project

RPG Maker => RPG Maker Scripts => Topic started by: legacyblade on February 07, 2010, 01:01:43 pm

Title: Any advice when making a custom message system?
Post by: legacyblade on February 07, 2010, 01:01:43 pm
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)
Title: Re: Any advice when making a custom message system?
Post by: Ryex on February 07, 2010, 04:26:44 pm
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
Title: Re: Any advice when making a custom message system?
Post by: legacyblade on February 07, 2010, 05:24:42 pm
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.
Title: Re: Any advice when making a custom message system?
Post by: Blizzard on February 08, 2010, 04:50:00 am
I love you. <3

Learning regex is a very good idea. If you need help with some aspects, you can always ask me.
Title: Re: Any advice when making a custom message system?
Post by: legacyblade on February 08, 2010, 05:26:30 pm
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?
Title: Re: Any advice when making a custom message system?
Post by: Blizzard on February 09, 2010, 03:36:35 am
Can you give me an example. (BTW, Regex is probably the most optimized way to find text patterns.)
Title: Re: Any advice when making a custom message system?
Post by: Fantasist on February 09, 2010, 10:58:05 am
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.
Title: Re: Any advice when making a custom message system?
Post by: Ryex on February 09, 2010, 02:45:08 pm
would this work?

use Regex to find the first block of
Title: Re: Any advice when making a custom message system?
Post by: Blizzard on February 10, 2010, 03:10:48 am
Sure.