<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.teamspec.net/index.php?action=history&amp;feed=atom&amp;title=Level_Editor%2FScripting%2FZones</id>
	<title>Level Editor/Scripting/Zones - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.teamspec.net/index.php?action=history&amp;feed=atom&amp;title=Level_Editor%2FScripting%2FZones"/>
	<link rel="alternate" type="text/html" href="https://wiki.teamspec.net/index.php?title=Level_Editor/Scripting/Zones&amp;action=history"/>
	<updated>2026-10-28T08:30:18Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.11</generator>
	<entry>
		<id>https://wiki.teamspec.net/index.php?title=Level_Editor/Scripting/Zones&amp;diff=482&amp;oldid=prev</id>
		<title>TeamSpecBot: American spelling</title>
		<link rel="alternate" type="text/html" href="https://wiki.teamspec.net/index.php?title=Level_Editor/Scripting/Zones&amp;diff=482&amp;oldid=prev"/>
		<updated>2026-10-20T04:45:50Z</updated>

		<summary type="html">&lt;p&gt;American spelling&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 04:45, 20 October 2026&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l17&quot;&gt;Line 17:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 17:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* Its &amp;#039;&amp;#039;&amp;#039;label&amp;#039;&amp;#039;&amp;#039;, exactly the name you typed. [[Level Editor/Scripting/Reference/GamemodeServerApi#zone_label|api.zone_label]]&amp;lt;code&amp;gt;(zone)&amp;lt;/code&amp;gt; returns it.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* Its &amp;#039;&amp;#039;&amp;#039;label&amp;#039;&amp;#039;&amp;#039;, exactly the name you typed. [[Level Editor/Scripting/Reference/GamemodeServerApi#zone_label|api.zone_label]]&amp;lt;code&amp;gt;(zone)&amp;lt;/code&amp;gt; returns it.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&#039;&#039;&#039;Compare labels, not keys.&#039;&#039;&#039; &amp;lt;code&amp;gt;zone == &amp;amp;&quot;Capture Point&quot;&amp;lt;/code&amp;gt; only ever matches the first zone with that name; &amp;lt;code&amp;gt;api.zone_label(zone) == &amp;amp;&quot;Capture Point&quot;&amp;lt;/code&amp;gt; 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#&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;zones_labelled&lt;/del&gt;|api.&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;zones_labelled&lt;/del&gt;]]. Names are matched exactly, including capitals and spaces.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&#039;&#039;&#039;Compare labels, not keys.&#039;&#039;&#039; &amp;lt;code&amp;gt;zone == &amp;amp;&quot;Capture Point&quot;&amp;lt;/code&amp;gt; only ever matches the first zone with that name; &amp;lt;code&amp;gt;api.zone_label(zone) == &amp;amp;&quot;Capture Point&quot;&amp;lt;/code&amp;gt; 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#&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;zones_labeled&lt;/ins&gt;|api.&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;zones_labeled&lt;/ins&gt;]]. Names are matched exactly, including capitals and spaces.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== Zone hooks ==&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== Zone hooks ==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;!-- diff cache key wiki:diff:1.41:old-66:rev-482:php=table --&gt;
&lt;/table&gt;</summary>
		<author><name>TeamSpecBot</name></author>
	</entry>
	<entry>
		<id>https://wiki.teamspec.net/index.php?title=Level_Editor/Scripting/Zones&amp;diff=66&amp;oldid=prev</id>
		<title>TeamSpecBot: Level Editor: zones scripting guide</title>
		<link rel="alternate" type="text/html" href="https://wiki.teamspec.net/index.php?title=Level_Editor/Scripting/Zones&amp;diff=66&amp;oldid=prev"/>
		<updated>2026-10-20T03:46:25Z</updated>

		<summary type="html">&lt;p&gt;Level Editor: zones scripting guide&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;A zone is a volume your script reacts to: a capture point, a spawn room, a deposit area, a hazard. Every area trigger in the map is a zone, and your script decides what each one means by its name.&lt;br /&gt;
