Quest Tree
  • Quest Tree Documentation
  • đŸ•šī¸Quick Start
    • Installation
    • Start Editing
  • 🎓Tutorials
    • Videos
    • Example Scenes
  • 🧩Components
    • Core Defaults
      • Quest Tree Initializer
      • Quest Tree Sync
      • General Dialogue
      • Default Quest Provider
    • Default UI
      • Default Choice Button
      • Default Dialogue Window
      • Default Dialogue Window Triggerer
      • Default Input Handler
      • Default Item Slot
      • Default Memorable Message
      • Default Quest Foldout
      • Default Quest Foldout Item
      • Default Quest HUD
      • Default Quest HUD Item
      • Default Quest Message UI
      • Default Quest Window
      • NPC World Canvas Handler
    • World Triggers
      • World Dialogue Trigger
      • World Quest Completer
      • World Quest Failer
      • World Quest Receiver
      • World Requirement Trigger
  • âš™ī¸Systems
    • Quest Tree
      • Editor Window
      • Quest Types Editor
      • Settings
      • Character
      • Items
        • Item
    • Dialogue Tree
      • Editor Window
        • Nodes
          • Dialogue Node
          • Choices Node
          • Receive Node
          • Complete Node
          • Trigger Node
          • Boolean (If) Node
      • Settings
      • Quest Dialogue
      • General Dialogue
  • 📄Scripting
    • Quests
      • Getting Quests
        • Quest Find Settings
      • Working with Quests
        • Quest Types
        • Child Quests
        • Quest NPCs
        • Requirements
      • Managing Quest States
    • Dialogue
      • Getting Dialogue
      • Dialogue Graph
        • Working With the Graph
    • Initialization
    • Disconnect
    • Syncing
    • Events
    • Saving/Loading
    • Player Recognition
    • Choices
    • Items
      • Rewards
        • Managing Granted Rewards
    • Characters
    • Requirements Manager
    • Procedural Generation
  • đŸ› ī¸Support
    • Getting Help
  • 📚Changelogs
    • Latest Releases
  • ⭐Rate Me?
Powered by GitBook
On this page
  • Creating and Adding a Child Quest
  • Removing Child Quests
  • Getting a Child Quest
  1. Scripting
  2. Quests
  3. Working with Quests

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");
PreviousQuest TypesNextQuest NPCs

Last updated 5 months ago

📄