Copyright © 2025-2026 Candy ArtsCode Modification
Candy Dialogue Engine is designed to be extended with your own code, without rewriting its scripts. Most customizations are done in one of two ways:
- Hook functions: functions Candy Dialogue Engine calls at specific moments, which are empty until you write code in them.
- Drop-in scripts: a script you add to a folder becomes a new Command, Dialogue Mode, event or tag. Nothing needs registering.
| Goal | How | See |
| Run code at a specific Dialogue step. | Write it in a hook function, in User_Data/Functions | Hook Functions |
| Change how a UI Element or media player behaves. | Write it in the hook functions of its script. | UI |
| Create a Command. | Add a script in Scripts/Commands, or one in Scripts/Custom_Events for the Custom command | Custom Commands |
| Decide what an Input Menu's events do. | Add a script in Scripts/Input_Events | Event Scripts |
| Decide what a Choice Menu's events do. | Add a script in Scripts/Choice_Events | Event Scripts |
| Run code when the Await Command detects a signal. | Add a script in Scripts/Await_Events | Event Scripts |
| Create a Dialogue Mode. | Add a script in Scripts/Dialogue_Modes | Dialogue Modes, under Custom Modes, and write a script for the UI Element your Dialogue Mode displays Lines in. |
| Create a custom Variation tag. | Add a script in Scripts/Variation_Tags | Variations, under Tag Scripts |
| Add a data table. | Add a script in User_Data/Data_Tables | Database |
| Generate speech with text-to-speech or an LLM. | Write it in the tts() and llm_query() functions | TTS, LLM |
| Move characters in cutscenes. | Add a script in Scripts/Move_Events for the CS_Move command | CS Move |
- The file name is the name. Give_Item.gd is the Give_Item command, Phone.gd the Phone mode, Door_Opened.gd handles the door_opened signal. Names aren't case-sensitive.
- The script extends the folder's base class:
CandyCommand,CandyDialogueMode,CandyInputEvent... A script that extends something else is reported and left out. - Sub-folders only sort. Your scripts can be placed in a sub-folder of your own, such as Scripts/Commands/My_Commands.
- Names must be unique. If two scripts of a folder have the same file name, even in different sub-folders, a warning names them and only one is loaded.
await. The Engine waits for them to return before it carries on.
Updates
An update never modifies the files you add, and never overwrites the files that are meant to be edited, such as the hook function scripts of User_Data/Functions (see Updates, which lists them all). These files are deemed 'safe'.
All other Candy Dialogue Engine files are 'unsafe': updates overwrite them. The Wizard detects modified files by comparing their hashes, and lists them before the update proceeds.
To edit an 'unsafe' script anyway, record your changes and copy them back after each update.