EnvGlobal
Sets, clears, or toggles a named GlobalState flag via the output system.
Properties
State to Set String The name of the GlobalState flag this entity controls. The name is arbitrary, use something descriptive like "bossDefeated" or "powerRestored". Inputs
TurnOn — Sets the named GlobalState flag to true. TurnOff — Sets the named GlobalState flag to false. Toggle — Flips the named GlobalState flag. If it was true it becomes false, and vice versa. Notes
EnvGlobal connects the output system to GlobalState, which is the engine’s dictionary of named boolean flags that persist across map transitions and saves. Without EnvGlobal, setting a global state flag requires code. With it, any output chain can write to global state directly from the editor.
A typical use is marking a one-time world event as complete. When the player defeats a boss, the boss’s death triggers an EnvGlobal with TurnOn. On the next map, a LogicBranch reads that state on spawn (via a LogicAuto chain) and adjusts the world accordingly. Could also indicate more binary forms of progression, such as “player is now an enemy” or “player has this item”.
Unlike LogicBranch, EnvGlobal flags are global and survive level transitions. LogicBranch state is local to the map it lives in. Use EnvGlobal for anything that needs to be known across multiple maps, and LogicBranch for state that is only relevant within a single map.
Reading global state in the editor is not currently directly supported, you need a small piece of code that checks GlobalState.ReadState("flagName") and responds accordingly, typically in OnSpawn of a controller. This is a planned change.