Page 1 of 1

Quest Log Window Automatic Update?

Posted: Mon Aug 22, 2016 7:38 pm
by nathanj
Hi Tony

Is there a way to get the Quest Log Window (QLW) (in my case an adaption of the NGUI example from your 3rd party support) to automatically update? What's happening is if I open the QLW, select a quest and then close the window the next time I open the QLW the same panel remains even if that quest has changed state.

Any suggestions would be appreciated.

Thanks Again for the amazing program!

Nathan

Re: Quest Log Window Automatic Update?

Posted: Mon Aug 22, 2016 9:05 pm
by Tony Li
Hi Nathan,

Use the newish SetQuestState() Lua function to set quest states in conversations. For example, set the Script field to this:

Code: Select all

SetQuestState("Assassinate the Emperor", "active");
Variable["Alert"] = "Mission Update: Assassinate the Emperor"
instead of the older method:

Code: Select all

Quest["Assassinate_the_Emperor"].State = "active"; 
Variable["Alert"] = "Mission Update: Assassinate the Emperor"
This Lua function was introduced so it can also tell Quest Log Windows, etc., to update, in addition to just setting the quest state.

There's also a corresponding CurrentQuestState() Lua function that you can use in Conditions fields, such as:

Code: Select all

CurrentQuestState("Assassinate the Emperor") == "active"
instead of:

Code: Select all

Quest["Assassinate_the_Emperor"].State == "active"
Both functions are described here.

And there's also a new ShowAlert() Lua function if you want to use that instead of setting Variable["Alert"]:

Code: Select all

Quest["Assassinate_the_Emperor"].State = "active"; 
ShowAlert("Mission Update: Assassinate the Emperor")
It behaves slightly differently from setting Variable["Alert"] because it shows the alert immediately, whereas Variable["Alert"] is only checked at the end of the conversation.