Putting Conversations in Order with same Trigger

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
emberise
Posts: 2
Joined: Thu Jul 04, 2024 6:32 pm

Putting Conversations in Order with same Trigger

Post by emberise »

Hello,

I was hoping someone could help me out with this. I have a game where a player presses a button, has a conversation with an NPC, and then when that conversation ends, the player can press the same button, spawning in a new NPC and starting a new conversation with said new NPC. I have had success setting up the trigger, and having a whole (singular) conversation. My issue is currently understanding the logic of how to "queue" up the conversations so that the player can have them one after another, by pressing the same button.

If anyone could help with some advice that would be fantastic, thank you so much!
User avatar
Tony Li
Posts: 22107
Joined: Thu Jul 18, 2013 1:27 pm

Re: Putting Conversations in Order with same Trigger

Post by Tony Li »

Hi,

You could do this similarly to the second post on How To: Run a Conversation Only Once. In your specific case, you might want to use multiple Dialogue System Triggers (the first suggestion in the second post's list) so you can assign different actors to each Dialogue System Trigger.
emberise
Posts: 2
Joined: Thu Jul 04, 2024 6:32 pm

Re: Putting Conversations in Order with same Trigger

Post by emberise »

In terms of the dialogue, that worked perfectly! Thank you so much for that! Right now I am still struggling with getting the Gameobjects to setactive at the end of the conversation. (Have one NPC disappear from the place, and have another one take it's place)
User avatar
Tony Li
Posts: 22107
Joined: Thu Jul 18, 2013 1:27 pm

Re: Putting Conversations in Order with same Trigger

Post by Tony Li »

Hi!

Add an empty dialogue entry node at the end of the conversation. Set the Sequence field to:

Code: Select all

Continue()
You can type it manually or select "+" > Continue > Simulate continue button click.

Then add an OnExecute UnityEvent > Scene Event to deactivate one GameObject and activate the other, or use the SetActive () sequencer command. For example, let's say you want to deactivate a GameObject named Adam and activate one named Bob. In this case, you'd set the Sequence field to:

Code: Select all

required SetActive(Adam, false);
required SetActive(Bob, true);
Continue()
Post Reply