Copyright © 2025-2026 Candy ArtsFor
The For command runs a Command once per item of an Array, key of a Dictionary, or number in a range. The loop is named in its Condition, and the current item is stored under that name in the Engine's for_ Dictionary: in a loop written i in ¢range(3), the Command reads the current number as ¢for_["i"].
Keys
Every key also accepts a ¢ expression instead of a fixed value, unless its description says otherwise. See CandyRef Expressions.
Condition
Description:
The loop's name and the collection it iterates over, written as name in ¢expression. The expression must start with ¢.
Values:
• name in ¢Array: Iterates over each item, such as item in ¢globals.inventory.
• name in ¢Dictionary: Iterates over each key.
• name in ¢Number: Iterates from 0 to the number minus 1, such as i in ¢3 or i in ¢range(3).
Type
Description:
The name of the Command contained in Commands. Candy Dialogue Creator reads it to select the Command to edit; Candy Dialogue Engine only prints it in debug messages.
Values:
• Command name: Such as Set.
Commands
Description:
The Command to run once per item, as a Dictionary with the Command's name as key and its keys as value, such as {"Set": {...}}. A Dictionary can only contain each Command name once, so to run several Commands, place them in a Block and Bridge to it. This key isn't evaluated.
Values:
• Command: Any Command, with its own keys.