Page 3 of 5

Re: Quest states

Posted: Sun Mar 17, 2019 6:33 pm
by nivlekius
the only error in that class is:

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

"record" does not exist in this current context.

Re: Quest states

Posted: Sun Mar 17, 2019 6:36 pm
by nivlekius
Oh I see what it is. it's outside of the for each loop

Re: Quest states

Posted: Sun Mar 17, 2019 6:40 pm
by nivlekius
I changed record.questTitle to title. Does that seem right to you?

Re: Quest states

Posted: Sun Mar 17, 2019 6:52 pm
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 ;)

Re: Quest states

Posted: Sun Mar 17, 2019 8:11 pm
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?

Re: Quest states

Posted: Sun Mar 17, 2019 8:33 pm
by Tony Li
Can you share the code that you're using in the MessageAction field?

Re: Quest states

Posted: Sun Mar 17, 2019 8:37 pm
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

Re: Quest states

Posted: Sun Mar 17, 2019 8:53 pm
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()));
}

Re: Quest states

Posted: Sun Mar 17, 2019 9:01 pm
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

Re: Quest states

Posted: Sun Mar 17, 2019 9:51 pm
by Tony Li
Thanks! :-)