You are viewing an older revision of this wiki page. The current revision may be more detailed and up-to-date.
Click here to see the current revision of this page.
The env_global entity provides a way to store global variables — that is, values that can be retrieved and used across level changes. For example, you could use an env_global to have a switch in one level unlock a door in another.
Attributes
Name (targetname) - Name is a general attribute used to identify entities.
Global State to Set (globalstate) - The name of the global variable you want to set the value of. This name is what you need to reference in other entities to be able to read the value.
Trigger Mode (triggermode) - This is the value that the global variable is set to when the env_global is triggered.
Off (0) - Sets the value to "Off".
On (1) - Sets the value to "On".
Dead (2) - Clears the value of the global variable.
Toggle (3) - Toggles the value between "Off" and "On".
Initial State (initialstate) - If the Set Initial State flag is enabled, the env_global will set the variable to the given value when it first loads.
Off (0) - Sets the value to "Off".
On (1) - Sets the value to "On".
Dead (2) - Clears the value of the global variable.
Flags
Set Initial State - If enabled, the value of the global variable will be set by the env_global when it is first loaded.
Notes
This global variables are mostly read by trigger_auto and multisource entities. See Tutorial: Globals for details on how to effectively use the env_global entity.
Global variables default to "Off". As such, a toggled variable that has not been set will be set to "On".