Variables, types, and scopes
A Variable gives a typed name to a value. Declare it before using it in expressions or operations.
Create and configure
Section titled “Create and configure”- Take a Variable from Objects or use an argument’s Create New picker.
- Give it a name. Held-item chat renaming remains supported.
- Right-click it to edit its name, type, scope, and Final setting in a dialog.
- Choose the exact type, including a Target subtype or collection element/key types.
- Use it as a Set Variable destination or a method input/result.
Defaults are Private, non-Final, and a non-nullable declared type. Sneak-right-click cycles scope. Names and String contents are preserved; choosing a nice display name does not make a type compatible.
Scopes
Section titled “Scopes”| Scope | Lifetime and access | Typical use |
|---|---|---|
| Private | Current event/method call; isolated between calls | Temporary calculations and parameters |
| Public | Shared plot-program state | Current round or shared score |
| Save | Persistent plot state | Best score or stored objects |
| Environment | Read-only named setting | Owner-tunable difficulty |
Parameters share their call’s Private namespace with its locals. Reusing a Private name in different methods does not share the value. Public and Save access must be explicit. Environment bindings come from /plot environment.
Assignment and results
Section titled “Assignment and results”Set Variable can assign a literal, another Variable, or an applicable event source, and can run value-transforming operations. Arithmetic lives under Set Variable → Operations → Number. Use Number results for arithmetic and compatible destinations for other operations.
A declared-but-unassigned value cannot be read. Test Variable Exists/Is Assigned when appropriate, or use coalescing. Assigning null is an assignment, not the same state as never assigning.
Final locks a binding after its first assignment, including a null assignment. It does not freeze referenced object fields or collection contents. A Final List may still have entries appended; it cannot be rebound to another List after assignment. Persisted Save bindings retain their Final assignment state.
Names inside expressions
Section titled “Names inside expressions”${private.score + 1}${save.bestScore ?? 0}Expressions require previously declared bindings. Names with spaces remain usable through Variable items but cannot be written as ordinary expression identifiers. See expressions and reference types.