Triggering a Response on Trigger Exit

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
pegassy
Posts: 135
Joined: Sat Mar 17, 2018 8:07 pm

Triggering a Response on Trigger Exit

Post by pegassy »

I am going with bubble menu UI for my dialogue style after some deliberation. I noticed now that the number of choices I have for the character at a time can bloat the screen too much, so I am looking for ways to reduce options.

One idea is to discard the "end dialogue" button (goodbye, I should go now, see you, etc) options by simply having the character say the content of that dialogue just by walking out of the trigger zone. Is there a way a particular dialogue option can be triggered if the character just exits the trigger? (Again, credit goes to Oxenfree for inspiration towards more genuine dialogue)
User avatar
Tony Li
Posts: 22058
Joined: Thu Jul 18, 2013 1:27 pm

Re: Triggering a Response on Trigger Exit

Post by Tony Li »

Hi,

You may prefer to handle it manually.

However, it's possible to handle it using Dialogue System Triggers and no scripting. Here's how:

On your regular Dialogue System Trigger, tick Stop Conversation On Trigger Exit.

Add another Dialogue System Trigger set to OnConversationEnd that runs a one-node conversation (e.g., "Goodbye").

At this point, when the player leaves the trigger zone, the player will always say "Goodbye", even if the conversation ended normally. To fix this:

1. Add a Boolean variable, for example named "Said Bye".

2. In the normal conversation's <START> node's Script field, set "Said Bye" to false.

3. In the final nodes of the normal conversation, use the Script field to set "Said Bye" to true.

4. In the Dialogue System Trigger that's set to OnConversationEnd, add a Condition > Lua Condition that "Said Bye" is false.
pegassy
Posts: 135
Joined: Sat Mar 17, 2018 8:07 pm

Re: Triggering a Response on Trigger Exit

Post by pegassy »

That is a pretty brilliant solution. Thank you for the direction.
User avatar
Tony Li
Posts: 22058
Joined: Thu Jul 18, 2013 1:27 pm

Re: Triggering a Response on Trigger Exit

Post by Tony Li »

Glad to help!
Post Reply