<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://mygamingtalk.com/wiki/index.php?action=history&amp;feed=atom&amp;title=Vehicle_Trigger_Regions</id>
	<title>Vehicle Trigger Regions - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://mygamingtalk.com/wiki/index.php?action=history&amp;feed=atom&amp;title=Vehicle_Trigger_Regions"/>
	<link rel="alternate" type="text/html" href="https://mygamingtalk.com/wiki/index.php?title=Vehicle_Trigger_Regions&amp;action=history"/>
	<updated>2026-04-09T22:25:47Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.41.1</generator>
	<entry>
		<id>https://mygamingtalk.com/wiki/index.php?title=Vehicle_Trigger_Regions&amp;diff=1537&amp;oldid=prev</id>
		<title>Palota: 1 revision imported</title>
		<link rel="alternate" type="text/html" href="https://mygamingtalk.com/wiki/index.php?title=Vehicle_Trigger_Regions&amp;diff=1537&amp;oldid=prev"/>
		<updated>2023-02-13T07:02:36Z</updated>

		<summary type="html">&lt;p&gt;1 revision imported&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 07:02, 13 February 2023&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-notice&quot; lang=&quot;en&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(No difference)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</summary>
		<author><name>Palota</name></author>
	</entry>
	<entry>
		<id>https://mygamingtalk.com/wiki/index.php?title=Vehicle_Trigger_Regions&amp;diff=1536&amp;oldid=prev</id>
		<title>Palota: 1 revision imported</title>
		<link rel="alternate" type="text/html" href="https://mygamingtalk.com/wiki/index.php?title=Vehicle_Trigger_Regions&amp;diff=1536&amp;oldid=prev"/>
		<updated>2021-07-13T19:07:18Z</updated>

		<summary type="html">&lt;p&gt;1 revision imported&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;__NOTOC__&lt;br /&gt;
{{process header&lt;br /&gt;
 | title    = Vehicle Trigger Regions&lt;br /&gt;
 | section  =&lt;br /&gt;
 | previous = [[Omni-Bot_Map_Scripting | Omni-Bot_Map_Scripting]] &lt;br /&gt;
 | next     = &lt;br /&gt;
 | shortcut =&lt;br /&gt;
 | notes    =&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
In Omni-bot 0.8 a new version just for detecting Vehicles entering trigger regions was introduced.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== The Trigger ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
A standard AABB trigger region text looks like this:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
OnTriggerRegion(AABB(0,0,0,1,1,1),Map.YourTrigger);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For the new version you simply need to edit the section at the end like this:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
OnTriggerRegion(AABB(0,0,0,1,1,1), RegionTrigger.VehicleTrigger);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== What does this do ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
When using the new trigger it now sends a message to the console (requires &amp;quot;/bot debugtriggers&amp;quot; to see) saying vehicle name &amp;quot;at location&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Example:&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
	tank at location&lt;br /&gt;
	truck at location&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Creating a new trigger ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This next section works the same way as normal trigger text&lt;br /&gt;
&lt;br /&gt;
Example&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt; &lt;br /&gt;
	OnTrigger( &amp;quot;tank at location&amp;quot;, Map.vehicle_at_location );&lt;br /&gt;
	OnTrigger( &amp;quot;truck at location&amp;quot;, Map.vehicle_at_location );&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In the example there are triggers for both a truck &amp;amp; a tank pointing to the same trigger function &amp;quot;vehicle_at_location&amp;quot; this is because of how the next trigger function works.  It does not matter if you just have 1 tank or both a tank &amp;amp; a truck all that matters is that the vehicles reach the trigger regions in order.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== The Trigger Function ==&lt;br /&gt;
&lt;br /&gt;
Within the new trigger function you need to setup a &amp;quot;switch(Map.VehicleLocation)&amp;quot; table.  Within the table you setup a series of case&amp;#039;s i.e. case 1, case 2 etc.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Each time the vehicle(s) enter a trigger region the &amp;quot;VehicleLocation&amp;quot; is updated so the 1st time the vehicle a trigger region is goes to case 1 &amp;amp; the 2nd to case 2 etc.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Within the case series you can add any scripting command such as &amp;quot;SetAvailableMapGoals&amp;quot; or make it run another standard trigger &amp;quot;Map.tank_at_barrier1();&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt; &lt;br /&gt;
vehicle_at_location = function( trigger )&lt;br /&gt;
	{&lt;br /&gt;
		switch(Map.VehicleLocation)&lt;br /&gt;
		{&lt;br /&gt;
			case 1:&lt;br /&gt;
			{&lt;br /&gt;
				SetAvailableMapGoals( TEAM.AXIS, true, &amp;quot;MOUNT_tank_axis&amp;quot; );&lt;br /&gt;
				Map.tank_at_barrier1();&lt;br /&gt;
			}&lt;br /&gt;
			case 2:&lt;br /&gt;
			{&lt;br /&gt;
				Map.truck_at_barrier2();&lt;br /&gt;
			}&lt;br /&gt;
		}&lt;br /&gt;
		Util.MapDebugPrint(&amp;quot;vehicle at location &amp;quot; + Map.VehicleLocation, true);&lt;br /&gt;
	},&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Example Script ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This is a edited cut down version from goldrush&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt; &lt;br /&gt;
global Map =&lt;br /&gt;
{&lt;br /&gt;
	tank_at_barrier1 = function()&lt;br /&gt;
	{&lt;br /&gt;
		Util.MapDebugPrint(&amp;quot;tank_at_barrier1&amp;quot;);&lt;br /&gt;
	},&lt;br /&gt;
&lt;br /&gt;
	truck_at_barrier2 = function()&lt;br /&gt;
	{&lt;br /&gt;
		Util.MapDebugPrint(&amp;quot;truck_at_barrier2&amp;quot;);&lt;br /&gt;
	},&lt;br /&gt;
&lt;br /&gt;
	vehicle_at_location = function( trigger )&lt;br /&gt;
	{&lt;br /&gt;
		switch(Map.VehicleLocation)&lt;br /&gt;
		{&lt;br /&gt;
			case 1:&lt;br /&gt;
			{&lt;br /&gt;
				SetAvailableMapGoals( TEAM.AXIS, true, &amp;quot;MOUNT_tank_axis&amp;quot; );&lt;br /&gt;
				Map.tank_at_barrier1();&lt;br /&gt;
			}&lt;br /&gt;
			case 2:&lt;br /&gt;
			{&lt;br /&gt;
				Map.truck_at_barrier2();&lt;br /&gt;
			}&lt;br /&gt;
		}&lt;br /&gt;
		Util.MapDebugPrint(&amp;quot;vehicle at location &amp;quot; + Map.VehicleLocation, true);&lt;br /&gt;
	},&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
global OnMapLoad = function()&lt;br /&gt;
{&lt;br /&gt;
	OnTrigger( &amp;quot;tank at location&amp;quot;, Map.vehicle_at_location );&lt;br /&gt;
	OnTrigger( &amp;quot;truck at location&amp;quot;, Map.vehicle_at_location );&lt;br /&gt;
&lt;br /&gt;
	OnTriggerRegion(AABB(660.253,828.462,59.548,960.874,1040.700,173.040), RegionTrigger.VehicleTrigger);&lt;br /&gt;
	OnTriggerRegion(AABB(480.061,-720.472,-332.313,634.705,-478.740,-222.440), RegionTrigger.VehicleTrigger);&lt;br /&gt;
&lt;br /&gt;
	print( &amp;quot;Omni-bot map script for &amp;quot; + GetMapName() + &amp;quot; executed.&amp;quot; );&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>Palota</name></author>
	</entry>
</feed>