Page 1 of 1

Activate dialogue options via scripting

Posted: Wed Jun 12, 2019 12:55 pm
by Yipikayei
Hello,

I don't know how can I activate/desactivate options in the dialogue via scripting in "real time".

For example:
Start conversation:
- Hello
- Hello, how are you?
And now there is no options until the player interact with a coke (for example), so in scripting I have this: DialogueLua.SetVariable("ImFine", true). I want in THAT moment show a new option in the dialogue "I'm fine now".

Can you help me, please?

Thanks in advance.

Re: Activate dialogue options via scripting

Posted: Wed Jun 12, 2019 1:09 pm
by Tony Li
Hi,

After setting the variable, call DialogueManager.UpdateResponses(). This will reevaluate the responses' Conditions and update the response menu.

Re: Activate dialogue options via scripting

Posted: Thu Jun 13, 2019 8:26 am
by Yipikayei
Thank you!

That is working but showing the options as not elegible, but if I don't want show options until the action is completed, could it be possible? Like waiting until something is done.

Thanks in advance.

Re: Activate dialogue options via scripting

Posted: Thu Jun 13, 2019 8:42 am
by Tony Li
Turn off the Dialogue Manager's Input Settings > Include Invalid Entries.

If you need to show some invalid entries and hide others, there is a thread in this forum section that covers how to do that.