Quest Log Window Automatic Update?

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
User avatar
nathanj
Posts: 303
Joined: Sat May 28, 2016 12:30 am

Quest Log Window Automatic Update?

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

Re: Quest Log Window Automatic Update?

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