How do I make a dialogue system

Get help using Construct 2

Post » Mon Aug 18, 2014 6:35 pm

hello all.
i just need a little bit of help with some things.
i want to make a platformer where i can talk to people. i don't mean respond or input text but, i press and button and they speak. i press it again and it takes me to the next line of dialogue.

now i can make a text box appear but when it comes to doing it for a complete game with diffrent dialogue from different npc's , i have no clue how to implement this.

for example in castlevania dawn of sorrow (or any of the newer ones) they have cutscenes and shop keepers. i assume the text is stored somewhere, and i assume when you come in close contact and press a button the text is extracted and added to a text box in a certain way. i assume an array is involved .
how you code/implement this is a head scratcher, i just want my player to be able to talk to people and read signs and what not without having to code a specific text box for each situation.

i know from rpg maker each npc or character or even object has a way to store text and code . when you interact with them its extracted and read accordingly. i have been trying to find a way to have each npc store additional lines of text and have them extracted in specific situations since that system is so easy to use. (you have to boots, you dont have the boots)
everything i have tried has been extremely resource heavy and obviously the wrong way to go about it (event sheets for each npc or an invisible text box for each npc)

tl;dr how do you read and write to a text box, similar to reading a sign in a game or talking to a npc. where do i store the text and how do i extract it. also how will i do this for multiple npc's in a game with multiple instances. the rpg maker dialogue system is a great example of what im looking for in a resource economic way .
B
3
Posts: 4
Reputation: 179

Post » Mon Aug 18, 2014 6:52 pm

You could give the npc's text instance variables and set a text object to the instance variable on trigger..
Let's call the instance variable collisiontext, then the event would be:

player on collision with npc - text - set text to : npc.collisiontext
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Mon Aug 18, 2014 8:59 pm

thatnks for reply!
ill try this but im afraid its not quite the answer in full.
variables are about as far as i can get.
as soon as the text box appears thats it, i dont know how to make the dialogue wrap into the next line upon pressing whatever button. would i make multiple text instance variables for each line of dialogue or is there a way to wrap the dialogue ?
is there any example i can see with npc's in it , i have yet to find it
B
3
Posts: 4
Reputation: 179

Post » Mon Aug 18, 2014 9:15 pm

There are a few examples in the FAQ topic..

you could for instance work with the tokenat expression to have multiple lines in one variable..
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775


Return to How do I....?

Who is online

Users browsing this forum: BackendFreak, farsen, lahbach, newt, TRMG, Yahoo [Bot], Yarfapet and 17 guests