A quest instance is an in-memory copy of a quest asset. There may be many quest instances of a quest asset.
Would this prevent SetTag from being applied properly? I'm looping through all the Quests DBs/Quests on the Quest Machine Configuration Component in Awake(). All my questDBs are divided by in game locations and I'm trying to add a tag {REGION}. But in UI is just shows "REGION".
If it's in your script's Awake() method (I strongly recommend against directly modifying QM scripts themselves), it should be fine to set the tag. You can set "REGION" and then any text that contains "{REGION}" should show the value of the tag.
I'm sorry, I don't know what I was thinking. You need to update the quest instances, which are instantiated in Start(). Use something like this in your script:
using System.Collections;
using PixelCrushers.QuestMachine;
using UnityEngine;
namespace AIL.Helpers
{
public class SetSceneNameTag : MonoBehaviour
{
private static readonly string SceneNameTag = "{REGION}"; // Must include {..} in tag.
private IEnumerator Start()
{
yield return new WaitForEndOfFrame(); // Wait for quest givers, etc., to instantiate quests.
foreach (var questInstanceList in QuestMachine.GetAllQuestInstances().Values)
{
foreach (var questInstance in questInstanceList)
{
questInstance.tagDictionary.SetTag(SceneNameTag, "Sample Scene");
}
}
}
}
}
No worries about that. When a quest giver gives a quest to the player's Quest Journal, the quest giver clones its own quest instance and adds the clone to the Quest Journal. The clone has the same tags as the original instance.
Are you seeing a quest that doesn't have the tags it's supposed to? Can you provide details? I've finished work for the night, but I'll check back in the morning.