Page 1 of 1

Hide a button

Posted: Thu Sep 08, 2022 7:16 pm
by rauljl1
Hi Tony!
Is there a way to hide a button in a dialogue (A dialogue entry from player to npc) by script?
For example, I have 5 options in a conversation. How to hide enable and disable by a boolean?
Thanks!

Re: Hide a button

Posted: Thu Sep 08, 2022 9:04 pm
by Tony Li
Hi,

Reference the Boolean in the dialogue entry's Conditions field. See the Conditions Tutorial for an example.

This assumes you're using a Boolean variable defined in your dialogue database. If you're talking about a bool in your own C# instead, write a method to return that bool's value, and register the method with Lua so you can use it in the Conditions field. More info: Registering C# Methods With Lua