Candy Logo Copyright © 2025-2026 Candy Arts

Custom Input
Any scene serves as an Input scene: a virtual keypad, a character creation screen, a lock-picking mini-game, or the game world itself, such as a duel the player must win before the conversation goes on. The Input command adds the scene, passes it the Line's values, and pauses the Dialogue until the scene reports that it's done. The rules a scene's script follows (the caller and depth variables, the setup() function and the other functions the Engine calls) are listed in Input Menus. Two Ways to a Custom Input A mode of the shipped scene For another kind of text entry (a password with a minimum length, a number, a word from an allowed list), add a mode to a copy of Input_Text.gd: each mode sets its own checks, sanitization and texts, and the Line selects it with its Mode key. The script itself is overwritten by updates, so attach the copy to your own Input scene (see Input Menus). A scene of your own For anything else, write the scene freely. The Variable, Mode, Instructions, Text and Placeholder values of the Line are passed to its setup() function, which interprets them as it sees fit: a keypad reads the code to match from Text, for example, and a duel scene ignores them all. Capabilities While the scene is open, the Dialogue waits, and the scene decides what happens:
  • It stores its results in variables of your game, as the shipped scene does: the template's store_to_variable() function writes a value to the variable named by Variable, written as the Set command's.
  • It runs Lines of the Dialogue, then continues to wait: after a wrong code on a keypad, the NPC comments on it.
  • It finishes: the Dialogue continues after the Input command. A duel scene finishes when the player wins, and the Lines that follow play.
  • It closes: the scene is deleted, and the Dialogue continues after the Input command.
Through an event of your own, it can also return from the current Block or end the Dialogue (see Custom Events below). Events The scene reports to the Input command by emitting the Engine's input_received signal, with the depth the Line assigned it, the event's name and the data the event requires:
caller.input_received.emit(depth, "finish", null)
EventEffect
"finish"The Dialogue continues after the Input command. The scene is left as it is: hide it yourself.
"close"The Dialogue continues after the Input command, and the scene is deleted.
"run_lines"The Lines sent as data, written as in a Dialogue file, run; the scene then continues to wait. A Return among them deletes the scene and returns from the current Block.
Store the player's answer before sending "finish" or "close": the Line stores nothing itself. Custom events Every event is a script in Scripts/Input_Events, named after the event, and an event of your own is added as a new script there: a script that returns from the current Block, ends the Dialogue, or reacts to the scene without leaving the Line (a hint the keypad requests, for example). See Event Scripts. An event with no script leaves the Input command, with a warning, so that a faulty scene can't block the Dialogue. Location The scene is instantiated as a child of the node at input_node_path, in the Engine's ui_elements_paths. The Parent key designates another parent node: a node of the game world, named as a CS_Scene target (Actors/Terminal, a node path, or a ¢ expression returning the node), for a keypad displayed on the screen of a terminal (see Input). A click reaches the last node in the scene tree, whatever the Z-order: an Input scene opened over a choice menu must follow the menu's node, or the menu's shield intercepts its clicks (see Input Menus). Reuse of an Open Scene The scene's node is named after its file. When a node of that name is already under the same parent, from an earlier Input command whose scene was hidden rather than deleted, the Line reuses it and calls its setup() again instead of adding a new one. The Mouse Mode The scene may change the mouse mode freely, to display the cursor over a keypad for example: the Input command restores the mouse mode it started with once it's done. Suspension When the Dialogue is suspended, the Engine calls the scene's suspend_on() function, and suspend_off() when the Dialogue resumes: implement them to disable the scene's controls meanwhile. To leave the scene active during the suspension, call suspend_dialogue(0) (see Suspending Dialogues).