Level Editor/Scripting/Zones: Difference between revisions

Level Editor: zones scripting guide
 
American spelling
 
Line 17: Line 17:
* Its '''label''', exactly the name you typed. [[Level Editor/Scripting/Reference/GamemodeServerApi#zone_label|api.zone_label]]<code>(zone)</code> returns it.
* Its '''label''', exactly the name you typed. [[Level Editor/Scripting/Reference/GamemodeServerApi#zone_label|api.zone_label]]<code>(zone)</code> returns it.


'''Compare labels, not keys.''' <code>zone == &"Capture Point"</code> only ever matches the first zone with that name; <code>api.zone_label(zone) == &"Capture Point"</code> matches all of them. Tell same-named zones apart with [[Level Editor/Scripting/Reference/GamemodeServerApi#zone_team|api.zone_team]], and find them all with [[Level Editor/Scripting/Reference/GamemodeServerApi#zones_labelled|api.zones_labelled]]. Names are matched exactly, including capitals and spaces.
'''Compare labels, not keys.''' <code>zone == &"Capture Point"</code> only ever matches the first zone with that name; <code>api.zone_label(zone) == &"Capture Point"</code> matches all of them. Tell same-named zones apart with [[Level Editor/Scripting/Reference/GamemodeServerApi#zone_team|api.zone_team]], and find them all with [[Level Editor/Scripting/Reference/GamemodeServerApi#zones_labeled|api.zones_labeled]]. Names are matched exactly, including capitals and spaces.


== Zone hooks ==
== Zone hooks ==