Page 1 of 1
Tracking quest progress.
Posted: Tue Aug 31, 2021 1:06 am
by hipsterdufus
Hello! Let's say you're trying to make a quest to kill x amount of something. Do I have to manually call DialogueManager.Instance.SendMessage("UpdateTracker"); in order to update the HUD? Or is there any automatic way for the quest to realize that it depends on a certain variable and update itself? Thanks!
Re: Tracking quest progress.
Posted: Tue Aug 31, 2021 1:13 am
by hipsterdufus
I guess I should be more clear. The quest log UI seems to update with the correct number but the HUD is just frozen with 0/3 (0 being the [var=myquestvar]). I'm still trying to figure out how to update it. It does get updated when the quest is completed because I have a condition monitor that updates it, but I'm wondering if the system can track that variable and update the HUD automatically at runtime.
Re: Tracking quest progress.
Posted: Tue Aug 31, 2021 6:13 am
by Tony Li
Hi,
After changing the variable, call
DialogueManager.SendUpdateTracker().
Quest entries can have [lua(
code)] tags, which could call any C# method(s) that you've registered with Lua. So there's no way to automatically monitor for changes in all situations. Instead, when you manually call DialogueManager.SendUpdateTracker(), it tells the Dialogue System to update the HUD -- and the quest log window if it's open.
Note: The
Increment On Destroy component automatically calls SendUpdateTracker when it increments its variable.