Can you CurrentQuestEntryState in a ConditionObserver?

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
AoF
Posts: 241
Joined: Sun May 12, 2019 8:36 pm

Can you CurrentQuestEntryState in a ConditionObserver?

Post 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?
Last edited by AoF on Fri May 31, 2019 5:38 pm, edited 1 time in total.
AoF
Posts: 241
Joined: Sun May 12, 2019 8:36 pm

Re: Can you CurrentQuestEntryState in a ConditionObserver?

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

Re: Can you CurrentQuestEntryState in a ConditionObserver?

Post 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 #).
AoF
Posts: 241
Joined: Sun May 12, 2019 8:36 pm

Re: Can you CurrentQuestEntryState in a ConditionObserver?

Post by AoF »

Ah thank you :)
AoF
Posts: 241
Joined: Sun May 12, 2019 8:36 pm

Re: Can you CurrentQuestEntryState in a ConditionObserver?

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

Re: Can you CurrentQuestEntryState in a ConditionObserver?

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