Candy Logo Copyright © 2025-2026 Candy Arts

Testing Dialogues
Testing a Dialogue takes a scene that loads it and runs it. Candy Dialogue Engine ships with one, and your own scenes can serve as well. The Testing Scene The provided testing scene is Testing_Scene.tscn, in Candy_DE/Scenes/Testing_Scenes. When it starts, it loads a Dialogue and runs it in the default Dialogue UI (the candy_ui autoload). It also contains three buttons, which suspend, resume and interrupt the Dialogue. Which Dialogue it runs, and where that Dialogue starts, is set on its root node, in the Inspector:
VariableValue
dialogueThe Dialogue file to load, without its .txt extension.
conversationThe Conversation to start in.
blockThe Block to start in.
lineThe Line to start at: its index, or the Reference of a Line Mark.
The scene is a 'safe' file: updates never overwrite it, so it can be modified freely. Its script, Testing_Scene.gd, is 'unsafe': to modify the script, attach a copy of it, under a new name, to the scene. Running a Test A testing scene is run in three ways:
  • From the Godot Editor: open the scene, set the four variables in the Inspector, and run the current scene.
  • From the Wizard's Test tool: choose the testing scene, the Dialogue, and the Conversation, Block and Line to start at, then run the test. The scene file isn't modified.
  • From Candy Dialogue Creator: its Test button exports the Dialogue being written, and the Godot Editor runs it in the testing scene chosen in the Wizard's Test tool or in the Creator. Your project must be open in the Godot Editor, with the Candy Wizard enabled. See the Candy Dialogue Creator documentation.
Your Own Testing Scenes The provided scene only contains the Dialogue UI. A Dialogue that needs nodes of your game doesn't work in it: a cutscene that moves characters with CS Commands, speech bubbles above Actors, or an Await on a signal of one of your nodes. For such Dialogues, make a testing scene that contains what they need:
  1. Duplicate Testing_Scene.tscn under a new name, in the same folder, or attach Testing_Scene.gd to the root node of a scene of your own.
  2. Add the nodes the Dialogue needs: characters, cameras, markers, lights...
  3. If the Dialogue should run in another Engine than the default Dialogue UI, replace candy_ui in the script with that Engine's node.
For a scene to be listed in the Wizard's Test tool and in Candy Dialogue Creator, it must:
  • Be saved in the testing scenes folder: testing_scenes_folder in Candy_Properties.gd, which is Candy_DE/Scenes/Testing_Scenes by default.
  • Have a root node whose script exports the four variables above (dialogue, conversation, block and line), as Testing_Scene.gd does. The tools write what to run into them.
Testing in a Game Scene Any scene of your project can serve for testing, a real scene of your game included: it only has to load a Dialogue and run it in its _ready() function. A Dialogue is thus tested where it will actually happen, rather than in a scene made for testing.
func _ready() -> void: candy_ui.load_scripted_dialogue("test_dialogue") candy_ui.start_dialogue("Conversation_1", "Block_1", 0)
Replace candy_ui with your own Engine node if the Dialogue should run in another Engine. See Running Dialogues. Then run that scene from the Godot Editor. Remove these lines once the test is over, or the Dialogue will also start in your game. To run a game scene from the Wizard's Test tool or from Candy Dialogue Creator, it must follow the two rules above: export the four variables in its root node's script and read them in _ready(), and be saved in the testing scenes folder.