Message box feature, instant message display while writing

For questions about using Classic.

Post » Tue Jul 06, 2010 3:22 am

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.

B
4
S
2
G
4
Posts: 164
Reputation: 1,878

Post » Tue Jul 06, 2010 1:49 pm

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.
B
10
S
5
G
8
Posts: 203
Reputation: 4,395

Post » Wed Jul 07, 2010 3:11 am

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.
B
3
S
2
G
2
Posts: 187
Reputation: 1,449

Post » Wed Jul 07, 2010 10:30 am

You should use parameters in the time line. I'll make you a quick example one sec...
B
4
S
2
G
5
Posts: 641
Reputation: 3,011

Post » Wed Jul 07, 2010 10:40 am

B
4
S
2
G
5
Posts: 641
Reputation: 3,011

Post » Wed Jul 07, 2010 9:02 pm

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. ;)
B
3
S
2
G
2
Posts: 187
Reputation: 1,449

Post » Wed Jul 07, 2010 10:39 pm

[quote="David":1oilyqqk]http://dl.dropbox.com/u/939828/Message%20System.cap

Here we go, a lot simplier :)[/quote:1oilyqqk]


VERY Nice and so useful for many different games,
This is is much harder in Game Maker.

Great Example David
B
28
S
8
G
8
Posts: 530
Reputation: 7,154

Post » Wed Jul 07, 2010 10:42 pm

[quote="David":1zzs7rpy]http://dl.dropbox.com/u/939828/Message%20System.cap

Here we go, a lot simplier :)[/quote:1zzs7rpy]

Wow I've never used the timeline before and this just made my mind explode!
Great example!
B
2
S
2
G
3
Posts: 140
Reputation: 1,530

Post » Wed Jul 07, 2010 10:54 pm

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?
B
28
S
8
G
8
Posts: 530
Reputation: 7,154

Post » Thu Jul 08, 2010 3:13 am

[quote="Guyon":2celvmbt]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?[/quote:2celvmbt]

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
B
3
S
2
G
2
Posts: 187
Reputation: 1,449

Next

Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 5 guests