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

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
Nefisto
Posts: 2
Joined: Tue Aug 13, 2024 12:41 pm

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

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

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

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