Child Quests

Creating and Adding a Child Quest

When creating child quests, both the parent quest and child quest need to reference each other. The child quest must know the ID of it's parent quest and the parent quest must know the IDs of it's children. We can achieve this with the code below.

// Get a quest
var parentQuest = QT.GetQuest("MyParentQuest");

// Create a child quest of the parent quest
var childQuest = new Quest(true, "QuestKey", "Quest Name", "A long quest description.", parentQuest.ID, "Side Quest", 0, false, true);
parentQuest.AddChild(parentQuest);

Removing Child Quests

// Where parentQuest and childQuest are both instances of a Quest
parentQuest.RemoveChild(childQuest);

Getting a Child Quest

You can get a child quest from its parent quest by ID, key, or its index in the list of children.

// Get child by quest key
var childQuest = parentQuest.GetChild("MyQuestKey");

Last updated