Globalname: Difference between revisions
No edit summary |
|||
Line 10: | Line 10: | ||
== Examples == | == Examples == | ||
{{ | {{note|There are several in {{hl2|4}}}} | ||
=== d1_canals_05 / d1_canals_06 === | |||
The following func_breakables and func_physboxes use globalname to properly preserve state between transitions. | |||
[[File:todo1]] | |||
After destroying the func_breakable we can see the following global states using {{cmd|dump_globals}} command output. | |||
[[File:todo2]] | |||
<pre> | |||
] dump_globals | |||
is_pc: d1_canals_05 (On) = 217026304 | |||
-- Globals -- | |||
05.breakable01_2: d1_canals_05 (On) = 12110476 | |||
skill.cfg: d1_canals_05 (On) = 0 | |||
05.breakable01_1: d1_canals_05 (On) = 12110476 | |||
is_console: d1_canals_05 (Off) = 1560839504 | |||
05.breakable02_4: d1_canals_05 (Dead) = 12110476 | |||
05.breakable02_1: d1_canals_05 (Dead) = 12110476 | |||
05.breakable02_5: d1_canals_05 (Dead) = 12110476 | |||
05.breakable02_6: d1_canals_05 (Dead) = 12110476 | |||
05.breakable02_2: d1_canals_05 (Dead) = 12110476 | |||
05.breakable02_3: d1_canals_05 (Dead) = 12110476 | |||
</pre> | |||
After transition we can see states preserved and model name being different. [[File:todo3]] | |||
== See also == | == See also == | ||
* [[targetname]] | * [[targetname]] | ||
* [[classname]] | * [[classname]] |
Revision as of 14:04, 29 March 2025

Remember to check for any notes left by the tagger at this article's talk page.
globalname
is a keyvalue available in all Source games. It's a name to designate two entities in different maps as being logically the same entity. When player transitions from map A to B the entity in map B with matching globalname will get most of its properties from entity that was in map A like origin, angles, color etc. (model for example is not transferred). If the entity was killed in map A it will not spawn in map B.





Other ways to ensure no duplicate (logically same) entities between transition is properly utilizing logic_auto outputs like OnNewGame, OnMapTransition.
Examples


d1_canals_05 / d1_canals_06
The following func_breakables and func_physboxes use globalname to properly preserve state between transitions. File:Todo1
After destroying the func_breakable we can see the following global states using dump_globals command output.
File:Todo2
] dump_globals is_pc: d1_canals_05 (On) = 217026304 -- Globals -- 05.breakable01_2: d1_canals_05 (On) = 12110476 skill.cfg: d1_canals_05 (On) = 0 05.breakable01_1: d1_canals_05 (On) = 12110476 is_console: d1_canals_05 (Off) = 1560839504 05.breakable02_4: d1_canals_05 (Dead) = 12110476 05.breakable02_1: d1_canals_05 (Dead) = 12110476 05.breakable02_5: d1_canals_05 (Dead) = 12110476 05.breakable02_6: d1_canals_05 (Dead) = 12110476 05.breakable02_2: d1_canals_05 (Dead) = 12110476 05.breakable02_3: d1_canals_05 (Dead) = 12110476
After transition we can see states preserved and model name being different. File:Todo3