Tracking quest progress.

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
hipsterdufus
Posts: 95
Joined: Thu Aug 12, 2021 6:39 pm

Tracking quest progress.

Post 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!
hipsterdufus
Posts: 95
Joined: Thu Aug 12, 2021 6:39 pm

Re: Tracking quest progress.

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

Re: Tracking quest progress.

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