&lt;br /&gt;
== Making a zone ==&lt;br /&gt;
&lt;br /&gt;
# Build a brush of the shape you want with any shape tool. It can be carved and subtracted like any brush, so a zone can follow the shape of a room.&lt;br /&gt;
# With it selected, tick &amp;#039;&amp;#039;&amp;#039;Is Area&amp;#039;&amp;#039;&amp;#039; in the inspector. The brush is no longer solid or visible in the game; it only marks out space.&lt;br /&gt;
# Set &amp;#039;&amp;#039;&amp;#039;Trigger Name&amp;#039;&amp;#039;&amp;#039; to the name your script will match, for example &amp;lt;code&amp;gt;Capture Point&amp;lt;/code&amp;gt;. Left blank, the brush&amp;#039;s own name is used.&lt;br /&gt;
# Set &amp;#039;&amp;#039;&amp;#039;Zone Team&amp;#039;&amp;#039;&amp;#039; if the zone belongs to a team (0 means neutral).&lt;br /&gt;
&lt;br /&gt;
Zone brushes draw translucent in the editor. &amp;#039;&amp;#039;&amp;#039;Edit &amp;gt; Click Through Zone Brushes&amp;#039;&amp;#039;&amp;#039; lets you click what is behind them, and &amp;#039;&amp;#039;&amp;#039;Area Trigger Opacity&amp;#039;&amp;#039;&amp;#039; in [[Level Editor/Settings|Settings]] changes how strongly they draw.&lt;br /&gt;
&lt;br /&gt;
== Names, keys and labels ==&lt;br /&gt;
&lt;br /&gt;
Several zones may share a name: one &amp;quot;Spawn Room&amp;quot; per team is the natural way to build a map, told apart by their team. So a zone has two names:&lt;br /&gt;
&lt;br /&gt;
* Its &amp;#039;&amp;#039;&amp;#039;key&amp;#039;&amp;#039;&amp;#039;, which the hooks hand you as &amp;lt;code&amp;gt;zone&amp;lt;/code&amp;gt;. Every key is unique: when two zones share a name, the second one&amp;#039;s key gets a number added.&lt;br /&gt;
* Its &amp;#039;&amp;#039;&amp;#039;label&amp;#039;&amp;#039;&amp;#039;, exactly the name you typed. [[Level Editor/Scripting/Reference/GamemodeServerApi#zone_label|api.zone_label]]&amp;lt;code&amp;gt;(zone)&amp;lt;/code&amp;gt; returns it.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Compare labels, not keys.&amp;#039;&amp;#039;&amp;#039; &amp;lt;code&amp;gt;zone == &amp;amp;&amp;quot;Capture Point&amp;quot;&amp;lt;/code&amp;gt; only ever matches the first zone with that name; &amp;lt;code&amp;gt;api.zone_label(zone) == &amp;amp;&amp;quot;Capture Point&amp;quot;&amp;lt;/code&amp;gt; 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.&lt;br /&gt;
&lt;br /&gt;
== Zone hooks ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
func _zone_entered(zone: StringName, entity_id: int) -&amp;gt; void:&lt;br /&gt;
	pass&lt;br /&gt;
&lt;br /&gt;
func _zone_exited(zone: StringName, entity_id: int) -&amp;gt; void:&lt;br /&gt;
	pass&lt;br /&gt;
&lt;br /&gt;
func _zone_tick(zone: StringName, occupants: Array, delta: float) -&amp;gt; void:&lt;br /&gt;
	pass&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;_zone_entered&amp;lt;/code&amp;gt; runs when a player comes into a zone.&lt;br /&gt;
