env_global

keyvalues

• targetname (string) - name

• globalstate (string) - global state to set

• triggermode (integer) - trigger mode

0 = off

1 = on

2 = dead

3 = toggle

• initialstate (integer) - if this is the first time this global state is encountered, set it to this (if the flag is set)

0 = off

1 = on

2 = dead

flags

• set initial state (1) - this must be enabled for the initial state to be set. this is here mostly to allow global entities to be killed by the trigger without being affected by some initial state.

notes

• changes global state variable when triggered

• make this entity the target of a trigger. when that trigger fires, the global state will be set according to the trigger mode

• if the trigger mode is set to toggle, it will toggle the existing global state

• all global states default to "off", so you must set the initial state to "on" if you need it to be on at first

• only multisource entities can read global states. you must set the global state field on the multisource to the name of the global state

• This can be used to have a button in one BSP enable a door / machine / whatever in another BSP.

related topics

multisource

Overview of env_ entities

Entity Guide Overview