Announcements, support questions, and discussion for the Dialogue System.
Roen
Posts: 9 Joined: Fri Jan 31, 2020 1:26 am
Post
by Roen » Thu May 28, 2020 1:57 am
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
Tony Li
Posts: 23315 Joined: Thu Jul 18, 2013 1:27 pm
Post
by Tony Li » Thu May 28, 2020 8:07 am
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.