Page 1 of 1

Disable a specific response button

Posted: Fri Sep 06, 2024 2:50 pm
by jonathancarroll
Hello, I'd like to set a specific response option's button to be disabled, ie interactable = false, if a certain condition is met.
Wondering how to write the LUA to do this.
I want the player to be able to see that they can't choose the option, so I'd be setting a specific "disabled" color in the button component.
Thanks!

Re: Disable a specific response button

Posted: Fri Sep 06, 2024 3:09 pm
by Tony Li
Hi,

Set that dialogue entry's Conditions. For example:
  • Menu Text: "Buy a laser pistol [50 credits]"
  • Conditions: Variable["Credits"] >= 50
Then tick the Dialogue Manager GameObject's Display Settings > Input Settings > Include Invalid Entries. This will tell the Dialogue System to include response buttons for entries whose Conditions are false, but it will make them non-interactable.

You can also set the [em#] Tag for Invalid Entries dropdown to show the response button's text in a specific emphasis setting value by automatically adding [em#] markup tags.

If you only want to have "Include Invalid Entries" behavior for certain invalid entries but not others, see this post.

Re: Disable a specific response button

Posted: Sat Sep 07, 2024 11:18 am
by jonathancarroll
Thank you so much!

Re: Disable a specific response button

Posted: Sat Sep 07, 2024 11:37 am
by Tony Li
Happy to help!