For example, say you're using an additional, custom quest state called "pending" by setting a dialogue entry node's Script field to:
Code: Select all
Quest["My Quest"].State = "pending";
To do this, create a new script called, say, CustomQuestStates.cs, and add it to the Dialogue Manager. The script should look something like this:
CustomQuestStates.cs
Code: Select all
using UnityEngine;
using PixelCrushers.DialogueSystem;
public class CustomQuestStates : MonoBehaviour {
void Start() {
QuestLog.StringToState = CustomStringToState; // Insert our replacement "StringToState" function.
}
QuestState CustomStringToState(string s) {
// Convert any special quest state string values to their appropriate QuestState type:
if (s == "pending") return QuestState.Active;
// Otherwise just use the defaults for "unassigned", "active", "success", etc:
return QuestLog.DefaultStringToState(s);
}
}