[HOWTO] How To: Toggle Another Quest's Tracking When Quest Ends
Posted: Fri Jul 30, 2021 11:42 pm
To toggle another quest's tracking on or off when a quest is completed, add the following Set Tracking quest action to the quest's Success state Actions list.
SetTrackingQuestAction.cs
SetTrackingQuestAction.cs
Code: Select all
namespace PixelCrushers.QuestMachine
{
public class SetTrackingQuestAction : QuestAction
{
public StringField questID;
public bool track;
public override string GetEditorName()
{
return (track ? "Track " : "Untrack ") + questID;
}
public override void Execute()
{
base.Execute();
var quest = QuestMachine.GetQuestInstance(questID);
if (quest != null)
{
quest.showInTrackHUD = track;
QuestMachineMessages.RefreshUIs(quest);
}
}
}
}