Page 1 of 1

Can you CurrentQuestEntryState in a ConditionObserver?

Posted: Fri May 31, 2019 5:27 pm
by AoF
Hello. I've got a quest with multiple entries in it. The quest is about planting your first crop. The first entry is to go to the field. The second entry is to plant your first crop.

When you arrive on the field (the field is a scene), I'd like to mark the first entry as completed, but as far as I can tell, the ConditionObserver does not let you assign entry statuses, only the state for the whole quest. This script seems convenient, but is there a way to set quest entries with it? Is there a better script for this purpose?

Re: Can you CurrentQuestEntryState in a ConditionObserver?

Posted: Fri May 31, 2019 5:29 pm
by AoF
I have pretty much the same question for conditions. Is there a way to have a condition that says, "if this entry is active"?

Re: Can you CurrentQuestEntryState in a ConditionObserver?

Posted: Sat Jun 01, 2019 8:16 am
by Tony Li
Hi,

Use a Dialogue System Trigger to set the entry state. Set the trigger to OnUse. When the player plants the first crop, call the trigger's OnUse method. If your system to plant crops has UnityEvents, you can configure an event to call DialogueSystemTrigger.OnUse.

Or, if you prefer to use a script, call QuestLog.SetQuestEntryState().

I recommend either of the approaches above over using a Condition Observer. They only do work when needed. The Condition Observer, on the other hand, constantly polls the condition to check when it's true, so it's not as efficient.

To check an entry state in a condition, use the Lua Conditions section. Click "..." and select Quest Entry > (quest) > (entry #).

Re: Can you CurrentQuestEntryState in a ConditionObserver?

Posted: Sat Jun 01, 2019 2:17 pm
by AoF
Ah thank you :)

Re: Can you CurrentQuestEntryState in a ConditionObserver?

Posted: Sat Jun 01, 2019 2:46 pm
by AoF
BTW, I think you have a typo here? https://www.pixelcrushers.com/dialogue_ ... uests.html

That last function in the lua table should be called SetQuestEntryState in the first column.

Re: Can you CurrentQuestEntryState in a ConditionObserver?

Posted: Sun Jun 02, 2019 4:11 pm
by Tony Li
Oops, thank you! BTW, that page is for the legacy 1.x manual. I'll fix that typo in the next update for legacy 1.x users. The current version is here: Quest-Related Lua Functions.