Any advice when making a custom message system?

Started by legacyblade, February 07, 2010, 01:01:43 pm

Previous topic - Next topic

legacyblade

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)

Ryex

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
I no longer keep up with posts in the forum very well. If you have a question or comment, about my work, or in general I welcome PM's. if you make a post in one of my threads and I don't reply with in a day or two feel free to PM me and point it out to me.<br /><br />DropBox, the best free file syncing service there is.<br />

legacyblade

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.

Blizzard

I love you. <3

Learning regex is a very good idea. If you need help with some aspects, you can always ask me.
Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

legacyblade

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?

Blizzard

Can you give me an example. (BTW, Regex is probably the most optimized way to find text patterns.)
Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

Fantasist

February 09, 2010, 10:58:05 am #6 Last Edit: February 09, 2010, 11:00:49 am by Fantasist
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.
Do you like ambient/electronic music? Then you should promote a talented artist! Help out here. (I'm serious. Just listen to his work at least!)


The best of freeware reviews: Gizmo's Freeware Reviews




Ryex

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
I no longer keep up with posts in the forum very well. If you have a question or comment, about my work, or in general I welcome PM's. if you make a post in one of my threads and I don't reply with in a day or two feel free to PM me and point it out to me.<br /><br />DropBox, the best free file syncing service there is.<br />

Blizzard

Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.