Globalname: Difference between revisions
No edit summary |
|||
Line 14: | Line 14: | ||
=== d1_canals_05 / d1_canals_06 === | === d1_canals_05 / d1_canals_06 === | ||
To properly preserve states of the following entities | |||
*<kbd>func_breakables</kbd> (on the left with globalnames 05.breakable02_1 to 05.breakable02_6) | |||
*<kbd>func_physboxes</kbd> (on the right with globalnames 05.breakable01_1 and 05.breakable01_2) | |||
[[File:D1 canals 05-d1 canals 06-transition-example-1.jpg|600px|center]] | [[File:D1 canals 05-d1 canals 06-transition-example-1.jpg|600px|center]] | ||
After destroying the | After destroying the <kbd>func_breakables</kbd> then using {{cmd|dump_globals}} command we can see global states 05.breakable02_1 to 05.breakable02_6 marked as <code>Dead</code> which will ensure they will not spawn in next map. | ||
[[File:D1 canals 05-d1 canals 06-transition-example-2.jpg|600px|center]] | [[File:D1 canals 05-d1 canals 06-transition-example-2.jpg|600px|center]] | ||
Line 37: | Line 39: | ||
</pre> | </pre> | ||
Changing one of the func_physboxes color to red using <code>ent_fire !picker color "255 0 0"</code>. | Changing one of the <kbd>func_physboxes</kbd> color to red using <code>ent_fire !picker color "255 0 0"</code> for the sake of demonstration. | ||
[[File:D1 canals 05-d1 canals 06-transition-example-3.jpg|600px|center]] | [[File:D1 canals 05-d1 canals 06-transition-example-3.jpg|600px|center]] | ||
After transition we can see states were preserved and model name being different (*112 and *113 in d5 changed to *162 and *161 in d6). | After transition we can see states were preserved and model name being different (*112 and *113 in d5 changed to *162 and *161 in d6). | ||
[[File:D1 canals 05-d1 canals 06-transition-example-4.jpg|600px|center]] | [[File:D1 canals 05-d1 canals 06-transition-example-4.jpg|600px|center]] | ||
== See also == | == See also == | ||
* [[targetname]] | * [[targetname]] | ||
* [[classname]] | * [[classname]] |
Revision as of 14:23, 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
To properly preserve states of the following entities
- func_breakables (on the left with globalnames 05.breakable02_1 to 05.breakable02_6)
- func_physboxes (on the right with globalnames 05.breakable01_1 and 05.breakable01_2)
After destroying the func_breakables then using dump_globals command we can see global states 05.breakable02_1 to 05.breakable02_6 marked as Dead
which will ensure they will not spawn in next map.
] 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
Changing one of the func_physboxes color to red using ent_fire !picker color "255 0 0"
for the sake of demonstration.
After transition we can see states were preserved and model name being different (*112 and *113 in d5 changed to *162 and *161 in d6).