Update Variable in Quest Entry

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
Timeslip
Posts: 39
Joined: Fri Apr 05, 2019 6:31 am

Update Variable in Quest Entry

Post by Timeslip »

Hi Tony,

Am working on a simple quest that requires you defeat x enemies. Would like to avoid destroying the gameobjects (hence can't use increment on destroy script) so have incremented the relevant variable manually:

Code: Select all

int numberIncapacitated = DialogueLua.GetVariable("DragInhabitantsIncapacitated").asInt;
            numberIncapacitated++;
            DialogueLua.SetVariable("DragInhabitantsIncapacitated", numberIncapacitated);
Have confirmed the variable is increasing, but the quest entry UI text is not reflecting the changes. Do I need to call a method to update this?
User avatar
Tony Li
Posts: 22056
Joined: Thu Jul 18, 2013 1:27 pm

Re: Update Variable in Quest Entry

Post by Tony Li »

Yes, call DialogueManager.SendUpdateTracker(). This sends an "UpdateTracker" message to any UIs that listen for it, such as the quest tracker HUD and the quest log window.
Timeslip
Posts: 39
Joined: Fri Apr 05, 2019 6:31 am

Re: Update Variable in Quest Entry

Post by Timeslip »

Cheers, Tony.
Post Reply