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 a Quest
  • Database
  • Locking
  • Adding to the Database
  • Removing from the Database
  1. Scripting
  2. Quests

Working with Quests

Quests are meant to be created through the Editor Window, which will automatically updated the quest database. Editing quests through code is not a recommended task but can be necessary for some use cases, like procedural generation.

Creating a Quest

A quest can be created by using it's constructor.

// isEnabled, key, name, description, parentQuestID, questType, levelRequirement, isRepeatable, autoCompleteEnabled
var quest = new Quest(true, "QuestKey", "Quest Name", "A long quest description.", null, "Side Quest", 0, false, true);

When a quest is created, it's not automatically added to the database. This needs to be done manually.

Database

Quests can be added and removed from the database at runtime. All your created quests shouldn't be stored in memory, especially not if you have a lot of them. It's a good idea to add your quests to the database if you believe the game would need to access them at a later time.

Locking

Quests are designed to be automatically updated in the database as their data changes in-game. When certain properties are edited, a database update is performed right away. You can prevent this from happening by setting the updateLock value to true before making any changes. This lock is only on the instance of the quest rather than the database itself.

quest.updateLock = true;

After making your changes, simply set the lock off.

quest.updateLock = false;

Adding to the Database

QT.AddQuest(myQuest);

Removing from the Database

QT.RemoveQuest(myQuest);
PreviousQuest Find SettingsNextQuest Types

Last updated 4 months ago

📄