Quest states

Announcements, support questions, and discussion for the Dialogue System.
nivlekius
Posts: 105
Joined: Thu Feb 28, 2019 4:39 pm

Re: Quest states

Post by nivlekius »

the only error in that class is:

if (QuestLog.CurrentQuestState(record.questTitle) == "unassigned") continue;

"record" does not exist in this current context.
nivlekius
Posts: 105
Joined: Thu Feb 28, 2019 4:39 pm

Re: Quest states

Post by nivlekius »

Oh I see what it is. it's outside of the for each loop
nivlekius
Posts: 105
Joined: Thu Feb 28, 2019 4:39 pm

Re: Quest states

Post by nivlekius »

I changed record.questTitle to title. Does that seem right to you?
nivlekius
Posts: 105
Joined: Thu Feb 28, 2019 4:39 pm

Re: Quest states

Post by nivlekius »

yeah that was the problem it's fixed but I didn't need it as I got it working by changing the other script like I said. I'm holding on to it for future reference though. Thanks a lot for your help today.

Now to have a look at the item listener stuff. Here's to hoping I don't have to ask you anything about it ;)
nivlekius
Posts: 105
Joined: Thu Feb 28, 2019 4:39 pm

Re: Quest states

Post by nivlekius »

OK, so the listener stuff seems to be set up correctly but I'm getting an error about the function not being registered. Should I register each function when the item is added then unregister when used or destroyed?
User avatar
Tony Li
Posts: 22055
Joined: Thu Jul 18, 2013 1:27 pm

Re: Quest states

Post by Tony Li »

Can you share the code that you're using in the MessageAction field?
nivlekius
Posts: 105
Joined: Thu Feb 28, 2019 4:39 pm

Re: Quest states

Post by nivlekius »

sure,

Variable["chazpea/yellowskull"] = true
UpdateTracker()
if (CurrentQuestState("chazpea/yellowskull") == "active" and Variable["chazpea/yellowskull"] == true) then
SetQuestState("chazpea/yellowskull", "preempted")
ShowAlert("You found a yellow skull that Chazpea wanted")
end
User avatar
Tony Li
Posts: 22055
Joined: Thu Jul 18, 2013 1:27 pm

Re: Quest states

Post by Tony Li »

UpdateTracker() was added in version 2.1.3, which should be available for download tomorrow.

In the meantime, you can add this to the CustomQuestStateCode.cs script (or whatever script you prefer) so the Lua will work:

Code: Select all

private void OnEnable()
{
    Lua.RegisterFunction("UpdateTracker", null, SymbolExtensions.GetMethodInfo(() => DialogueManager.SendUpdateTracker()));
}
nivlekius
Posts: 105
Joined: Thu Feb 28, 2019 4:39 pm

Re: Quest states

Post by nivlekius »

That was it. It's working great and it's Frenching sweet!

Thanks a lot.

Have I told you yet that I love this asset? Yeah I know I have
User avatar
Tony Li
Posts: 22055
Joined: Thu Jul 18, 2013 1:27 pm

Re: Quest states

Post by Tony Li »

Thanks! :-)
Post Reply