Dialogue w/ multiple characters

R

Rockit381

Guest
So I want multiple characters/NPCs to speak simultaneously in one dialogue box, as if they are all talking to each other in one conversation. Each character's face will be shown on both sides of the dialogue box I've only got about half-a-year's worth of experience in GML, and I can write dialogue for one character, but seem to have a little bit of trouble w/ multiple. Any and all code I can make fit w/ mine, so I just need a general idea of how to get it done efficiently. My big question is: How can I write dialogue for multiple characters in one box? Any and all help is appreciated! Thank you!
 
Last edited by a moderator:

FrostyCat

Redemption Seeker
How exactly is doing a textbox with one character any different from doing a textbox with multiple characters?

With one character, you specify the character's face and the body text while creating the box. With multiple characters, you specify a list of character faces, which one is speaking, and the body text. Adjust the drawing positions accordingly and you're set.

None of this is difficult or new unless you are hard-coding messages into hundreds of distinct objects on the resource tree.
 
R

Rockit381

Guest
Alright, so could I do this in just one object and have each character give it's messages and facial expressions to that object, or is there an easier way of doing this? I was confused because I didn't know if I should put an entire cutscene into a script, or if I should let the characters decide whether it's their turn to speak or not. In other words, how would I go about swapping between speakers?
 

origamihero

Member
You could keep the active speaker's ID and text in global variables. It also sounds like you need a way to play out a dialogue between characters. There are many ways to do this. I've used arrays or ds_lists to store and play a queue of events and dialogues in my projects, that always seems to do the trick.
 

TheouAegis

Member
Show all the characters' avatars at the same time. Then draw a rectangle around whichever one is talking, or animate the avatar for whichever one is talking.

As GG said, it's not significantly different from a normal text box.

Personally, I'd make an array of all the possible things anyone could say. Then make a 2D array for each dialogue that holds which character is speaking at each phse of the dialogue and what index in the texts array to use in the speech. But that's just me.
 
R

Rockit381

Guest
Alright, I think I've got it from here. I can put an entire cutscene into a script, and configure the dialogue and facial expressions and movements from there. I have a switch statement set up to change between speakers & cutscenes, so that should do the trick. Thank you guys so much, I appreciate it!
 
Top