Copyright © 2025-2026 Candy ArtsFlag
The Flag command assigns a value to a flag in candy_de.flags. It works like Set, and also calls the x_flag_changed hook, so your code can respond to the change. See Flags.
Keys
Every key also accepts a ¢ expression instead of a fixed value, unless its description says otherwise. See CandyRef Expressions.
Flag
Description:
The flag to assign: its key in candy_de.flags.
Values:
• Flag name: Such as met_alice.
• Empty: No flag is assigned.
Operator
Description:
How Expression is applied to the flag. Operators that take no operand work on Expression when it is provided, and on the current value otherwise.
Values:
• =: Replace the value with Expression.
• +=: Add a number, or concatenate two Strings or two Arrays. An unset value counts as 0.
• -=, *= or ×=: Subtract or multiply.
• /= or ÷=: Divide, with a decimal result. Dividing by 0 leaves the value unchanged.
• //=: Divide, rounding down to a whole number.
• %=: The remainder of the division.
• ^=, **= or pow: Raise to a power.
• strip_edges, to_upper, to_lower: Transform a String.
• replace: Replace text in a String. Expression is [from, to].
• substr: Extract part of a String. Expression is [start, length].
• split or split_to_array: Split a String into a PackedStringArray or an Array, using Expression as the separator.
• join: Join an Array into a String, using Expression as the separator.
• path_join: Append Expression to a path.
• append, append_first: Add Expression to the end or the start of an Array.
• insert: Insert an item into an Array. Expression is [index, item].
• erase: Remove the first item equal to Expression.
• remove_at: Remove the item at index Expression.
• slice: Extract part of an Array. Expression is [start, end].
• clear: Empty an Array or a Dictionary.
• reverse, sort, shuffle, unique: Reorder an Array, or remove its duplicate items.
• rand_pick: A random item of an Array.
• merge: Merge the Dictionary Expression into the value, overwriting existing keys.
• get: Read a Dictionary key. Expression is the key, or [key, default].
• set_key: Set a Dictionary key. Expression is [key, value].
• duplicate, deep_duplicate: A shallow or deep copy of the Array or Dictionary Expression.
• typeof, type_string, is_array, is_dict, is_object, is_nan, is_inf: Read or test the value's type.
• to_int, to_float, to_string, to_bool, toggle_bool, var_to_str, str_to_var, json_to_str, str_to_json, var_to_bytes, bytes_to_var: Type conversions.
• abs, floor, ceil, round, sqrt or root, sign, sin, cos, tan, asin, acos, atan, deg_to_rad, rad_to_deg, log, log10: Math functions.
• log_base (the base), clamp ([min, max]), min and max (a number or an Array), lerp ([to, weight]), wrap ([min, max]): Math functions whose operand is set in Expression.
• randi or rand_i, randf or rand_f: A random integer or float.
• randi_range or rand_i_range, randf_range or rand_f_range: A random integer or float within [min, max].
• get_node, get_node_or_null: The node at the path Expression, relative to the Engine.
• candy_to_dict, candy_to_array, candy_to_string: Convert between Candy's text format and Dictionaries or Arrays.
• Empty: Not valid. An error is reported, and the flag is left unchanged.
Expression
Description:
The operand of the operator. Plain text is stored as a String; to store a number, a bool or any other type, use an expression, such as ¢5 or ¢true.
Values:
• Value: Stored as a String.
• ¢ expression: Evaluated when the Line runs, such as ¢true or ¢globals.day > 3.
• Empty: An error with =; no operand with other operators.