Variables
Variables store values for use across your flow, and in some cases across runs.
Flow Variables
Scoped to a single flow and reset each time it runs. Use them for temporary values, results passed between branches and per-run counters.
- Define variables in the flow's variable panel.
- Read them with the Flow Variable data node.
- Write them with the Set Flow Variable effect.
Broadcaster Variables
Persistent and shared across all of your flows. They survive between runs and streams. Use them for death counters, sub counters and toggles that carry over.
- Read them with the Broadcaster Variable data node.
- Write them with the Set Broadcaster Variable effect.
Variable Types
- String: Text.
- Number: Numbers.
- Boolean: True or false.
- Lists: A list of one of the above.
- Custom types: Your own object types, as single values or lists. See Custom Types.
- Text Style: One of your text styles, picked from tiles. See below.
The type is set when you create the variable. A custom-typed variable's fields are addressable in {{template}} tokens by path, such as {{broadcaster.champion.username}} for the username field of your champion variable.
Text Style Variables
Flow variables, overlay variables and streamer variables can be type Text Style. The value is picked from style tiles, and the variable always holds a style.
Set Streamer Variable, Set Overlay Variable and Set Flow Variable take a Text Style value from a connected Text Style Data node. Their own value field is disabled and says "Connect a Text Style node".
Overlay widgets can follow a streamer or overlay variable of this type and redraw when a flow changes it. See Linking a style to a variable.
Example: Death Counter
- Add a Chat Command trigger set to
death. - Add a Change Broadcaster Variable effect with Variable
deaths, Operation Add and Amount1. - Connect the trigger to the effect's
Activateinput. - Add a Generate Text node with the template
Death count: {{0}}and connect the effect'sValueoutput to it. - Add a Send Chat Message effect to post the count.
Two deaths at the same moment both count.