Interpreter Variable System

Local Variables

  • Scoped to a single interpreter instance

  • Each DSL Interpreter has its own isolated variable store

Global Variables

  • Shared across all interpreters

  • Supports cross-scene and cross-system state sharing

@Init
Set("playerHealth", 100)
SetGlobal("difficulty", "Normal")
Log("Local Health: {0}", Get("playerHealth"))
Log("Global Difficulty: {0}", GetGlobal("difficulty"))
Goto("Combat")

@Combat
Set("playerHealth", SubtractInt(Get("playerHealth"), 20))
Log("After damage, Health: {0}", Get("playerHealth"))

Save and Load

  • Variables can be serialized to JSON

  • Built-in one-click Save / Load functions

  • Great for debugging, persistence, or sharing state with teammates

Last updated