Candy Logo Copyright © 2025-2026 Candy Arts

Parallel Dialogues
A game can contain as many Engines as it needs, and each one runs its own dialogue, separately from the others. Dialogues that run at the same time are called Parallel Dialogues. Separate Engines Each Engine (each node with Candy_Engine.gd attached) has its own:
  • Dialogue: the file it loaded, and its position in it.
  • Settings: Dialogue Mode, typewriter speed, language, input actions... A setting changed on one Engine doesn't affect the others.
  • UI Elements: the ones its ui_elements_paths and media_players_paths point to.
  • State: suspension, interruption, choice menus, Input scenes, and its own Dialogue History (see Dialogue History).
One Engine can therefore be suspended, interrupted or ended without affecting the others. What every Engine shares is the game data in candy_de: Actors, Roles, Flags, variables... A Flag set by one dialogue is read by every other. UI Ownership Engines usually work best with UI Elements of their own: each one displays its lines in its own dialogue box, speech bubbles or chat, and never interferes with the others. Some UI Elements are worth sharing, such as the music player or the background. Owners An Engine lists its UI Elements by path. A plain path designates the Engine as the UI Element's owner; ["path", false] only allows the Engine to use the UI Element, without owning it. A UI Element has one owner at most. See UI Elements. Private and Public Media players, Background Scenes and VN Scenes have an Access setting, which decides which Engines may control them:
  • Private: only the owner may.
  • Public: any Engine may. The Engine that starts a playback on it holds it until that playback is over, and its Public Mode decides whether other Engines are refused, limited to a few commands (such as pausing), or free to take over.
The owner of a Private UI Element always pauses it when its dialogue is suspended, and stops it when its dialogue ends. For a Public one, the Engine holding it does the same if the settings say so. See Media Players for the details. Speech Display Dialogue boxes, subtitles and bark bubbles have no Access setting: an Engine writes into them. Two Engines writing into the same dialogue box at once would mix their lines, so assign each Engine its own. A Chat_Channel is the exception: it is designed to be shared. Lines from several Engines are added to it in the order they're spoken (see Chat). Speech bubbles belong to Actors, and each bubble records which Engine wrote its last line: only that Engine can clear it. Parallel dialogues therefore never erase each other's bubbles, and an Actor can leave one conversation to join another. An Actor can only speak in one dialogue at a time, though: the Engine that writes in their bubble last takes it over. To clear every bubble whichever Engine wrote in it, use the master clear of the UI_Clear command. Uses NPC barks Each NPC has its own Engine, and barks while the player explores, or even during a conversation. See NPC Barks. Group conversations In a tavern, several groups of NPCs talk among themselves, each group with its own Engine and its own conversation, displayed in speech bubbles above their heads. The player walks from table to table and listens in. Each group's dialogue advances on its own (auto_advance), and input is turned off on those Engines (input_enabled). TV or radio channels Each channel is an Engine running its own dialogue, and the player switches between channels. Only the current channel is seen and heard, but every channel runs on, so that switching back to a channel finds it further along, as a real broadcast would be.
  • Assign each channel its own dialogue box (or subtitles), all at the same place on screen. A UI Element shows itself whenever it displays a line, so to hide the other channels, place each channel's box inside its own parent node, and hide the parents of the channels not watched.
  • Mute the voice of the channels not watched, for example by assigning each channel's voice player its own audio bus.
  • The channels can advance on their own (auto_advance), like a broadcast. If the player should read at their own pace instead, assign every channel the same input actions: they all advance together on the same key, but only the current one is seen.
Local multiplayer In a split-screen or couch co-op game, each player talks to NPCs on their own, at the same time. Assign each player an Engine, with its own UI Elements on that player's side of the screen, and its own input actions (input_advance_dialogue and the others: for example, "P1_Advance" and "P2_Advance"), so that each player advances their own dialogue. Tips
  • Game state: every Engine calls change_game_state() when its dialogue starts and ends. Limit the switch to the Engines that should change the game state (see Game State).
  • Mouse: each Engine sets the mouse mode at the start and end of its dialogue. Leave mouse_mode_start and mouse_mode_end at None on Engines that run in the background.
  • Input: Engines with the same input actions all react to the same key. Turn off input_enabled on Engines the player shouldn't control, or assign them actions of their own.
  • Suspension: suspending the game's main dialogue doesn't suspend the others. Suspend each Engine that should pause (see Suspending Dialogues).