Quest states
Re: Quest states
the only error in that class is:
if (QuestLog.CurrentQuestState(record.questTitle) == "unassigned") continue;
"record" does not exist in this current context.
if (QuestLog.CurrentQuestState(record.questTitle) == "unassigned") continue;
"record" does not exist in this current context.
Re: Quest states
Oh I see what it is. it's outside of the for each loop
Re: Quest states
I changed record.questTitle to title. Does that seem right to you?
Re: Quest states
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
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
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
Can you share the code that you're using in the MessageAction field?
Re: Quest states
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
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
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:
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
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
Thanks a lot.
Have I told you yet that I love this asset? Yeah I know I have