This is a draft page. It is a work in progress open to editing by anyone.
Remember to check for any notes left by the tagger at this article's talk page.
Stub
This article or section is a stub. You can help by expanding it.
dump_globals
is a command available in all
Source games. It dumps all global states. Global states remain between map transitions and are used to store state of entities using globalname or by env_global. logic_auto can be set to fire only if certain global state is ON.
Each global state is saved as name, map_name, state (ON/OFF/DEAD), counter"
Example output
Note:
doesn't initialize the counter and therefore shows garbage value.
format: <name>: <map_name> (<state>) = <counter>
Example from
Half-Life 2
Expand
-- Globals --
skill.cfg: d1_canals_01 (On) = 0
05.breakable02_5: d1_canals_05 (Dead) = 5884868
is_console: d1_canals_01 (Off) = 1582466224
05.breakable02_6: d1_canals_05 (Dead) = 161718712
is_pc: d1_canals_01 (On) = 212523520
05.breakable02_2: d1_canals_06 (On) = 161718700
canals_02_teeter_totter: d1_canals_02 (On) = 5884868
05.breakable02_3: d1_canals_06 (On) = 161718736
05.breakable01_2: d1_canals_05 (Dead) = 5884868
global_airlock2_scan: d1_eli_01 (On) = 170325036
05.breakable01_1: d1_canals_05 (Dead) = 5884868
friendly_encounter: d1_eli_01 (Off) = 17223328
05.breakable02_4: d1_canals_05 (Dead) = 5884868
suit_no_sprint: d1_eli_02 (Off) = 17223328
05.breakable02_1: d1_canals_05 (Dead) = 5884868
start_door_2: d1_town_01a (On) = 17223352
d1_town_01_door1: d1_town_01a (On) = 17223352
start_door: d1_town_01a (On) = 17223352
d1_town_02_returndoor_unlock_trigger: d1_town_02 (Dead) = 205092020
d1_town_05_motor: d1_town_05 (On) = 205279832
citizen_warehouse_door_0: d2_coast_01 (On) = 205279544
citizen_warehouse_door_1: d1_town_05 (On) = 205279868
gunship_trigger_11: d2_coast_07 (On) = 204942992
windmill_global: d2_coast_07 (On) = 204942764
gunship_trigger_12: d2_coast_07 (On) = 204943004
bridge_field_02: d2_coast_07 (On) = 17223352
gunship_trigger_2: d2_coast_08 (On) = 204943016
gunship_trigger_10: d2_coast_07 (On) = 204942728
gunship_trigger_4: d2_coast_08 (On) = 204943040
gunship_trigger_1: d2_coast_08 (On) = 204942728
prison01-02_door_2: d2_prison_02 (On) = 232113708
gunship_trigger_3: d2_coast_08 (On) = 17223352
gunship_trigger_6: d2_coast_08 (On) = 204943052
gunship_trigger_5: d2_coast_08 (On) = 17223352
gunship_trigger_7: d2_coast_08 (On) = 204943088
gunship_trigger_9: d2_coast_08 (On) = 231124808
gunship_trigger_8: d2_coast_08 (On) = 17223352
bridge_field_01: d2_coast_08 (On) = 17223352
bridge_gate_open: d2_coast_08 (On) = 17227456
antlion_allied: d2_coast_11 (On) = 17227456
01-02_door_1: d2_prison_01 (On) = 17223352
|
Means of working with global states
Keyvalue availabe to each entity. When an entity is being spawned and it has a non-empty string globalname it will create a global state
- name: <globalname>, map_name: <current_map_name>, state: ON
After the entity is killed the global state is set to DEAD and any entity with such globalname won't be spawned anymore.
Todo: more details
An entity that can set global state via its keyvalues globalstate, initialstate. Also can set the counter via counter keyvalue but the output for it is broken making this feature useless
- name: <globalstate>, map_name: <current_map_name>, state: <initialstate>, counter: <counter>
Can be set to fire its outputs only if a specified global state is ON.
Global states are appended to criteria set as <name>: <state (0,1,2)>
.
global_set
Console command global_set <name> <state>
. State is either 0 = OFF, 1 = ON, 2 = DEAD
CGlobalState vscript class (only in
Mapbase)
See Mapbase/Scripting/Script_Functions#CGlobalState
See also