<?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=Triggers</id>
	<title>Triggers - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://mygamingtalk.com/wiki/index.php?action=history&amp;feed=atom&amp;title=Triggers"/>
	<link rel="alternate" type="text/html" href="https://mygamingtalk.com/wiki/index.php?title=Triggers&amp;action=history"/>
	<updated>2026-05-01T11:23:44Z</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=Triggers&amp;diff=1529&amp;oldid=prev</id>
		<title>Palota: 1 revision imported</title>
		<link rel="alternate" type="text/html" href="https://mygamingtalk.com/wiki/index.php?title=Triggers&amp;diff=1529&amp;oldid=prev"/>
		<updated>2023-02-13T07:02:35Z</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=Triggers&amp;diff=1528&amp;oldid=prev</id>
		<title>Palota: 1 revision imported</title>
		<link rel="alternate" type="text/html" href="https://mygamingtalk.com/wiki/index.php?title=Triggers&amp;diff=1528&amp;oldid=prev"/>
		<updated>2021-07-13T19:06:50Z</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    = Triggers&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;
== What is a trigger ==&lt;br /&gt;
&lt;br /&gt;
A trigger is something that happens in the map.&lt;br /&gt;
The most common triggers are text triggers &amp;amp; sound triggers.&lt;br /&gt;
Using the goldrush map as an example, when the 1st tank barrier is blown up you will see this text come up on your screen &amp;amp; in console&lt;br /&gt;
&lt;br /&gt;
Tank Barrier #1 has been destroyed.&lt;br /&gt;
&lt;br /&gt;
This is an example of a text trigger.&lt;br /&gt;
The next example is of a sound trigger, when the tank is past the barrier you will hear a sound saying &amp;quot;The tank is past the 1st barrier&amp;quot; but this time you will not see any message.&lt;br /&gt;
&lt;br /&gt;
=== Locating the &amp;quot;MISSING_STRING&amp;quot; ===&lt;br /&gt;
&lt;br /&gt;
For this part we are only interested in the &amp;quot;global OnMapLoad = function()&amp;quot; section of the script.&lt;br /&gt;
&lt;br /&gt;
You will see in there something like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt; &lt;br /&gt;
	OnTrigger( &amp;quot;MISSING_STRING&amp;quot;, Map.Main_Entrance_Destroyed );&lt;br /&gt;
	OnTrigger( &amp;quot;MISSING_STRING&amp;quot;, Map.documents_Taken );&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Now you need to find out what the actual trigger should be to replace the &amp;quot;MISSING_STRING&amp;quot; section of the line.&lt;br /&gt;
&lt;br /&gt;
There are 3 ways you can do this.&lt;br /&gt;
&lt;br /&gt;
1) Copy the text you see in the console. This is not a perfect method because some map makers add colour tags.&lt;br /&gt;
&lt;br /&gt;
2) Open the map PK3 file.  A PK3 file is just a Zip file that has been renamed. You can open it in any Zip program. Then locate file &amp;lt;mapname&amp;gt;.script in the maps folder.  Extract that file from the archive and open it in your text editor. You need to search the script for text such as wm_announce or wm_teamvoiceannounce.&lt;br /&gt;
&lt;br /&gt;
3) To find the trigger text you need to open the console &amp;amp; type the following command.&lt;br /&gt;
&lt;br /&gt;
     /bot debugtriggers&lt;br /&gt;
&lt;br /&gt;
Now all you need to do is play the map &amp;amp; read the console messages.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&lt;br /&gt;
     &amp;lt;---&amp;gt; Trigger: TagName: The Tank has been repaired! Action: announce Entity: (698:1) Activator: (-1:0)&lt;br /&gt;
&lt;br /&gt;
Here we need to use the TagName as the trigger. From this trigger text you just use this section of text&lt;br /&gt;
&lt;br /&gt;
     The Tank has been repaired!&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Tip:&amp;#039;&amp;#039;&amp;#039; Rather then coping text from the console you can save it by using the /condump command.&lt;br /&gt;
Just add a filename after the command&lt;br /&gt;
&lt;br /&gt;
/condump filename.txt&lt;br /&gt;
&lt;br /&gt;
You will then find this in you mod folder (omnibot in this case) called filename.txt or whatever name you have called it.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Note:&amp;#039;&amp;#039;&amp;#039; The maximum supported length is 71 chars. That&amp;#039;s why in Marrakesh Streets 2 By Night script you will read:&lt;br /&gt;
&lt;br /&gt;
     ^D***^WAllied team have constructed a command post.  Charge speed incre&lt;br /&gt;
&lt;br /&gt;
One less or one more doesn&amp;#039;t work well usually.&lt;br /&gt;
&lt;br /&gt;
=== Understanding what you have done ===&lt;br /&gt;
&lt;br /&gt;
Each time something happens in the map such as the allies destroying the main entrance the bots need a way to know this.  Replacing the &amp;quot;MISSING_STRING&amp;quot; with actual text that happens in the map will run a command to go to a section in the &amp;#039;global Map&amp;#039;&lt;br /&gt;
&lt;br /&gt;
Now when the example text of &amp;quot;Allies have destroyed the main entrance&amp;quot; comes up in the game, the command &amp;quot;Map.Main_Entrance_Destroyed&amp;quot; is run, this directs the script to the section in &amp;#039;global Map&amp;#039; called &amp;quot;Main_Entrance_Destroyed = function( trigger )&amp;quot;&lt;br /&gt;
&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;
	Main_Entrance_Destroyed = function( trigger )&lt;br /&gt;
	{&lt;br /&gt;
                //This is where you would add new instructions&lt;br /&gt;
&lt;br /&gt;
		Util.MapDebugPrint( &amp;quot;Main_Entrance_Destroyed&amp;quot; );&lt;br /&gt;
	},&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
global OnMapLoad = function()&lt;br /&gt;
{&lt;br /&gt;
       OnTrigger( &amp;quot;Allies have destroyed the main entrance&amp;quot;, Map.Main_Entrance_Destroyed );&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Command /bot makemapgm is not perfect and you will sometimes need to create extra triggers.&lt;br /&gt;
&lt;br /&gt;
=== Supported Triggers ===&lt;br /&gt;
&lt;br /&gt;
Most events in ET will fall into the following Omni-Bot recognized categories: &lt;br /&gt;
&lt;br /&gt;
*allied_complete &lt;br /&gt;
*allied_default &lt;br /&gt;
*allied_failed &lt;br /&gt;
*announce &lt;br /&gt;
*announce_icon &lt;br /&gt;
*axis_complete &lt;br /&gt;
*axis_default &lt;br /&gt;
*axis_failed &lt;br /&gt;
*defused &lt;br /&gt;
*dynamited &lt;br /&gt;
*exploded &lt;br /&gt;
*faceangle &lt;br /&gt;
*mover_goto x y z &lt;br /&gt;
*moving &lt;br /&gt;
*opened &lt;br /&gt;
*closed &lt;br /&gt;
*opening &lt;br /&gt;
*closing &lt;br /&gt;
*returned &lt;br /&gt;
*stolen &lt;br /&gt;
*team_announce &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;NOTE:&amp;#039;&amp;#039;&amp;#039; For the returned trigger (i.e. documents returned) use /bot debugtriggers output for when the flag is returned by expiring (no player returns it). If the regular wm_announce message is used, the event that occurs when the flag expires will not be used. It is recommended to manually steal the flag, /kill and wait for them to be automatically returned. An example can be found in radar.gm. Most of the time it will be something like &amp;quot;Flag returned flag!&amp;quot;&lt;/div&gt;</summary>
		<author><name>Palota</name></author>
	</entry>
</feed>