Author Topic: Any advice when making a custom message system?  (Read 1295 times)

Offline legacyblade

  • Pretzel Man
  • Moderator
  • Chaos User
  • ***
  • Posts: 1838
  • LV: 84
  • Gender: Male
  • There is a fate worse than hell
    • View Profile
    • SpencerConrad.com
Any advice when making a custom message system?
« on: February 07, 2010, 08: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)

Offline Ryex

  • Arctic Bird of Programming
  • Global Moderator
  • Chaos Ultimate
  • ****
  • Posts: 5135
  • LV: 198
  • Gender: Female
  • Wants to write a compiler for fun
    • View Profile
Re: Any advice when making a custom message system?
« Reply #1 on: February 07, 2010, 11: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
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.

DropBox, the best free file syncing service there is.
(click to show/hide)

Offline legacyblade

  • Pretzel Man
  • Moderator
  • Chaos User
  • ***
  • Posts: 1838
  • LV: 84
  • Gender: Male
  • There is a fate worse than hell
    • View Profile
    • SpencerConrad.com
Re: Any advice when making a custom message system?
« Reply #2 on: February 08, 2010, 12:24:42 AM »
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.

Offline Blizzard

  • This sexy
  • Administrator
  • has over 9000 posts
  • *****
  • Posts: 20016
  • LV: 651
  • Gender: Male
  • Magic midgets.
    • View Profile
    • You're already on it. (-_-')
Re: Any advice when making a custom message system?
« Reply #3 on: February 08, 2010, 11: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.
Check out Daygames and our games:

King of Booze      King of Booze: Never Ever      Pet Bots
Drinking Game for Android      Never have I ever for Android      Pet Bots for Android
Drinking Game for iOS      Never have I ever for iOS      Pet Bots for iOS
Drinking Game on Steam


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

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

Offline legacyblade

  • Pretzel Man
  • Moderator
  • Chaos User
  • ***
  • Posts: 1838
  • LV: 84
  • Gender: Male
  • There is a fate worse than hell
    • View Profile
    • SpencerConrad.com
Re: Any advice when making a custom message system?
« Reply #4 on: February 09, 2010, 12:26:30 AM »
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?

Offline Blizzard

  • This sexy
  • Administrator
  • has over 9000 posts
  • *****
  • Posts: 20016
  • LV: 651
  • Gender: Male
  • Magic midgets.
    • View Profile
    • You're already on it. (-_-')
Re: Any advice when making a custom message system?
« Reply #5 on: February 09, 2010, 10:36:35 AM »
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      King of Booze: Never Ever      Pet Bots
Drinking Game for Android      Never have I ever for Android      Pet Bots for Android
Drinking Game for iOS      Never have I ever for iOS      Pet Bots for iOS
Drinking Game on Steam


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

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

Offline Fantasist

  • Lexima Warrior
  • *******
  • Posts: 2223
  • LV: 146
  • Gender: Male
    • View Profile
    • Blog
Re: Any advice when making a custom message system?
« Reply #6 on: February 09, 2010, 05:58:05 PM »
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.
« Last Edit: February 09, 2010, 06:00:49 PM by Fantasist »
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



Offline Ryex

  • Arctic Bird of Programming
  • Global Moderator
  • Chaos Ultimate
  • ****
  • Posts: 5135
  • LV: 198
  • Gender: Female
  • Wants to write a compiler for fun
    • View Profile
Re: Any advice when making a custom message system?
« Reply #7 on: February 09, 2010, 09:45:08 PM »
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.

DropBox, the best free file syncing service there is.
(click to show/hide)

Offline Blizzard

  • This sexy
  • Administrator
  • has over 9000 posts
  • *****
  • Posts: 20016
  • LV: 651
  • Gender: Male
  • Magic midgets.
    • View Profile
    • You're already on it. (-_-')
Re: Any advice when making a custom message system?
« Reply #8 on: February 10, 2010, 10:10:48 AM »
Sure.
Check out Daygames and our games:

King of Booze      King of Booze: Never Ever      Pet Bots
Drinking Game for Android      Never have I ever for Android      Pet Bots for Android
Drinking Game for iOS      Never have I ever for iOS      Pet Bots for iOS
Drinking Game on Steam


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

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