Custom buttons on UI

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
Strongal
Posts: 2
Joined: Thu Aug 06, 2020 2:21 pm

Custom buttons on UI

Post by Strongal »

Hello! First of all, this is an amazing asset <3

I'm trying to create some sort of "interruption" during a conversation, in which you can stop the other character message by pressing a button in the canvas. This is how it would look, if I simplify it

Image (Edit: Seems like preview isnt working, link here: https://ibb.co/hKL70mV )

The conversation should go from Start, to "Conversacion1", then "Conversacion2" and then it should start all over, after an input. But I want to add a button on the canvas that makes "Presion1" show instead of "Conversacion2" if pressed instead of using the "Continue" button. Is there an easy way to do so? I've been reading the docs and trying several things the whole afternoon with little success.

Sorry if I'm missing something quite simple!
User avatar
Tony Li
Posts: 22054
Joined: Thu Jul 18, 2013 1:27 pm

Re: Custom buttons on UI

Post by Tony Li »

Hi,

Use Conditions on Declaracion2 and Presion1 so only one can be true at a time. (Conditions Tutorial)

By default, the Conditions for Declaracion2 should be true. For example:
  • Declaracion2 Conditions: Variable["Interrupt"] == false
  • Presion1 Conditions: Variable["Interrupt"] == true
Configure your special button to change the values that the Conditions check. Then call DialogueManager.UpdateResponses(). Example:

Code: Select all

DialogueLua.SetVariable("Interrupt", true);
DialogueManager.UpdateResponses();
Strongal
Posts: 2
Joined: Thu Aug 06, 2020 2:21 pm

Re: Custom buttons on UI

Post by Strongal »

Tony Li wrote: Thu Aug 06, 2020 4:17 pm Hi,

Use Conditions on Declaracion2 and Presion1 so only one can be true at a time. (Conditions Tutorial)

By default, the Conditions for Declaracion2 should be true. For example:
  • Declaracion2 Conditions: Variable["Interrupt"] == false
  • Presion1 Conditions: Variable["Interrupt"] == true
Configure your special button to change the values that the Conditions check. Then call DialogueManager.UpdateResponses(). Example:

Code: Select all

DialogueLua.SetVariable("Interrupt", true);
DialogueManager.UpdateResponses();
You're an absolute monster! I was on the right track, but I was missing the "UpdateResponses" line. Thank you so much! :D
This is so amazingly complete and allows for sooo many incredible things :)
User avatar
Tony Li
Posts: 22054
Joined: Thu Jul 18, 2013 1:27 pm

Re: Custom buttons on UI

Post by Tony Li »

Thanks! And happy to help.
Post Reply