Page 1 of 1

Getting Quest State

Posted: Thu May 28, 2020 1:57 am
by Roen
Hey forum!

May I know if there's a way to get quest state via script instead of just on the dialogue trigger?
e.g. a gameobject will be activated/deactivated if a quest is successful/ongoing.

Thank you and wish you a good day :)

Re: Getting Quest State

Posted: Thu May 28, 2020 8:07 am
by Tony Li
Hi,

Use the QuestLog class. Example:

Code: Select all

if (QuestLog.GetQuestState("My Quest") == QuestState.Success)
{
    Debug.Log("My Quest is successful.");
}
If you want to be notified when a quest state changes, use a Dialogue System Events component or add an OnQuestStateChange method to the Dialogue Manager.