Playing conversations one after another based on different variables

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
annathehank
Posts: 95
Joined: Sun May 03, 2020 2:17 pm

Playing conversations one after another based on different variables

Post by annathehank »

Hi Tony!

I thought I would check in here real quick before I set this up and possibly muck everything up :lol:

I have a series of conversations that are sort of like, event indicators. Such that when the player goes back to the main map scene, if the variables that indicate an event is ready are all true, a short conversation will run with whichever NPC the event is about popping up to say they need to talk to them/ask something. (for example, once you reach a certain friendship level with someone, they'll pop up and say they want to talk with you).

I'm not sure the best method to work this. My first guess would be to create many different system dialogue triggers on the main map scene, each with a different set of variable conditions set for On Start. But I have a feeling that will take a lot of loading time/cause some issues with it running through all the options. Is there a more streamlined option for this?

Thank you! <3
User avatar
Tony Li
Posts: 22049
Joined: Thu Jul 18, 2013 1:27 pm

Re: Playing conversations one after another based on different variables

Post by Tony Li »

Hi,

Since it's possible that multiple NPCs could be ready to talk, you might consider using alerts instead. Alerts can queue up so that they appear one after another. Conversations, on the other hand, don't queue up sequentially if you try to start multiple conversations at the same time. If you're using TextMesh Pro, you can include <sprite> tags in your alerts to show the NPC's portrait image.

If you use alerts, you can add a Dialogue System Trigger for each alert. Set it to OnStart like you said. Set the Conditions to check if the NPC wants to talk. Then Add Action > Show Alert to show the alert (e.g., "<sprite name="Abe">Abe: Can we talk?"). You may also want to Add Action > Run Lua Code to set a variable to remember that you showed the alert.

If you need to use conversations instead, you could write a custom script to queue up conversations. Since that's more complex, I won't go into details unless you need it.
annathehank
Posts: 95
Joined: Sun May 03, 2020 2:17 pm

Re: Playing conversations one after another based on different variables

Post by annathehank »

Thank you for the advice!

The alert system would work perfectly, but is there a way to have two alert boxes and indicate which one should play the alert?
I currently have another alert system in place for when the player unlocks a journal entry, which pops up in the top corner, and I'd want these alerts to play in the middle if possible.
User avatar
Tony Li
Posts: 22049
Joined: Thu Jul 18, 2013 1:27 pm

Re: Playing conversations one after another based on different variables

Post by Tony Li »

Hi,

Not out of the box, but I briefly described how you might implement it here.
annathehank
Posts: 95
Joined: Sun May 03, 2020 2:17 pm

Re: Playing conversations one after another based on different variables

Post by annathehank »

Thank you <3
User avatar
Tony Li
Posts: 22049
Joined: Thu Jul 18, 2013 1:27 pm

Re: Playing conversations one after another based on different variables

Post by Tony Li »

Happy to help!
Post Reply