Skip to content

Variables, types, and scopes

A Variable gives a typed name to a value. Declare it before using it in expressions or operations.

  1. Take a Variable from Objects or use an argument’s Create New picker.
  2. Give it a name. Held-item chat renaming remains supported.
  3. Right-click it to edit its name, type, scope, and Final setting in a dialog.
  4. Choose the exact type, including a Target subtype or collection element/key types.
  5. 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.

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.

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.

${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.