Candy Logo

Conditions
The Condition Commands branch and loop a Dialogue:
CommandRuns its Command
IfWhen its condition is true.
ElifWhen its condition is true and nothing before it in the chain ran.
ElseWhen nothing before it in the chain ran.
ForOnce per item of the value it iterates.
WhileAgain and again while its condition is true.
A Condition is one Line that contains two things: the condition, and the Command it runs. What conditions can be written is explained in the Candy Dialogue Engine documentation, under Commands > Condition Commands.
If Form
The Fields
FieldDescription
ConditionThe test, written as an expression. Else has none.
DescriptionWhat the condition tests and what happens, in plain words. The game doesn't read it: it's for the people who read the Dialogue.
TypeThe Command to run. Pick it from the dropdown, where the Commands are sorted by category.
The Command It Runs Once a Command is picked in Type, its form is displayed below, in a Command Editor. It's the same form the Command has on a Line of its own, with the same tabs, widgets and filters.
  • Picking another Command in Type replaces it, with empty fields.
  • Emptying Type removes it.
The Command that a Condition runs has no row in the Dialogue Navigator. Click the Condition's Line to edit it. Running Several Commands A Condition runs one Command. To run several, place them in a Block of their own and pick Bridge or Jump as the Condition's Command:
  • Bridge runs the Block, then returns to the Line after the Condition.
  • Jump moves to the Block without returning.
Descriptions An expression such as ¢globals.gold >= 50 and not globals.shop_closed is hard to read in a list of Lines. Write what it means in Description:
The player can afford the sword, and the shop is open: go to the sale.
With the Dialogue Navigator in Short mode, the Line then displays that description instead of the expression and the Command. Writers and translators can follow the Dialogue's branches without reading code. If Chains An Elif or an Else belongs to the If above it, so the Lines of a chain must follow each other without a gap. Candy Dialogue Creator reports an Elif or Else that doesn't follow an If chain with a message in its form.