Page 1 of 1

Unlock Dialogue Options in Runtime

Posted: Sun Mar 24, 2024 1:42 pm
by GREI
Hi Tony,
I want to have a system where some dialogue options remain hidden(or locked) unless the player has done something in the game.

e.g. Only when player clicks on a book in a scene, then a dialogue option unlocks and reads "read the book's content".
the response panel would remain open the whole time, with reponse options changing from [1]...
[2]...
to
[1]...
[2]...
[3]...

What is the most effecient way to go about that?

Right now I have set up the book as a button to change the Lua boolean "canReadBook" to true.
However, the dialogue response panel would not respond to the Lua boolean change.
It seems that I would need to "refresh" the dialogue system somehow for it to check the conditions again.

Thanks!

Re: Unlock Dialogue Options in Runtime

Posted: Sun Mar 24, 2024 2:36 pm
by Tony Li
Hi,

If you set the Lua variable before the conversation gets to the response menu (2+ nodes before), you can use Conditions on the response dialogue entries to only show those response entries if the Conditions are true.

If you change the Lua variable while the response menu is visible, you can call DialogueManager.UpdateResponses() to tell the conversation to reevaluate the Conditions and update the response menu accordingly.

Re: Unlock Dialogue Options in Runtime

Posted: Tue Mar 26, 2024 6:49 am
by GREI
worked out great, thanks!

Re: Unlock Dialogue Options in Runtime

Posted: Tue Mar 26, 2024 9:01 am
by Tony Li
Glad to help!

Re: Unlock Dialogue Options in Runtime

Posted: Thu Mar 28, 2024 3:03 pm
by GREI
Hi, a follow-up to UpdateResponses() question.

When I call this method, it seems to work as a "Continue" button as well.
That is to say it presses the continue button for me if there is one pending in the dialogue.

Is there a way to disable this behaviour?

Thanks

Re: Unlock Dialogue Options in Runtime

Posted: Thu Mar 28, 2024 3:49 pm
by Tony Li
Hi,

If the conversation isn't currently showing a response menu, don't call UpdateResponses() since it will have this behavior.