I want to catch quests states.
If there a quest state changed from "unassigned" to "active" i want to keep tracking it from code,
There is
StringEvent PixelCrushers.DialogueSystem.DialogueSystemEvents.QuestEvents.onQuestStateChange = new StringEvent()
An object reference is required to access non-static member `PixelCrushers.DialogueSystem.DialogueSystemEvents.QuestEvents.onQuestStateChange'
so what's wrong .
Thanks
Is there a way to register a event
Re: Is there a way to register a event
Hi,
There are a few ways you can do this.
Dialogue System Events is a component. Add it to the Dialogue Manager GameObject. Then assign event handlers in the inspector.
Or add your own script to the Dialogue Manager, and add special methods such as OnQuestStateChange:
Or use the override delegates in the static QuestLog class. For example, to hook into the method that changes a quest state:
There are a few ways you can do this.
Dialogue System Events is a component. Add it to the Dialogue Manager GameObject. Then assign event handlers in the inspector.
Or add your own script to the Dialogue Manager, and add special methods such as OnQuestStateChange:
Code: Select all
void OnQuestStateChange(string questName) {
Debug.Log("Quest " + questName + " changed to " + QuestLog.GetQuestState(questName));
}
Code: Select all
QuestLog.SetQuestStateOverride = CustomSetQuestState;
void CustomSetQuestState(string questName, string state) {
// Log a message:
Debug.Log("Setting quest " + questName + " to " + state);
// Then use the default functionality:
DefaultSetQuestState(questName, state);
}
Re: Is there a way to register a event
Just wanted to point that QuestLog.SetQuestStateOverride in Versions 1.7.7.1 and later of the Dialogue System. I was looking for it in 1.7.6 and could not find it.
Re: Is there a way to register a event
Thanks for pointing that out. You probably already found it in the Release Notes, but I thought I'd post the link in case others in the future need to look up what version something was added in.