[Level Design/Coding Help] env_global Custom States?

I was decompiling some of Valve’s maps today to check out their entity setup on d2_coast_07 and 08, because in those two maps is the train bridge sequence where a button pressed in one map deactivates a field in the other. My original theory was that the state was controlled by a logic relay of some kind that was retained in the level transition between maps. However, this was proven to be invalidated, as the button actually toggled on an env_global with a custom state on it.

You see, the “normal” env_global states are as follows:

Gordon pre-criminal
Antlions are player allies
Suit sprint function not yet enabled
Super phys gun is enabled
Friendly encounter sequence (lower weapons, etc.)
Gordon is invulnerable
Don’t spawn seagulls on the jeep
Episode 2: Alyx injured
Episodic: Alyx darkness mode
Ep2 Counter: Hunters to run over before they dodge

These are code functions related to a specific area of the game or a modified AI state. HOWEVER, the env_global in d2_coast_08 has the following state:

bridge_gate_open

WAT. I’ve never seen this state before, but it is used to control the open and closed status of the bridge’s laser gate in map 07. My only real hypothesis here is that either A. the developers intentionally programmed in a state specific to this part of the game that cannot be used any other way (a valid possibility but seemingly a waste of resources), or B. they hacked in their own state to the env_global and I can totally do something similar.

If I somehow had a way to make custom env_global states, this could massively reduce the complexity of the entity setups required to keep track of the variables influencing world state in each map. Does anyone here know anything about custom states in env_global or where in the code to look? Any help would be appreciated.

You can make custom env_global states. I think you just have to type into the “global state to set” textbox rather than choose a drop-down option, though it’s been a while since I’ve messed around with them.
EDIT:
This is for Goldsource, but it should work about the same in Source, just with the I/O system instead of single-target triggers.

Yeah you can just type directly into the dropbown field to set your own state.

Founded in 2004, Leakfree.org became one of the first online communities dedicated to Valve’s Source engine development. It is more famously known for the formation of Black Mesa: Source under the 'Leakfree Modification Team' handle in September 2004.