Page 1 of 1

How to set some dialog options as not-interactable based on some outside condition?

Posted: Mon Aug 19, 2024 3:53 pm
by Nefisto
Something like a quest that requires killing 10 rats and if you speak with NPC while not have killed them all you see an not interactable option "Kill rats (2/10)".
If possible lemme know how would I make this condition to get some outside value, by outside I mean my own inventory instead of using the inventory coupled into the dialog system.

Re: How to set some dialog options as not-interactable based on some outside condition?

Posted: Mon Aug 19, 2024 5:40 pm
by Tony Li
Hi,

1. Register your condition function with Lua (instructions).

2. Use your function in the dialogue entry's Conditions field (info).

3. On your Dialogue Manager GameObject, tick Display Settings > Input Settings > Include Invalid Entries. You can also set an [em#] tag to show the non-interactable button differently.

Side note: For "Kill rats (2/10)", if it's a quest then you might be able to use the built-in quest functions. But it's fine to use your own functions, too.