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
  1. Scripting

Events

The QT class has multiple events that you can use to register a callback.

Name
Description

onSaveLoaded

A callback for when a save is loaded.

onQuestAccepted

A callback for when a quest is accepted. This accepts 1 argument: the accepted quest (Quest).

onQuestCompleted

A callback for when a quest is completed. This accepts 1 argument: the completed quest (Quest).

onQuestAbandoned

A callback for when a quest is abandoned. This accepts 1 argument: the abandoned quest (Quest).

onQuestFailed

A callback for when a quest is failed. This accepts 1 argument: the failed quest (Quest).

onQuestRequirementsCompleted

A callback for when the requirements of a quest are completed. This accepts 1 argument: the affected quest (Quest).

onQuestStateChanged

A callback for when a quest's state is changed. This accepts 1 argument: the affected quest (Quest).

onRewardsReceived

A callback for when rewards are received. This accepts 1 argument: a list of rewards (List<QTRewardItem>).

onMemorableChoiceMade

A callback for when a memorable choice is made during dialogue. This accepts 1 argument: the choice made (QTChoice).

Example

public class EventExample : MonoBehaviour
{
    private void Awake()
    {
        QT.onQuestAccepted.AddListener(HandleQuestAccepted);
    }

    public void HandleQuestAccepted(Quest quest)
    {
        // Do something...
    }
}
PreviousSyncingNextSaving/Loading

Last updated 5 months ago

📄