Activate dialogue options via scripting

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
Yipikayei
Posts: 6
Joined: Fri Jun 07, 2019 7:43 am

Activate dialogue options via scripting

Post 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.
User avatar
Tony Li
Posts: 22056
Joined: Thu Jul 18, 2013 1:27 pm

Re: Activate dialogue options via scripting

Post by Tony Li »

Hi,

After setting the variable, call DialogueManager.UpdateResponses(). This will reevaluate the responses' Conditions and update the response menu.
Yipikayei
Posts: 6
Joined: Fri Jun 07, 2019 7:43 am

Re: Activate dialogue options via scripting

Post 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.
User avatar
Tony Li
Posts: 22056
Joined: Thu Jul 18, 2013 1:27 pm

Re: Activate dialogue options via scripting

Post 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.
Post Reply