Getting Quest State

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
Roen
Posts: 9
Joined: Fri Jan 31, 2020 1:26 am

Getting Quest State

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

Re: Getting Quest State

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