Message box feature, instant message display while writing

This forum is currently in read-only mode.
From the Asset Store
Punch the boxes as hard as you can and crush them all!
  • Is this the best way to go about doing this? You know how in games, a message pops up, and it starts writing out text and if you push the confirmation button while it's writing, it instantly displays the whole page?

    I wanna do that, but I'm not sure if the way I've done it is the most efficient way. Some copying and pasting is required, and bloating of the event sheet, but the way I've done it like this, it works exactly like that. The text will be writing, and if you push the confirmation button again, it displays the whole thing. Then you can move onto the next page.

    But, I'd like it if someone could take a look and tell me if this is absolutely the only way of doing this, or if there could be a cleaner, more programmer-friendly way of doing this.

    By the way, ignore line 8, it has nothing to do with this. It's a leftover from previous attempts at getting this to work.

    <img src="http://i77.photobucket.com/albums/j42/Dreamer_Kisai/MessageBoxEventSheet.jpg">

  • All I can say is that your events are too messy. I got kinda lazy reading it lol. Anyway, I did something similar before but I guess I lost it or something. Its great that it worked, but if that's going to be your code for every dialog to be be done in your game, then that event sheet's going to be really long.

    All I can suggest is find a way to make one event sheet that will cater every dialog in your game. Just call that event sheet whenever a dialog scene will take place and then let it loop until that dialog scene is over.

    I'll be doing one probably in an rpg game I'm working on, but I'm still busy with other stuff.

  • There are certainly many ways to do almost anything in Construct.

    If I had more than a small amount of dialogue in the game, I'd probably go for something a bit more dynamic than that. I've never used the timeline object, so I'd probably go for my usual solution of creating variables of some sort to control it.

    Since the complexity of dialogue systems in various games can differ greatly, it's hard to say how well what I'd do would fit your game, but I'd most likely load all of the dialogue into an array from a separate file. Then I'd create another array that contained the indexes of the start and end of the dialogue for each segment of the story progression. If there are more 'speakers' than one, then that would also have to contain an index for said 'speaker' with each segment.

    With that in place, one can build an 'engine' to activate, display, handle input, and deactivate dialogue, so that a function call or enable group (or whatever) could be used for dynamically handling any point in the story progression.

    I made a quick mock-up of the idea here:

    http://dl.dropbox.com/u/5868916/dialogue.cap

    It's very basic, and could very well be optimized quite a bit, but it gets the point across, I think. It doesn't handle story progression, but just displays whatever array entries you tell it to, when the global variables 'DialogBeginIndex' and 'DialogEndIndex' are set to something other than zero.

    It handles instant display of the text when the spacebar is pressed during writing in much the same way as you did, but doesn't have to have duplicate text in the event sheet, because it's stored in a variable already.

    Anyway, I'm more of a hobby programmer than a game designer. The first idea is usually not the best, in my experience, so don't be discouraged at the idea of re-writing portions of code if you come up with a better way. Maybe a mix of timeline and other variables to control things may work, too.

  • You should use parameters in the time line. I'll make you a quick example one sec...

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • http://dl.dropbox.com/u/939828/Message%20System.cap

    Here we go, a lot simplier

  • That's very cool, David. Thanks for that example. That's much simpler than I thought it could be! I guess I should study the Timeline object, soon.

  • dl.dropbox.com/u/939828/Message%20System.cap

    Here we go, a lot simplier

    VERY Nice and so useful for many different games,

    This is is much harder in Game Maker.

    Great Example David

  • dl.dropbox.com/u/939828/Message%20System.cap

    Here we go, a lot simplier

    Wow I've never used the timeline before and this just made my mind explode!

    Great example!

  • So say you had a game where conversation was between 2 people and depending what what action was taken. Would you have more than 1 Time Line?

    And if so when you came back to the fist Time Line? would it pick up where you left off?

    In other words can this be a little more dynamic?

  • So say you had a game where conversation was between 2 people and depending what what action was taken. Would you have more than 1 Time Line?

    And if so when you came back to the fist Time Line? would it pick up where you left off?

    In other words can this be a little more dynamic?

    From what I've seen so far, I'd say that if you want conditional branches in dialogue, you'd probably have to set up multiple timelines. Then, start a new timeline at the end of each timeline, based upon the player's choice.

    Maybe the timelines could go like so:

    1 ends with a question with 2 choices

    2a continues with choice 1

    2b continues with choice 2, which ends with 3 choices

    3a ...

    3b ...

    3c ...

    Could get pretty complicated that way...

    As for just having more than one character involved, with no branching dialogue, I made just a few modifications to David's original .cap to show one way to deal with that. There are a few ways to handle that, but I chose adding a second parameter to each entry to indicate the character number that it came from. Could also use different time period names, though that might get a bit more tricky in conditions.

    I ended up creating and destroying the text object for each message with the intention of allowing multiple messages to display simultaneously, but just left it at only allowing one for now. Basically, for what I ended up with, I could have just moved the text and panel for each message. Some more changes to the events would be needed for the former option, and I've got other things to work on. Here's the .cap:

    http://dl.dropbox.com/u/5868916/Multi-M ... System.cap

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)