* &amp;lt;code&amp;gt;_zone_exited&amp;lt;/code&amp;gt; runs when they go out of it, &amp;#039;&amp;#039;&amp;#039;and also when they die or leave the match&amp;#039;&amp;#039;&amp;#039; inside it. Do not assume an exit means they are alive somewhere else.&lt;br /&gt;
* &amp;lt;code&amp;gt;_zone_tick&amp;lt;/code&amp;gt; runs every server tick for every zone, &amp;#039;&amp;#039;&amp;#039;including empty ones&amp;#039;&amp;#039;&amp;#039;, so a capture meter can drain when nobody is on the point. &amp;lt;code&amp;gt;occupants&amp;lt;/code&amp;gt; is sorted.&lt;br /&gt;
* Only living players count. What counts is the player&amp;#039;s position: they are inside when the point they stand on is inside the volume.&lt;br /&gt;
* &amp;lt;code&amp;gt;_zone_used&amp;lt;/code&amp;gt; runs when a player standing in a usable zone presses the use key. A zone is usable when it has a &amp;#039;&amp;#039;&amp;#039;Use Prompt&amp;#039;&amp;#039;&amp;#039;, which the HUD shows to anyone inside it. See [[Level Editor/Scripting/Reference/GamemodeServerScript#_zone_used|_zone_used]].&lt;br /&gt;
&lt;br /&gt;
To ask at any other moment: [[Level Editor/Scripting/Reference/GamemodeServerApi#zones|api.zones]], [[Level Editor/Scripting/Reference/GamemodeServerApi#zone_occupants|api.zone_occupants]] and [[Level Editor/Scripting/Reference/GamemodeServerApi#zone_position|api.zone_position]]. The hooks are the cheaper way; there is no need to check every zone yourself in &amp;lt;code&amp;gt;_tick&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
A zone can also act without a script: its &amp;#039;&amp;#039;&amp;#039;Outputs&amp;#039;&amp;#039;&amp;#039; in the inspector fire another entity&amp;#039;s input (open a door, trigger a relay) when a player comes in or goes out. See [[Level Editor/Workflows/Outputs and logic|Logic and outputs]].&lt;br /&gt;
&lt;br /&gt;
== The world boundary ==&lt;br /&gt;
&lt;br /&gt;
Place one &amp;#039;&amp;#039;&amp;#039;World Boundary&amp;#039;&amp;#039;&amp;#039; from the Functional menu, below everything a player can stand on. It is a flat plane through the marker: anybody whose position falls below it has left the world.&lt;br /&gt;
&lt;br /&gt;
That does not arrive through &amp;lt;code&amp;gt;_zone_entered&amp;lt;/code&amp;gt;. It calls &amp;lt;code&amp;gt;_left_world(entity_id)&amp;lt;/code&amp;gt;, which by default kills the player with nobody credited. Override it to do something else, such as putting them back:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
func _left_world(entity_id: int) -&amp;gt; void:&lt;br /&gt;
	api.teleport(entity_id, _spawn_position(entity_id))&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Do not name a zone &amp;lt;code&amp;gt;WorldBoundary&amp;lt;/code&amp;gt;; that name belongs to the boundary.&lt;br /&gt;
&lt;br /&gt;
== Moving zones ==&lt;br /&gt;
&lt;br /&gt;
A zone brush placed under a moving platform (&amp;#039;&amp;#039;&amp;#039;Functional &amp;gt; Create Anchor Platform&amp;#039;&amp;#039;&amp;#039;) moves with the platform, so a lift can carry a capture point. Nothing changes in the script: the zone arrives through the same hooks, and &amp;lt;code&amp;gt;api.zone_position&amp;lt;/code&amp;gt; follows it.&lt;br /&gt;
&lt;br /&gt;
A payload cart carries a zone of its own too; see [[Level Editor/Scripting/Payload tracks|Payload tracks]].&lt;br /&gt;
&lt;br /&gt;
{{Level Editor nav}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Level Editor]]&lt;br /&gt;
[[Category:Gamemode scripting]]&lt;/div&gt;</summary>
		<author><name>TeamSpecBot</name></author>
	</entry>
</feed>