Page 1 of 1

Custom buttons on UI

Posted: Thu Aug 06, 2020 2:32 pm
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!

Re: Custom buttons on UI

Posted: Thu Aug 06, 2020 4:17 pm
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();

Re: Custom buttons on UI

Posted: Thu Aug 06, 2020 5:02 pm
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 :)

Re: Custom buttons on UI

Posted: Thu Aug 06, 2020 9:01 pm
by Tony Li
Thanks! And happy to help.