Quest Tracker event
Quest Tracker event
Hey Tony,
Is there an event I can listen for when a user turns on and off the quest tracker?
I'm using the Compass Navigator Pro asset, and I want to turn on or off destinations when the player is tracking a quest.
Is there an event I can listen for when a user turns on and off the quest tracker?
I'm using the Compass Navigator Pro asset, and I want to turn on or off destinations when the player is tracking a quest.
Re: Quest Tracker event
I'm sure Tony will give a better response but onQuestTrackingEnabled and onQuestTrackingDisabled
Re: Quest Tracker event
^ Yes, that. In Dialogue System Events or add methods to a script on the Dialogue Manager.
Re: Quest Tracker event
Exactly what I was looking for! Thanks Dragoon and Tony!
Re: Quest Tracker event
Tony,
How do I subscribe to these events? I think I would rather have the triggers in script rather than using the Dialog System Events script
How do I subscribe to these events? I think I would rather have the triggers in script rather than using the Dialog System Events script
Re: Quest Tracker event
Hi,
Here's the list of quest methods you can add to a script on the Dialogue Manager: Script Methods - Quest-Related.
You can also register for "update quest tracker" events from anywhere. Example:
The QuestLog class also has several delegates that you can hook into.
Here's the list of quest methods you can add to a script on the Dialogue Manager: Script Methods - Quest-Related.
You can also register for "update quest tracker" events from anywhere. Example:
Code: Select all
void OnEnable() {
DialogueManager.instance.receivedUpdateTracker += OnUpdateTracker;
}
void OnDisable() {
DialogueManager.instance.receivedUpdateTracker -= OnUpdateTracker;
}
void OnUpdateTracker() {
Debug.Log("A quest state changed. Update the tracker.");
}
Re: Quest Tracker event
Hey Tony,
Got it working great, but ran into a little issue. When the player completes the quest, the tracking goes away on the UI, but my script that listens for the OnQuestTrackingDisabled never got a disable tracking message for the finished quest.
Got it working great, but ran into a little issue. When the player completes the quest, the tracking goes away on the UI, but my script that listens for the OnQuestTrackingDisabled never got a disable tracking message for the finished quest.
Re: Quest Tracker event
Technically is still trackable. If you were to set the quest state back to active, it would appear in the tracker. (Some games do have quests that bounce back and forth between active and success.)
Listen for OnQuestStateChange(questName), too.
Listen for OnQuestStateChange(questName), too.
Re: Quest Tracker event
That's what I was thinking, but does it pass the quest name AND the new state? I wouldn't want to turn off the tracking just because the state changed.
Re: Quest Tracker event
Use the QuestLog class to check the state:
Code: Select all
void OnQuestStateChange(string quest)
{
if (QuestLog.IsQuestDone(quest))
{
QuestLog.SetQuestTracking(quest, false);
}
}