Candy Logo Copyright © 2025-2026 Candy Arts

Flags
Progression flags record what has happened in your game's story, so that Dialogues can react to it. A flag can record that the player met a character, accepted a quest or made a choice. Dialogues set flags as these events happen, and test them later to decide what to say. For example, the first time the player talks to Alice, she introduces herself and the Dialogue sets a met_alice flag to true. The next time, the Dialogue tests that flag, and Alice greets the player as someone she already knows. Flags aren't limited to true or false: a number can record the stage of a quest, and a String can record which side the player chose. Progression flags are not specific to Candy Dialogue Engine: many games use them. Candy Dialogue Engine provides a few features for Dialogues to read and modify your game's flags. Flags Dictionary Flags are registered in the flags dictionary, in the Flags.gd script. It's a 'safe' file: updates never overwrite it. Each key is a flag's name, and its value is the flag's starting value. Your game can store flags in other variables and scripts, but the flag-specific features of Candy Dialogue Engine only read the flags dictionary. Using Flags A flag is modified by the Flag command, or by your game code through candy_de.flags. Dialogues read flags in CandyRef expressions, typically in the conditions of Condition Commands: ¢candy_de.flags.met_alice. Each time the Flag command modifies a flag, the x_flag_changed() hook function is called, so that your game can react: update a quest tracker, play a sound, trigger an event. Flag Symbol To shorten flag references inside expressions, register a symbol in CandyRef: add it to SHORTCUT_SYMBOLS in the CandyRef_Shortcuts.gd script, with candy_de.flags as its target:
const SHORTCUT_SYMBOLS := { "£": "candy_de.flags", }
¢£met_alice then reads the same flag as ¢candy_de.flags.met_alice. Choose a symbol that follows the rules in 'Your Own Symbols', on the CandyRef Expressions page.