<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://mygamingtalk.com/wiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Palota</id>
	<title>MyGamingTalk - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://mygamingtalk.com/wiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Palota"/>
	<link rel="alternate" type="text/html" href="https://mygamingtalk.com/wiki/Special:Contributions/Palota"/>
	<updated>2026-05-05T18:23:26Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.41.1</generator>
	<entry>
		<id>https://mygamingtalk.com/wiki/index.php?title=Waypoint_Library&amp;diff=1794</id>
		<title>Waypoint Library</title>
		<link rel="alternate" type="text/html" href="https://mygamingtalk.com/wiki/index.php?title=Waypoint_Library&amp;diff=1794"/>
		<updated>2026-04-24T15:43:56Z</updated>

		<summary type="html">&lt;p&gt;Palota: connections&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{process header&lt;br /&gt;
 | title    = Waypoint Library&lt;br /&gt;
 | section  =&lt;br /&gt;
 | previous = [[Omni-bot_Script_Reference | Script Reference]]&lt;br /&gt;
 | next     = &lt;br /&gt;
 | shortcut =&lt;br /&gt;
 | notes    =&lt;br /&gt;
}}&lt;br /&gt;
{{TOCright}}&lt;br /&gt;
== AddWaypoint ==&lt;br /&gt;
Creates a new waypoint at a specified location.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&amp;lt;Vector3&amp;gt;&amp;lt;/nowiki&amp;gt;            The position to add waypoint.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&amp;lt;optional Vector3&amp;gt;&amp;lt;/nowiki&amp;gt;            The facing for the waypoint.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
int            Waypoint Id if successful OR null if there was an error adding waypoint.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 Wp.AddWaypoint(Vector3(1000,2000,1000))&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== CheckBlockable ==&lt;br /&gt;
Verifies all red blockable connections and changes them to green immediately if they are not blocked anymore. This function should be used in triggers of destroyable walls or constructible bridges. It prevents a lot of path failed errors. Objects destroyed by a dynamite usually also require sleep(0.1) before CheckBlockable.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
None&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Count of changed connections, but the number is unreliable and can be zero.&lt;br /&gt;
&lt;br /&gt;
== Connect ==&lt;br /&gt;
Connects two waypoints&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&amp;lt;int&amp;gt;&amp;lt;/nowiki&amp;gt;            Guid of a waypoint.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&amp;lt;int&amp;gt;&amp;lt;/nowiki&amp;gt;            Guid of another waypoint.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
true if successful, false if not&lt;br /&gt;
&lt;br /&gt;
== DeleteWaypoint ==&lt;br /&gt;
Delete a waypoint from a specified location.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&amp;lt;Vector3&amp;gt;&amp;lt;/nowiki&amp;gt;            &amp;lt;nowiki&amp;gt;The &amp;lt;Vector3&amp;gt; position to delete waypoint from.&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
true if successful, false if not&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 Wp.DeleteWaypoint(Vector3(1000,2000,1000))&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Disconnect ==&lt;br /&gt;
Disconnects two waypoints.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&amp;lt;int&amp;gt;&amp;lt;/nowiki&amp;gt;            Guid of a waypoint.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&amp;lt;int&amp;gt;&amp;lt;/nowiki&amp;gt;            Guid of another waypoint.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
true if successful, false if not&lt;br /&gt;
&lt;br /&gt;
== GetAllWaypoints ==&lt;br /&gt;
Gets all waypoints.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&amp;lt;table&amp;gt;&amp;lt;/nowiki&amp;gt;            An empty table, the function will fill tables of position, facing, guid, radius, name, flags, property, connections.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
None&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example&#039;&#039;&#039; &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
wpTable = {};&lt;br /&gt;
Wp.GetAllWaypoints( wpTable );&lt;br /&gt;
foreach( waypoint in wpTable ) {&lt;br /&gt;
	if( waypoint.name ) {&lt;br /&gt;
		print(waypoint.name, &amp;quot;-&amp;quot;, waypoint.position);&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== GetClosestWaypoint ==&lt;br /&gt;
Gets waypoint near position.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;Vector3&amp;gt;           position&lt;br /&gt;
&lt;br /&gt;
&amp;lt;optional int&amp;gt;    team&lt;br /&gt;
&lt;br /&gt;
&amp;lt;optional options&amp;gt; 1=don&#039;t skip closed waypoints,  2=ignore waypoints without connections&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&amp;lt;table&amp;gt;&amp;lt;/nowiki&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example&#039;&#039;&#039; &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
w = Wp.GetClosestWaypoint( Vec3(100,200,0) );&lt;br /&gt;
if(w) {&lt;br /&gt;
	print(&amp;quot;waypoint UID &amp;quot;, w.guid);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== GetAllSelectedWaypoints ==&lt;br /&gt;
Gets selected waypoints.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&amp;lt;table&amp;gt;&amp;lt;/nowiki&amp;gt;            An empty table, the function will fill tables of position, facing, guid, radius, name, flags, property, connections.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
None&lt;br /&gt;
&lt;br /&gt;
== GetWaypointByGUID ==&lt;br /&gt;
Gets a waypoint information by its guid.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&amp;lt;int&amp;gt;&amp;lt;/nowiki&amp;gt;   Guid of a waypoint.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&amp;lt;table&amp;gt;&amp;lt;/nowiki&amp;gt;            An empty table, the function will fill in position, facing, guid, radius, name, flags, property, connections.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
true if successful, false if not&lt;br /&gt;
&lt;br /&gt;
== GetWaypointByName ==&lt;br /&gt;
Gets a waypoint&#039;s information by its name.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&amp;lt;string&amp;gt;&amp;lt;/nowiki&amp;gt;            The name of the waypoint to get the info of.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&amp;lt;table&amp;gt;&amp;lt;/nowiki&amp;gt;            An empty table, the function will fill in position, facing, guid, radius, name, flags, property, connections.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
true if successful, false if not&lt;br /&gt;
&lt;br /&gt;
== IsWaypointViewOn ==&lt;br /&gt;
Checks if waypoint view is on.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
None&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
int       true if waypoint_view is on, false if not&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 Wp.IsWaypointViewOn()&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Load ==&lt;br /&gt;
Loads waypoints from nav folder.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&amp;lt;optional string&amp;gt;&amp;lt;/nowiki&amp;gt;   File name.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
true if successful, false if not&lt;br /&gt;
&lt;br /&gt;
== Save ==&lt;br /&gt;
Saves waypoints to nav folder.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&amp;lt;optional string&amp;gt;&amp;lt;/nowiki&amp;gt;   File name.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
true if successful, false if not&lt;br /&gt;
&lt;br /&gt;
== SetRadius ==&lt;br /&gt;
Sets a wapoint radius. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&amp;lt;int&amp;gt;&amp;lt;/nowiki&amp;gt;   Guid of a waypoint&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&amp;lt;int&amp;gt;&amp;lt;/nowiki&amp;gt;            Radius.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
true if successful, false if not&lt;br /&gt;
&lt;br /&gt;
== SetWaypointFlag ==&lt;br /&gt;
Sets the [[Waypoint_Flags|flag]] on a waypoint by name.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&amp;lt;int&amp;gt;&amp;lt;/nowiki&amp;gt;   Guid of a waypoint &#039;&#039;&#039;OR&#039;&#039;&#039;&amp;lt;nowiki&amp;gt;  &amp;lt;string&amp;gt;&amp;lt;/nowiki&amp;gt; Name of the waypoint or a regular expression.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&amp;lt;string&amp;gt;&amp;lt;/nowiki&amp;gt;   The name of the flag to set &#039;&#039;&#039;OR&#039;&#039;&#039; &amp;lt;nowiki&amp;gt;&amp;lt;table&amp;gt;&amp;lt;/nowiki&amp;gt; Multiple flags to set.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&amp;lt;int&amp;gt;&amp;lt;/nowiki&amp;gt;   True to set, false to clear.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
None&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 Wp.SetWaypointFlag(&amp;quot;waypointname&amp;quot;, &amp;quot;closed&amp;quot;, false);&lt;br /&gt;
 Wp.SetWaypointFlag(&amp;quot;bridge_.*&amp;quot;, &amp;quot;crouch&amp;quot;, true);&lt;br /&gt;
 Wp.SetWaypointFlag(&amp;quot;main_entrance&amp;quot;, { &amp;quot;axis&amp;quot;, &amp;quot;door&amp;quot; }, true );&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== SetWaypointName ==&lt;br /&gt;
Assigns a name to a waypoint.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&amp;lt;int&amp;gt;&amp;lt;/nowiki&amp;gt;   The id of the waypoint to set the name of.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&amp;lt;string&amp;gt;&amp;lt;/nowiki&amp;gt;            The name to assign to the waypoint.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
true if successful, false if not&lt;br /&gt;
&lt;br /&gt;
== SetWaypointProperty ==&lt;br /&gt;
Sets the waypoint property.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&amp;lt;int&amp;gt;&amp;lt;/nowiki&amp;gt;   Guid of a waypoint &#039;&#039;&#039;OR&#039;&#039;&#039;&amp;lt;nowiki&amp;gt;  &amp;lt;string&amp;gt;&amp;lt;/nowiki&amp;gt; Name of the waypoint.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&amp;lt;string&amp;gt;&amp;lt;/nowiki&amp;gt;            The name of the property to set.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&amp;lt;string&amp;gt;&amp;lt;/nowiki&amp;gt;            Property value to set.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
None&lt;br /&gt;
&lt;br /&gt;
== WaypointColor ==&lt;br /&gt;
Customize the color of various types of waypoints, paths, etc...  See [[Waypoint_Commands#waypoint_color|waypoint_color]] command for help.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&amp;lt;string&amp;gt;&amp;lt;/nowiki&amp;gt;            The name of the category to set a color for.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&amp;lt;int&amp;gt;&amp;lt;/nowiki&amp;gt;   The color to use for this type.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
None&lt;br /&gt;
&lt;br /&gt;
=Properties=&lt;br /&gt;
&lt;br /&gt;
== BlockablePathOffset ==&lt;br /&gt;
the offset for blockable paths for drawing purposes.&lt;br /&gt;
&lt;br /&gt;
== BottomPathOffset ==&lt;br /&gt;
the offset for path bottom for drawing purposes.&lt;br /&gt;
&lt;br /&gt;
== BottomWaypointOffset ==&lt;br /&gt;
the offset for waypoint bottom for drawing purposes.&lt;br /&gt;
&lt;br /&gt;
== FacingOffset ==&lt;br /&gt;
the offset for drawing the facing indicator.&lt;br /&gt;
&lt;br /&gt;
== PathLevelOffset ==&lt;br /&gt;
relative offset for path finding, default is 0.5&lt;br /&gt;
&lt;br /&gt;
== TextDuration ==&lt;br /&gt;
drawing duration for texts, default is 2 seconds&lt;br /&gt;
&lt;br /&gt;
== TextOffset ==&lt;br /&gt;
the offset for drawing waypoint name, UID, radius, flags.&lt;br /&gt;
&lt;br /&gt;
== TopPathOffset ==&lt;br /&gt;
the offset for path top for drawing purposes.&lt;br /&gt;
&lt;br /&gt;
== TopWaypointOffset ==&lt;br /&gt;
the offset for waypoint top for drawing purposes.&lt;/div&gt;</summary>
		<author><name>Palota</name></author>
	</entry>
	<entry>
		<id>https://mygamingtalk.com/wiki/index.php?title=System_Library&amp;diff=1793</id>
		<title>System Library</title>
		<link rel="alternate" type="text/html" href="https://mygamingtalk.com/wiki/index.php?title=System_Library&amp;diff=1793"/>
		<updated>2026-04-24T15:40:33Z</updated>

		<summary type="html">&lt;p&gt;Palota: CopyToClipboard&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{process header&lt;br /&gt;
 | title    = System Library&lt;br /&gt;
 | section  =&lt;br /&gt;
 | previous = [[Omni-bot_Script_Reference | Script Reference]]&lt;br /&gt;
 | next     = &lt;br /&gt;
 | shortcut =&lt;br /&gt;
 | notes    =&lt;br /&gt;
}}&lt;br /&gt;
{{TOCright}}&lt;br /&gt;
==Global FileSystem Functions==&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===CopyToClipboard===&lt;br /&gt;
Copies a text to the Windows clipboard. Does not work on Linux or Mac.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; string&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; true if success, false if failed&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;System.CopyToClipboard(&amp;quot;Hello&amp;quot;);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===FileDelete===&lt;br /&gt;
Deletes a file by name. This function is restricted to files under the user folder.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (filename)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; true if success, false if failed&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 System.FileDelete(&amp;quot;myfile.txt&amp;quot;);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===FileEnumerate===&lt;br /&gt;
Enumerates over all files in a directory. This function is restricted to files under the user folder. This function will call the provided script function with all files enumerated.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (folder name, script function)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; true if success, false if failed&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 myfunc = function(filename)&lt;br /&gt;
 {&lt;br /&gt;
 }&lt;br /&gt;
 System.FileEnumerate(&amp;quot;myfolder&amp;quot;, myfunc);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
===FileExists===&lt;br /&gt;
Checks if a file exists by name. This function is restricted to files under the user folder.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (filename)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; true if exists, false if not&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 if(System.FileExists(&amp;quot;myfile.txt&amp;quot;))&lt;br /&gt;
 {&lt;br /&gt;
 }&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
===Newline===&lt;br /&gt;
Returns a NewLine custom type. Used for writing newlines in text formatted files. It was a function in Omni-bot 0.71, but now it is a variable in Omni-bot 0.8.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 f = File();&lt;br /&gt;
 f.Open(&amp;quot;myfile.txt&amp;quot;, &amp;quot;text&amp;quot;, false);&lt;br /&gt;
 if(f.IsOpen())&lt;br /&gt;
 {&lt;br /&gt;
     f.Write(&amp;quot;Some test data&amp;quot;, System.NewLine);&lt;br /&gt;
 }&lt;br /&gt;
 f.Close();&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==File==&lt;br /&gt;
Creates a new File Object.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 f = File();&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===Close===&lt;br /&gt;
Closes the file object and commits changes to disk.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 f.Close();&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===EndOfFile===&lt;br /&gt;
Checks if the File Object is at the end of the file. Useful for read operations.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; true if end of file, false if not.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 eof = f.EndOfFile();&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===FileSize===&lt;br /&gt;
Gets the file size of the file, in bytes.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; size of file in bytes&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 size = f.FileSize();&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===Flush===&lt;br /&gt;
Flushes the file buffer to disk.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 f.Flush();&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===IsOpen===&lt;br /&gt;
Checks if the file is currently open. Usually used after a call to Open.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; true if file is open, false if not&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 if(f.IsOpen())&lt;br /&gt;
 {&lt;br /&gt;
 }&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===Open===&lt;br /&gt;
Creates a new File Object.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (filename, &amp;quot;text&amp;quot;/&amp;quot;binary&amp;quot;, readonly&amp;lt;optional&amp;gt;, append&amp;lt;optional&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; true if success, false if failed.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 if(f.Open(&amp;quot;myfile.txt&amp;quot;, &amp;quot;text&amp;quot;, false))&lt;br /&gt;
 {&lt;br /&gt;
 }&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===ReadFloat===&lt;br /&gt;
Reads a float from the file.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; float read, or null if there was an error&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 num = f.ReadFloat();&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===ReadInt===&lt;br /&gt;
Reads an integer from the file.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; integer read, or null if there was an error&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 num = f.ReadInt();&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===ReadLine===&lt;br /&gt;
Reads a string from a file until a newline or end of file is encountered.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; string read, or null if there was an error&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 str = f.ReadLine();&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===ReadString===&lt;br /&gt;
Reads a string from a file.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; string read, or null if there was an error&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 str = f.ReadString();&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===Seek===&lt;br /&gt;
Seeks the read/write position to a specified offset.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (byte offset to seek to)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 f.Seek(100); // seek 100 bytes into file&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===Tell===&lt;br /&gt;
Returns the current offset of the read/write position in the file.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; byte position in file&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 t = f.Tell();&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===Write===&lt;br /&gt;
Writes a value of varying types to the file, in whatever file mode was used to open the file.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (...)&lt;br /&gt;
&lt;br /&gt;
This function can take any number of parameters, of types integer, float, string, or System.NewLine.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; true if successful, false if not&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 f = File();&lt;br /&gt;
 f.Open(&amp;quot;myfile.txt&amp;quot;, &amp;quot;text&amp;quot;, false);&lt;br /&gt;
 if(f.IsOpen())&lt;br /&gt;
 {&lt;br /&gt;
     assert( f.Write(&amp;quot;Some test data&amp;quot;, System.NewLine) );&lt;br /&gt;
 }&lt;br /&gt;
 f.Close();&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===WriteLine===&lt;br /&gt;
Write with a new line.&lt;br /&gt;
&lt;br /&gt;
----&lt;/div&gt;</summary>
		<author><name>Palota</name></author>
	</entry>
	<entry>
		<id>https://mygamingtalk.com/wiki/index.php?title=System_Library&amp;diff=1792</id>
		<title>System Library</title>
		<link rel="alternate" type="text/html" href="https://mygamingtalk.com/wiki/index.php?title=System_Library&amp;diff=1792"/>
		<updated>2026-04-24T15:34:31Z</updated>

		<summary type="html">&lt;p&gt;Palota: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{process header&lt;br /&gt;
 | title    = System Library&lt;br /&gt;
 | section  =&lt;br /&gt;
 | previous = [[Omni-bot_Script_Reference | Script Reference]]&lt;br /&gt;
 | next     = &lt;br /&gt;
 | shortcut =&lt;br /&gt;
 | notes    =&lt;br /&gt;
}}&lt;br /&gt;
{{TOCright}}&lt;br /&gt;
==Global FileSystem Functions==&lt;br /&gt;
----&lt;br /&gt;
===FileDelete===&lt;br /&gt;
Deletes a file by name. This function is restricted to files under the user folder.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (filename)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; true if success, false if failed&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 System.FileDelete(&amp;quot;myfile.txt&amp;quot;);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===FileEnumerate===&lt;br /&gt;
Enumerates over all files in a directory. This function is restricted to files under the user folder. This function will call the provided script function with all files enumerated.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (folder name, script function)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; true if success, false if failed&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 myfunc = function(filename)&lt;br /&gt;
 {&lt;br /&gt;
 }&lt;br /&gt;
 System.FileEnumerate(&amp;quot;myfolder&amp;quot;, myfunc);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
===FileExists===&lt;br /&gt;
Checks if a file exists by name. This function is restricted to files under the user folder.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (filename)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; true if exists, false if not&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 if(System.FileExists(&amp;quot;myfile.txt&amp;quot;))&lt;br /&gt;
 {&lt;br /&gt;
 }&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
===Newline===&lt;br /&gt;
Returns a NewLine custom type. Used for writing newlines in text formatted files. It was a function in Omni-bot 0.71, but now it is a variable in Omni-bot 0.8.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 f = File();&lt;br /&gt;
 f.Open(&amp;quot;myfile.txt&amp;quot;, &amp;quot;text&amp;quot;, false);&lt;br /&gt;
 if(f.IsOpen())&lt;br /&gt;
 {&lt;br /&gt;
     f.Write(&amp;quot;Some test data&amp;quot;, System.NewLine);&lt;br /&gt;
 }&lt;br /&gt;
 f.Close();&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==File==&lt;br /&gt;
Creates a new File Object.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 f = File();&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===Close===&lt;br /&gt;
Closes the file object and commits changes to disk.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 f.Close();&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===EndOfFile===&lt;br /&gt;
Checks if the File Object is at the end of the file. Useful for read operations.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; true if end of file, false if not.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 eof = f.EndOfFile();&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===FileSize===&lt;br /&gt;
Gets the file size of the file, in bytes.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; size of file in bytes&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 size = f.FileSize();&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===Flush===&lt;br /&gt;
Flushes the file buffer to disk.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 f.Flush();&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===IsOpen===&lt;br /&gt;
Checks if the file is currently open. Usually used after a call to Open.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; true if file is open, false if not&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 if(f.IsOpen())&lt;br /&gt;
 {&lt;br /&gt;
 }&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===Open===&lt;br /&gt;
Creates a new File Object.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (filename, &amp;quot;text&amp;quot;/&amp;quot;binary&amp;quot;, readonly&amp;lt;optional&amp;gt;, append&amp;lt;optional&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; true if success, false if failed.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 if(f.Open(&amp;quot;myfile.txt&amp;quot;, &amp;quot;text&amp;quot;, false))&lt;br /&gt;
 {&lt;br /&gt;
 }&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===ReadFloat===&lt;br /&gt;
Reads a float from the file.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; float read, or null if there was an error&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 num = f.ReadFloat();&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===ReadInt===&lt;br /&gt;
Reads an integer from the file.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; integer read, or null if there was an error&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 num = f.ReadInt();&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===ReadLine===&lt;br /&gt;
Reads a string from a file until a newline or end of file is encountered.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; string read, or null if there was an error&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 str = f.ReadLine();&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===ReadString===&lt;br /&gt;
Reads a string from a file.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; string read, or null if there was an error&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 str = f.ReadString();&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===Seek===&lt;br /&gt;
Seeks the read/write position to a specified offset.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (byte offset to seek to)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 f.Seek(100); // seek 100 bytes into file&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===Tell===&lt;br /&gt;
Returns the current offset of the read/write position in the file.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; byte position in file&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 t = f.Tell();&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===Write===&lt;br /&gt;
Writes a value of varying types to the file, in whatever file mode was used to open the file.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (...)&lt;br /&gt;
&lt;br /&gt;
This function can take any number of parameters, of types integer, float, string, or System.NewLine.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; true if successful, false if not&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 f = File();&lt;br /&gt;
 f.Open(&amp;quot;myfile.txt&amp;quot;, &amp;quot;text&amp;quot;, false);&lt;br /&gt;
 if(f.IsOpen())&lt;br /&gt;
 {&lt;br /&gt;
     assert( f.Write(&amp;quot;Some test data&amp;quot;, System.NewLine) );&lt;br /&gt;
 }&lt;br /&gt;
 f.Close();&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===WriteLine===&lt;br /&gt;
Write with a new line.&lt;br /&gt;
&lt;br /&gt;
----&lt;/div&gt;</summary>
		<author><name>Palota</name></author>
	</entry>
	<entry>
		<id>https://mygamingtalk.com/wiki/index.php?title=Template:Configuration&amp;diff=1791</id>
		<title>Template:Configuration</title>
		<link rel="alternate" type="text/html" href="https://mygamingtalk.com/wiki/index.php?title=Template:Configuration&amp;diff=1791"/>
		<updated>2026-02-22T09:43:11Z</updated>

		<summary type="html">&lt;p&gt;Palota: /* Log files */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Number of bots ==&lt;br /&gt;
&lt;br /&gt;
 /bot maxbots 15&lt;br /&gt;
&lt;br /&gt;
Sets maximum number of bots. It must be less than number of slots (sv_maxclients). The server manager script will automatically kick one bot when a human player connects to server and joins axis or allied team. Similarly, it will add a new bot if some player disconnects.&lt;br /&gt;
&lt;br /&gt;
 /bot minbots 2&lt;br /&gt;
&lt;br /&gt;
Sets minimum number of bots. Default value is -1. You should set minbots only if you want some bots to be always playing even if your server is full.&lt;br /&gt;
&lt;br /&gt;
If you want to add bots manually, you must set maxbots and minbots to -1. Then you can add bots by commands [[Omni-bot_Command_Reference#ab|/bot ab]] or [[Omni-bot_Command_Reference#addbot|/bot addbot]].&lt;br /&gt;
&lt;br /&gt;
== Difficulty levels ==&lt;br /&gt;
&lt;br /&gt;
 /bot difficulty 4&lt;br /&gt;
&lt;br /&gt;
Difficulty ranges from 0 to 6 (0 is easy, 6 is hard).&lt;br /&gt;
&lt;br /&gt;
If you change difficulty, bots&#039; properties will be adjusted (reaction time, field of view, aim error, view distance, ...). Advanced users can adjust bot properties for each difficulty level in the file omni-bot/et/scripts/goals/goal_difficulty.gm.&lt;br /&gt;
&lt;br /&gt;
== Combat movement skill ==&lt;br /&gt;
&lt;br /&gt;
 /bot moveskill 4&lt;br /&gt;
&lt;br /&gt;
Moveskill ranges from 0 to 3. Specifying 4 for moveskill will have each bot choose a random moveskill.&lt;br /&gt;
&lt;br /&gt;
It affects bot&#039;s behaviour during combat (crouch, strafe left or right, ...).&lt;br /&gt;
&lt;br /&gt;
== Balance teams ==&lt;br /&gt;
&lt;br /&gt;
 /bot balanceteams 1 &lt;br /&gt;
&lt;br /&gt;
If you enable balanceteams, bots will move between teams in order to keep same number of players in both teams.&lt;br /&gt;
&lt;br /&gt;
== Log files ==&lt;br /&gt;
&lt;br /&gt;
Log files are written to folder omni-bot/et/logs. If the folder does not exists, log files are written to Enemy Territory game folder. File name is omnibot_&amp;lt;mapname&amp;gt;.log.&lt;br /&gt;
&lt;br /&gt;
 /seta omnibot_logsize 100&lt;br /&gt;
&lt;br /&gt;
* Default value 0 disables logging. &lt;br /&gt;
* Value greater than 0 means maximal file size in KB.&lt;br /&gt;
&lt;br /&gt;
== Configuration file ==&lt;br /&gt;
&lt;br /&gt;
You can find the file &#039;&#039;&#039;omni-bot.cfg&#039;&#039;&#039; in the folder omni-bot/et/user. You usually don&#039;t need to modify this file because most settings can be changed from the console. Nevertheless, some advanced settings are not accessible from the console: CountSpectators, SleepBots, SaveConfigChanges, AdjustAim, DumpFileEnable, DumpFileDialog, LiveUpdate, Debug,  EnableInterProcess, LogInfo, LogWarnings, LogErrors, LogCriticalErrors.&lt;br /&gt;
&lt;br /&gt;
Documentation can be found in file omni-bot.txt.&lt;br /&gt;
&lt;br /&gt;
== Changing bot names ==&lt;br /&gt;
&lt;br /&gt;
You need to go into the omni-bot/et/scripts folder. In Omni-bot 0.82 or later open file &amp;quot;&#039;&#039;&#039;et_botnames_ext.gm&#039;&#039;&#039;&amp;quot;. In Omni-bot 0.81 or 0.8 open file &amp;quot;et_botnames.gm&amp;quot;. In Omni-bot 0.71 or older open file &amp;quot;et_autoexec.gm&amp;quot;. Bots&#039; names are in quotes. Do not change other commands in that scripts.&lt;br /&gt;
&lt;br /&gt;
== Waypoints folder ==&lt;br /&gt;
&lt;br /&gt;
Waypoints and map scripts can be found in the &#039;&#039;&#039;omni-bot/et/nav&#039;&#039;&#039; and &#039;&#039;&#039;omni-bot/et/incomplete_navs&#039;&#039;&#039; folders. New waypoints should be added into this folder. You can add new waypoints in a zip or 7z file (they must be at the root level of the zip file, not in a folder) or you can just add the files directly.&lt;/div&gt;</summary>
		<author><name>Palota</name></author>
	</entry>
	<entry>
		<id>https://mygamingtalk.com/wiki/index.php?title=Paththrough_Navigation&amp;diff=1790</id>
		<title>Paththrough Navigation</title>
		<link rel="alternate" type="text/html" href="https://mygamingtalk.com/wiki/index.php?title=Paththrough_Navigation&amp;diff=1790"/>
		<updated>2025-08-16T09:00:17Z</updated>

		<summary type="html">&lt;p&gt;Palota: /* Navigation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{process header&lt;br /&gt;
 | title    = Paththrough Navigation&lt;br /&gt;
 | section  =&lt;br /&gt;
 | previous = [[paththrough | Paththrough Main Page]]&lt;br /&gt;
 | next     = &lt;br /&gt;
 | shortcut =&lt;br /&gt;
 | notes    =&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== Navigation ==&lt;br /&gt;
Navigation is the simplest paththrough type. It requires two things:&lt;br /&gt;
&lt;br /&gt;
(1) Navigation table inside the Map table in the map script that could look like this:&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;
	Navigation =&lt;br /&gt;
	{&lt;br /&gt;
		strafe_r_point =&lt;br /&gt;
		{&lt;br /&gt;
			navigate = function()&lt;br /&gt;
			{&lt;br /&gt;
				this.AddAimRequest(Priority.High, &amp;quot;facing&amp;quot;, Vec3(0.7, 0, 0.8));&lt;br /&gt;
				this.Bot.HoldButton(BTN.STRAFE_R, 2);&lt;br /&gt;
				sleep(2);&lt;br /&gt;
			}&lt;br /&gt;
		},&lt;br /&gt;
	},&lt;br /&gt;
 };&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the above example, the navigate function tells the bot that when it reaches a waypoint whose paththrough property is set to &amp;lt;nowiki&amp;gt;Navigation_PT:strafe_r_point,&amp;lt;/nowiki&amp;gt; it should hold the strafe right button for two seconds. &lt;br /&gt;
&lt;br /&gt;
If you use HoldButton with buttons FORWARD, BACKWARD, STRAFE_L or STRAFE_R, you must also call AddAimRequest, otherwise bot would aim at enemies and direction would be unpredictable.&lt;br /&gt;
&lt;br /&gt;
(2) The second thing that&#039;s necessary to set up paththrough navigation: go to the waypoint where you want the bots to strafe (or whatever) and add the property:&lt;br /&gt;
&lt;br /&gt;
 /bot waypoint_setproperty paththrough Navigation_PT:strafe_r_point&lt;br /&gt;
&lt;br /&gt;
===Using the Script Goal Object===&lt;br /&gt;
Although this is the simplest paththrough type, it is also the most powerful in terms of capabilities. The navigate function receives the entire [[ScriptGoal|script goal]] object as this parameter. This basically exposes the new goal scripting system to map scripters; providing means for the map scripter to define more complex bot behaviors or &amp;quot;mini goals&amp;quot; when a bot gets to a specific waypoint. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;If navigate function does not call Goto or GotoAsync, bot follows the path to his current goal.&#039;&#039;&#039; If navigate function calls Goto, bot goes to that position and then stops there and waits. Bot will find new path to current goal after your navigate function exits.&lt;br /&gt;
&lt;br /&gt;
Paththrough navigation in Omni-Bot 0.71, 0.8 and 0.81 could be interrupted if high level goal changed. This caused bots to stuck or fall to death. This changed in 0.82 and paththrough navigation is interrupted only by death. It&#039;s recommended that every while loop checks for time out so that navigate function won&#039;t suspend bot forever.&lt;br /&gt;
&lt;br /&gt;
As an example, this following setup would instruct a bot that reaches the paththrough waypoint to go throw a grenade at some target:&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;
	Grate_Bot_Count = 0,&lt;br /&gt;
	Grate_Destroyed = false,&lt;br /&gt;
&lt;br /&gt;
	Navigation =&lt;br /&gt;
	{&lt;br /&gt;
		grenadegrate =&lt;br /&gt;
		{&lt;br /&gt;
			EvalFunc = function()  // if EvalFunc returns false, navigation and OnExit will not run&lt;br /&gt;
			{&lt;br /&gt;
				// do nothing if the grate is already destroyed&lt;br /&gt;
				return !Map.Grate_Destroyed;&lt;br /&gt;
			},&lt;br /&gt;
			navigate = function()&lt;br /&gt;
			{&lt;br /&gt;
				// you can use command /bot mypos or /bot spp to get coordinates&lt;br /&gt;
				if ( this.Goto(Vec3(1608, 3830, 24)) == EVENT.PATH_SUCCESS&lt;br /&gt;
					// only one bot will throw grenade&lt;br /&gt;
					&amp;amp;&amp;amp; Map.Grate_Bot_Count == 0 &amp;amp;&amp;amp; this.Bot.HasWeapon( WEAPON.AXIS_GRENADE ))&lt;br /&gt;
				{&lt;br /&gt;
					this.Grate_Bot = true; //this is local, each bot has his own variable&lt;br /&gt;
					Map.Grate_Bot_Count += 1; //Map is global and shared by all bots&lt;br /&gt;
&lt;br /&gt;
					// look at the grate, you can use command /bot mypos to get facing vector&lt;br /&gt;
					this.AddAimRequest(Priority.High, &amp;quot;facing&amp;quot;, Vec3(-0.758, 0.614, -0.221));&lt;br /&gt;
					// switch to grenade (the navigation is only for Axis team !)&lt;br /&gt;
					this.AddWeaponRequest(Priority.High, WEAPON.AXIS_GRENADE );&lt;br /&gt;
					this.BlockForWeaponChange( WEAPON.AXIS_GRENADE );&lt;br /&gt;
					// throw grenade&lt;br /&gt;
					this.Bot.HoldButton(BTN.ATTACK1, 0.5);&lt;br /&gt;
					sleep(1);&lt;br /&gt;
					// switch to primary weapon&lt;br /&gt;
					this.ReleaseAimRequest();&lt;br /&gt;
					this.ReleaseWeaponRequest();&lt;br /&gt;
					//wait until the grenade explodes&lt;br /&gt;
					sleep(4);&lt;br /&gt;
				}&lt;br /&gt;
				else&lt;br /&gt;
				{&lt;br /&gt;
					// wait and hope that somebody else will destroy the grate&lt;br /&gt;
					sleep(6);&lt;br /&gt;
				}&lt;br /&gt;
			},&lt;br /&gt;
			OnExit = function() // OnExit is called after navigate finished or the bot has been killed&lt;br /&gt;
			{&lt;br /&gt;
				//if this is the bot who threw a grenade, decrease count&lt;br /&gt;
				if (this.Grate_Bot)&lt;br /&gt;
				{&lt;br /&gt;
					this.Grate_Bot = null;&lt;br /&gt;
					Map.Grate_Bot_Count -= 1;&lt;br /&gt;
				}&lt;br /&gt;
			},&lt;br /&gt;
		},&lt;br /&gt;
	},&lt;br /&gt;
	&lt;br /&gt;
	Grate_Trigger = function(trigger)&lt;br /&gt;
	{&lt;br /&gt;
		Map.Grate_Destroyed = true;&lt;br /&gt;
	},&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this case the waypoint property would be set as:&lt;br /&gt;
 /bot waypoint_setproperty paththrough Navigation_PT:grenadegrate&lt;br /&gt;
&lt;br /&gt;
While this application of the navigation paththrough goal offers complete flexibility, great care should be taken when scripting such things. Any implementation should be thoroughly tested.&lt;/div&gt;</summary>
		<author><name>Palota</name></author>
	</entry>
	<entry>
		<id>https://mygamingtalk.com/wiki/index.php?title=Waypoint_Commands&amp;diff=1789</id>
		<title>Waypoint Commands</title>
		<link rel="alternate" type="text/html" href="https://mygamingtalk.com/wiki/index.php?title=Waypoint_Commands&amp;diff=1789"/>
		<updated>2025-08-13T06:40:41Z</updated>

		<summary type="html">&lt;p&gt;Palota: /* waypoint_autoflag */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{TOCright}}&lt;br /&gt;
== Waypoint Commands ==&lt;br /&gt;
&lt;br /&gt;
* [[Console|How to open console and execute command]]&lt;br /&gt;
&lt;br /&gt;
=== waypoint_add ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Usage:&#039;&#039; waypoint_add&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Example:&#039;&#039; waypoint_add&lt;br /&gt;
* Adds a waypoint at the location where you are currently standing. When executing waypoint_add, a new waypoint will be created at the location you are currently standing. Some waypoint flags may be automatically placed on the waypoint.&lt;br /&gt;
** If the waypoint is underwater, the underwater flag should be automatically added.&lt;br /&gt;
** If you are crouching when you place the waypoint, the crouch flag should be automatically added.&lt;br /&gt;
** If you are proning when you place the waypoint, the crouch flag should be automatically added instead of adding prone flag.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== waypoint_addflag ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Usage:&#039;&#039; waypoint_addflag flags[string] ...&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Example:&#039;&#039; waypoint_addflag crouch&lt;br /&gt;
* Flags the nearest waypoint with named properties, or clears the flag from the waypoint if it already exists. This command can take any number of waypoint flags. See [[Waypoint_Flags | the list of flags]] here.&lt;br /&gt;
&lt;br /&gt;
=== waypoint_addflagx ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Usage:&#039;&#039; waypoint_addflagx flags[string] ...&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Example:&#039;&#039; waypoint_addflagx crouch&lt;br /&gt;
* Same as waypoint_addflag, only instead of the nearest waypoint, uses the waypoint you are currently aimed at.&lt;br /&gt;
&lt;br /&gt;
=== waypoint_addx ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Usage:&#039;&#039; waypoint_addx&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Example:&#039;&#039; waypoint_addx&lt;br /&gt;
* Same as waypoint_add, only instead of location you are currently standing., it adds a waypoint where you are currently aimed at.&lt;br /&gt;
* Note for 0.7 and above only&lt;br /&gt;
&lt;br /&gt;
=== waypoint_autobuild ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Usage:&#039;&#039; waypoint_autobuild dc[1/0] bbox[1/0] limitheight[#] limitdist[#] maxconnections[#]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Example:&#039;&#039; waypoint_autobuild 1 0 32 1024 4&lt;br /&gt;
* This command automatically creates connections between waypoints based on the parameters used. It is a time saving function that can generate a pretty good starting point for paths between waypoints. It is not meant to do all the work for you, and will likely need additional cleanup after using where you may need to add additional connections it missed, or removed bad connections in may have added.&lt;br /&gt;
&lt;br /&gt;
** dc - Disconnect all current connections before auto connecting.&lt;br /&gt;
** bbox - Use a small bounding box when casting the ray between waypoints. Useful for filtering out some connections that clip closely to a wall.&lt;br /&gt;
** limitheight - Only make connections to waypoints that are only within this height difference. Useful to prevent connections between multiple levels in a wide open room, even if there is line of sight between them.&lt;br /&gt;
** limitdist - Only make connections to other waypoints within this distance.&lt;br /&gt;
** maxconnections - Only make a maximum of this many connections. 3-5 tends to be a good range to start with.&lt;br /&gt;
&lt;br /&gt;
=== waypoint_autofeature ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Usage:&#039;&#039; waypoint_autofeature&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Example:&#039;&#039; waypoint_autofeature&lt;br /&gt;
* Attempts to add waypoints at all detected map features. This includes spawn points, mg42, and portals. If used, it should be used first before adding any other waypoints in the map. The detected features are game dependent; meaning not all games will have all listed features detected.&lt;br /&gt;
&lt;br /&gt;
=== waypoint_autoradius ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Usage:&#039;&#039; waypoint_autoradius all/cur[string] height[#] minradius[#] maxradius[#]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Example:&#039;&#039; waypoint_autoradius all 32 20 200&lt;br /&gt;
* Automatically detects a waypoint radius on the nearest or all waypoints(depending on 1st parameter).&lt;br /&gt;
** all/cur - all performs autoradius on all waypoints, cur performs it on the nearest.&lt;br /&gt;
** height - A vertical offset from the waypoint position to perform the collision tests with. This is useful due to differences in waypoint position between games. In Doom3 &amp;amp; HL2 engine games, the position is at the ground, while in ET the position is about half-way up a players height.&lt;br /&gt;
** minradius - The minimum radius to use.&lt;br /&gt;
** maxradius - The maximum radius to use.&lt;br /&gt;
&lt;br /&gt;
=== waypoint_biconnect ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Usage:&#039;&#039; waypoint_biconnect&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Example:&#039;&#039; waypoint_biconnect&lt;br /&gt;
* Same as waypoint_connect, but results in a 2 way connection between the waypoints.&lt;br /&gt;
&lt;br /&gt;
=== waypoint_biconnectx ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Usage:&#039;&#039; waypoint_biconnectx&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Example:&#039;&#039; waypoint_biconnectx&lt;br /&gt;
* Same as waypoint_connectx, but results in a 2 way connection between the waypoints.&lt;br /&gt;
&lt;br /&gt;
=== waypoint_boxselect ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Usage:&#039;&#039; waypoint_boxselect&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Example:&#039;&#039; waypoint_boxselect&lt;br /&gt;
* Creates a box area to select all waypoints within the boundaries. First usage starts the select area, use the cursor to expand the box, then use the command again to finish the selection.&lt;br /&gt;
&lt;br /&gt;
=== waypoint_boxselectroom ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Usage:&#039;&#039; waypoint_boxselectroom&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Example:&#039;&#039; waypoint_boxselectroom&lt;br /&gt;
* Not fully implemented&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== waypoint_changeradius ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Usage:&#039;&#039; waypoint_changeradius change[#]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Example:&#039;&#039; waypoint_changeradius -10&lt;br /&gt;
* Change the radius of the nearest waypoint by the change amount. Useful if you want to bind a increase and decrease radius key, such as a mouse wheel.&lt;br /&gt;
&lt;br /&gt;
=== waypoint_clearallflags ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Usage:&#039;&#039; waypoint_clearallflags flags[string] ...&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Example:&#039;&#039; waypoint_clearallflags crouch&lt;br /&gt;
* Clears a list of flags from all waypoints in the map. Like waypoint_addflag, it can take any number of flag names, and clears the flags from all waypoints in the map. Useful if you want to remove all of a particular flag from a map.&lt;br /&gt;
&lt;br /&gt;
=== waypoint_clearcon ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Usage:&#039;&#039; waypoint_clearcon&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Example:&#039;&#039; waypoint_clearcon&lt;br /&gt;
* Clears all the connections from the nearest waypoint or all selected waypoints(if any).&lt;br /&gt;
&lt;br /&gt;
=== waypoint_clearproperty ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Usage:&#039;&#039; waypoint_clearproperty name[string]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Example:&#039;&#039; waypoint_clearproperty bias&lt;br /&gt;
* Clears a property from a waypoint by its name.&lt;br /&gt;
&lt;br /&gt;
=== waypoint_color ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Usage:&#039;&#039; waypoint_color&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Example:&#039;&#039; waypoint_color type[string] red[#] green[#] blue[#]&lt;br /&gt;
* Allows colors to be configured for certain types of waypoints.&lt;br /&gt;
** waypoint_color - Default color of waypoints.&lt;br /&gt;
** waypoint_selected - Selected waypoints.&lt;br /&gt;
** link_closedcolor - If the waypoint has a closed flag.&lt;br /&gt;
** link_teleport - If the waypoint has a teleport flag.&lt;br /&gt;
** link_1way - One-way connection links.&lt;br /&gt;
** link_2way - Two-way connection link.&lt;br /&gt;
** blockable_blocked - Blockable line indicators when it is blocked.&lt;br /&gt;
** blockable_open - Blockable line indicators when it is open(unblocked).&lt;br /&gt;
** aimentity - Color of the box drawn around entities when you aim at them with waypoint_view enabled.&lt;br /&gt;
** radius - Color of the radius indicator.&lt;br /&gt;
** team1 - Team 1 flagged waypoints&lt;br /&gt;
** team2 - Team 2 flagged waypoints&lt;br /&gt;
** team3 - Team 3 flagged waypoints (not for ET)&lt;br /&gt;
** team4 - Team 4 flagged waypoints (not for ET)&lt;br /&gt;
&lt;br /&gt;
=== waypoint_connect ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Usage:&#039;&#039; waypoint_connect&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Example:&#039;&#039; waypoint_connect&lt;br /&gt;
* Flags the nearest waypoint for a connection. If a waypoint is already flagged for connection that waypoint will be connected to this waypoint with a 1-way connection.&lt;br /&gt;
&lt;br /&gt;
=== waypoint_connectx ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Usage:&#039;&#039; waypoint_connectx&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Example:&#039;&#039; waypoint_connectx&lt;br /&gt;
* Same as waypoint_connect, only uses the waypoint you are aiming at.&lt;br /&gt;
&lt;br /&gt;
=== waypoint_dcall ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Usage:&#039;&#039; waypoint_dcall&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Example:&#039;&#039; waypoint_dcall&lt;br /&gt;
* Disconnect all waypoints in the map. This removes all connections, while leaving only the waypoints.&lt;br /&gt;
&lt;br /&gt;
=== waypoint_del ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Usage:&#039;&#039; waypoint_del&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Example:&#039;&#039; waypoint_del&lt;br /&gt;
* Deletes a nearest waypoint that you are standing within 100 units of. All connections from and to the waypoint will get automatically removed as well.&lt;br /&gt;
&lt;br /&gt;
=== waypoint_delx ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Usage:&#039;&#039; waypoint_delx&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Example:&#039;&#039; waypoint_delx&lt;br /&gt;
* Same as waypoint_del, but removes the waypoint you are aiming at.&lt;br /&gt;
&lt;br /&gt;
=== waypoint_deleteaxis ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Usage:&#039;&#039; waypoint_deleteaxis axis[string]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Example:&#039;&#039; waypoint_deleteaxis&lt;br /&gt;
* Deletes all waypoints on a specified side of a specified axis.&lt;br /&gt;
** axis - x, y, z, -x, -y, -z, which side of which axis to delete all waypoints from. Mainly useful for symmetrical maps when you wish to delete a side, make adjustments, and re-mirror the waypoints.&lt;br /&gt;
&lt;br /&gt;
=== waypoint_goto ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Usage:&#039;&#039; waypoint_goto &amp;lt;waypoint GUID&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Example:&#039;&#039; waypoint_goto 127&lt;br /&gt;
* Teleports the player to the given waypoint by GUID&lt;br /&gt;
* Requires game specific implementation, not all games support it.&lt;br /&gt;
&lt;br /&gt;
=== waypoint_ground ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Usage:&#039;&#039; waypoint_ground&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Example:&#039;&#039; waypoint_ground&lt;br /&gt;
* Grounds all waypoints based on the navigation rendering offsets.&lt;br /&gt;
&lt;br /&gt;
=== waypoint_info ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Usage:&#039;&#039; waypoint_info&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Example:&#039;&#039; waypoint_info&lt;br /&gt;
* Prints some basic information about the nearest waypoint.&lt;br /&gt;
&lt;br /&gt;
=== waypoint_load ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Usage:&#039;&#039; waypoint_load name[string, optional]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Example:&#039;&#039; waypoint_load&lt;br /&gt;
* name is optional and if used, loads the waypoints for the currently loaded map with the suffix name. For example, if the map d3ctf1 is loaded, waypoint_load half would load from the nav directory the file d3ctf1half.way&lt;br /&gt;
* Loads the waypoints for the currently loaded map. Waypoints are loaded from the nav directory under the mod currently running. Warning: Any changes you may have made to the waypoints since the last load will be lost. This command is typically used for undoing changes made after the last save.&lt;br /&gt;
&lt;br /&gt;
=== waypoint_lockselected ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Usage:&#039;&#039; waypoint_lockselected&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Example:&#039;&#039; waypoint_lockselected&lt;br /&gt;
* Locks all currently selected waypoints. Locked waypoints aren&#039;t effected by waypoint_translate.&lt;br /&gt;
&lt;br /&gt;
=== waypoint_maxradius ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Usage:&#039;&#039; waypoint_maxradius &amp;lt;radius&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Example:&#039;&#039; waypoint_maxradius 70&lt;br /&gt;
* Clamps all waypoints maximum radius to this value&lt;br /&gt;
&lt;br /&gt;
=== waypoint_minradius ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Usage:&#039;&#039; waypoint_minradius &amp;lt;radius&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Example:&#039;&#039; waypoint_minradius 70&lt;br /&gt;
* Clamps all waypoints minimum radius to this value&lt;br /&gt;
&lt;br /&gt;
=== waypoint_mirror ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Usage:&#039;&#039; waypoint_mirror axis[string] p[optional]&lt;br /&gt;
* If axis parameter is x, y, or z, waypoints are rotated around provided axis.&lt;br /&gt;
* If axis parameter is m, waypoints are mirrored, north to south.&lt;br /&gt;
* If axis parameter is mz, waypoints are mirrored, west to east.&lt;br /&gt;
* p is optional, and if defined will use your current position to define origin (map center)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Example:&#039;&#039; waypoint_mirror z&lt;br /&gt;
* This command duplicates all or selected waypoints and rotates or mirrors the duplicated waypoints across the origin of a provided axis. This function is useful for mirroring the waypoints in a symmetrical map, where each team has an identical base. The optional p parameter is useful for when the map isn&#039;t centered around the 0 axis. Stand as closely to the center of the map as possible and execute the command including the optional p parameter and the waypoints will be mirrored and offset based on the player position.&lt;br /&gt;
&lt;br /&gt;
=== waypoint_move ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Usage:&#039;&#039; waypoint_move&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Example:&#039;&#039; waypoint_move&lt;br /&gt;
* Grabs the nearest waypoint for moving. If a waypoint has already been grabbed by a previous call to waypoint_move, it is dropped at your current position. Connections are maintained throughout waypoint moving.&lt;br /&gt;
&lt;br /&gt;
=== waypoint_save ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Usage:&#039;&#039; waypoint_save&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Example:&#039;&#039; waypoint_save&lt;br /&gt;
* name is optional and if used, saves the waypoints for the currently loaded map with the suffix name. For example, if the map d3ctf1 is loaded, waypoint_save half would save the waypoints to the nav directory as the file d3ctf1half.way&lt;br /&gt;
* Saves the waypoints for the currently loaded map. Waypoints are saved to a file called mapname.way in the nav directory under the mod currently running. Warning: This will overwrite an existing waypoint file of the same name without asking. Rename or backup your original waypoint files when you want to experiment.&lt;br /&gt;
&lt;br /&gt;
=== waypoint_select ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Usage:&#039;&#039; waypoint_select radius[#]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Example:&#039;&#039; waypoint_select 500&lt;br /&gt;
* Selects all waypoints in the provided radius. If no radius is provided, the selection is cleared. Some of the above functions work on selected waypoints.&lt;br /&gt;
&lt;br /&gt;
=== waypoint_setdefaultradius ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Usage:&#039;&#039; waypoint_setdefaultradius radius[#]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Example:&#039;&#039; waypoint_setdefaultradius 100&lt;br /&gt;
* Sets the default radius that is used with all waypoints placed. Useful if you plan to waypoint_add a bunch of waypoints that will share a radius different from the current default to save time going back and changing radius manually.&lt;br /&gt;
&lt;br /&gt;
=== waypoint_setfacing ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Usage:&#039;&#039; waypoint_setfacing&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Example:&#039;&#039; waypoint_setfacing&lt;br /&gt;
* Sets the facing for the nearest waypoint to your current facing. A waypoint&#039;s facing is basically a vector associated with a waypoint. It was used in Omni-bot 0.71 to tell the bot in which direction to look when the bot was camping on that waypoint (due to a sniper or defend flag in most cases). Goals do not use waypoint facing since Omni-bot 0.8, but it can be used for various purposes in map scripts.&lt;br /&gt;
&lt;br /&gt;
=== waypoint_setname ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Usage:&#039;&#039; waypoint_setname name[string]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Example:&#039;&#039; waypoint_setname spawnarea&lt;br /&gt;
* Sets the name of the nearest waypoint. Waypoint names are used as part of the map goal name if goal entity does not have name. It usually happens only for goals MOUNTMG42, REPAIRMG42, AMMOCAB, HEALTHCAB. It&#039;s much easier and less error-prone to manipulate goals in a map script based on meaningful names rather than UIDs.&lt;br /&gt;
* Note: Omni-bot 0.71 and older used waypoint name for any goals that were created as a result of the flags on a waypoint. For example, if you set a waypoint&#039;s name to &amp;quot;barrier_axis1&amp;quot; and the waypoint had a sniper flag set, it appeared as SNIPE_barrier_axis1 in the bots&#039; goal list.&lt;br /&gt;
&lt;br /&gt;
=== waypoint_setproperty ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Usage:&#039;&#039; waypoint_setproperty name[string] value[string]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Example:&#039;&#039; waypoint_setproperty paththrough Navigation_PT:ladder1&lt;br /&gt;
* Sets an arbitrary propery value by name. It is usually used to set [[Paththrough]].&lt;br /&gt;
&lt;br /&gt;
=== waypoint_setradius ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Usage:&#039;&#039; waypoint_setradius radius[#]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Example:&#039;&#039; waypoint_setradius 100&lt;br /&gt;
* Sets the radius of the nearest waypoint.&lt;br /&gt;
&lt;br /&gt;
=== waypoint_shownames ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Usage:&#039;&#039; waypoint_shownames expression[string, optional]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Example:&#039;&#039; waypoint_shownames ATTACK.*&lt;br /&gt;
* Prints all waypoint id&#039;s and names that optionally match an expression.&lt;br /&gt;
&lt;br /&gt;
=== waypoint_showproperty ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Usage:&#039;&#039; waypoint_showproperty&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Example:&#039;&#039; waypoint_showproperty&lt;br /&gt;
* Shows all properties on the current waypoint.&lt;br /&gt;
&lt;br /&gt;
=== waypoint_slice ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Usage:&#039;&#039; waypoint_slice&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Example:&#039;&#039; waypoint_slice maxsegmentlength[#]&lt;br /&gt;
* Slices a 2 way connection so that it doesn&#039;t exceed a specified length.&lt;br /&gt;
&lt;br /&gt;
=== waypoint_split ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Usage:&#039;&#039; waypoint_split&lt;br /&gt;
* Splits a 2 way connection to 2 parts. A new waypoint is created near the location where you are currently standing.&lt;br /&gt;
&lt;br /&gt;
=== waypoint_stats ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Usage:&#039;&#039; waypoint_stats&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Example:&#039;&#039; waypoint_stats&lt;br /&gt;
* Prints out some basic information for the waypoint pathing system. Primarily a debug tool, but useful if you want to see the total number of waypoints currently placed.&lt;br /&gt;
&lt;br /&gt;
=== waypoint_translate ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Usage:&#039;&#039; waypoint_translate x[#] y[#] z[#]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Example:&#039;&#039; waypoint_translate 10 0 0&lt;br /&gt;
* Translates(moves) all waypoints, or the currently selected waypoints by Vector3(x,y,z)&lt;br /&gt;
&lt;br /&gt;
=== waypoint_unlockall ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Usage:&#039;&#039; waypoint_unlockall&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Example:&#039;&#039; waypoint_unlockall&lt;br /&gt;
* Unlocks all waypoints.&lt;br /&gt;
&lt;br /&gt;
=== waypoint_unsplit ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Usage:&#039;&#039; waypoint_unsplit &lt;br /&gt;
&lt;br /&gt;
* Deletes a nearest waypoint which has 2 connections and makes 1 connection.&lt;br /&gt;
&lt;br /&gt;
=== waypoint_view ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Usage:&#039;&#039; waypoint_view enable[1,0,true,false,on,off,toggle]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Example:&#039;&#039; waypoint_view 1&lt;br /&gt;
* Enables or disables waypoint rendering.&lt;br /&gt;
&lt;br /&gt;
=== waypoint_viewfacing ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Usage:&#039;&#039; waypoint_viewfacing enable[1,0,true,false,on,off]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Example:&#039;&#039; waypoint_viewfacing 1&lt;br /&gt;
* Enables or disables rendering of the facing vector for waypoints if they have a facing vector.&lt;/div&gt;</summary>
		<author><name>Palota</name></author>
	</entry>
	<entry>
		<id>https://mygamingtalk.com/wiki/index.php?title=Waypoint_Commands&amp;diff=1788</id>
		<title>Waypoint Commands</title>
		<link rel="alternate" type="text/html" href="https://mygamingtalk.com/wiki/index.php?title=Waypoint_Commands&amp;diff=1788"/>
		<updated>2025-08-11T15:11:53Z</updated>

		<summary type="html">&lt;p&gt;Palota: /* waypoint_view */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{TOCright}}&lt;br /&gt;
== Waypoint Commands ==&lt;br /&gt;
&lt;br /&gt;
* [[Console|How to open console and execute command]]&lt;br /&gt;
&lt;br /&gt;
=== waypoint_add ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Usage:&#039;&#039; waypoint_add&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Example:&#039;&#039; waypoint_add&lt;br /&gt;
* Adds a waypoint at the location where you are currently standing. When executing waypoint_add, a new waypoint will be created at the location you are currently standing. Some waypoint flags may be automatically placed on the waypoint.&lt;br /&gt;
** If the waypoint is underwater, the underwater flag should be automatically added.&lt;br /&gt;
** If you are crouching when you place the waypoint, the crouch flag should be automatically added.&lt;br /&gt;
** If you are proning when you place the waypoint, the crouch flag should be automatically added instead of adding prone flag.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== waypoint_addflag ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Usage:&#039;&#039; waypoint_addflag flags[string] ...&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Example:&#039;&#039; waypoint_addflag crouch&lt;br /&gt;
* Flags the nearest waypoint with named properties, or clears the flag from the waypoint if it already exists. This command can take any number of waypoint flags. See [[Waypoint_Flags | the list of flags]] here.&lt;br /&gt;
&lt;br /&gt;
=== waypoint_addflagx ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Usage:&#039;&#039; waypoint_addflagx flags[string] ...&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Example:&#039;&#039; waypoint_addflagx crouch&lt;br /&gt;
* Same as waypoint_addflag, only instead of the nearest waypoint, uses the waypoint you are currently aimed at.&lt;br /&gt;
&lt;br /&gt;
=== waypoint_addx ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Usage:&#039;&#039; waypoint_addx&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Example:&#039;&#039; waypoint_addx&lt;br /&gt;
* Same as waypoint_add, only instead of location you are currently standing., it adds a waypoint where you are currently aimed at.&lt;br /&gt;
* Note for 0.7 and above only&lt;br /&gt;
&lt;br /&gt;
=== waypoint_autobuild ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Usage:&#039;&#039; waypoint_autobuild dc[1/0] bbox[1/0] limitheight[#] limitdist[#] maxconnections[#]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Example:&#039;&#039; waypoint_autobuild 1 0 32 1024 4&lt;br /&gt;
* This command automatically creates connections between waypoints based on the parameters used. It is a time saving function that can generate a pretty good starting point for paths between waypoints. It is not meant to do all the work for you, and will likely need additional cleanup after using where you may need to add additional connections it missed, or removed bad connections in may have added.&lt;br /&gt;
&lt;br /&gt;
** dc - Disconnect all current connections before auto connecting.&lt;br /&gt;
** bbox - Use a small bounding box when casting the ray between waypoints. Useful for filtering out some connections that clip closely to a wall.&lt;br /&gt;
** limitheight - Only make connections to waypoints that are only within this height difference. Useful to prevent connections between multiple levels in a wide open room, even if there is line of sight between them.&lt;br /&gt;
** limitdist - Only make connections to other waypoints within this distance.&lt;br /&gt;
** maxconnections - Only make a maximum of this many connections. 3-5 tends to be a good range to start with.&lt;br /&gt;
&lt;br /&gt;
=== waypoint_autofeature ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Usage:&#039;&#039; waypoint_autofeature&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Example:&#039;&#039; waypoint_autofeature&lt;br /&gt;
* Attempts to add waypoints at all detected map features. This includes spawn points, mg42, and portals. If used, it should be used first before adding any other waypoints in the map. The detected features are game dependent; meaning not all games will have all listed features detected.&lt;br /&gt;
&lt;br /&gt;
=== waypoint_autoflag ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Usage:&#039;&#039; waypoint_autoflag &amp;lt;flag&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Example:&#039;&#039; waypoint_autoflag crouch&lt;br /&gt;
* Toggles whether or not waypoints are autoflagged. &#039;&#039;&#039;Currently not used&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== waypoint_autoradius ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Usage:&#039;&#039; waypoint_autoradius all/cur[string] height[#] minradius[#] maxradius[#]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Example:&#039;&#039; waypoint_autoradius all 32 20 200&lt;br /&gt;
* Automatically detects a waypoint radius on the nearest or all waypoints(depending on 1st parameter).&lt;br /&gt;
** all/cur - all performs autoradius on all waypoints, cur performs it on the nearest.&lt;br /&gt;
** height - A vertical offset from the waypoint position to perform the collision tests with. This is useful due to differences in waypoint position between games. In Doom3 &amp;amp; HL2 engine games, the position is at the ground, while in ET the position is about half-way up a players height.&lt;br /&gt;
** minradius - The minimum radius to use.&lt;br /&gt;
** maxradius - The maximum radius to use.&lt;br /&gt;
&lt;br /&gt;
=== waypoint_biconnect ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Usage:&#039;&#039; waypoint_biconnect&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Example:&#039;&#039; waypoint_biconnect&lt;br /&gt;
* Same as waypoint_connect, but results in a 2 way connection between the waypoints.&lt;br /&gt;
&lt;br /&gt;
=== waypoint_biconnectx ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Usage:&#039;&#039; waypoint_biconnectx&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Example:&#039;&#039; waypoint_biconnectx&lt;br /&gt;
* Same as waypoint_connectx, but results in a 2 way connection between the waypoints.&lt;br /&gt;
&lt;br /&gt;
=== waypoint_boxselect ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Usage:&#039;&#039; waypoint_boxselect&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Example:&#039;&#039; waypoint_boxselect&lt;br /&gt;
* Creates a box area to select all waypoints within the boundaries. First usage starts the select area, use the cursor to expand the box, then use the command again to finish the selection.&lt;br /&gt;
&lt;br /&gt;
=== waypoint_boxselectroom ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Usage:&#039;&#039; waypoint_boxselectroom&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Example:&#039;&#039; waypoint_boxselectroom&lt;br /&gt;
* Not fully implemented&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== waypoint_changeradius ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Usage:&#039;&#039; waypoint_changeradius change[#]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Example:&#039;&#039; waypoint_changeradius -10&lt;br /&gt;
* Change the radius of the nearest waypoint by the change amount. Useful if you want to bind a increase and decrease radius key, such as a mouse wheel.&lt;br /&gt;
&lt;br /&gt;
=== waypoint_clearallflags ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Usage:&#039;&#039; waypoint_clearallflags flags[string] ...&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Example:&#039;&#039; waypoint_clearallflags crouch&lt;br /&gt;
* Clears a list of flags from all waypoints in the map. Like waypoint_addflag, it can take any number of flag names, and clears the flags from all waypoints in the map. Useful if you want to remove all of a particular flag from a map.&lt;br /&gt;
&lt;br /&gt;
=== waypoint_clearcon ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Usage:&#039;&#039; waypoint_clearcon&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Example:&#039;&#039; waypoint_clearcon&lt;br /&gt;
* Clears all the connections from the nearest waypoint or all selected waypoints(if any).&lt;br /&gt;
&lt;br /&gt;
=== waypoint_clearproperty ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Usage:&#039;&#039; waypoint_clearproperty name[string]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Example:&#039;&#039; waypoint_clearproperty bias&lt;br /&gt;
* Clears a property from a waypoint by its name.&lt;br /&gt;
&lt;br /&gt;
=== waypoint_color ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Usage:&#039;&#039; waypoint_color&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Example:&#039;&#039; waypoint_color type[string] red[#] green[#] blue[#]&lt;br /&gt;
* Allows colors to be configured for certain types of waypoints.&lt;br /&gt;
** waypoint_color - Default color of waypoints.&lt;br /&gt;
** waypoint_selected - Selected waypoints.&lt;br /&gt;
** link_closedcolor - If the waypoint has a closed flag.&lt;br /&gt;
** link_teleport - If the waypoint has a teleport flag.&lt;br /&gt;
** link_1way - One-way connection links.&lt;br /&gt;
** link_2way - Two-way connection link.&lt;br /&gt;
** blockable_blocked - Blockable line indicators when it is blocked.&lt;br /&gt;
** blockable_open - Blockable line indicators when it is open(unblocked).&lt;br /&gt;
** aimentity - Color of the box drawn around entities when you aim at them with waypoint_view enabled.&lt;br /&gt;
** radius - Color of the radius indicator.&lt;br /&gt;
** team1 - Team 1 flagged waypoints&lt;br /&gt;
** team2 - Team 2 flagged waypoints&lt;br /&gt;
** team3 - Team 3 flagged waypoints (not for ET)&lt;br /&gt;
** team4 - Team 4 flagged waypoints (not for ET)&lt;br /&gt;
&lt;br /&gt;
=== waypoint_connect ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Usage:&#039;&#039; waypoint_connect&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Example:&#039;&#039; waypoint_connect&lt;br /&gt;
* Flags the nearest waypoint for a connection. If a waypoint is already flagged for connection that waypoint will be connected to this waypoint with a 1-way connection.&lt;br /&gt;
&lt;br /&gt;
=== waypoint_connectx ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Usage:&#039;&#039; waypoint_connectx&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Example:&#039;&#039; waypoint_connectx&lt;br /&gt;
* Same as waypoint_connect, only uses the waypoint you are aiming at.&lt;br /&gt;
&lt;br /&gt;
=== waypoint_dcall ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Usage:&#039;&#039; waypoint_dcall&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Example:&#039;&#039; waypoint_dcall&lt;br /&gt;
* Disconnect all waypoints in the map. This removes all connections, while leaving only the waypoints.&lt;br /&gt;
&lt;br /&gt;
=== waypoint_del ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Usage:&#039;&#039; waypoint_del&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Example:&#039;&#039; waypoint_del&lt;br /&gt;
* Deletes a nearest waypoint that you are standing within 100 units of. All connections from and to the waypoint will get automatically removed as well.&lt;br /&gt;
&lt;br /&gt;
=== waypoint_delx ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Usage:&#039;&#039; waypoint_delx&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Example:&#039;&#039; waypoint_delx&lt;br /&gt;
* Same as waypoint_del, but removes the waypoint you are aiming at.&lt;br /&gt;
&lt;br /&gt;
=== waypoint_deleteaxis ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Usage:&#039;&#039; waypoint_deleteaxis axis[string]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Example:&#039;&#039; waypoint_deleteaxis&lt;br /&gt;
* Deletes all waypoints on a specified side of a specified axis.&lt;br /&gt;
** axis - x, y, z, -x, -y, -z, which side of which axis to delete all waypoints from. Mainly useful for symmetrical maps when you wish to delete a side, make adjustments, and re-mirror the waypoints.&lt;br /&gt;
&lt;br /&gt;
=== waypoint_goto ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Usage:&#039;&#039; waypoint_goto &amp;lt;waypoint GUID&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Example:&#039;&#039; waypoint_goto 127&lt;br /&gt;
* Teleports the player to the given waypoint by GUID&lt;br /&gt;
* Requires game specific implementation, not all games support it.&lt;br /&gt;
&lt;br /&gt;
=== waypoint_ground ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Usage:&#039;&#039; waypoint_ground&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Example:&#039;&#039; waypoint_ground&lt;br /&gt;
* Grounds all waypoints based on the navigation rendering offsets.&lt;br /&gt;
&lt;br /&gt;
=== waypoint_info ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Usage:&#039;&#039; waypoint_info&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Example:&#039;&#039; waypoint_info&lt;br /&gt;
* Prints some basic information about the nearest waypoint.&lt;br /&gt;
&lt;br /&gt;
=== waypoint_load ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Usage:&#039;&#039; waypoint_load name[string, optional]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Example:&#039;&#039; waypoint_load&lt;br /&gt;
* name is optional and if used, loads the waypoints for the currently loaded map with the suffix name. For example, if the map d3ctf1 is loaded, waypoint_load half would load from the nav directory the file d3ctf1half.way&lt;br /&gt;
* Loads the waypoints for the currently loaded map. Waypoints are loaded from the nav directory under the mod currently running. Warning: Any changes you may have made to the waypoints since the last load will be lost. This command is typically used for undoing changes made after the last save.&lt;br /&gt;
&lt;br /&gt;
=== waypoint_lockselected ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Usage:&#039;&#039; waypoint_lockselected&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Example:&#039;&#039; waypoint_lockselected&lt;br /&gt;
* Locks all currently selected waypoints. Locked waypoints aren&#039;t effected by waypoint_translate.&lt;br /&gt;
&lt;br /&gt;
=== waypoint_maxradius ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Usage:&#039;&#039; waypoint_maxradius &amp;lt;radius&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Example:&#039;&#039; waypoint_maxradius 70&lt;br /&gt;
* Clamps all waypoints maximum radius to this value&lt;br /&gt;
&lt;br /&gt;
=== waypoint_minradius ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Usage:&#039;&#039; waypoint_minradius &amp;lt;radius&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Example:&#039;&#039; waypoint_minradius 70&lt;br /&gt;
* Clamps all waypoints minimum radius to this value&lt;br /&gt;
&lt;br /&gt;
=== waypoint_mirror ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Usage:&#039;&#039; waypoint_mirror axis[string] p[optional]&lt;br /&gt;
* If axis parameter is x, y, or z, waypoints are rotated around provided axis.&lt;br /&gt;
* If axis parameter is m, waypoints are mirrored, north to south.&lt;br /&gt;
* If axis parameter is mz, waypoints are mirrored, west to east.&lt;br /&gt;
* p is optional, and if defined will use your current position to define origin (map center)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Example:&#039;&#039; waypoint_mirror z&lt;br /&gt;
* This command duplicates all or selected waypoints and rotates or mirrors the duplicated waypoints across the origin of a provided axis. This function is useful for mirroring the waypoints in a symmetrical map, where each team has an identical base. The optional p parameter is useful for when the map isn&#039;t centered around the 0 axis. Stand as closely to the center of the map as possible and execute the command including the optional p parameter and the waypoints will be mirrored and offset based on the player position.&lt;br /&gt;
&lt;br /&gt;
=== waypoint_move ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Usage:&#039;&#039; waypoint_move&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Example:&#039;&#039; waypoint_move&lt;br /&gt;
* Grabs the nearest waypoint for moving. If a waypoint has already been grabbed by a previous call to waypoint_move, it is dropped at your current position. Connections are maintained throughout waypoint moving.&lt;br /&gt;
&lt;br /&gt;
=== waypoint_save ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Usage:&#039;&#039; waypoint_save&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Example:&#039;&#039; waypoint_save&lt;br /&gt;
* name is optional and if used, saves the waypoints for the currently loaded map with the suffix name. For example, if the map d3ctf1 is loaded, waypoint_save half would save the waypoints to the nav directory as the file d3ctf1half.way&lt;br /&gt;
* Saves the waypoints for the currently loaded map. Waypoints are saved to a file called mapname.way in the nav directory under the mod currently running. Warning: This will overwrite an existing waypoint file of the same name without asking. Rename or backup your original waypoint files when you want to experiment.&lt;br /&gt;
&lt;br /&gt;
=== waypoint_select ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Usage:&#039;&#039; waypoint_select radius[#]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Example:&#039;&#039; waypoint_select 500&lt;br /&gt;
* Selects all waypoints in the provided radius. If no radius is provided, the selection is cleared. Some of the above functions work on selected waypoints.&lt;br /&gt;
&lt;br /&gt;
=== waypoint_setdefaultradius ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Usage:&#039;&#039; waypoint_setdefaultradius radius[#]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Example:&#039;&#039; waypoint_setdefaultradius 100&lt;br /&gt;
* Sets the default radius that is used with all waypoints placed. Useful if you plan to waypoint_add a bunch of waypoints that will share a radius different from the current default to save time going back and changing radius manually.&lt;br /&gt;
&lt;br /&gt;
=== waypoint_setfacing ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Usage:&#039;&#039; waypoint_setfacing&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Example:&#039;&#039; waypoint_setfacing&lt;br /&gt;
* Sets the facing for the nearest waypoint to your current facing. A waypoint&#039;s facing is basically a vector associated with a waypoint. It was used in Omni-bot 0.71 to tell the bot in which direction to look when the bot was camping on that waypoint (due to a sniper or defend flag in most cases). Goals do not use waypoint facing since Omni-bot 0.8, but it can be used for various purposes in map scripts.&lt;br /&gt;
&lt;br /&gt;
=== waypoint_setname ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Usage:&#039;&#039; waypoint_setname name[string]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Example:&#039;&#039; waypoint_setname spawnarea&lt;br /&gt;
* Sets the name of the nearest waypoint. Waypoint names are used as part of the map goal name if goal entity does not have name. It usually happens only for goals MOUNTMG42, REPAIRMG42, AMMOCAB, HEALTHCAB. It&#039;s much easier and less error-prone to manipulate goals in a map script based on meaningful names rather than UIDs.&lt;br /&gt;
* Note: Omni-bot 0.71 and older used waypoint name for any goals that were created as a result of the flags on a waypoint. For example, if you set a waypoint&#039;s name to &amp;quot;barrier_axis1&amp;quot; and the waypoint had a sniper flag set, it appeared as SNIPE_barrier_axis1 in the bots&#039; goal list.&lt;br /&gt;
&lt;br /&gt;
=== waypoint_setproperty ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Usage:&#039;&#039; waypoint_setproperty name[string] value[string]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Example:&#039;&#039; waypoint_setproperty paththrough Navigation_PT:ladder1&lt;br /&gt;
* Sets an arbitrary propery value by name. It is usually used to set [[Paththrough]].&lt;br /&gt;
&lt;br /&gt;
=== waypoint_setradius ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Usage:&#039;&#039; waypoint_setradius radius[#]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Example:&#039;&#039; waypoint_setradius 100&lt;br /&gt;
* Sets the radius of the nearest waypoint.&lt;br /&gt;
&lt;br /&gt;
=== waypoint_shownames ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Usage:&#039;&#039; waypoint_shownames expression[string, optional]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Example:&#039;&#039; waypoint_shownames ATTACK.*&lt;br /&gt;
* Prints all waypoint id&#039;s and names that optionally match an expression.&lt;br /&gt;
&lt;br /&gt;
=== waypoint_showproperty ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Usage:&#039;&#039; waypoint_showproperty&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Example:&#039;&#039; waypoint_showproperty&lt;br /&gt;
* Shows all properties on the current waypoint.&lt;br /&gt;
&lt;br /&gt;
=== waypoint_slice ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Usage:&#039;&#039; waypoint_slice&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Example:&#039;&#039; waypoint_slice maxsegmentlength[#]&lt;br /&gt;
* Slices a 2 way connection so that it doesn&#039;t exceed a specified length.&lt;br /&gt;
&lt;br /&gt;
=== waypoint_split ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Usage:&#039;&#039; waypoint_split&lt;br /&gt;
* Splits a 2 way connection to 2 parts. A new waypoint is created near the location where you are currently standing.&lt;br /&gt;
&lt;br /&gt;
=== waypoint_stats ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Usage:&#039;&#039; waypoint_stats&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Example:&#039;&#039; waypoint_stats&lt;br /&gt;
* Prints out some basic information for the waypoint pathing system. Primarily a debug tool, but useful if you want to see the total number of waypoints currently placed.&lt;br /&gt;
&lt;br /&gt;
=== waypoint_translate ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Usage:&#039;&#039; waypoint_translate x[#] y[#] z[#]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Example:&#039;&#039; waypoint_translate 10 0 0&lt;br /&gt;
* Translates(moves) all waypoints, or the currently selected waypoints by Vector3(x,y,z)&lt;br /&gt;
&lt;br /&gt;
=== waypoint_unlockall ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Usage:&#039;&#039; waypoint_unlockall&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Example:&#039;&#039; waypoint_unlockall&lt;br /&gt;
* Unlocks all waypoints.&lt;br /&gt;
&lt;br /&gt;
=== waypoint_unsplit ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Usage:&#039;&#039; waypoint_unsplit &lt;br /&gt;
&lt;br /&gt;
* Deletes a nearest waypoint which has 2 connections and makes 1 connection.&lt;br /&gt;
&lt;br /&gt;
=== waypoint_view ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Usage:&#039;&#039; waypoint_view enable[1,0,true,false,on,off,toggle]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Example:&#039;&#039; waypoint_view 1&lt;br /&gt;
* Enables or disables waypoint rendering.&lt;br /&gt;
&lt;br /&gt;
=== waypoint_viewfacing ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Usage:&#039;&#039; waypoint_viewfacing enable[1,0,true,false,on,off]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Example:&#039;&#039; waypoint_viewfacing 1&lt;br /&gt;
* Enables or disables rendering of the facing vector for waypoints if they have a facing vector.&lt;/div&gt;</summary>
		<author><name>Palota</name></author>
	</entry>
	<entry>
		<id>https://mygamingtalk.com/wiki/index.php?title=System_Library&amp;diff=1787</id>
		<title>System Library</title>
		<link rel="alternate" type="text/html" href="https://mygamingtalk.com/wiki/index.php?title=System_Library&amp;diff=1787"/>
		<updated>2025-07-06T13:15:27Z</updated>

		<summary type="html">&lt;p&gt;Palota: /* Global FileSystem Functions */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{process header&lt;br /&gt;
 | title    = System Library&lt;br /&gt;
 | section  =&lt;br /&gt;
 | previous = [[Omni-bot_Script_Reference | Script Reference]]&lt;br /&gt;
 | next     = &lt;br /&gt;
 | shortcut =&lt;br /&gt;
 | notes    =&lt;br /&gt;
}}&lt;br /&gt;
{{TOCright}}&lt;br /&gt;
==Global FileSystem Functions==&lt;br /&gt;
----&lt;br /&gt;
===FileDelete===&lt;br /&gt;
Deletes a file by name. This function is restricted to files under the user folder.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (filename)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; true if success, false if failed&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 System.FileDelete(&amp;quot;myfile.txt&amp;quot;);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===FileEnumerate===&lt;br /&gt;
Enumerates over all files in a directory. This function is restricted to files under the user folder. This function will call the provided script function with all files enumerated.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (folder name, script function)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; true if success, false if failed&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 myfunc = function(filename)&lt;br /&gt;
 {&lt;br /&gt;
 }&lt;br /&gt;
 System.FileEnumerate(&amp;quot;myfolder&amp;quot;, myfunc);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
===FileExists===&lt;br /&gt;
Checks if a file exists by name. This function is restricted to files under the user folder.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (filename)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; true if exists, false if not&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 if(System.FileExists(&amp;quot;myfile.txt&amp;quot;))&lt;br /&gt;
 {&lt;br /&gt;
 }&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
===Newline===&lt;br /&gt;
Returns a NewLine custom type. Used for writing newlines in text formatted files. It was a function in Omni-bot 0.71, but now it is a variable in Omni-bot 0.8.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 f = File();&lt;br /&gt;
 f.Open(&amp;quot;myfile.txt&amp;quot;, &amp;quot;text&amp;quot;, false);&lt;br /&gt;
 if(f.IsOpen())&lt;br /&gt;
 {&lt;br /&gt;
     f.Write(&amp;quot;Some test data&amp;quot;, System.NewLine);&lt;br /&gt;
 }&lt;br /&gt;
 f.Close();&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==File==&lt;br /&gt;
Creates a new File Object.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 f = File();&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===Close===&lt;br /&gt;
Closes the file object and commits changes to disk.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 f.Close();&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===EndOfFile===&lt;br /&gt;
Checks if the File Object is at the end of the file. Useful for read operations.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; true if end of file, false if not.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 eof = f.EndOfFile();&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===FileSize===&lt;br /&gt;
Gets the file size of the file, in bytes.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; size of file in bytes&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 size = f.FileSize();&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===Flush===&lt;br /&gt;
Flushes the file buffer to disk.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 f.Flush();&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===IsOpen===&lt;br /&gt;
Checks if the file is currently open. Usually used after a call to Open.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; true if file is open, false if not&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 if(f.IsOpen())&lt;br /&gt;
 {&lt;br /&gt;
 }&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===Open===&lt;br /&gt;
Creates a new File Object.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (filename, &amp;quot;text&amp;quot;/&amp;quot;binary&amp;quot;, readonly&amp;lt;optional&amp;gt;, append&amp;lt;optional&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; true if success, false if failed.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 if(f.Open(&amp;quot;myfile.txt&amp;quot;, &amp;quot;text&amp;quot;, false))&lt;br /&gt;
 {&lt;br /&gt;
 }&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===ReadFloat===&lt;br /&gt;
Reads a float from the file.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; float read, or null if there was an error&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 num = f.ReadFloat();&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===ReadInt===&lt;br /&gt;
Reads an integer from the file.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; integer read, or null if there was an error&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 num = f.ReadInt();&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===ReadLine===&lt;br /&gt;
Reads a string from a file until a newline or end of file is encountered.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; string read, or null if there was an error&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 str = f.ReadLine();&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===ReadString===&lt;br /&gt;
Reads a string from a file.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; string read, or null if there was an error&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 str = f.ReadString();&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===Seek===&lt;br /&gt;
Seeks the read/write position to a specified offset.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (byte offset to seek to)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 f.Seek(100); // seek 100 bytes into file&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===Tell===&lt;br /&gt;
Returns the current offset of the read/write position in the file.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; byte position in file&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 t = f.Tell();&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===Write===&lt;br /&gt;
Writes a value of varying types to the file, in whatever file mode was used to open the file.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (...)&lt;br /&gt;
&lt;br /&gt;
This function can take any number of parameters, of types integer, float, string, or System.NewLine.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; true if successful, false if not&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 f = File();&lt;br /&gt;
 f.Open(&amp;quot;myfile.txt&amp;quot;, &amp;quot;text&amp;quot;, false);&lt;br /&gt;
 if(f.IsOpen())&lt;br /&gt;
 {&lt;br /&gt;
     assert( f.Write(&amp;quot;Some test data&amp;quot;, System.NewLine) );&lt;br /&gt;
 }&lt;br /&gt;
 f.Close();&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
----&lt;/div&gt;</summary>
		<author><name>Palota</name></author>
	</entry>
	<entry>
		<id>https://mygamingtalk.com/wiki/index.php?title=Waypoint_Library&amp;diff=1786</id>
		<title>Waypoint Library</title>
		<link rel="alternate" type="text/html" href="https://mygamingtalk.com/wiki/index.php?title=Waypoint_Library&amp;diff=1786"/>
		<updated>2025-07-05T10:57:25Z</updated>

		<summary type="html">&lt;p&gt;Palota: /* AddWaypoint */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{process header&lt;br /&gt;
 | title    = Waypoint Library&lt;br /&gt;
 | section  =&lt;br /&gt;
 | previous = [[Omni-bot_Script_Reference | Script Reference]]&lt;br /&gt;
 | next     = &lt;br /&gt;
 | shortcut =&lt;br /&gt;
 | notes    =&lt;br /&gt;
}}&lt;br /&gt;
{{TOCright}}&lt;br /&gt;
== AddWaypoint ==&lt;br /&gt;
Creates a new waypoint at a specified location.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&amp;lt;Vector3&amp;gt;&amp;lt;/nowiki&amp;gt;            The position to add waypoint.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&amp;lt;optional Vector3&amp;gt;&amp;lt;/nowiki&amp;gt;            The facing for the waypoint.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
int            Waypoint Id if successful OR null if there was an error adding waypoint.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 Wp.AddWaypoint(Vector3(1000,2000,1000))&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== CheckBlockable ==&lt;br /&gt;
Verifies all red blockable connections and changes them to green immediately if they are not blocked anymore. This function should be used in triggers of destroyable walls or constructible bridges. It prevents a lot of path failed errors. Objects destroyed by a dynamite usually also require sleep(0.1) before CheckBlockable.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
None&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Count of changed connections, but the number is unreliable and can be zero.&lt;br /&gt;
&lt;br /&gt;
== Connect ==&lt;br /&gt;
Connects two waypoints&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&amp;lt;int&amp;gt;&amp;lt;/nowiki&amp;gt;            Guid of a waypoint.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&amp;lt;int&amp;gt;&amp;lt;/nowiki&amp;gt;            Guid of another waypoint.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
true if successful, false if not&lt;br /&gt;
&lt;br /&gt;
== DeleteWaypoint ==&lt;br /&gt;
Delete a waypoint from a specified location.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&amp;lt;Vector3&amp;gt;&amp;lt;/nowiki&amp;gt;            &amp;lt;nowiki&amp;gt;The &amp;lt;Vector3&amp;gt; position to delete waypoint from.&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
true if successful, false if not&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 Wp.DeleteWaypoint(Vector3(1000,2000,1000))&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Disconnect ==&lt;br /&gt;
Disconnects two waypoints.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&amp;lt;int&amp;gt;&amp;lt;/nowiki&amp;gt;            Guid of a waypoint.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&amp;lt;int&amp;gt;&amp;lt;/nowiki&amp;gt;            Guid of another waypoint.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
true if successful, false if not&lt;br /&gt;
&lt;br /&gt;
== GetAllWaypoints ==&lt;br /&gt;
Gets all waypoints.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&amp;lt;table&amp;gt;&amp;lt;/nowiki&amp;gt;            An empty table, the function will fill tables of position, facing, guid, radius, name, flags, property.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
None&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example&#039;&#039;&#039; &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
wpTable = {};&lt;br /&gt;
Wp.GetAllWaypoints( wpTable );&lt;br /&gt;
foreach( waypoint in wpTable ) {&lt;br /&gt;
	if( waypoint.name ) {&lt;br /&gt;
		print(waypoint.name, &amp;quot;-&amp;quot;, waypoint.position);&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== GetClosestWaypoint ==&lt;br /&gt;
Gets waypoint near position.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;Vector3&amp;gt;           position&lt;br /&gt;
&lt;br /&gt;
&amp;lt;optional int&amp;gt;    team&lt;br /&gt;
&lt;br /&gt;
&amp;lt;optional options&amp;gt; 1=don&#039;t skip closed waypoints,  2=ignore waypoints without connections&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&amp;lt;table&amp;gt;&amp;lt;/nowiki&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example&#039;&#039;&#039; &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
w = Wp.GetClosestWaypoint( Vec3(100,200,0) );&lt;br /&gt;
if(w) {&lt;br /&gt;
	print(&amp;quot;waypoint UID &amp;quot;, w.guid);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== GetAllSelectedWaypoints ==&lt;br /&gt;
Gets selected waypoints.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&amp;lt;table&amp;gt;&amp;lt;/nowiki&amp;gt;            An empty table, the function will fill tables of position, facing, guid, radius, name, flags, property.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
None&lt;br /&gt;
&lt;br /&gt;
== GetWaypointByGUID ==&lt;br /&gt;
Gets a waypoint information by its guid.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&amp;lt;int&amp;gt;&amp;lt;/nowiki&amp;gt;   Guid of a waypoint.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&amp;lt;table&amp;gt;&amp;lt;/nowiki&amp;gt;            An empty table, the function will fill in position, facing, guid, radius, name, flags, property.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
true if successful, false if not&lt;br /&gt;
&lt;br /&gt;
== GetWaypointByName ==&lt;br /&gt;
Gets a waypoint&#039;s information by its name.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&amp;lt;string&amp;gt;&amp;lt;/nowiki&amp;gt;            The name of the waypoint to get the info of.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&amp;lt;table&amp;gt;&amp;lt;/nowiki&amp;gt;            An empty table, the function will fill in position, facing, guid, radius, name, flags, property.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
true if successful, false if not&lt;br /&gt;
&lt;br /&gt;
== IsWaypointViewOn ==&lt;br /&gt;
Checks if waypoint view is on.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
None&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
int       true if waypoint_view is on, false if not&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 Wp.IsWaypointViewOn()&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Load ==&lt;br /&gt;
Loads waypoints from nav folder.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&amp;lt;optional string&amp;gt;&amp;lt;/nowiki&amp;gt;   File name.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
true if successful, false if not&lt;br /&gt;
&lt;br /&gt;
== Save ==&lt;br /&gt;
Saves waypoints to nav folder.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&amp;lt;optional string&amp;gt;&amp;lt;/nowiki&amp;gt;   File name.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
true if successful, false if not&lt;br /&gt;
&lt;br /&gt;
== SetRadius ==&lt;br /&gt;
Sets a wapoint radius. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&amp;lt;int&amp;gt;&amp;lt;/nowiki&amp;gt;   Guid of a waypoint&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&amp;lt;int&amp;gt;&amp;lt;/nowiki&amp;gt;            Radius.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
true if successful, false if not&lt;br /&gt;
&lt;br /&gt;
== SetWaypointFlag ==&lt;br /&gt;
Sets the [[Waypoint_Flags|flag]] on a waypoint by name.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&amp;lt;int&amp;gt;&amp;lt;/nowiki&amp;gt;   Guid of a waypoint &#039;&#039;&#039;OR&#039;&#039;&#039;&amp;lt;nowiki&amp;gt;  &amp;lt;string&amp;gt;&amp;lt;/nowiki&amp;gt; Name of the waypoint or a regular expression.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&amp;lt;string&amp;gt;&amp;lt;/nowiki&amp;gt;   The name of the flag to set &#039;&#039;&#039;OR&#039;&#039;&#039; &amp;lt;nowiki&amp;gt;&amp;lt;table&amp;gt;&amp;lt;/nowiki&amp;gt; Multiple flags to set.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&amp;lt;int&amp;gt;&amp;lt;/nowiki&amp;gt;   True to set, false to clear.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
None&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 Wp.SetWaypointFlag(&amp;quot;waypointname&amp;quot;, &amp;quot;closed&amp;quot;, false);&lt;br /&gt;
 Wp.SetWaypointFlag(&amp;quot;bridge_.*&amp;quot;, &amp;quot;crouch&amp;quot;, true);&lt;br /&gt;
 Wp.SetWaypointFlag(&amp;quot;main_entrance&amp;quot;, { &amp;quot;axis&amp;quot;, &amp;quot;door&amp;quot; }, true );&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== SetWaypointName ==&lt;br /&gt;
Assigns a name to a waypoint.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&amp;lt;int&amp;gt;&amp;lt;/nowiki&amp;gt;   The id of the waypoint to set the name of.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&amp;lt;string&amp;gt;&amp;lt;/nowiki&amp;gt;            The name to assign to the waypoint.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
true if successful, false if not&lt;br /&gt;
&lt;br /&gt;
== SetWaypointProperty ==&lt;br /&gt;
Sets the waypoint property.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&amp;lt;int&amp;gt;&amp;lt;/nowiki&amp;gt;   Guid of a waypoint &#039;&#039;&#039;OR&#039;&#039;&#039;&amp;lt;nowiki&amp;gt;  &amp;lt;string&amp;gt;&amp;lt;/nowiki&amp;gt; Name of the waypoint.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&amp;lt;string&amp;gt;&amp;lt;/nowiki&amp;gt;            The name of the property to set.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&amp;lt;string&amp;gt;&amp;lt;/nowiki&amp;gt;            Property value to set.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
None&lt;br /&gt;
&lt;br /&gt;
== WaypointColor ==&lt;br /&gt;
Customize the color of various types of waypoints, paths, etc...  See [[Waypoint_Commands#waypoint_color|waypoint_color]] command for help.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&amp;lt;string&amp;gt;&amp;lt;/nowiki&amp;gt;            The name of the category to set a color for.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&amp;lt;int&amp;gt;&amp;lt;/nowiki&amp;gt;   The color to use for this type.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
None&lt;br /&gt;
&lt;br /&gt;
=Properties=&lt;br /&gt;
&lt;br /&gt;
== BlockablePathOffset ==&lt;br /&gt;
the offset for blockable paths for drawing purposes.&lt;br /&gt;
&lt;br /&gt;
== BottomPathOffset ==&lt;br /&gt;
the offset for path bottom for drawing purposes.&lt;br /&gt;
&lt;br /&gt;
== BottomWaypointOffset ==&lt;br /&gt;
the offset for waypoint bottom for drawing purposes.&lt;br /&gt;
&lt;br /&gt;
== FacingOffset ==&lt;br /&gt;
the offset for drawing the facing indicator.&lt;br /&gt;
&lt;br /&gt;
== PathLevelOffset ==&lt;br /&gt;
relative offset for path finding, default is 0.5&lt;br /&gt;
&lt;br /&gt;
== TextDuration ==&lt;br /&gt;
drawing duration for texts, default is 2 seconds&lt;br /&gt;
&lt;br /&gt;
== TextOffset ==&lt;br /&gt;
the offset for drawing waypoint name, UID, radius, flags.&lt;br /&gt;
&lt;br /&gt;
== TopPathOffset ==&lt;br /&gt;
the offset for path top for drawing purposes.&lt;br /&gt;
&lt;br /&gt;
== TopWaypointOffset ==&lt;br /&gt;
the offset for waypoint top for drawing purposes.&lt;/div&gt;</summary>
		<author><name>Palota</name></author>
	</entry>
	<entry>
		<id>https://mygamingtalk.com/wiki/index.php?title=Supported_Games&amp;diff=1785</id>
		<title>Supported Games</title>
		<link rel="alternate" type="text/html" href="https://mygamingtalk.com/wiki/index.php?title=Supported_Games&amp;diff=1785"/>
		<updated>2025-07-01T11:12:53Z</updated>

		<summary type="html">&lt;p&gt;Palota: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{process header&lt;br /&gt;
 | title    = Supported Games&lt;br /&gt;
 | section  =&lt;br /&gt;
 | previous = [[Main_Page | Main Page]]&lt;br /&gt;
 | next     = &lt;br /&gt;
 | shortcut =&lt;br /&gt;
 | notes    =&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== [[Gameet | Enemy Territory]] ==&lt;br /&gt;
&lt;br /&gt;
Enemy Territory is a free for [https://www.etlegacy.com/ download] team based game that currently is the most advanced in terms of bot support as it has been focused on more than other games.&lt;br /&gt;
&lt;br /&gt;
Omni-bot has been integrated into many of the popular ET mods ([http://etpub.org/ etpub], [http://jaymod.clanfu.org/ jaymod], noquarter ...) , which contain enhancements, fixes, additional weapons, etc on top of the ET game type. Supported mods versions are listed on page [[Download_Omni-Bot_ET]].&lt;br /&gt;
&lt;br /&gt;
== [[Gamertcw | Return to Castle Wolfenstein]] ==&lt;br /&gt;
&lt;br /&gt;
[http://www.idsoftware.com/games/wolfenstein/rtcw/ Return to Castle Wolfenstein] game is similar to Enemy Territory. All scripts and commands have been recently updated to the latest Omni-bot version.&lt;br /&gt;
&lt;br /&gt;
== [[Fortressforever | Fortress Forever]] ==&lt;br /&gt;
&lt;br /&gt;
[http://www.fortress-forever.com/ Fortress Forever] is a Team Fortress modification for [https://www.half-life.com/es/halflife2 Half-life 2]. Omni-bot will come with the default installation for training and scrimmage purposes, with training scripts targeted to helping those that are new to Team Fortress, as it can be a difficult game to attract new players.&lt;br /&gt;
&lt;br /&gt;
== [[Quake4| Quake 4]] ==&lt;br /&gt;
&lt;br /&gt;
[http://www.quake4game.com/ Quake 4] by [http://www.ravensoft.com/ Raven Software] has had an alpha Omni-bot release in an early version.&lt;br /&gt;
&lt;br /&gt;
== [[Doom3 | Doom 3]] ==&lt;br /&gt;
&lt;br /&gt;
[http://www.doom3.com/ Doom 3] by [http://www.idsoftware.com/ id software] has joined the Omni-bot supported games list. It was supported by Geekfeststarter. There has not been a public release.&lt;br /&gt;
&lt;br /&gt;
== Want to support Omni-bot? ==&lt;br /&gt;
Omni-bot support is added to a mod by adding a lightweight interface file to the mod that compiles into it and communicates with the bot dll. After that, all the bot behavior is handled in the bot dll. If you are a minor variation of an existing supported game, chances are your mod can use the same dll, like Jaymod, etpub, NQ.&lt;/div&gt;</summary>
		<author><name>Palota</name></author>
	</entry>
	<entry>
		<id>https://mygamingtalk.com/wiki/index.php?title=Faqomnibot&amp;diff=1784</id>
		<title>Faqomnibot</title>
		<link rel="alternate" type="text/html" href="https://mygamingtalk.com/wiki/index.php?title=Faqomnibot&amp;diff=1784"/>
		<updated>2025-07-01T10:23:31Z</updated>

		<summary type="html">&lt;p&gt;Palota: /* How do I customize the bots names ? */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Omni-Bot F.A.Q.==&lt;br /&gt;
=== General Questions ===&lt;br /&gt;
==== How do I customize the bots names ? ====&lt;br /&gt;
&lt;br /&gt;
ET and RTCW games have bots names in files &#039;&#039;&#039;et_botnames_ext.gm&#039;&#039;&#039; and &#039;&#039;&#039;rtcw_botnames_ext.gm&#039;&#039;&#039;. Other games have names in autoexec. For Quake4 it is called &#039;&#039;&#039;q4_autoexec.gm&#039;&#039;&#039;, and so on.&lt;br /&gt;
&lt;br /&gt;
Inside you will see a table being constructed that associate names with a profile script.&lt;br /&gt;
&lt;br /&gt;
Here&#039;s what the &#039;&#039;&#039;q4_autoexec.gm&#039;&#039;&#039; looks like at the time of this writing.&lt;br /&gt;
&lt;br /&gt;
 Names[&amp;quot;[BOT]Walter&amp;quot;] = &amp;quot;def_bot.gm&amp;quot;;&lt;br /&gt;
 Names[&amp;quot;[BOT]Fred&amp;quot;] = &amp;quot;def_bot.gm&amp;quot;;&lt;br /&gt;
 Names[&amp;quot;[BOT]Morgan&amp;quot;] = &amp;quot;def_bot.gm&amp;quot;;&lt;br /&gt;
 Names[&amp;quot;[BOT]Lawrence&amp;quot;] = &amp;quot;def_bot.gm&amp;quot;;&lt;br /&gt;
 Names[&amp;quot;[BOT]Richard&amp;quot;] = &amp;quot;def_bot.gm&amp;quot;;&lt;br /&gt;
 Names[&amp;quot;[BOT]Michael&amp;quot;] = &amp;quot;def_bot.gm&amp;quot;;&lt;br /&gt;
 Names[&amp;quot;[BOT]Brad&amp;quot;] = &amp;quot;def_bot.gm&amp;quot;;&lt;br /&gt;
 Names[&amp;quot;[BOT]George&amp;quot;] = &amp;quot;def_bot.gm&amp;quot;;&lt;br /&gt;
 Names[&amp;quot;[BOT]Anton&amp;quot;] = &amp;quot;def_bot.gm&amp;quot;;&lt;br /&gt;
 Names[&amp;quot;[BOT]Monty&amp;quot;] = &amp;quot;def_bot.gm&amp;quot;;&lt;br /&gt;
 Names[&amp;quot;[BOT]Bean&amp;quot;] = &amp;quot;def_bot.gm&amp;quot;;&lt;br /&gt;
 Names[&amp;quot;[BOT]Sean&amp;quot;] = &amp;quot;def_bot.gm&amp;quot;;&lt;br /&gt;
 Names[&amp;quot;[BOT]Backfire&amp;quot;] = &amp;quot;def_bot.gm&amp;quot;;&lt;br /&gt;
 Names[&amp;quot;[BOT]Halfwit&amp;quot;] = &amp;quot;def_bot.gm&amp;quot;;&lt;br /&gt;
 Names[&amp;quot;[BOT]Halfbaked&amp;quot;] = &amp;quot;def_bot.gm&amp;quot;;&lt;br /&gt;
 Names[&amp;quot;[BOT]Fullmonty&amp;quot;] = &amp;quot;def_bot.gm&amp;quot;;&lt;br /&gt;
 Names[&amp;quot;[BOT]Nohope&amp;quot;] = &amp;quot;def_bot.gm&amp;quot;;&lt;br /&gt;
 Names[&amp;quot;[BOT]Hitnrun&amp;quot;] = &amp;quot;def_bot.gm&amp;quot;;&lt;br /&gt;
 Names[&amp;quot;[BOT]Missnrun&amp;quot;] = &amp;quot;def_bot.gm&amp;quot;;&lt;br /&gt;
 Names[&amp;quot;[BOT]Oysterhead&amp;quot;] = &amp;quot;def_bot.gm&amp;quot;;&lt;br /&gt;
 Names[&amp;quot;[BOT]Fullthrottle&amp;quot;] = &amp;quot;def_bot.gm&amp;quot;;&lt;br /&gt;
 Names[&amp;quot;[BOT]Noammo&amp;quot;] = &amp;quot;def_bot.gm&amp;quot;;&lt;br /&gt;
 Names[&amp;quot;[BOT]Bullseye&amp;quot;] = &amp;quot;def_bot.gm&amp;quot;;&lt;br /&gt;
 Names[&amp;quot;[BOT]Aimless&amp;quot;] = &amp;quot;def_bot.gm&amp;quot;;&lt;br /&gt;
 Names[&amp;quot;[BOT]Blackadder&amp;quot;] = &amp;quot;def_bot.gm&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
When a bot is added to the game without a name specified, it will choose a random available name from the ones listed. Each name has a profile associated with it, in this case all of these names have def_bot.gm, which is typically common for most games. The profile script is a way to customize a particular bot. You can script additional features or modifications to existing features into a script and associate the script with a specific bot name in order to have varying yet consistent behavior.&lt;br /&gt;
Look [[Main_Page#Customizing_Omni-bot|here]] for more on customizing your Omni-bots.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;To add additional names, simply add another line with a new name.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Normally there should be at least as many names as there are player slots available in the game, though you can add more and Omni-bot will randomly choose between all of them.&lt;br /&gt;
&lt;br /&gt;
Small note : you don&#039;t have to add the prefix [BOT] to the name of the bot, but it would be fair or at least informative to let the players on your server know in a glance that Omni-bot is enabled and running.&lt;br /&gt;
&lt;br /&gt;
=== ET Related ===&lt;br /&gt;
====How To Adjust The Difficulty====&lt;br /&gt;
Use command /bot difficulty&lt;br /&gt;
&lt;br /&gt;
====How To Edit Waypoints====&lt;br /&gt;
&lt;br /&gt;
Here you have the [[Template:Basewaypointing|Omni-bot Waypointing]] general info page.&lt;br /&gt;
&lt;br /&gt;
====How To use Custom Waypoints====&lt;br /&gt;
&lt;br /&gt;
When you&#039;ve downloaded a custom map, your Omni-bots will need a waypoint file for that map.&lt;br /&gt;
&lt;br /&gt;
When you&#039;ve downloaded a waypoint file for a custom ET map, you simply put the *.way and *.gm files inside your : ... \et\nav directory.&lt;br /&gt;
&lt;br /&gt;
Currently released waypoints can be found in the Assembla SVN repository.&lt;br /&gt;
&lt;br /&gt;
====How To Run Omni-bot On Windows(tm) Home Server====&lt;br /&gt;
&lt;br /&gt;
Here&#039;s a small description on how to make a quick -vanilla ET + Omni-bot server run on your Win32 home computer.&lt;br /&gt;
You should be able to let some Omni-bots run and also view and edit or create waypoints for the maps with it.&lt;br /&gt;
&lt;br /&gt;
If not already :&lt;br /&gt;
* Install Wolfenstein:Enemy Territory&lt;br /&gt;
* Run the patch 2.60b&lt;br /&gt;
* Install the latest Omni-Bot version&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
When the above is installed you&#039;ll see a new shortcut in your Start Menu : Omni-Bot ET. The new shortcut is also on your desktop.&lt;br /&gt;
When you click on this shortcut you will start Enemy Territory with the mod : Omni-bot.&lt;br /&gt;
In this way you will still have to go through the ingame menu to host and or play on your own server.&lt;br /&gt;
&lt;br /&gt;
To avoid this hassle every time here below there&#039;s the double click way to start your own server.&lt;br /&gt;
Make a shortcut like this on your desktop or wherever you want :&lt;br /&gt;
&lt;br /&gt;
     &amp;quot;C:\Program Files\Wolfenstein - Enemy Territory\ET.exe&amp;quot; +set dedicated 0 +set fs_game omnibot +set com_hunkmegs 64 +exec server.cfg&lt;br /&gt;
&lt;br /&gt;
*+set dedicated 0       *&#039;&#039;a server, to be played on as well by the server host (=you)&#039;&#039;&lt;br /&gt;
*+set fs_game omnibot       *&#039;&#039;set the gametype, make sure to set this if you want to start waypointing&#039;&#039;   &lt;br /&gt;
*+set com_hunkmegs 64       *&#039;&#039;allocates a certain amount of memory for map and item loading&#039;&#039;&lt;br /&gt;
*+exec server.cfg       *&#039;&#039;server settings, your server configuration file which gets executed, in directory &#039;etmain, if you put a .cfg in your modfolder this gets executed, this comes in handy if you want to run different mods&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Note : The above settings are called Cvar&#039;s (server variables).&lt;br /&gt;
&lt;br /&gt;
After you made the shortcut, you should be able to start and run the Omni-bot server with it.&lt;br /&gt;
&lt;br /&gt;
More and in depth info:&lt;br /&gt;
[https://wolffiles.de/filebase/ET/Stuff/ET-Serverguide.pdf Advanced Wolfenstein: Enemy Territory Server Setup Guide]&lt;br /&gt;
&lt;br /&gt;
====How To Run Omni-bot On Linux Home Server====&lt;br /&gt;
     &lt;br /&gt;
     #et +set fs_game omnibot +set com_hunkmegs 64&lt;br /&gt;
&lt;br /&gt;
Make sure you&#039;ve read the information on [[Gameet#Installation|Installing Omni-bot]].&lt;br /&gt;
&lt;br /&gt;
====How To Quickly Add The Omni-bots To Your server====&lt;br /&gt;
&lt;br /&gt;
There are -in short- 3 ways :&lt;br /&gt;
&lt;br /&gt;
* Via the : [[Omni-bot_Command_Reference#minbots|MinBots]] &amp;amp; [[Omni-bot_Command_Reference#maxbots|MaxBots]] Omni-bot commands *&#039;&#039;set those in your et_autoexec.gm. file, in the directory &#039;scripts&#039;&#039;&#039;  &lt;br /&gt;
* Via the [[Bot_Library#AddBot|&#039;bot addbot&#039;]] console command, f.e to add a Axis Covert type : &amp;quot;\bot addbot 1 5 Covert-Axis&amp;quot;&lt;br /&gt;
* Via a omni-bot.cfg, a file in which you put the above [[Omni-bot_Command_Reference#addbot|&#039;bot addbot&#039;]] command as many times you want a bot with a selected class.&lt;br /&gt;
&lt;br /&gt;
Example 1 omni-bot.cfg :&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
// start&lt;br /&gt;
// bot addbot &amp;lt;team&amp;gt; &amp;lt;class&amp;gt; &amp;lt;name&amp;gt;&lt;br /&gt;
// save f.e as : omni-bot.cfg -in same folder where your server.cfg is-&lt;br /&gt;
// put the line : exec omni-bot.cfg in your server.cfg to add bots automatic on map start&lt;br /&gt;
bot addbot 1 1 Soldat-Axis&lt;br /&gt;
bot addbot 1 2 Sani-Axis&lt;br /&gt;
bot addbot 1 3 Engi-Axis&lt;br /&gt;
bot addbot 1 4 Leut-Axis&lt;br /&gt;
bot addbot 1 5 Covert-Axis&lt;br /&gt;
bot addbot 2 1 Soldier-Allied&lt;br /&gt;
bot addbot 2 2 Medic-Allied&lt;br /&gt;
bot addbot 2 3 Engi-Allied&lt;br /&gt;
bot addbot 2 4 Leut-Allied&lt;br /&gt;
bot addbot 2 5 Covert-Allied&lt;br /&gt;
// eof&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Example 2 omni-bot2.cfg :&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
// start&lt;br /&gt;
bot minbots 0&lt;br /&gt;
bot maxbots 10&lt;br /&gt;
// eof&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Example 3 omni-bot3.cfg :&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
// kicks all bots from server&lt;br /&gt;
// start&lt;br /&gt;
bot kickall&lt;br /&gt;
// eof&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Omni-bot and Other Mods ====&lt;br /&gt;
&lt;br /&gt;
Running Omni-bot with Wolfenstein:Enemy Territory is also possible in combination with several other mods.&lt;br /&gt;
&lt;br /&gt;
Setting up a mod server to run with Omni-bot isn&#039;t much different from running Omni-bot with vanilla etmain.&lt;br /&gt;
&lt;br /&gt;
*Reassure yourself that the Omni-bot &amp;amp; mod version you are trying to run are fully compatible. (See [[Download Omni-Bot ET]])&lt;br /&gt;
*Use the included readme file in the mod folder or check their website and or forum, f.e. to get more info on Omni-bot specific cvars for your mod.&lt;br /&gt;
*&#039;&#039;&#039;Important Note&#039;&#039;&#039; : waypoints can be edited only in omnibot mod.&lt;br /&gt;
&lt;br /&gt;
==== Mod Folders &amp;amp; Mod Versions ====&lt;br /&gt;
The modfolders called omnibot, jaymod, etpub &amp;amp; noquarter should all (if installed) be at the same level as the etmain folder.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
So after you install the mod you can create a new shortcut that points to the specific mod (folder) like :&lt;br /&gt;
&lt;br /&gt;
*ETPub&lt;br /&gt;
  &amp;quot;C:\...\ET.exe&amp;quot; +set fs_game etpub +set com_hunkmegs 64 +exec pubserver.cfg &lt;br /&gt;
&lt;br /&gt;
*Jaymod&lt;br /&gt;
  &amp;quot;C:\...\ET.exe&amp;quot; +set fs_game jaymod +set com_hunkmegs 64 +exec jayserver.cfg &lt;br /&gt;
&lt;br /&gt;
*NQ&lt;br /&gt;
  &amp;quot;C:\...\ET.exe&amp;quot; +set fs_game noquarter +set com_hunkmegs 64 +exec nqserver.cfg &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
You&#039;ll notice that the only thing in the shortcut line changing is the setting of fs_game.&lt;br /&gt;
&lt;br /&gt;
Also you can set some Cvars which are specific to your mod into your (mod)server.cfg.&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;5&amp;quot; cellspacing=&amp;quot;0&amp;quot;|colspan=&amp;quot;3&amp;quot;|&lt;br /&gt;
&lt;br /&gt;
==== Mod Specific Cvars ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot; border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;5&amp;quot; cellspacing=&amp;quot;1&amp;quot;&lt;br /&gt;
! ET Mod&lt;br /&gt;
! Omni-bot Specific Cvars Link&lt;br /&gt;
! Mod Version Documentation Link&lt;br /&gt;
|-- &lt;br /&gt;
|[http://www.etpub.org/news.php ET Pub]&lt;br /&gt;
|[http://etpub.org/ETPubServerDocs.html#omnibot_flags Omni-bot ET Pub 0.8.1 ]&lt;br /&gt;
|[http://etpub.org/ETPubServerDocs.html#gen 0.8.1]&lt;br /&gt;
|--&lt;br /&gt;
|[http://jaymod.clanfu.org/ Jaymod]&lt;br /&gt;
|[http://www.clanfu.org/jaymod/2.1.6/html/omni.html Omni-bot Jaymod]&lt;br /&gt;
|[http://www.clanfu.org/jaymod/2.1.5/html/index.html 2.1.5]  [http://www.clanfu.org/jaymod/2.1.6/html/index.html 2.1.6]  [http://www.clanfu.org/jaymod/2.1.7/html/index.html 2.1.7]&lt;br /&gt;
|--&lt;br /&gt;
|[http://shitstorm.org/noquarter/wiki/index.php?title=Main_Page NQ]&lt;br /&gt;
|[http://shitstorm.org/noquarter/wiki/index.php?title=No_Quarter_Mod#Omni-Bot_Enabling Omni-bot NQ]&lt;br /&gt;
|[http://shitstorm.org/noquarter/wiki/index.php?title=Admin_CVARs#omnibot_enable_.28New_in_1.1.1.29 1.1.1]&lt;br /&gt;
&amp;lt;!--Please alphabetize until we implement a sortable table--&amp;gt;&lt;br /&gt;
&amp;lt;!--This next line must be the last in the table--&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Note :&lt;br /&gt;
&lt;br /&gt;
Version [http://jaymod.clanfu.org/index.php?date=2007-04-10 2.0.6 of Jaymod] is the latest of the &amp;quot;stable&amp;quot; branch and runs with [http://www.omni-bot.de/e107/download.php?list.2 Omni-Bot version 0.61.]&lt;br /&gt;
&lt;br /&gt;
====General Cvars====&lt;br /&gt;
&lt;br /&gt;
Whatever mod you are running, the server.cfg needs to be configured before players can connect. &lt;br /&gt;
If you are renting a server then your game server provider will probably do the initial configuration for you. &lt;br /&gt;
&lt;br /&gt;
The list is not to be said : complete.&lt;br /&gt;
You as a server admin have to tweak it !&lt;br /&gt;
&lt;br /&gt;
Here below are the most common ones.&lt;br /&gt;
&lt;br /&gt;
* set dedicated &amp;quot;2&amp;quot; : &#039;&#039;change to 1 if you use the server on a LAN, change to 0 if you use it to be played on as well by the server host (=you)&#039;&#039;&lt;br /&gt;
* set net_ip &amp;quot;&amp;quot; : &#039;&#039;set to override the default IP ET uses. No need to change&#039;&#039;&lt;br /&gt;
* set net_port &amp;quot;27970&amp;quot; : &#039;&#039;set to override the default port ET uses. Default port is 27960 but some  server providers use other ports. Should already be set correctly if you rent a server&#039;&#039;&lt;br /&gt;
* set sv_maxclients &amp;quot;22&amp;quot; : &#039;&#039;number of maximum players that can be connected on the server including private slots. If you are renting then this is controlled by your provider and changing it will have no effect&#039;&#039;&lt;br /&gt;
* set g_password &amp;quot;&amp;quot; : &#039;&#039;set a password to lock the server. Players will be prompted for password when they connect. You can lock server e.g. during scrims&#039;&#039;&lt;br /&gt;
* set sv_privateclients &amp;quot;2&amp;quot; : &#039;&#039;if set &amp;gt; 0, then this number of client slots will be reserved only for people who have the privatepassword (see below)&#039;&#039;&lt;br /&gt;
* set sv_privatepassword &amp;quot;your password&amp;quot; : &#039;&#039;if you have defined private slots then you should define a password for them as well&#039;&#039;&lt;br /&gt;
* set rconpassword &amp;quot;your_rcon_ password&amp;quot; : &#039;&#039;this is the most important password. Access to it should be strictly restricted to people who change the configuration and manage the server at this level. People who have this password can have full server control&#039;&#039;&lt;br /&gt;
* set refereePassword &amp;quot;your_ref_password&amp;quot; : &#039;&#039;this will set the password for a referee. If you are running any of the mods this will be useful because you can assign people referee status to administer the server. Referees can shuffle teams, put players in teams or spectator, kick players etc. Again, be careful about who you give ref access.&#039;&#039;&lt;br /&gt;
* set sv_wwwDownload &amp;quot;1&amp;quot; : &#039;&#039;if you have custom maps on your server then make sure you have this set at 1. Otherwise players won&#039;t be able to download them&#039;&#039;&lt;br /&gt;
* set sv_wwwBaseURL &amp;quot;http://myre-direct.com&amp;quot; : &#039;&#039;if you are re-directing your downloads then here is where you set the url.&#039;&#039;&lt;br /&gt;
* set g_friendlyFire &amp;quot;1&amp;quot; : &#039;&#039;set this to 0 if you don&#039;t want Friendly Fire on i.e. if set to 1, you can kill your team mates&#039;&#039;&lt;br /&gt;
* set g_teamforcebalance &amp;quot;1&amp;quot; : &#039;&#039;if you have this set to 1 then the server won&#039;t allow a player to join a team which has already one player more than the other team. If set to 0 then it will be easier to end up with unequal teams in terms of numbers&#039;&#039;&lt;br /&gt;
* set g_voiceChatsAllowed &amp;quot;4&amp;quot; : &#039;&#039;this is the maximum number of chats someone can spam chat with. Make this too big and you risk a lot of spamming&#039;&#039;&lt;br /&gt;
* set g_warmup &amp;quot;60&amp;quot; :  &#039;&#039;warm-up time i.e. the number of seconds prior to starting the game. Make sure this is long enough to allow players to connect after the end of the previous map. You can increase it e.g. during scrims to allow people more time to organise&#039;&#039;&lt;br /&gt;
* set vote_allow_kick &amp;quot;1&amp;quot; : &#039;&#039;if you set this as 1 then players will be allowed to vote-kick someone out of the server&#039;&#039;&lt;br /&gt;
* exec maprotation.cfg : &#039;&#039;set this as your map rotation config file.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===General Server Setup Tips===&lt;br /&gt;
&lt;br /&gt;
*Use a &#039;shortcut&#039; to startup your server.&lt;br /&gt;
&lt;br /&gt;
*Start your server with a &#039;basic settings&#039; server.cfg. (f.e. for ET use the server.cfg in your mod folder)&lt;br /&gt;
&lt;br /&gt;
*Make back-ups of (all) your server configuration files! &lt;br /&gt;
&lt;br /&gt;
*Add the cvars you want to run the server with gradually, so you can always revert to a previous version when something is wrong.&lt;/div&gt;</summary>
		<author><name>Palota</name></author>
	</entry>
	<entry>
		<id>https://mygamingtalk.com/wiki/index.php?title=Utility_Functions&amp;diff=1783</id>
		<title>Utility Functions</title>
		<link rel="alternate" type="text/html" href="https://mygamingtalk.com/wiki/index.php?title=Utility_Functions&amp;diff=1783"/>
		<updated>2025-06-30T08:59:04Z</updated>

		<summary type="html">&lt;p&gt;Palota: /* ETUtil.SetCabinets */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{process header&lt;br /&gt;
 | title    = Utility Functions&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;
{{TOCright}}&lt;br /&gt;
&lt;br /&gt;
=== Util ===&lt;br /&gt;
&lt;br /&gt;
==== Util.AddUsePoint ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: Util.AddUsePoint(goalname, &amp;lt;Vector3 or table&amp;gt;);&lt;br /&gt;
  example: Util.AddUsePoint(&amp;quot;PLANT_wall&amp;quot;,{Vec3(12,34,5),Vec3(23,5,67)});&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
used to add use points for a goal at given positions. Goals can have multiple use points. You must set RandomUsePoint property to 1, otherwise bots will always choose the nearest use point.&lt;br /&gt;
&lt;br /&gt;
==== Util.AddUseWp ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: Util.AddUseWp(goalname, &amp;lt;waypointname or table&amp;gt;);&lt;br /&gt;
  example: Util.AddUseWp( &amp;quot;somegoalname&amp;quot;, &amp;quot;somewaypointname&amp;quot; );&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
used to add use points for a goal at given waypoints positions. Goals can have multiple use points. You must set RandomUsePoint property to 1, otherwise bots will always choose the nearest use point.&lt;br /&gt;
&lt;br /&gt;
==== Util.AliveCount ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: Util.AliveCount( team, class );&lt;br /&gt;
  example: Util.AliveCount( TEAM.AXIS, CLASS.MEDIC ); &amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
returns the number of bots alive on a team with a given class&lt;br /&gt;
&lt;br /&gt;
==== Util.BotChat ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: Util.BotChat(Team, msgType, Msg, NumBots);&lt;br /&gt;
  example: Util.BotChat(TEAM.ALLIES, &amp;quot;vsay&amp;quot;, VOICE.G_CHEER, 2);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
See [[Talking_bots]] page&lt;br /&gt;
&lt;br /&gt;
==== Util.BotHasAnyRole ====&lt;br /&gt;
&lt;br /&gt;
This function is deprecated. Use [[Bot#HasRole|HasRole]]&lt;br /&gt;
&lt;br /&gt;
==== Util.CanBotSnipe ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: Util.CanBotSnipe(bot);&lt;br /&gt;
  example: if ( Util.CanBotSnipe(bot) ) {&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
returns true if bot has a sniper weapon.&lt;br /&gt;
&lt;br /&gt;
==== Util.CappointForFlag ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: Util.CappointForFlag( flag_goalname, cappoint_goalname );&lt;br /&gt;
  example: Util.CappointForFlag( &amp;quot;FLAG_axis_gold&amp;quot;, &amp;quot;CAPPOINT_Truck&amp;quot; );&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
used if there are multiple active cappoint goals. It should be called from _Taken triggers.&lt;br /&gt;
&lt;br /&gt;
==== Util.ChangeBotSpawn ====&lt;br /&gt;
This function is deprecated. See [[Changing spawns]].&lt;br /&gt;
&lt;br /&gt;
==== Util.ChangeCrucialClassForRole ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: Util.ChangeCrucialClassForRole ( team, role, class );&lt;br /&gt;
  example: Util.ChangeCrucialClassForRole(TEAM.AXIS, ROLE.DEFENDER1, CLASS.COVERTOPS);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sets new crucialClass in the Map.Roles table.&lt;br /&gt;
&lt;br /&gt;
==== Util.ChangeSpawn ====&lt;br /&gt;
&lt;br /&gt;
This function is deprecated. See [[Changing spawns]].&lt;br /&gt;
&lt;br /&gt;
==== Util.ChangeSpawnForRole ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: Util.ChangeSpawnForRole( &amp;lt;team&amp;gt;, &amp;lt;role&amp;gt;, &amp;lt;spawnpoint&amp;gt; );&lt;br /&gt;
  example: Util.ChangeSpawnForRole(TEAM.ALLIES, ROLE.ATTACKER, 1);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Set the spawn point for all bots on the given team with the given role&lt;br /&gt;
&lt;br /&gt;
see also: [[Roles]] Page&lt;br /&gt;
&lt;br /&gt;
==== Util.ChangeToSniperWeapons ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: Util.ChangeToSniperWeapons( bot, &amp;lt;optional viewDistance&amp;gt; );&lt;br /&gt;
  example: Util.ChangeToSniperWeapons(bot);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
called from OnBotJoin on sniper maps.&lt;br /&gt;
&lt;br /&gt;
see also: [[Sniper_and_Panzer_maps]]&lt;br /&gt;
&lt;br /&gt;
==== Util.ClearRoleForGoals ====&lt;br /&gt;
&lt;br /&gt;
This function is deprecated. Use [[Bot_Library#ClearGoalRole|ClearGoalRole]]&lt;br /&gt;
&lt;br /&gt;
==== Util.ClearRoleForGroup ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: Util.ClearRoleForGroup( group, &amp;lt;role or table&amp;gt; );&lt;br /&gt;
  example: Util.ClearRoleForGroup( &amp;quot;someGroup&amp;quot;, ROLE.DEFENDER );&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
used to remove roles from a given group of goals&lt;br /&gt;
&lt;br /&gt;
see also: [[Roles]] Page&lt;br /&gt;
&lt;br /&gt;
==== Util.ClearRoleForTable ====&lt;br /&gt;
&lt;br /&gt;
This function is deprecated. Use [[Bot_Library#ClearGoalRole|ClearGoalRole]]&lt;br /&gt;
&lt;br /&gt;
==== Util.DisableGoal ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: Util.DisableGoal(goalname, &amp;lt;optional true&amp;gt;);&lt;br /&gt;
  example: Util.DisableGoal(&amp;quot;FLAG_someflag&amp;quot;); &amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
disables the goal for both teams. the optional true parameter is used to disable all goals except for ROUTE goals.&lt;br /&gt;
&lt;br /&gt;
==== Util.DisableGroup ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: Util.DisableGroup(groupname, team);&lt;br /&gt;
  example: Util.DisableGroup( &amp;quot;somegroupname&amp;quot;, TEAM.ALLIES );&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
used to disable a set of goals in the given group for a given team&lt;br /&gt;
&lt;br /&gt;
==== Util.EnableGoal ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: Util.EnableGoal(goalname);&lt;br /&gt;
  example: Util.EnableGoal(&amp;quot;FLAG_someflag&amp;quot;);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
enables the goal for both teams.&lt;br /&gt;
&lt;br /&gt;
==== Util.EnableGroup ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: Util.EnableGroup(groupname, team);&lt;br /&gt;
  example: Util.EnableGroup( &amp;quot;somegroupname&amp;quot;, TEAM.SOMETEAM );&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
used to enable a set of goals in the given group for a given team&lt;br /&gt;
&lt;br /&gt;
==== Util.ExcludeClass ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: Util.ExcludeClass( goalname, team, class1, class2, class3, class4 );&lt;br /&gt;
  example: Util.ExcludeClass( &amp;quot;DEFEND_somegoal.*&amp;quot;, TEAM.AXIS, CLASS.MEDIC );&lt;br /&gt;
  example: Util.ExcludeClass( &amp;quot;MOUNTMG42_.*&amp;quot;, TEAM.ALLIES, CLASS.FIELDOPS, CLASS.ENGINEER );&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
limit given goal usage to specific classes by team. class2, class3, and class4 are optional.&lt;br /&gt;
&lt;br /&gt;
==== Util.ForceRouting ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: Util.ForceRouting(goalName, true/false);&lt;br /&gt;
  example: Util.ForceRouting( &amp;quot;BUILD_Tank&amp;quot;, true );&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
disables BUILD goal offsets and enables routes to the goal. You should set ForceRouting to true only when a vehicle is at known position (in OnMapLoad or at tank barriers). You must set it to false when a vehicle is repaired.&lt;br /&gt;
&lt;br /&gt;
==== Util.GetEntHealth ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: Util.GetEntHealth(entity);&lt;br /&gt;
  example: health = Util.GetEntHealth(this.TargetEntity);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
returns entity health.&lt;br /&gt;
&lt;br /&gt;
==== Util.GetGroup ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: Util.GetGroup(groupname);&lt;br /&gt;
  example: Util.GetGroup(&amp;quot;somegroupname&amp;quot;);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
this function will return a table of goals belonging to the given group name&lt;br /&gt;
&lt;br /&gt;
==== Util.GetRandomFromTable ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: Util.GetRandomFromTable( tbl );&lt;br /&gt;
  example: index = Util.GetRandomFromTable( someTable );&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
used to get a randomly selected index from a given table. Returns -1 if invalid. Table keys must be integers from 0 to (count - 1).&lt;br /&gt;
&lt;br /&gt;
==== Util.GetRandomTableValue====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: Util.GetRandomTableValue( tbl );&lt;br /&gt;
  example: value = Util.GetRandomTableValue( someTable );&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
used to get a randomly selected value from a given table. Returns null if the table is empty or invalid. Table keys must be integers from 0 to (count - 1).&lt;br /&gt;
&lt;br /&gt;
==== Util.GoalTable ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: Util.GoalTable( &amp;lt;optional expression&amp;gt;, &amp;lt;optional teamId&amp;gt; );&lt;br /&gt;
  example: goals = Util.GoalTable(&amp;quot;PLANT_Back_Door&amp;quot;);&lt;br /&gt;
  example: goals = Util.GoalTable(&amp;quot;FLAG.*&amp;quot;, TEAM.AXIS);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
returns table of map goals that match a regular expression. &lt;br /&gt;
&lt;br /&gt;
==== Util.IgnoreTargetGoal ====&lt;br /&gt;
&lt;br /&gt;
This function is deprecated. Use [[Bot#IgnoreTarget|IgnoreTarget]]&lt;br /&gt;
&lt;br /&gt;
==== Util.IgnoreTargetGoalTable ====&lt;br /&gt;
&lt;br /&gt;
This function is deprecated. Use [[Bot#IgnoreTarget|IgnoreTarget]]&lt;br /&gt;
&lt;br /&gt;
==== Util.IsBot ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: Util.IsBot(entity);&lt;br /&gt;
  example: bot = Util.IsBot(ent); &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
returns Bot object from entity or null if entity is not a bot. Usually used in region triggers if the TriggerOnClass is CLASS.ANYPLAYER.&lt;br /&gt;
&lt;br /&gt;
==== Util.LimitToClass ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: Util.LimitToClass(goalname, team, class1, class2, class3, class4);&lt;br /&gt;
  example: Util.LimitToClass(&amp;quot;CHECKPOINT.*&amp;quot;, TEAM.ALLIES, CLASS.SOLDIER); //only soldiers on the allied team&lt;br /&gt;
  example: Util.LimitToClass(&amp;quot;CHECKPOINT.*&amp;quot;, TEAM.ALLIES, CLASS.SOLDIER, CLASS.MEDIC); //only soldiers and medics&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
used to limit specific goals to a specific class or classes&lt;br /&gt;
&lt;br /&gt;
==== Util.LimitToTeam ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: Util.LimitToTeam(team, goal);&lt;br /&gt;
  example: Util.LimitToTeam(TEAM.AXIS, &amp;quot;SWITCH_gate_depot&amp;quot;);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
limits goals to a certain team without the need to disable for 1 team&lt;br /&gt;
&lt;br /&gt;
==== Util.MapDebugPrint ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: Util.MapDebugPrint( &amp;quot;Text&amp;quot;, &amp;lt;optional message only&amp;gt; );&lt;br /&gt;
  example: Util.MapDebugPrint( &amp;quot;East_Barrier_Destroyed&amp;quot; );&lt;br /&gt;
  example: Util.MapDebugPrint( &amp;quot;East_Barrier_Destroyed&amp;quot;, true ); // only print the message&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
used to print text &amp;amp; list of available goals in the console when in debug mode&lt;br /&gt;
&lt;br /&gt;
see also: [[Debugging_tips]]&lt;br /&gt;
&lt;br /&gt;
==== Util.OnTriggerPosition ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: Util.OnTriggerPosition( goalname, wpname or position, tolerance, wpfunction );&lt;br /&gt;
  example: Util.OnTriggerPosition( &amp;quot;MOVER_train1&amp;quot;, &amp;quot;depotyard&amp;quot;, 200.0, Map.tug_depotyard );&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
note: used for setting up positional triggers for movers.&lt;br /&gt;
&lt;br /&gt;
==== Util.RandomBotSpawn ====&lt;br /&gt;
&lt;br /&gt;
This function is deprecated. See [[Changing spawns]].&lt;br /&gt;
&lt;br /&gt;
==== Util.RandomSpawn ====&lt;br /&gt;
&lt;br /&gt;
This function is deprecated. See [[Changing spawns]].&lt;br /&gt;
&lt;br /&gt;
==== Util.RemoveGoal ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: Util.RemoveGoal( goalnames );&lt;br /&gt;
  example: Util.RemoveGoal( &amp;quot;MOVER_truck&amp;quot; );&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
removes the goals from the map goal table. It should only be used for invalid goals which are badly detected by the game.&lt;br /&gt;
&lt;br /&gt;
==== Util.Routes ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: Util.Routes( &amp;lt;table&amp;gt; );&lt;br /&gt;
  example: Util.Routes(MapRoutes);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
initializes routes&lt;br /&gt;
&lt;br /&gt;
see also: [[Template:Baserouting|Routing]]&lt;br /&gt;
&lt;br /&gt;
==== Util.SetGoalOffset ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: Util.SetGoalOffset( x, y, z, GoalName );&lt;br /&gt;
  info x = North, -x = South y = East, -y = West, z = Up, -z =Down&lt;br /&gt;
  example: Util.SetGoalOffset( 0, -20, -10, &amp;quot;MOUNTMG42_boat&amp;quot; );&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
the x y and z parameters are added to the origin of the goal to move the location of where bots will look for the goal. It is sometimes needed for MOUNTMG42 and REPAIRMG42 goals because some mg42 cannot be mounted or repaired if it&#039;s position is not corrected.&lt;br /&gt;
&lt;br /&gt;
==== Util.SetGoalPosition ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: Util.SetGoalPosition( x, y, z, GoalName );&lt;br /&gt;
  example: Util.SetGoalPosition( 4534, 2168, -199, &amp;quot;BUILD_construct&amp;quot; )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
used to give the goal a new origin.&lt;br /&gt;
&lt;br /&gt;
note: it&#039;s  usually much better to use function Util.AddUsePoint to set position of BUILD or PLANT goals.&lt;br /&gt;
&lt;br /&gt;
note: console command &amp;quot;/bot mypos&amp;quot; prints your body position, command &amp;quot;/viewpos&amp;quot; prints your eye position rounded to integer.&lt;br /&gt;
&lt;br /&gt;
==== Util.SetGoalRange ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: Util.SetGoalRange( goalNames, distance or AABB );&lt;br /&gt;
  examples:&lt;br /&gt;
  Util.SetGoalRange(&amp;quot;GRENADE_tower.*&amp;quot;, 800);&lt;br /&gt;
  Util.SetGoalRange(&amp;quot;PLANT_SideGate&amp;quot;, AABB(-2785,-3579,65,2702,-1306,257));&lt;br /&gt;
  //reset to unlimited&lt;br /&gt;
  Util.SetGoalRange(&amp;quot;GRENADE_tower.*&amp;quot;, 0);&lt;br /&gt;
  Util.SetGoalRange(&amp;quot;PLANT_SideGate&amp;quot;, AABB());&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
sets the range for map goals.  It can be int radius or AABB box or both. The QueryGoals functions does not return goals which are out of range. Default range for all goals is unlimited. Goals will not be interrupted if the range changes after the bot has already activated the goal.&lt;br /&gt;
&lt;br /&gt;
==== Util.SetGroup ====&lt;br /&gt;
&lt;br /&gt;
This function is deprecated. Use [[Bot_Library#SetGoalGroup|SetGoalGroup]]&lt;br /&gt;
&lt;br /&gt;
==== Util.SetGroupForTable ====&lt;br /&gt;
&lt;br /&gt;
This function is deprecated. Use [[Bot_Library#SetGoalGroup|SetGoalGroup]]&lt;br /&gt;
&lt;br /&gt;
==== Util.SetMaxUsers ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: Util.SetMaxUsers( botnum, goal );&lt;br /&gt;
  example: Util.SetMaxUsers( 1, &amp;quot;ATTACK_.*&amp;quot; );&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
used to limit number of bots using a particular goal(s). this function sets both In_Use and In_Progress&lt;br /&gt;
&lt;br /&gt;
==== Util.SetMaxUsersInProgress ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: Util.SetMaxUsersInProgress( Users, GoalNames );&lt;br /&gt;
  example: Util.SetMaxUsersInProgress( 15, &amp;quot;CHECKPOINT.*&amp;quot; );&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
used to set the maximum number of bots going for a particular goal(s).&lt;br /&gt;
&lt;br /&gt;
==== Util.SetMaxUsersInUse ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: Util.SetMaxUsersInUse( Users, GoalNames );&lt;br /&gt;
  example: Util.SetMaxUsersInUse( 1, &amp;quot;MOUNT_.*&amp;quot; );&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
used to set the maximum number of bots using a particular goal(s).&lt;br /&gt;
&lt;br /&gt;
==== Util.SetPercentInProgress ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: Util.SetPercentInProgress(%, goal);&lt;br /&gt;
  example: Util.SetPercentInProgress(70, &amp;quot;FLAG_docs&amp;quot;);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
sets a percentage of bots to use a particular goal(s).&lt;br /&gt;
&lt;br /&gt;
note: number of bots is calculated only once when this function is called. It does not work well after bots are added or kicked.&lt;br /&gt;
&lt;br /&gt;
==== Util.SetPositionGoal ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: Util.SetPositionGoal( goalname1, goalname2 );&lt;br /&gt;
  example: Util.SetPositionGoal( &amp;quot;BUILD_Tank&amp;quot;, &amp;quot;MOVER_tank&amp;quot; );&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
sets the origin of one goal to match the origin of another. This function was used in Omni-bot 0.66. Current Omni-bot version automatically sets positions of BUILD goals.&lt;br /&gt;
&lt;br /&gt;
==== Util.SetRoleForGoals ====&lt;br /&gt;
&lt;br /&gt;
This function is deprecated. Use [[Bot_Library#SetGoalRole|SetGoalRole]]&lt;br /&gt;
&lt;br /&gt;
==== Util.SetRoleForGroup ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: Util.SetRoleForGroup( &amp;lt;goal group&amp;gt;, &amp;lt;role or table&amp;gt; );&lt;br /&gt;
  example: Util.SetRoleForGroup( &amp;quot;myGroup&amp;quot;, ROLE.DEFENDER );&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
sets the given roles for the given group of goals.&lt;br /&gt;
&lt;br /&gt;
==== Util.SetRoleForTable ====&lt;br /&gt;
&lt;br /&gt;
This function is deprecated. Use [[Bot_Library#SetGoalRole|SetGoalRole]]&lt;br /&gt;
&lt;br /&gt;
see also: [[Roles]] Page&lt;br /&gt;
&lt;br /&gt;
==== Util.ShowGroup ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: Util.ShowGroup(groupname);&lt;br /&gt;
  example: Util.ShowGroup(&amp;quot;somegroupname&amp;quot;);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
this function will list all goals in the given group in the console.&lt;br /&gt;
&lt;br /&gt;
==== Util.UpdateSwitchData ====&lt;br /&gt;
&lt;br /&gt;
This function is deprecated. Use [[Switch_Goal]]&lt;br /&gt;
&lt;br /&gt;
==== Util.WpNameInfo ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: Util.WpNameInfo(waypointName);&lt;br /&gt;
  example: wpInfo = Util.WpNameInfo(&amp;quot;rNadeHall&amp;quot;);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
finds waypoint by name and returns table which contains position, facing, radius, flags, property. It is often used in paththrough navigation.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== ETUtil ===&lt;br /&gt;
These functions are available only in the Enemy Territory game.&lt;br /&gt;
&lt;br /&gt;
==== ETUtil.ChangeToPanzer ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: ETUtil.ChangeToPanzer( bot );&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
called from OnBotJoin on panzer maps.&lt;br /&gt;
&lt;br /&gt;
see also: [[Sniper_and_Panzer_maps]]&lt;br /&gt;
&lt;br /&gt;
==== ETUtil.CountClass ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: ETUtil.CountClass( team, class );&lt;br /&gt;
  example: ETUtil.CountClass( TEAM.ALLIES, CLASS.ENGINEER ); &amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
can be used to determine if a team has enough of a critical class for the map&lt;br /&gt;
&lt;br /&gt;
==== ETUtil.GetReinforceTime ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: ETUtil.GetReinforceTime(TEAM.AXIS);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
returns time to next respawn, or null if no bot exists in the team.&lt;br /&gt;
&lt;br /&gt;
==== ETUtil.GetTimeElapsed ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: ETUtil.GetTimeElapsed();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
returns time since map start.&lt;br /&gt;
&lt;br /&gt;
==== ETUtil.IsTeamClassDead ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: ETUtil.IsTeamClassDead( team, class );&lt;br /&gt;
  example: ETUtil.IsTeamClassDead( TEAM.AXIS, CLASS.MEDIC ); &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
returns true if all the players of the given class on the given team are dead.&lt;br /&gt;
&lt;br /&gt;
==== ETUtil.IsTeamDead ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: ETUtil.IsTeamDead( team );&lt;br /&gt;
  example: ETUtil.IsTeamDead( TEAM.AXIS );&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
returns true if all players on the given team are dead.&lt;br /&gt;
&lt;br /&gt;
==== ETUtil.KillTeam ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: ETUtil.KillTeam( team, &amp;lt;optional maxTime&amp;gt; );&lt;br /&gt;
  example: ETUtil.KillTeam( TEAM.AXIS, 15 );&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
waits for next respawn and then kills all bots in the team, but only if time to next respawn is not greater than maxTime.&lt;br /&gt;
&lt;br /&gt;
==== ETUtil.LosingChat ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: ETUtil.LosingChat(team);&lt;br /&gt;
  example: ETUtil.LosingChat( TEAM.AXIS );&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
See [[Talking_bots]] page&lt;br /&gt;
&lt;br /&gt;
==== ETUtil.SelectWeapon ====&lt;br /&gt;
&lt;br /&gt;
This function does not work since version 0.82. Now you have to use [[Utility_Functions#WeaponTable|WeaponTable.SetWeaponAvailability]].&lt;br /&gt;
&lt;br /&gt;
==== ETUtil.SetAimModeForMount====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: ETUtil.SetAimModeForMount(goalName, aimType);&lt;br /&gt;
  example: ETUtil.SetAimModeForMount(&amp;quot;MOUNT_ship&amp;quot;, Vec3(-340, 1530, 90));&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sets AimMode property of MOUNT goal. Valid values are &amp;quot;velocity&amp;quot;, &amp;quot;opposite&amp;quot;, &amp;quot;random&amp;quot; or Vector3.&lt;br /&gt;
&lt;br /&gt;
==== ETUtil.SetExcludeIndexes ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: ETUtil.SetExcludeIndexes( goal, { offset } );&lt;br /&gt;
  example: ETUtil.SetExcludeIndexes( &amp;quot;BUILD_Truck&amp;quot;, { 4, 5, 6 } ); // Disable offset 4, 5 &amp;amp; 6&lt;br /&gt;
  example: ETUtil.SetExcludeIndexes( &amp;quot;BUILD_Truck&amp;quot;, {} ); // Removes Disabled offsets&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
disables vehicle offsets, used when an offset cannot be reached. Used only by goals BUILD, ESCORT, MOUNT, RIDE.&lt;br /&gt;
&lt;br /&gt;
==== ETUtil.SetStartIndex ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: ETUtil.SetStartIndex(goal, offset);&lt;br /&gt;
  example: ETUtil.SetStartIndex(&amp;quot;ESCORT_tank&amp;quot;, 2); // Use Offset 2&lt;br /&gt;
  example: ETUtil.SetStartIndex(&amp;quot;ESCORT_tank&amp;quot;, -1); // Random&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
used to make a bot start from a certain vehicle offset in mover goals that have offsets defined. Normally set in OnMapLoad then reset inside a trigger. Used only by goals BUILD, ESCORT, MOUNT, RIDE.&lt;br /&gt;
&lt;br /&gt;
==== ETUtil.SuicideSpawn ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: ETUtil.SuicideSpawn( team, spawn, numbots, class);&lt;br /&gt;
  example: ETUtil.SuicideSpawn( TEAM.AXIS, 2, 1, CLASS.ENGINEER ); // 2 bots spawn at spawnpoint 2&lt;br /&gt;
  example: ETUtil.SuicideSpawn( TEAM.AXIS, 2, -1, CLASS.ENGINEER ); // all axis engineer bots spawn at spawnpoint 2&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
used to make bots self kill and change to a new spawn, often used in maps to defend areas when players have sneaked past.&lt;br /&gt;
&lt;br /&gt;
==== ETUtil.SwitchWeapon ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: ETUtil.SwitchWeapon(weapon);&lt;br /&gt;
  example: ETUtil.SwitchWeapon(WEAPON.PANZERFAUST); //all soldiers will switch to panzer&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This function is deprecated since version 0.82 because it only kills bot and does not change his weapon.&lt;br /&gt;
&lt;br /&gt;
==== ETUtil.WaitForSpawn ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: ETUtil.WaitForSpawn(Team);&lt;br /&gt;
  example: ETUtil.WaitForSpawn( TEAM.ALLIES );&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sleeps until next respawn of the team. Returns 0.15 seconds before respawn.&lt;br /&gt;
&lt;br /&gt;
==== ETUtil.WinningChat ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: ETUtil.WinningChat(Team);&lt;br /&gt;
  example: ETUtil.WinningChat( TEAM.ALLIES );&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
See [[Talking_bots]] page&lt;br /&gt;
&lt;br /&gt;
=== RTCWUtil ===&lt;br /&gt;
These functions are available only in the Return to Castle Wolfenstein game.&lt;br /&gt;
&lt;br /&gt;
==== RTCWUtil.BotDisableCombatCrouch ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: RTCWUtil.BotDisableCombatCrouch( bot, bool enable );&lt;br /&gt;
  example: RTCWUtil.BotDisableCombatCrouch( bot, true );&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
used to disable crouching in combat for the given bot&lt;br /&gt;
&lt;br /&gt;
==== RTCWUtil.ChangeClass ====&lt;br /&gt;
&lt;br /&gt;
This function is deprecated. Use Server.MinClassCount.&lt;br /&gt;
&lt;br /&gt;
==== RTCWUtil.ChangeSpawnNoDefenders ====&lt;br /&gt;
&lt;br /&gt;
This function is deprecated. See [[Changing spawns]].&lt;br /&gt;
&lt;br /&gt;
==== RTCWUtil.ClearMainGoals ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: RTCWUtil.ClearMainGoals();&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
This function will deactivate all main goals for both teams.&lt;br /&gt;
  &lt;br /&gt;
   goals deactivated: PLANT MOUNTMG42 MOVER CHECKPOINT FLAG&lt;br /&gt;
&lt;br /&gt;
==== RTCWUtil.ClearSecondaryGoals ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: RTCWUtil.ClearSecondaryGoals();&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  This function will deactivate all secondary goals for both teams.&lt;br /&gt;
  &lt;br /&gt;
  goals deactivated: ARTILLERY REPAIR&lt;br /&gt;
&lt;br /&gt;
==== RTCWUtil.CountClass ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: RTCWUtil.CountClass( team, class );&lt;br /&gt;
  example: RTCWUtil.CountClass( TEAM.ALLIES, CLASS.ENGINEER ); &amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
can be used to determine if a team has enough of a critical class for the map&lt;br /&gt;
&lt;br /&gt;
==== RTCWUtil.CountTeam ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: RTCWUtil.DisableGoal(goalname, &amp;lt;optional true&amp;gt;);&lt;br /&gt;
  example: RTCWUtil.DisableGoal(&amp;quot;FLAG_someflag&amp;quot;); &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
disables the goal for both teams. the optional true parameter is used to disable all goals except for ROUTE goals.&lt;br /&gt;
&lt;br /&gt;
==== RTCWUtil.IsPlantGoalAvailable ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: RTCWUtil.IsPlantGoalAvailable();&lt;br /&gt;
  example: RTCWUtil.IsPlantGoalAvailable();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
returns true if there is a plant goal available&lt;br /&gt;
&lt;br /&gt;
==== RTCWUtil.IsTeamClassDead ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: RTCWUtil.IsTeamClassDead( team, class );&lt;br /&gt;
  example: RTCWUtil.IsTeamClassDead( TEAM.AXIS, CLASS.ENGINEER )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
returns true if there are no living players or bots of a given class on the given team&lt;br /&gt;
&lt;br /&gt;
==== RTCWUtil.IsTeamDead ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: RTCWUtil.IsTeamDead( team, minbots );&lt;br /&gt;
  example: RTCWUtil.IsTeamDead( TEAM.AXIS, 2 );&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
returns true if the number of living players on the given team is less than minbots.&lt;br /&gt;
&lt;br /&gt;
note: minbots is optional as it defaults to 1&lt;br /&gt;
&lt;br /&gt;
==== RTCWUtil.KillEntities ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: RTCWUtil.KillEntities( table or int );&lt;br /&gt;
  example: RTCWUtil.KillEntities( 123 );&lt;br /&gt;
  example: RTCWUtil.KillEntities( {123, 124} );&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
used to remove entities from the map. typically called from OnMapLoad&lt;br /&gt;
&lt;br /&gt;
==== RTCWUtil.NoSnipe ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: syntax: RTCWUtil.NoSnipe(bot);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
soldier bots will not choose a mauser when selecting a weapon&lt;br /&gt;
 &lt;br /&gt;
note: this is typically called in OnBotJoin&lt;br /&gt;
&lt;br /&gt;
==== RTCWUtil.SelectSoldierWeapons ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: RTCWUtil.SelectSoldierWeapons(team, bot, weap1, weap2, weap3);&lt;br /&gt;
  soldiers will only select weapons passed in as parameters&lt;br /&gt;
  &lt;br /&gt;
  note: typically used in OnBotJoin to have soldiers choose between given weapons&lt;br /&gt;
  example: RTCWUtil.SelectSoldierWeapons(TEAM.AXIS, bot, WEAPON.MAUSER, WEAPON.PANZERFAUST); //axis soldiers randomly select panzer or mauser&lt;br /&gt;
  example: RTCWUtil.SelectSoldierWeapons(0, bot, WEAPON.MAUSER, WEAPON.PANZERFAUST); //all soldiers randomly select panzer or mauser&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
&lt;br /&gt;
==== RTCWUtil.SelectWeapon ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: RTCWUtil.SelectWeapon(bot, weapon, isFog);&lt;br /&gt;
  example: RTCWUtil.SelectWeapon(bot, WEAPON.MAUSER);&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
the given bot will switch to the given weapon if it is the correct class for the weapon&lt;br /&gt;
 &lt;br /&gt;
note: typically used in OnBotJoin to have soldiers choose a specific weapon&lt;br /&gt;
         the isFog parameter is optional and disables extra view distance given to snipers&lt;br /&gt;
&lt;br /&gt;
==== RTCWUtil.SetPrimaryGoals ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: RTCWUtil.SetPrimaryGoals(priority);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
used for setting priorities of common goals.&lt;br /&gt;
  &lt;br /&gt;
note: this is typically called in OnMapLoad and effects the following goals (in order of priority):&lt;br /&gt;
         CAPPOINT FLAGRETURN PLANT CHECKPOINT FLAG&lt;br /&gt;
&lt;br /&gt;
==== RTCWUtil.SetSuicide ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: RTCWUtil.SetSuicide(team, class, suicide, persistant);&lt;br /&gt;
  sets all classes on the given team so they commit suicide two seconds before the next spawn&lt;br /&gt;
         the persistant parameter if set will have them do it every spawn until it is turned off ( or round ends)&lt;br /&gt;
 &lt;br /&gt;
  example: RTCWUtil.SetSuicide(TEAM.ALLIES, CLASS.LIEUTENANT, 1, 1); //commit suicide 2 seconds before every spawn&lt;br /&gt;
  example: RTCWUtil.SetSuicide(TEAM.ALLIES, CLASS.LIEUTENANT, 0, 0); //disable the suicide flag for them&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== RTCWUtil.SetTeamSuicide ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: RTCWUtil.SetSuicide(team, suicide, persistant);&lt;br /&gt;
  sets all bots on the given team so they commit suicide two seconds before the next spawn&lt;br /&gt;
         the persistant parameter if set will have them do it every spawn until it is turned off ( or round ends)&lt;br /&gt;
 &lt;br /&gt;
  example: RTCWUtil.SetTeamSuicide(TEAM.ALLIES, 1, 1); //commit suicide 2 seconds before every spawn&lt;br /&gt;
  example: RTCWUtil.SetTeamSuicide(TEAM.ALLIES, 0, 0); //disable the suicide flag for them&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== RTCWUtil.StopSniping ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: RTCWUtil.StopSniping();&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
all bots currently using a sniper weapon will switch to a different weapon&lt;br /&gt;
  &lt;br /&gt;
note: this is typically called inside trigger functions&lt;br /&gt;
&lt;br /&gt;
==== RTCWUtil.SwitchSoldierWeapons ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: RTCWUtil.SwitchSoldierWeapons(team, bot, weap1, weap2, weap3);&lt;br /&gt;
  soldiers will only select weapons passed in as parameters&lt;br /&gt;
  &lt;br /&gt;
  note: typically used in triggers to have soldiers choose between given weapons&lt;br /&gt;
  example: RTCWUtil.SwitchSoldierWeapons(TEAM.AXIS, bot, WEAPON.MAUSER, WEAPON.PANZERFAUST); //axis soldiers randomly select panzer or mauser&lt;br /&gt;
  example: RTCWUtil.SwitchSoldierWeapons(0, bot, WEAPON.MAUSER, WEAPON.PANZERFAUST); //all soldiers randomly select panzer or mauser&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
==== RTCWUtil.SwitchWeapon ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: RTCWUtil.SwitchWeapon(weapon);&lt;br /&gt;
  all qualifying bots will switch to the given weapon&lt;br /&gt;
  &lt;br /&gt;
  example: RTCWUtil.SwitchWeapon(WEAPON.PANZERFAUST); //all soldiers will switch to panzer&lt;br /&gt;
  note: typically used in trigger functions&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== RTCWUtil.TeamDisableCombatCrouch ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: RTCWUtil.TeamDisableCombatCrouch( team );&lt;br /&gt;
  example: RTCWUtil.TeamDisableCombatCrouch( TEAM.AXIS );&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
disables combat crouching for the given team&lt;br /&gt;
&lt;br /&gt;
==== RTCWUtil.ToggleFlag ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: RTCWUtil.ToggleFlag( goal, time in seconds );&lt;br /&gt;
  example: thread(RTCWUtil.ToggleFlag, &amp;quot;CHECKPOINT.someFlag&amp;quot;, 300);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
used in dual objective maps like mp_depot to set availability of the checkpoint goal for the opposite team in the given interval&lt;br /&gt;
note: this should be called as a gm thread.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== WeaponTable ===&lt;br /&gt;
&lt;br /&gt;
==== WeaponTable.ListWeaponAvailability ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: WeaponTable.ListWeaponAvailability();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
prints current availability of all weapons&lt;br /&gt;
&lt;br /&gt;
==== WeaponTable.SetWeaponAvailability ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: WeaponTable.SetWeaponAvailability( class, weapon, &amp;lt;true/false&amp;gt;);&lt;br /&gt;
  example: WeaponTable.SetWeaponAvailability( CLASS.SOLDIER, WEAPON.FLAMETHROWER, false );&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
enables or disables specified weapon for class. The weapon parameter can be table.&lt;br /&gt;
The class parameter can be null to set availability for all classes.&lt;br /&gt;
&lt;br /&gt;
note: allied PANZERFAUST is automatically converted to BAZOOKA or LAW in Noquarter or ETnam&lt;br /&gt;
&lt;br /&gt;
note: bots select random available weapon every spawn (in limbo)&lt;br /&gt;
&lt;br /&gt;
==== WeaponTable.SetWeaponTeamAvailability ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: WeaponTable.SetWeaponTeamAvailability( team, class, weapon, &amp;lt;true/false&amp;gt;);&lt;br /&gt;
  example: WeaponTable.SetWeaponTeamAvailability( TEAM.AXIS, CLASS.ENGINEER, WEAPON.KAR98, false );&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
enables or disables weapon for team and class.&lt;br /&gt;
&lt;br /&gt;
==== WeaponTable.Shotgun ====&lt;br /&gt;
&lt;br /&gt;
The Shotgun property has value WEAPON.SHOTGUN, WEAPON.ITHACA, WEAPON.M97 or null.&lt;/div&gt;</summary>
		<author><name>Palota</name></author>
	</entry>
	<entry>
		<id>https://mygamingtalk.com/wiki/index.php?title=Template:Baserouting&amp;diff=1782</id>
		<title>Template:Baserouting</title>
		<link rel="alternate" type="text/html" href="https://mygamingtalk.com/wiki/index.php?title=Template:Baserouting&amp;diff=1782"/>
		<updated>2025-06-23T08:08:46Z</updated>

		<summary type="html">&lt;p&gt;Palota: /* Step 6: Copying routes */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:ET|Routing]]&lt;br /&gt;
[[Category:Doom 3|Routing]]&lt;br /&gt;
[[Category:Quake 4|Routing]]&lt;br /&gt;
[[Category:RTCW|Routing]]&lt;br /&gt;
[[Category:Waypointing]]&lt;br /&gt;
==Routing Overview==&lt;br /&gt;
&lt;br /&gt;
Until version 0.65, omni-bot path selection relied on the shortest path to a goal. While this typically provided for very focused attacks, game play became very predictable. The solution is Routing. Routing provides alternate goals for the bots to go to before heading to their main goal. When positioned correctly, these alternate goals provide the effect of bots choosing realistic and varied paths to their main goals.&lt;br /&gt;
&lt;br /&gt;
Routing requires some setup in script and in the waypoints, but the results are worth the effort.  The objective of this article is to provide an overview of how the routing system works and to clearly define how to set it up by walking through a working example on Goldrush.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:Gr_routes2.jpg|Goldrush Multiple Routes Example]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In this picture, Squares are route nodes and the Dots are potential paths. The color of the Dots correspond to the color of the Route nodes. Once they reach a route node, they will travel along the path(s) of the same color IF the route node is set up for their current main goal.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Walking through the picture, let’s say the tank construction goal is set up for an allied engineer within the AllySpawn route nodes, and that the engineer has the tank construct as its goal. The engineer will randomly choose whether to go to the green route node (as_right) or the yellow route node (depotgate). For the purpose of this example, let’s say the bot chose to go to the green route node. From there, he will randomly choose to go to the white or red route node.  The bot will continue to make these decisions until there are no route nodes left to go to. From that point, the bot will take the shortest path to the tank construct goal.&lt;br /&gt;
As you can see, this opens up several different points of attack for the bots; which creates a sense of realism in terms of predictability. Defenses will now need to be set up to be able to react to all of the entry points rather than focusing on easily predicted choke points if the shortest path is always used.&lt;br /&gt;
&lt;br /&gt;
==Setting It Up==&lt;br /&gt;
&lt;br /&gt;
Setting up Routes involves waypointing and scripting. This section will take you step by step through the process of setting up the routes in the Goldrush example. &lt;br /&gt;
&lt;br /&gt;
===Step 1: Setting up the script===&lt;br /&gt;
&lt;br /&gt;
The first requirement for routing is that the routes are defined in the map script. The method to do this consists of building a table for the routes and calling a utility function that will register the routes.&lt;br /&gt;
&lt;br /&gt;
If a map script does not exist yet, open up your favorite text editor and add the following to a new file:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 global InitializeRoutes = function()&lt;br /&gt;
 {&lt;br /&gt;
 }; &amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Save the file as &amp;lt;mapname&amp;gt;.gm in your Omni-Bot\et\nav folder. You are now ready to start building the routes.  Inside the InitializeRoutes function is where the route definitions are placed and they all start with a basic layout:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 global InitializeRoutes = function()&lt;br /&gt;
 {&lt;br /&gt;
     MapRoutes =&lt;br /&gt;
     {&lt;br /&gt;
     };&lt;br /&gt;
  &lt;br /&gt;
     Util.Routes(MapRoutes);&lt;br /&gt;
 }; &amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You now have a MapRoutes table defined and are registering everything within that table with the Util.Routes function.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Step 2: Adding route goal ===&lt;br /&gt;
&lt;br /&gt;
Route goals are fairly straight forward. They have two important properties; route name and radius. You can use any name you want for the route nodes, but they should be somewhat intuitive. To see the full guide on adding route goals see the [[Route_Goal]] page.&lt;br /&gt;
&lt;br /&gt;
Route goals are placed in positions where a bot might receive the goal you want them to use alternate paths for. The bot MUST be inside the route node radius when receiving a goal for it to work. Spawn points are good spots for route nodes because bots always receive a goal when they spawn. &lt;br /&gt;
&lt;br /&gt;
In the spawns area you need to place the goal over the spawn positions and give it a large radius to cover the spawn points. Issue the following commands in console:&lt;br /&gt;
&lt;br /&gt;
  /bot show_spawns&lt;br /&gt;
  /bot goal_create route AllySpawn&lt;br /&gt;
  /bot goal_setproperty radius 500&lt;br /&gt;
&lt;br /&gt;
The radius of the route nodes at spawn positions are very critical because the bots must be inside its radius for it to work. Be sure that the radius covers the entire spawn area. Bots do not always receive goals immediately at spawn. Sometimes they receive goals 2 seconds after spawn. That&#039;s why it&#039;s always better to set bigger radius. But be careful, route nodes must not overlap. &lt;br /&gt;
&lt;br /&gt;
For routing to be effective, you will need at least two defined because once they reach the route node, they will take the shortest path to their goal UNLESS there is another route node set up for them to go to. Continuing with our example, create a route node where the green square is in the picture and name it as_right:&lt;br /&gt;
&lt;br /&gt;
  /bot goal_create route as_right&lt;br /&gt;
&lt;br /&gt;
You now have two route nodes; meeting the requirement for working routes. In our example, we want the bots to use two paths from the spawn, so add the route node depicted by the yellow square at the depot gate:&lt;br /&gt;
&lt;br /&gt;
  /bot goal_create route depotgate&lt;br /&gt;
&lt;br /&gt;
Be sure to save the goals at this point. The next step is to set up the goals and route node selection in the script.&lt;br /&gt;
&lt;br /&gt;
  /bot goal_save&lt;br /&gt;
&lt;br /&gt;
===Step 3: Scripting the routes===&lt;br /&gt;
&lt;br /&gt;
The Maproutes table is set up with the following format:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  MapRoutes =&lt;br /&gt;
  {&lt;br /&gt;
      GOALNAME1 =&lt;br /&gt;
      {&lt;br /&gt;
          ROUTE_NAME = {},&lt;br /&gt;
      },&lt;br /&gt;
      GOALNAME2 =&lt;br /&gt;
      {&lt;br /&gt;
          ROUTE_NAME = {},&lt;br /&gt;
      },&lt;br /&gt;
  };&lt;br /&gt;
  MapRoutes[&amp;quot;GOALNAME3.*&amp;quot;] =&lt;br /&gt;
  {&lt;br /&gt;
      ROUTE_NAME = {},&lt;br /&gt;
  };&lt;br /&gt;
  MapRoutes[&amp;quot;GOALNAME4.*&amp;quot;] =&lt;br /&gt;
  {&lt;br /&gt;
      ROUTE_NAME = {},&lt;br /&gt;
  };&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you are new to map scripting, this may appear a bit intimidating. The key is to follow the steps and syntax exactly, then let the understanding of the syntax come naturally. If you are comfortable with gm scripting, the routing set up consists of nested tables. &lt;br /&gt;
&lt;br /&gt;
&amp;quot;GOALNAME3.*&amp;quot; is a regular expression which matches multiple goals.  It is usually used for ATTACK and DEFEND goals. For example, regular expression &amp;quot;ATTACK_Depot.*&amp;quot; matches goals ATTACK_Depot1, ATTACK_Depot2, ATTACK_Depot3, etc. Regular expression &amp;quot;ATTACK_Depot[25]&amp;quot; matches goals ATTACK_Depot2 and ATTACK_Depot5. Routes for regular expressions have special syntax and they must be defined after the initial MapRoutes table.&lt;br /&gt;
&lt;br /&gt;
The goal names and route names must match the output from command /bot show_goals. Be sure to double check the goal names. Route names are case sensitive.&lt;br /&gt;
&lt;br /&gt;
For the Goldrush example, set up the tank construct routing as follows:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 global InitializeRoutes = function()&lt;br /&gt;
 {&lt;br /&gt;
 	MapRoutes =&lt;br /&gt;
 	{&lt;br /&gt;
 		BUILD_tank =&lt;br /&gt;
 		{&lt;br /&gt;
 			ROUTE_AllySpawn = {},&lt;br /&gt;
 		},&lt;br /&gt;
 	};&lt;br /&gt;
 &lt;br /&gt;
 	Util.Routes(MapRoutes);&lt;br /&gt;
 }; &amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The AllySpawn route node is now a valid route node for the tank construct goal. If a bot spawns within its radius and receives the tank construct as a goal, it will use that route node. In and of itself, this route node will not do anything because at spawn the bot is already at it. So let’s add the two path options we want to give the bots from the Allied Spawn:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
global InitializeRoutes = function()&lt;br /&gt;
{&lt;br /&gt;
    MapRoutes =&lt;br /&gt;
    {&lt;br /&gt;
        BUILD_tank =&lt;br /&gt;
        {&lt;br /&gt;
            ROUTE_AllySpawn =&lt;br /&gt;
            {&lt;br /&gt;
                ROUTE_as_right = {},&lt;br /&gt;
                ROUTE_depotgate = {},&lt;br /&gt;
            },&lt;br /&gt;
        },&lt;br /&gt;
    };&lt;br /&gt;
&lt;br /&gt;
    Util.Routes(MapRoutes);&lt;br /&gt;
}; &amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It’s important to understand what we just did with this:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 ROUTE_AllySpawn = &lt;br /&gt;
 {&lt;br /&gt;
     ROUTE_as_right = {},&lt;br /&gt;
     ROUTE_depotgate = {},&lt;br /&gt;
 },&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The bot reaches the AllySpawn route node by default when it spawns; and because we have added the two routes inside the brackets, the bots will randomly choose between them. At this point, you have randomized routes for Allied engineers with the tank construct goal. Half the time they will choose to go to route as_right and half the time they will choose to go to route depotgate.&lt;br /&gt;
&lt;br /&gt;
Let’s make them even less predictable. Looking at the example picture, you can see that we want them to have a couple different options once they reach the route nodes we just set up. Repeating step 2, add the rest of the route nodes depicted by the colored squares.&lt;br /&gt;
&lt;br /&gt;
The scripting for the path options in the picture is as follows:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 global InitializeRoutes = function()&lt;br /&gt;
 {&lt;br /&gt;
     MapRoutes =&lt;br /&gt;
     {&lt;br /&gt;
         BUILD_tank =&lt;br /&gt;
         {&lt;br /&gt;
             ROUTE_AllySpawn = &lt;br /&gt;
             {    &lt;br /&gt;
                 ROUTE_as_right =&lt;br /&gt;
                 {&lt;br /&gt;
                     ROUTE_as_rightsplit1 = {},&lt;br /&gt;
                     ROUTE_as_rightsplit2 =&lt;br /&gt;
                     {&lt;br /&gt;
                         ROUTE_depotflank = {},&lt;br /&gt;
                     },&lt;br /&gt;
                 },&lt;br /&gt;
                 ROUTE_depotgate = &lt;br /&gt;
                 {&lt;br /&gt;
                     ROUTE_cproute = {},&lt;br /&gt;
                     ROUTE_depotgatesplit = {},&lt;br /&gt;
                     ROUTE_as_rightsplit1 = {},&lt;br /&gt;
                 },&lt;br /&gt;
             },&lt;br /&gt;
         },&lt;br /&gt;
     };&lt;br /&gt;
 &lt;br /&gt;
     Util.Routes(Maproutes);&lt;br /&gt;
 }; &amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Step 4: Testing the routes===&lt;br /&gt;
&lt;br /&gt;
Testing the routes is by far the most important step. It is recommended that you test routes individually as you start to learn the routing system. Once you are comfortable with the setup, you may want to add routes for an entire phase and then test them to make the process a bit faster. &lt;br /&gt;
&lt;br /&gt;
If the routing is not working as expected, there are some basic troubleshooting options. It’s important to remember the criteria for the routes; the bot must be within the radius of the route node when receiving the goal, and the route node must be set up to support the goal. The basic troubleshooting steps are:&lt;br /&gt;
&lt;br /&gt;
# Check in console when the map loads for any error messages. It should list any goal names not found when initializing the routes.&lt;br /&gt;
# Check the radius of the route where the bot receives the goal&lt;br /&gt;
# Make sure the bot can reach the goal &lt;br /&gt;
# Make sure the bot is getting the expected goal&lt;br /&gt;
&lt;br /&gt;
For numbers 2 and 3, consider using the command /bot debugbot all goals with only one bot connected. In console, it should give success / failure messages for short term and long term goals. An example of a known problem is if there are priority type goals (like radar parts stealing) that are active when they aren’t reachable. The solution is to set them to be not active in OnMapLoad if they are unreachable.&lt;br /&gt;
&lt;br /&gt;
===Step 5: Adding priorities to routes===&lt;br /&gt;
&lt;br /&gt;
In some cases, you may want bots to use a certain route more often than others. This can be done by adding a “weight” to the route table:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 ROUTE_as_right =&lt;br /&gt;
 {&lt;br /&gt;
     Weight = 2,&lt;br /&gt;
     ROUTE_as_rightsplit1 = {},&lt;br /&gt;
     ROUTE_as_rightsplit2 =&lt;br /&gt;
     {&lt;br /&gt;
 	  Weight = 2,&lt;br /&gt;
 	  ROUTE_depotflank = {},&lt;br /&gt;
     },&lt;br /&gt;
 },&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this example, the bots will randomly choose to go to route as_right twice as much as route depotgate. And then they will choose to go to route as_rightsplit2 twice as much as route as_rightsplit1.&lt;br /&gt;
&lt;br /&gt;
===Step 6: Copying routes===&lt;br /&gt;
&lt;br /&gt;
If you have more than one goal that you want to share the same routing with, you can copy the routing. In the Goldrush example, say we have some attack goals in the yard that we want to route to. Rather than writing out the tables for each attack goal, we can copy them like this:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 MapRoutes[&amp;quot;ATTACK_Depot_.*&amp;quot;] = MapRoutes.BUILD_tank;&lt;br /&gt;
 MapRoutes.MOUNT_tank = MapRoutes.BUILD_Tank;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The key point to remember when doing this is that the route table that exists must be on the right side of the equation. In this case, we have created routes for multiple attack goals and a mount goal that are the same as our example routing to build the tank.&lt;br /&gt;
&lt;br /&gt;
These should be placed in InitializeRoutes as well, below the Maproutes table and above the Util function that registers the routes:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 global InitializeRoutes = function()&lt;br /&gt;
 {&lt;br /&gt;
     MapRoutes =&lt;br /&gt;
     {&lt;br /&gt;
         BUILD_Tank =&lt;br /&gt;
         {&lt;br /&gt;
 	&lt;br /&gt;
         },&lt;br /&gt;
     };&lt;br /&gt;
   &lt;br /&gt;
     MapRoutes[&amp;quot;ATTACK_Depot_.*&amp;quot;] = MapRoutes.BUILD_tank;&lt;br /&gt;
     MapRoutes.MOUNT_tank = MapRoutes.BUILD_Tank;&lt;br /&gt;
   &lt;br /&gt;
     Util.Routes(MapRoutes);&lt;br /&gt;
 };&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can also store shared routes to a local variable and then use it for several goals:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
	r = {&lt;br /&gt;
		ROUTE_city1 = {},&lt;br /&gt;
		ROUTE_city2 = {},&lt;br /&gt;
		ROUTE_city3 = {},&lt;br /&gt;
	};&lt;br /&gt;
	MapRoutes =&lt;br /&gt;
	{&lt;br /&gt;
		FLAG_Gold_Bars =&lt;br /&gt;
		{&lt;br /&gt;
			ROUTE_spawn = r&lt;br /&gt;
		},&lt;br /&gt;
		CAPPOINT_gold =&lt;br /&gt;
		{&lt;br /&gt;
			ROUTE_gold = r&lt;br /&gt;
		},&lt;br /&gt;
	};&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If there are shared routes within one goal, then don&#039;t copy them. Just define them once:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
	MapRoutes =&lt;br /&gt;
	{&lt;br /&gt;
		PLANT_Gun =&lt;br /&gt;
		{&lt;br /&gt;
			ROUTE_spawn =&lt;br /&gt;
			{&lt;br /&gt;
				ROUTE_door =&lt;br /&gt;
				{&lt;br /&gt;
					ROUTE_hatch =&lt;br /&gt;
					{&lt;br /&gt;
						ROUTE_eastdoor = {},&lt;br /&gt;
						ROUTE_westdoor = {},&lt;br /&gt;
					},&lt;br /&gt;
					ROUTE_stairs =&lt;br /&gt;
					{&lt;br /&gt;
						ROUTE_westladder = {},&lt;br /&gt;
						ROUTE_eastladder = {},&lt;br /&gt;
					},&lt;br /&gt;
				},&lt;br /&gt;
				ROUTE_radar =&lt;br /&gt;
				{&lt;br /&gt;
					ROUTE_hatch = {},&lt;br /&gt;
					ROUTE_stairs = {},&lt;br /&gt;
				},&lt;br /&gt;
			},&lt;br /&gt;
		},&lt;br /&gt;
	};&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
If a bot chooses path ROUTE_spawn -&amp;gt; ROUTE_radar -&amp;gt; ROUTE_hatch, then he will continue to ROUTE_eastdoor or ROUTE_westdoor.&lt;br /&gt;
&lt;br /&gt;
===Step 7: Toggling routes===&lt;br /&gt;
&lt;br /&gt;
Routes are treated very similar to map goals. They will show up in your list if you do a /bot show_goals. They can be turned on and off via scripting with the SetAvailableMapGoals function. As an example, say we have route that we want opened up when barrier is destroyed, then closed when that barrier is constructed. This can be done inside the OnTriggers for those events:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  Barrier_construct = function ()&lt;br /&gt;
  {&lt;br /&gt;
  	Util.DisableGoal( &amp;quot;ROUTE_routname&amp;quot; ); &lt;br /&gt;
  };&lt;br /&gt;
  &lt;br /&gt;
  Barrier_destroyed = function ()&lt;br /&gt;
  {&lt;br /&gt;
  	Util.EnableGoal( &amp;quot;ROUTE_routname&amp;quot; ); &lt;br /&gt;
  };&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Step 8: Route maker===&lt;br /&gt;
* Windows users can use the route maker tool to easily create the MapRoutes table.&lt;br /&gt;
* Download it from http://svn.assembla.com/svn/omnibot/Enemy-Territory/0.8/tools/route_tool/&lt;br /&gt;
* Extract both RouteMaker.zip and RouteMaker2.zip into the same folder.&lt;br /&gt;
* Run RouteMaker2.exe&lt;br /&gt;
* You must set rcon password on your Enemy Territory or RTCW server.&lt;br /&gt;
* Then use menu command File / Load From RCON&lt;br /&gt;
* Drag &amp;amp; drop goals from left panel into middle panel.&lt;br /&gt;
* Drag &amp;amp; drop routes from right panel into middle panel.&lt;br /&gt;
* Double-click to delete routes.&lt;br /&gt;
* Finally use menu command Write / Script&lt;br /&gt;
* Output script will be copied to the clipboard. Paste it into the InitializeRoutes function in your map gm script.&lt;br /&gt;
&lt;br /&gt;
===Step 9: Ask for help===&lt;br /&gt;
&lt;br /&gt;
If you are having trouble with the syntax, set up, or understanding the routing system, ask for help. This guide is by no means comprehensive and complex maps will offer different challenges. Please post in the forums if you have questions / problems / bug reports.&lt;/div&gt;</summary>
		<author><name>Palota</name></author>
	</entry>
	<entry>
		<id>https://mygamingtalk.com/wiki/index.php?title=Template:Baserouting&amp;diff=1781</id>
		<title>Template:Baserouting</title>
		<link rel="alternate" type="text/html" href="https://mygamingtalk.com/wiki/index.php?title=Template:Baserouting&amp;diff=1781"/>
		<updated>2025-06-23T07:28:57Z</updated>

		<summary type="html">&lt;p&gt;Palota: /* Step 3: Scripting the routes */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:ET|Routing]]&lt;br /&gt;
[[Category:Doom 3|Routing]]&lt;br /&gt;
[[Category:Quake 4|Routing]]&lt;br /&gt;
[[Category:RTCW|Routing]]&lt;br /&gt;
[[Category:Waypointing]]&lt;br /&gt;
==Routing Overview==&lt;br /&gt;
&lt;br /&gt;
Until version 0.65, omni-bot path selection relied on the shortest path to a goal. While this typically provided for very focused attacks, game play became very predictable. The solution is Routing. Routing provides alternate goals for the bots to go to before heading to their main goal. When positioned correctly, these alternate goals provide the effect of bots choosing realistic and varied paths to their main goals.&lt;br /&gt;
&lt;br /&gt;
Routing requires some setup in script and in the waypoints, but the results are worth the effort.  The objective of this article is to provide an overview of how the routing system works and to clearly define how to set it up by walking through a working example on Goldrush.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:Gr_routes2.jpg|Goldrush Multiple Routes Example]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In this picture, Squares are route nodes and the Dots are potential paths. The color of the Dots correspond to the color of the Route nodes. Once they reach a route node, they will travel along the path(s) of the same color IF the route node is set up for their current main goal.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Walking through the picture, let’s say the tank construction goal is set up for an allied engineer within the AllySpawn route nodes, and that the engineer has the tank construct as its goal. The engineer will randomly choose whether to go to the green route node (as_right) or the yellow route node (depotgate). For the purpose of this example, let’s say the bot chose to go to the green route node. From there, he will randomly choose to go to the white or red route node.  The bot will continue to make these decisions until there are no route nodes left to go to. From that point, the bot will take the shortest path to the tank construct goal.&lt;br /&gt;
As you can see, this opens up several different points of attack for the bots; which creates a sense of realism in terms of predictability. Defenses will now need to be set up to be able to react to all of the entry points rather than focusing on easily predicted choke points if the shortest path is always used.&lt;br /&gt;
&lt;br /&gt;
==Setting It Up==&lt;br /&gt;
&lt;br /&gt;
Setting up Routes involves waypointing and scripting. This section will take you step by step through the process of setting up the routes in the Goldrush example. &lt;br /&gt;
&lt;br /&gt;
===Step 1: Setting up the script===&lt;br /&gt;
&lt;br /&gt;
The first requirement for routing is that the routes are defined in the map script. The method to do this consists of building a table for the routes and calling a utility function that will register the routes.&lt;br /&gt;
&lt;br /&gt;
If a map script does not exist yet, open up your favorite text editor and add the following to a new file:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 global InitializeRoutes = function()&lt;br /&gt;
 {&lt;br /&gt;
 }; &amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Save the file as &amp;lt;mapname&amp;gt;.gm in your Omni-Bot\et\nav folder. You are now ready to start building the routes.  Inside the InitializeRoutes function is where the route definitions are placed and they all start with a basic layout:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 global InitializeRoutes = function()&lt;br /&gt;
 {&lt;br /&gt;
     MapRoutes =&lt;br /&gt;
     {&lt;br /&gt;
     };&lt;br /&gt;
  &lt;br /&gt;
     Util.Routes(MapRoutes);&lt;br /&gt;
 }; &amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You now have a MapRoutes table defined and are registering everything within that table with the Util.Routes function.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Step 2: Adding route goal ===&lt;br /&gt;
&lt;br /&gt;
Route goals are fairly straight forward. They have two important properties; route name and radius. You can use any name you want for the route nodes, but they should be somewhat intuitive. To see the full guide on adding route goals see the [[Route_Goal]] page.&lt;br /&gt;
&lt;br /&gt;
Route goals are placed in positions where a bot might receive the goal you want them to use alternate paths for. The bot MUST be inside the route node radius when receiving a goal for it to work. Spawn points are good spots for route nodes because bots always receive a goal when they spawn. &lt;br /&gt;
&lt;br /&gt;
In the spawns area you need to place the goal over the spawn positions and give it a large radius to cover the spawn points. Issue the following commands in console:&lt;br /&gt;
&lt;br /&gt;
  /bot show_spawns&lt;br /&gt;
  /bot goal_create route AllySpawn&lt;br /&gt;
  /bot goal_setproperty radius 500&lt;br /&gt;
&lt;br /&gt;
The radius of the route nodes at spawn positions are very critical because the bots must be inside its radius for it to work. Be sure that the radius covers the entire spawn area. Bots do not always receive goals immediately at spawn. Sometimes they receive goals 2 seconds after spawn. That&#039;s why it&#039;s always better to set bigger radius. But be careful, route nodes must not overlap. &lt;br /&gt;
&lt;br /&gt;
For routing to be effective, you will need at least two defined because once they reach the route node, they will take the shortest path to their goal UNLESS there is another route node set up for them to go to. Continuing with our example, create a route node where the green square is in the picture and name it as_right:&lt;br /&gt;
&lt;br /&gt;
  /bot goal_create route as_right&lt;br /&gt;
&lt;br /&gt;
You now have two route nodes; meeting the requirement for working routes. In our example, we want the bots to use two paths from the spawn, so add the route node depicted by the yellow square at the depot gate:&lt;br /&gt;
&lt;br /&gt;
  /bot goal_create route depotgate&lt;br /&gt;
&lt;br /&gt;
Be sure to save the goals at this point. The next step is to set up the goals and route node selection in the script.&lt;br /&gt;
&lt;br /&gt;
  /bot goal_save&lt;br /&gt;
&lt;br /&gt;
===Step 3: Scripting the routes===&lt;br /&gt;
&lt;br /&gt;
The Maproutes table is set up with the following format:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  MapRoutes =&lt;br /&gt;
  {&lt;br /&gt;
      GOALNAME1 =&lt;br /&gt;
      {&lt;br /&gt;
          ROUTE_NAME = {},&lt;br /&gt;
      },&lt;br /&gt;
      GOALNAME2 =&lt;br /&gt;
      {&lt;br /&gt;
          ROUTE_NAME = {},&lt;br /&gt;
      },&lt;br /&gt;
  };&lt;br /&gt;
  MapRoutes[&amp;quot;GOALNAME3.*&amp;quot;] =&lt;br /&gt;
  {&lt;br /&gt;
      ROUTE_NAME = {},&lt;br /&gt;
  };&lt;br /&gt;
  MapRoutes[&amp;quot;GOALNAME4.*&amp;quot;] =&lt;br /&gt;
  {&lt;br /&gt;
      ROUTE_NAME = {},&lt;br /&gt;
  };&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you are new to map scripting, this may appear a bit intimidating. The key is to follow the steps and syntax exactly, then let the understanding of the syntax come naturally. If you are comfortable with gm scripting, the routing set up consists of nested tables. &lt;br /&gt;
&lt;br /&gt;
&amp;quot;GOALNAME3.*&amp;quot; is a regular expression which matches multiple goals.  It is usually used for ATTACK and DEFEND goals. For example, regular expression &amp;quot;ATTACK_Depot.*&amp;quot; matches goals ATTACK_Depot1, ATTACK_Depot2, ATTACK_Depot3, etc. Regular expression &amp;quot;ATTACK_Depot[25]&amp;quot; matches goals ATTACK_Depot2 and ATTACK_Depot5. Routes for regular expressions have special syntax and they must be defined after the initial MapRoutes table.&lt;br /&gt;
&lt;br /&gt;
The goal names and route names must match the output from command /bot show_goals. Be sure to double check the goal names. Route names are case sensitive.&lt;br /&gt;
&lt;br /&gt;
For the Goldrush example, set up the tank construct routing as follows:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 global InitializeRoutes = function()&lt;br /&gt;
 {&lt;br /&gt;
 	MapRoutes =&lt;br /&gt;
 	{&lt;br /&gt;
 		BUILD_tank =&lt;br /&gt;
 		{&lt;br /&gt;
 			ROUTE_AllySpawn = {},&lt;br /&gt;
 		},&lt;br /&gt;
 	};&lt;br /&gt;
 &lt;br /&gt;
 	Util.Routes(MapRoutes);&lt;br /&gt;
 }; &amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The AllySpawn route node is now a valid route node for the tank construct goal. If a bot spawns within its radius and receives the tank construct as a goal, it will use that route node. In and of itself, this route node will not do anything because at spawn the bot is already at it. So let’s add the two path options we want to give the bots from the Allied Spawn:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
global InitializeRoutes = function()&lt;br /&gt;
{&lt;br /&gt;
    MapRoutes =&lt;br /&gt;
    {&lt;br /&gt;
        BUILD_tank =&lt;br /&gt;
        {&lt;br /&gt;
            ROUTE_AllySpawn =&lt;br /&gt;
            {&lt;br /&gt;
                ROUTE_as_right = {},&lt;br /&gt;
                ROUTE_depotgate = {},&lt;br /&gt;
            },&lt;br /&gt;
        },&lt;br /&gt;
    };&lt;br /&gt;
&lt;br /&gt;
    Util.Routes(MapRoutes);&lt;br /&gt;
}; &amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It’s important to understand what we just did with this:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 ROUTE_AllySpawn = &lt;br /&gt;
 {&lt;br /&gt;
     ROUTE_as_right = {},&lt;br /&gt;
     ROUTE_depotgate = {},&lt;br /&gt;
 },&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The bot reaches the AllySpawn route node by default when it spawns; and because we have added the two routes inside the brackets, the bots will randomly choose between them. At this point, you have randomized routes for Allied engineers with the tank construct goal. Half the time they will choose to go to route as_right and half the time they will choose to go to route depotgate.&lt;br /&gt;
&lt;br /&gt;
Let’s make them even less predictable. Looking at the example picture, you can see that we want them to have a couple different options once they reach the route nodes we just set up. Repeating step 2, add the rest of the route nodes depicted by the colored squares.&lt;br /&gt;
&lt;br /&gt;
The scripting for the path options in the picture is as follows:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 global InitializeRoutes = function()&lt;br /&gt;
 {&lt;br /&gt;
     MapRoutes =&lt;br /&gt;
     {&lt;br /&gt;
         BUILD_tank =&lt;br /&gt;
         {&lt;br /&gt;
             ROUTE_AllySpawn = &lt;br /&gt;
             {    &lt;br /&gt;
                 ROUTE_as_right =&lt;br /&gt;
                 {&lt;br /&gt;
                     ROUTE_as_rightsplit1 = {},&lt;br /&gt;
                     ROUTE_as_rightsplit2 =&lt;br /&gt;
                     {&lt;br /&gt;
                         ROUTE_depotflank = {},&lt;br /&gt;
                     },&lt;br /&gt;
                 },&lt;br /&gt;
                 ROUTE_depotgate = &lt;br /&gt;
                 {&lt;br /&gt;
                     ROUTE_cproute = {},&lt;br /&gt;
                     ROUTE_depotgatesplit = {},&lt;br /&gt;
                     ROUTE_as_rightsplit1 = {},&lt;br /&gt;
                 },&lt;br /&gt;
             },&lt;br /&gt;
         },&lt;br /&gt;
     };&lt;br /&gt;
 &lt;br /&gt;
     Util.Routes(Maproutes);&lt;br /&gt;
 }; &amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Step 4: Testing the routes===&lt;br /&gt;
&lt;br /&gt;
Testing the routes is by far the most important step. It is recommended that you test routes individually as you start to learn the routing system. Once you are comfortable with the setup, you may want to add routes for an entire phase and then test them to make the process a bit faster. &lt;br /&gt;
&lt;br /&gt;
If the routing is not working as expected, there are some basic troubleshooting options. It’s important to remember the criteria for the routes; the bot must be within the radius of the route node when receiving the goal, and the route node must be set up to support the goal. The basic troubleshooting steps are:&lt;br /&gt;
&lt;br /&gt;
# Check in console when the map loads for any error messages. It should list any goal names not found when initializing the routes.&lt;br /&gt;
# Check the radius of the route where the bot receives the goal&lt;br /&gt;
# Make sure the bot can reach the goal &lt;br /&gt;
# Make sure the bot is getting the expected goal&lt;br /&gt;
&lt;br /&gt;
For numbers 2 and 3, consider using the command /bot debugbot all goals with only one bot connected. In console, it should give success / failure messages for short term and long term goals. An example of a known problem is if there are priority type goals (like radar parts stealing) that are active when they aren’t reachable. The solution is to set them to be not active in OnMapLoad if they are unreachable.&lt;br /&gt;
&lt;br /&gt;
===Step 5: Adding priorities to routes===&lt;br /&gt;
&lt;br /&gt;
In some cases, you may want bots to use a certain route more often than others. This can be done by adding a “weight” to the route table:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 ROUTE_as_right =&lt;br /&gt;
 {&lt;br /&gt;
     Weight = 2,&lt;br /&gt;
     ROUTE_as_rightsplit1 = {},&lt;br /&gt;
     ROUTE_as_rightsplit2 =&lt;br /&gt;
     {&lt;br /&gt;
 	  Weight = 2,&lt;br /&gt;
 	  ROUTE_depotflank = {},&lt;br /&gt;
     },&lt;br /&gt;
 },&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this example, the bots will randomly choose to go to route as_right twice as much as route depotgate. And then they will choose to go to route as_rightsplit2 twice as much as route as_rightsplit1.&lt;br /&gt;
&lt;br /&gt;
===Step 6: Copying routes===&lt;br /&gt;
&lt;br /&gt;
If you have more than one goal that you want to share the same routing with, you can copy the routing. In the Goldrush example, say we have some attack goals in the yard that we want to route to. Rather than writing out the tables for each attack goal, we can copy them like this:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 MapRoutes[&amp;quot;ATTACK_Depot_.*&amp;quot;] = MapRoutes.BUILD_tank;&lt;br /&gt;
 MapRoutes.MOUNT_tank = MapRoutes.BUILD_Tank;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The key point to remember when doing this is that the route table that exists must be on the right side of the equation. In this case, we have created routes for multiple attack goals and a mount goal that are the same as our example routing to build the tank.&lt;br /&gt;
&lt;br /&gt;
These should be placed in OnMapLoad as well, below the Maproutes table and above the Utility function that registers the routes:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 global InitializeRoutes = function()&lt;br /&gt;
 {&lt;br /&gt;
     MapRoutes =&lt;br /&gt;
     {&lt;br /&gt;
         BUILD_Tank =&lt;br /&gt;
         {&lt;br /&gt;
 	&lt;br /&gt;
         },&lt;br /&gt;
     };&lt;br /&gt;
   &lt;br /&gt;
     MapRoutes[&amp;quot;ATTACK_Depot_.*&amp;quot;] = MapRoutes.BUILD_tank;&lt;br /&gt;
     MapRoutes.MOUNT_tank = MapRoutes.BUILD_Tank;&lt;br /&gt;
   &lt;br /&gt;
     Util.Routes(MapRoutes);&lt;br /&gt;
 };&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Step 7: Toggling routes===&lt;br /&gt;
&lt;br /&gt;
Routes are treated very similar to map goals. They will show up in your list if you do a /bot show_goals. They can be turned on and off via scripting with the SetAvailableMapGoals function. As an example, say we have route that we want opened up when barrier is destroyed, then closed when that barrier is constructed. This can be done inside the OnTriggers for those events:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  Barrier_construct = function ()&lt;br /&gt;
  {&lt;br /&gt;
  	Util.DisableGoal( &amp;quot;ROUTE_routname&amp;quot; ); &lt;br /&gt;
  };&lt;br /&gt;
  &lt;br /&gt;
  Barrier_destroyed = function ()&lt;br /&gt;
  {&lt;br /&gt;
  	Util.EnableGoal( &amp;quot;ROUTE_routname&amp;quot; ); &lt;br /&gt;
  };&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Step 8: Route maker===&lt;br /&gt;
* Windows users can use the route maker tool to easily create the MapRoutes table.&lt;br /&gt;
* Download it from http://svn.assembla.com/svn/omnibot/Enemy-Territory/0.8/tools/route_tool/&lt;br /&gt;
* Extract both RouteMaker.zip and RouteMaker2.zip into the same folder.&lt;br /&gt;
* Run RouteMaker2.exe&lt;br /&gt;
* You must set rcon password on your Enemy Territory or RTCW server.&lt;br /&gt;
* Then use menu command File / Load From RCON&lt;br /&gt;
* Drag &amp;amp; drop goals from left panel into middle panel.&lt;br /&gt;
* Drag &amp;amp; drop routes from right panel into middle panel.&lt;br /&gt;
* Double-click to delete routes.&lt;br /&gt;
* Finally use menu command Write / Script&lt;br /&gt;
* Output script will be copied to the clipboard. Paste it into the InitializeRoutes function in your map gm script.&lt;br /&gt;
&lt;br /&gt;
===Step 9: Ask for help===&lt;br /&gt;
&lt;br /&gt;
If you are having trouble with the syntax, set up, or understanding the routing system, ask for help. This guide is by no means comprehensive and complex maps will offer different challenges. Please post in the forums if you have questions / problems / bug reports.&lt;/div&gt;</summary>
		<author><name>Palota</name></author>
	</entry>
	<entry>
		<id>https://mygamingtalk.com/wiki/index.php?title=Template:Baserouting&amp;diff=1780</id>
		<title>Template:Baserouting</title>
		<link rel="alternate" type="text/html" href="https://mygamingtalk.com/wiki/index.php?title=Template:Baserouting&amp;diff=1780"/>
		<updated>2025-06-23T06:55:00Z</updated>

		<summary type="html">&lt;p&gt;Palota: /* Step 3: Scripting the routes */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:ET|Routing]]&lt;br /&gt;
[[Category:Doom 3|Routing]]&lt;br /&gt;
[[Category:Quake 4|Routing]]&lt;br /&gt;
[[Category:RTCW|Routing]]&lt;br /&gt;
[[Category:Waypointing]]&lt;br /&gt;
==Routing Overview==&lt;br /&gt;
&lt;br /&gt;
Until version 0.65, omni-bot path selection relied on the shortest path to a goal. While this typically provided for very focused attacks, game play became very predictable. The solution is Routing. Routing provides alternate goals for the bots to go to before heading to their main goal. When positioned correctly, these alternate goals provide the effect of bots choosing realistic and varied paths to their main goals.&lt;br /&gt;
&lt;br /&gt;
Routing requires some setup in script and in the waypoints, but the results are worth the effort.  The objective of this article is to provide an overview of how the routing system works and to clearly define how to set it up by walking through a working example on Goldrush.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:Gr_routes2.jpg|Goldrush Multiple Routes Example]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In this picture, Squares are route nodes and the Dots are potential paths. The color of the Dots correspond to the color of the Route nodes. Once they reach a route node, they will travel along the path(s) of the same color IF the route node is set up for their current main goal.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Walking through the picture, let’s say the tank construction goal is set up for an allied engineer within the AllySpawn route nodes, and that the engineer has the tank construct as its goal. The engineer will randomly choose whether to go to the green route node (as_right) or the yellow route node (depotgate). For the purpose of this example, let’s say the bot chose to go to the green route node. From there, he will randomly choose to go to the white or red route node.  The bot will continue to make these decisions until there are no route nodes left to go to. From that point, the bot will take the shortest path to the tank construct goal.&lt;br /&gt;
As you can see, this opens up several different points of attack for the bots; which creates a sense of realism in terms of predictability. Defenses will now need to be set up to be able to react to all of the entry points rather than focusing on easily predicted choke points if the shortest path is always used.&lt;br /&gt;
&lt;br /&gt;
==Setting It Up==&lt;br /&gt;
&lt;br /&gt;
Setting up Routes involves waypointing and scripting. This section will take you step by step through the process of setting up the routes in the Goldrush example. &lt;br /&gt;
&lt;br /&gt;
===Step 1: Setting up the script===&lt;br /&gt;
&lt;br /&gt;
The first requirement for routing is that the routes are defined in the map script. The method to do this consists of building a table for the routes and calling a utility function that will register the routes.&lt;br /&gt;
&lt;br /&gt;
If a map script does not exist yet, open up your favorite text editor and add the following to a new file:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 global InitializeRoutes = function()&lt;br /&gt;
 {&lt;br /&gt;
 }; &amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Save the file as &amp;lt;mapname&amp;gt;.gm in your Omni-Bot\et\nav folder. You are now ready to start building the routes.  Inside the InitializeRoutes function is where the route definitions are placed and they all start with a basic layout:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 global InitializeRoutes = function()&lt;br /&gt;
 {&lt;br /&gt;
     MapRoutes =&lt;br /&gt;
     {&lt;br /&gt;
     };&lt;br /&gt;
  &lt;br /&gt;
     Util.Routes(MapRoutes);&lt;br /&gt;
 }; &amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You now have a MapRoutes table defined and are registering everything within that table with the Util.Routes function.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Step 2: Adding route goal ===&lt;br /&gt;
&lt;br /&gt;
Route goals are fairly straight forward. They have two important properties; route name and radius. You can use any name you want for the route nodes, but they should be somewhat intuitive. To see the full guide on adding route goals see the [[Route_Goal]] page.&lt;br /&gt;
&lt;br /&gt;
Route goals are placed in positions where a bot might receive the goal you want them to use alternate paths for. The bot MUST be inside the route node radius when receiving a goal for it to work. Spawn points are good spots for route nodes because bots always receive a goal when they spawn. &lt;br /&gt;
&lt;br /&gt;
In the spawns area you need to place the goal over the spawn positions and give it a large radius to cover the spawn points. Issue the following commands in console:&lt;br /&gt;
&lt;br /&gt;
  /bot show_spawns&lt;br /&gt;
  /bot goal_create route AllySpawn&lt;br /&gt;
  /bot goal_setproperty radius 500&lt;br /&gt;
&lt;br /&gt;
The radius of the route nodes at spawn positions are very critical because the bots must be inside its radius for it to work. Be sure that the radius covers the entire spawn area. Bots do not always receive goals immediately at spawn. Sometimes they receive goals 2 seconds after spawn. That&#039;s why it&#039;s always better to set bigger radius. But be careful, route nodes must not overlap. &lt;br /&gt;
&lt;br /&gt;
For routing to be effective, you will need at least two defined because once they reach the route node, they will take the shortest path to their goal UNLESS there is another route node set up for them to go to. Continuing with our example, create a route node where the green square is in the picture and name it as_right:&lt;br /&gt;
&lt;br /&gt;
  /bot goal_create route as_right&lt;br /&gt;
&lt;br /&gt;
You now have two route nodes; meeting the requirement for working routes. In our example, we want the bots to use two paths from the spawn, so add the route node depicted by the yellow square at the depot gate:&lt;br /&gt;
&lt;br /&gt;
  /bot goal_create route depotgate&lt;br /&gt;
&lt;br /&gt;
Be sure to save the goals at this point. The next step is to set up the goals and route node selection in the script.&lt;br /&gt;
&lt;br /&gt;
  /bot goal_save&lt;br /&gt;
&lt;br /&gt;
===Step 3: Scripting the routes===&lt;br /&gt;
&lt;br /&gt;
The Maproutes table is set up with the following format:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  MapRoutes =&lt;br /&gt;
  {&lt;br /&gt;
      GOALNAME =&lt;br /&gt;
      {&lt;br /&gt;
          ROUTNAME = {},&lt;br /&gt;
      },&lt;br /&gt;
      GOALNAME2 =&lt;br /&gt;
      {&lt;br /&gt;
          ROUTENAME = {},&lt;br /&gt;
      },&lt;br /&gt;
  };&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you are new to map scripting, this may appear a bit intimidating. The key is to follow the steps and syntax exactly, then let the understanding of the syntax come naturally. If you are comfortable with gm scripting, the routing set up consists of nested tables. &lt;br /&gt;
&lt;br /&gt;
The goal name must match the output from show_goals and the route name is the waypoint name prepended with ROUTE_. For the Goldrush example, set up the tank construct routing as follows:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 global InitializeRoutes = function()&lt;br /&gt;
 {&lt;br /&gt;
 	MapRoutes =&lt;br /&gt;
 	{&lt;br /&gt;
 		BUILD_tank =&lt;br /&gt;
 		{&lt;br /&gt;
 		},&lt;br /&gt;
 	};&lt;br /&gt;
 &lt;br /&gt;
 	Util.Routes(MapRoutes);&lt;br /&gt;
 }; &amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You have just added a map goal to the Maproutes table. The syntax of the goal name is VERY important. Be sure to double check the goal name with /bot show_goals. Once you are sure the goal name is correct, you can add the route nodes:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 global InitializeRoutes = function()&lt;br /&gt;
 {&lt;br /&gt;
 	MapRoutes =&lt;br /&gt;
 	{&lt;br /&gt;
 		BUILD_tank =&lt;br /&gt;
 		{&lt;br /&gt;
 			ROUTE_AllySpawn = {},&lt;br /&gt;
 		},&lt;br /&gt;
 	};&lt;br /&gt;
 &lt;br /&gt;
 	Util.Routes(MapRoutes);&lt;br /&gt;
 }; &amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The AllySpawn route node is now a valid route node for the tank construct goal. If a bot spawns within its radius and receives the tank construct as a goal, it will use that route node. In and of itself, this route node will not do anything because at spawn the bot is already at it. So let’s add the two path options we want to give the bots from the Allied Spawn:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
global InitializeRoutes = function()&lt;br /&gt;
{&lt;br /&gt;
    MapRoutes =&lt;br /&gt;
    {&lt;br /&gt;
        BUILD_tank =&lt;br /&gt;
        {&lt;br /&gt;
            ROUTE_AllySpawn =&lt;br /&gt;
            {&lt;br /&gt;
                ROUTE_as_right = {},&lt;br /&gt;
                ROUTE_depotgate = {},&lt;br /&gt;
            },&lt;br /&gt;
        },&lt;br /&gt;
    };&lt;br /&gt;
&lt;br /&gt;
    Util.Routes(MapRoutes);&lt;br /&gt;
}; &amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It’s important to understand what we just did with this:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 ROUTE_AllySpawn = &lt;br /&gt;
 {&lt;br /&gt;
     ROUTE_as_right = {},&lt;br /&gt;
     ROUTE_depotgate = {},&lt;br /&gt;
 },&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The bot reaches the AllySpawn route node by default when it spawns; and because we have added the two routes inside the brackets, the bots will randomly choose between them. At this point, you have randomized routes for Allied engineers with the tank construct goal. Half the time they will choose to go to route as_right and half the time they will choose to go to route depotgate.&lt;br /&gt;
&lt;br /&gt;
Let’s make them even less predictable. Looking at the example picture, you can see that we want them to have a couple different options once they reach the route nodes we just set up. Repeating step 2, add the rest of the route nodes depicted by the colored squares.&lt;br /&gt;
&lt;br /&gt;
The scripting for the path options in the picture is as follows:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 global InitializeRoutes = function()&lt;br /&gt;
 {&lt;br /&gt;
     MapRoutes =&lt;br /&gt;
     {&lt;br /&gt;
         BUILD_tank =&lt;br /&gt;
         {&lt;br /&gt;
             ROUTE_AllySpawn = &lt;br /&gt;
             {    &lt;br /&gt;
                 ROUTE_as_right =&lt;br /&gt;
                 {&lt;br /&gt;
                     ROUTE_as_rightsplit1 = {},&lt;br /&gt;
                     ROUTE_as_rightsplit2 =&lt;br /&gt;
                     {&lt;br /&gt;
                         ROUTE_depotflank = {},&lt;br /&gt;
                     },&lt;br /&gt;
                 },&lt;br /&gt;
                 ROUTE_depotgate = &lt;br /&gt;
                 {&lt;br /&gt;
                     ROUTE_cproute = {},&lt;br /&gt;
                     ROUTE_depotgatesplit = {},&lt;br /&gt;
                     ROUTE_as_rightsplit1 = {},&lt;br /&gt;
                 },&lt;br /&gt;
             },&lt;br /&gt;
         },&lt;br /&gt;
     };&lt;br /&gt;
 &lt;br /&gt;
     Util.Routes(Maproutes);&lt;br /&gt;
 }; &amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Step 4: Testing the routes===&lt;br /&gt;
&lt;br /&gt;
Testing the routes is by far the most important step. It is recommended that you test routes individually as you start to learn the routing system. Once you are comfortable with the setup, you may want to add routes for an entire phase and then test them to make the process a bit faster. &lt;br /&gt;
&lt;br /&gt;
If the routing is not working as expected, there are some basic troubleshooting options. It’s important to remember the criteria for the routes; the bot must be within the radius of the route node when receiving the goal, and the route node must be set up to support the goal. The basic troubleshooting steps are:&lt;br /&gt;
&lt;br /&gt;
# Check in console when the map loads for any error messages. It should list any goal names not found when initializing the routes.&lt;br /&gt;
# Check the radius of the route where the bot receives the goal&lt;br /&gt;
# Make sure the bot can reach the goal &lt;br /&gt;
# Make sure the bot is getting the expected goal&lt;br /&gt;
&lt;br /&gt;
For numbers 2 and 3, consider using the command /bot debugbot all goals with only one bot connected. In console, it should give success / failure messages for short term and long term goals. An example of a known problem is if there are priority type goals (like radar parts stealing) that are active when they aren’t reachable. The solution is to set them to be not active in OnMapLoad if they are unreachable.&lt;br /&gt;
&lt;br /&gt;
===Step 5: Adding priorities to routes===&lt;br /&gt;
&lt;br /&gt;
In some cases, you may want bots to use a certain route more often than others. This can be done by adding a “weight” to the route table:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 ROUTE_as_right =&lt;br /&gt;
 {&lt;br /&gt;
     Weight = 2,&lt;br /&gt;
     ROUTE_as_rightsplit1 = {},&lt;br /&gt;
     ROUTE_as_rightsplit2 =&lt;br /&gt;
     {&lt;br /&gt;
 	  Weight = 2,&lt;br /&gt;
 	  ROUTE_depotflank = {},&lt;br /&gt;
     },&lt;br /&gt;
 },&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this example, the bots will randomly choose to go to route as_right twice as much as route depotgate. And then they will choose to go to route as_rightsplit2 twice as much as route as_rightsplit1.&lt;br /&gt;
&lt;br /&gt;
===Step 6: Copying routes===&lt;br /&gt;
&lt;br /&gt;
If you have more than one goal that you want to share the same routing with, you can copy the routing. In the Goldrush example, say we have some attack goals in the yard that we want to route to. Rather than writing out the tables for each attack goal, we can copy them like this:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 MapRoutes[&amp;quot;ATTACK_Depot_.*&amp;quot;] = MapRoutes.BUILD_tank;&lt;br /&gt;
 MapRoutes.MOUNT_tank = MapRoutes.BUILD_Tank;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The key point to remember when doing this is that the route table that exists must be on the right side of the equation. In this case, we have created routes for multiple attack goals and a mount goal that are the same as our example routing to build the tank.&lt;br /&gt;
&lt;br /&gt;
These should be placed in OnMapLoad as well, below the Maproutes table and above the Utility function that registers the routes:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 global InitializeRoutes = function()&lt;br /&gt;
 {&lt;br /&gt;
     MapRoutes =&lt;br /&gt;
     {&lt;br /&gt;
         BUILD_Tank =&lt;br /&gt;
         {&lt;br /&gt;
 	&lt;br /&gt;
         },&lt;br /&gt;
     };&lt;br /&gt;
   &lt;br /&gt;
     MapRoutes[&amp;quot;ATTACK_Depot_.*&amp;quot;] = MapRoutes.BUILD_tank;&lt;br /&gt;
     MapRoutes.MOUNT_tank = MapRoutes.BUILD_Tank;&lt;br /&gt;
   &lt;br /&gt;
     Util.Routes(MapRoutes);&lt;br /&gt;
 };&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Step 7: Toggling routes===&lt;br /&gt;
&lt;br /&gt;
Routes are treated very similar to map goals. They will show up in your list if you do a /bot show_goals. They can be turned on and off via scripting with the SetAvailableMapGoals function. As an example, say we have route that we want opened up when barrier is destroyed, then closed when that barrier is constructed. This can be done inside the OnTriggers for those events:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  Barrier_construct = function ()&lt;br /&gt;
  {&lt;br /&gt;
  	Util.DisableGoal( &amp;quot;ROUTE_routname&amp;quot; ); &lt;br /&gt;
  };&lt;br /&gt;
  &lt;br /&gt;
  Barrier_destroyed = function ()&lt;br /&gt;
  {&lt;br /&gt;
  	Util.EnableGoal( &amp;quot;ROUTE_routname&amp;quot; ); &lt;br /&gt;
  };&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Step 8: Route maker===&lt;br /&gt;
* Windows users can use the route maker tool to easily create the MapRoutes table.&lt;br /&gt;
* Download it from http://svn.assembla.com/svn/omnibot/Enemy-Territory/0.8/tools/route_tool/&lt;br /&gt;
* Extract both RouteMaker.zip and RouteMaker2.zip into the same folder.&lt;br /&gt;
* Run RouteMaker2.exe&lt;br /&gt;
* You must set rcon password on your Enemy Territory or RTCW server.&lt;br /&gt;
* Then use menu command File / Load From RCON&lt;br /&gt;
* Drag &amp;amp; drop goals from left panel into middle panel.&lt;br /&gt;
* Drag &amp;amp; drop routes from right panel into middle panel.&lt;br /&gt;
* Double-click to delete routes.&lt;br /&gt;
* Finally use menu command Write / Script&lt;br /&gt;
* Output script will be copied to the clipboard. Paste it into the InitializeRoutes function in your map gm script.&lt;br /&gt;
&lt;br /&gt;
===Step 9: Ask for help===&lt;br /&gt;
&lt;br /&gt;
If you are having trouble with the syntax, set up, or understanding the routing system, ask for help. This guide is by no means comprehensive and complex maps will offer different challenges. Please post in the forums if you have questions / problems / bug reports.&lt;/div&gt;</summary>
		<author><name>Palota</name></author>
	</entry>
	<entry>
		<id>https://mygamingtalk.com/wiki/index.php?title=Template:Baserouting&amp;diff=1779</id>
		<title>Template:Baserouting</title>
		<link rel="alternate" type="text/html" href="https://mygamingtalk.com/wiki/index.php?title=Template:Baserouting&amp;diff=1779"/>
		<updated>2025-06-23T06:28:13Z</updated>

		<summary type="html">&lt;p&gt;Palota: /* Step 2: Adding route goal */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:ET|Routing]]&lt;br /&gt;
[[Category:Doom 3|Routing]]&lt;br /&gt;
[[Category:Quake 4|Routing]]&lt;br /&gt;
[[Category:RTCW|Routing]]&lt;br /&gt;
[[Category:Waypointing]]&lt;br /&gt;
==Routing Overview==&lt;br /&gt;
&lt;br /&gt;
Until version 0.65, omni-bot path selection relied on the shortest path to a goal. While this typically provided for very focused attacks, game play became very predictable. The solution is Routing. Routing provides alternate goals for the bots to go to before heading to their main goal. When positioned correctly, these alternate goals provide the effect of bots choosing realistic and varied paths to their main goals.&lt;br /&gt;
&lt;br /&gt;
Routing requires some setup in script and in the waypoints, but the results are worth the effort.  The objective of this article is to provide an overview of how the routing system works and to clearly define how to set it up by walking through a working example on Goldrush.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:Gr_routes2.jpg|Goldrush Multiple Routes Example]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In this picture, Squares are route nodes and the Dots are potential paths. The color of the Dots correspond to the color of the Route nodes. Once they reach a route node, they will travel along the path(s) of the same color IF the route node is set up for their current main goal.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Walking through the picture, let’s say the tank construction goal is set up for an allied engineer within the AllySpawn route nodes, and that the engineer has the tank construct as its goal. The engineer will randomly choose whether to go to the green route node (as_right) or the yellow route node (depotgate). For the purpose of this example, let’s say the bot chose to go to the green route node. From there, he will randomly choose to go to the white or red route node.  The bot will continue to make these decisions until there are no route nodes left to go to. From that point, the bot will take the shortest path to the tank construct goal.&lt;br /&gt;
As you can see, this opens up several different points of attack for the bots; which creates a sense of realism in terms of predictability. Defenses will now need to be set up to be able to react to all of the entry points rather than focusing on easily predicted choke points if the shortest path is always used.&lt;br /&gt;
&lt;br /&gt;
==Setting It Up==&lt;br /&gt;
&lt;br /&gt;
Setting up Routes involves waypointing and scripting. This section will take you step by step through the process of setting up the routes in the Goldrush example. &lt;br /&gt;
&lt;br /&gt;
===Step 1: Setting up the script===&lt;br /&gt;
&lt;br /&gt;
The first requirement for routing is that the routes are defined in the map script. The method to do this consists of building a table for the routes and calling a utility function that will register the routes.&lt;br /&gt;
&lt;br /&gt;
If a map script does not exist yet, open up your favorite text editor and add the following to a new file:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 global InitializeRoutes = function()&lt;br /&gt;
 {&lt;br /&gt;
 }; &amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Save the file as &amp;lt;mapname&amp;gt;.gm in your Omni-Bot\et\nav folder. You are now ready to start building the routes.  Inside the InitializeRoutes function is where the route definitions are placed and they all start with a basic layout:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 global InitializeRoutes = function()&lt;br /&gt;
 {&lt;br /&gt;
     MapRoutes =&lt;br /&gt;
     {&lt;br /&gt;
     };&lt;br /&gt;
  &lt;br /&gt;
     Util.Routes(MapRoutes);&lt;br /&gt;
 }; &amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You now have a MapRoutes table defined and are registering everything within that table with the Util.Routes function.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Step 2: Adding route goal ===&lt;br /&gt;
&lt;br /&gt;
Route goals are fairly straight forward. They have two important properties; route name and radius. You can use any name you want for the route nodes, but they should be somewhat intuitive. To see the full guide on adding route goals see the [[Route_Goal]] page.&lt;br /&gt;
&lt;br /&gt;
Route goals are placed in positions where a bot might receive the goal you want them to use alternate paths for. The bot MUST be inside the route node radius when receiving a goal for it to work. Spawn points are good spots for route nodes because bots always receive a goal when they spawn. &lt;br /&gt;
&lt;br /&gt;
In the spawns area you need to place the goal over the spawn positions and give it a large radius to cover the spawn points. Issue the following commands in console:&lt;br /&gt;
&lt;br /&gt;
  /bot show_spawns&lt;br /&gt;
  /bot goal_create route AllySpawn&lt;br /&gt;
  /bot goal_setproperty radius 500&lt;br /&gt;
&lt;br /&gt;
The radius of the route nodes at spawn positions are very critical because the bots must be inside its radius for it to work. Be sure that the radius covers the entire spawn area. Bots do not always receive goals immediately at spawn. Sometimes they receive goals 2 seconds after spawn. That&#039;s why it&#039;s always better to set bigger radius. But be careful, route nodes must not overlap. &lt;br /&gt;
&lt;br /&gt;
For routing to be effective, you will need at least two defined because once they reach the route node, they will take the shortest path to their goal UNLESS there is another route node set up for them to go to. Continuing with our example, create a route node where the green square is in the picture and name it as_right:&lt;br /&gt;
&lt;br /&gt;
  /bot goal_create route as_right&lt;br /&gt;
&lt;br /&gt;
You now have two route nodes; meeting the requirement for working routes. In our example, we want the bots to use two paths from the spawn, so add the route node depicted by the yellow square at the depot gate:&lt;br /&gt;
&lt;br /&gt;
  /bot goal_create route depotgate&lt;br /&gt;
&lt;br /&gt;
Be sure to save the goals at this point. The next step is to set up the goals and route node selection in the script.&lt;br /&gt;
&lt;br /&gt;
  /bot goal_save&lt;br /&gt;
&lt;br /&gt;
===Step 3: Scripting the routes===&lt;br /&gt;
&lt;br /&gt;
The Maproutes table is set up with the following format:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  MapRoutes =&lt;br /&gt;
  {&lt;br /&gt;
      GOALNAME =&lt;br /&gt;
      {&lt;br /&gt;
          ROUTNAME = {},&lt;br /&gt;
      },&lt;br /&gt;
      GOALNAME2 =&lt;br /&gt;
      {&lt;br /&gt;
          ROUTENAME = {},&lt;br /&gt;
      },&lt;br /&gt;
  };&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you are new to map scripting, this may appear a bit intimidating. The key is to follow the steps and syntax exactly, then let the understanding of the syntax come naturally. If you are comfortable with gm scripting, the routing set up consists of nested tables. &lt;br /&gt;
&lt;br /&gt;
The goal name must match the output from show_goals and the route name is the waypoint name prepended with ROUTE_. For the Goldrush example, set up the tank construct routing as follows:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 global InitializeRoutes = function()&lt;br /&gt;
 {&lt;br /&gt;
 	MapRoutes =&lt;br /&gt;
 	{&lt;br /&gt;
 		BUILD_tank_construct =&lt;br /&gt;
 		{&lt;br /&gt;
 		},&lt;br /&gt;
 	};&lt;br /&gt;
 &lt;br /&gt;
 	Util.Routes(MapRoutes);&lt;br /&gt;
 }; &amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You have just added a map goal to the Maproutes table. The syntax of the goal name is VERY important. Be sure to double check the goal name with /bot show_goals. Once you are sure the goal name is correct, you can add the route nodes:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 global InitializeRoutes = function()&lt;br /&gt;
 {&lt;br /&gt;
 	MapRoutes =&lt;br /&gt;
 	{&lt;br /&gt;
 		BUILD_tank_construct =&lt;br /&gt;
 		{&lt;br /&gt;
 			ROUTE_AllySpawn = {},&lt;br /&gt;
 		},&lt;br /&gt;
 	};&lt;br /&gt;
 &lt;br /&gt;
 	Util.Routes(MapRoutes);&lt;br /&gt;
 }; &amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The AllySpawn route node is now a valid route node for the tank construct goal. If a bot spawns within its radius and receives the tank construct as a goal, it will use that route node. In and of itself, this route node will not do anything because at spawn the bot is already at it. So let’s add the two path options we want to give the bots from the Allied Spawn:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
global InitializeRoutes = function()&lt;br /&gt;
{&lt;br /&gt;
    MapRoutes =&lt;br /&gt;
    {&lt;br /&gt;
        BUILD_tank_construct =&lt;br /&gt;
        {&lt;br /&gt;
            ROUTE_AllySpawn =&lt;br /&gt;
            {&lt;br /&gt;
                ROUTE_as_right = {},&lt;br /&gt;
                ROUTE_depotgate = {},&lt;br /&gt;
            },&lt;br /&gt;
        },&lt;br /&gt;
    };&lt;br /&gt;
&lt;br /&gt;
    Util.Routes(MapRoutes);&lt;br /&gt;
}; &amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It’s important to understand what we just did with this:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 ROUTE_AllySpawn = &lt;br /&gt;
 {&lt;br /&gt;
     ROUTE_as_right = {},&lt;br /&gt;
     ROUTE_depotgate = {},&lt;br /&gt;
 },&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The bot reaches the AllySpawn route node by default when it spawns; and because we have added the two routes inside the brackets, the bots will randomly choose between them. At this point, you have randomized routes for Allied engineers with the tank construct goal. Half the time they will choose to go to route as_right and half the time they will choose to go to route depotgate.&lt;br /&gt;
&lt;br /&gt;
Let’s make them even less predictable. Looking at the example picture, you can see that we want them to have a couple different options once they reach the route nodes we just set up. Repeating step 2, add the rest of the route nodes depicted by the colored squares.&lt;br /&gt;
&lt;br /&gt;
The scripting for the path options in the picture is as follows:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 global InitializeRoutes = function()&lt;br /&gt;
 {&lt;br /&gt;
     MapRoutes =&lt;br /&gt;
     {&lt;br /&gt;
         BUILD_tank_construct =&lt;br /&gt;
         {&lt;br /&gt;
             ROUTE_AllySpawn = &lt;br /&gt;
             {    &lt;br /&gt;
                 ROUTE_as_right =&lt;br /&gt;
                 {&lt;br /&gt;
                     ROUTE_as_rightsplit1 = {},&lt;br /&gt;
                     ROUTE_as_rightsplit2 =&lt;br /&gt;
                     {&lt;br /&gt;
                         ROUTE_depotflank = {},&lt;br /&gt;
                     },&lt;br /&gt;
                 },&lt;br /&gt;
                 ROUTE_depotgate = &lt;br /&gt;
                 {&lt;br /&gt;
                     ROUTE_cproute = {},&lt;br /&gt;
                     ROUTE_depotgatesplit = {},&lt;br /&gt;
                     ROUTE_as_rightsplit1 = {},&lt;br /&gt;
                 },&lt;br /&gt;
             },&lt;br /&gt;
         },&lt;br /&gt;
     };&lt;br /&gt;
 &lt;br /&gt;
     Util.Routes(Maproutes);&lt;br /&gt;
 }; &amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Step 4: Testing the routes===&lt;br /&gt;
&lt;br /&gt;
Testing the routes is by far the most important step. It is recommended that you test routes individually as you start to learn the routing system. Once you are comfortable with the setup, you may want to add routes for an entire phase and then test them to make the process a bit faster. &lt;br /&gt;
&lt;br /&gt;
If the routing is not working as expected, there are some basic troubleshooting options. It’s important to remember the criteria for the routes; the bot must be within the radius of the route node when receiving the goal, and the route node must be set up to support the goal. The basic troubleshooting steps are:&lt;br /&gt;
&lt;br /&gt;
# Check in console when the map loads for any error messages. It should list any goal names not found when initializing the routes.&lt;br /&gt;
# Check the radius of the route where the bot receives the goal&lt;br /&gt;
# Make sure the bot can reach the goal &lt;br /&gt;
# Make sure the bot is getting the expected goal&lt;br /&gt;
&lt;br /&gt;
For numbers 2 and 3, consider using the command /bot debugbot all goals with only one bot connected. In console, it should give success / failure messages for short term and long term goals. An example of a known problem is if there are priority type goals (like radar parts stealing) that are active when they aren’t reachable. The solution is to set them to be not active in OnMapLoad if they are unreachable.&lt;br /&gt;
&lt;br /&gt;
===Step 5: Adding priorities to routes===&lt;br /&gt;
&lt;br /&gt;
In some cases, you may want bots to use a certain route more often than others. This can be done by adding a “weight” to the route table:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 ROUTE_as_right =&lt;br /&gt;
 {&lt;br /&gt;
     Weight = 2,&lt;br /&gt;
     ROUTE_as_rightsplit1 = {},&lt;br /&gt;
     ROUTE_as_rightsplit2 =&lt;br /&gt;
     {&lt;br /&gt;
 	  Weight = 2,&lt;br /&gt;
 	  ROUTE_depotflank = {},&lt;br /&gt;
     },&lt;br /&gt;
 },&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this example, the bots will randomly choose to go to route as_right twice as much as route depotgate. And then they will choose to go to route as_rightsplit2 twice as much as route as_rightsplit1.&lt;br /&gt;
&lt;br /&gt;
===Step 6: Copying routes===&lt;br /&gt;
&lt;br /&gt;
If you have more than one goal that you want to share the same routing with, you can copy the routing. In the Goldrush example, say we have some attack goals in the yard that we want to route to. Rather than writing out the tables for each attack goal, we can copy them like this:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 MapRoutes[&amp;quot;ATTACK_Depot_.*&amp;quot;] = MapRoutes.BUILD_tank;&lt;br /&gt;
 MapRoutes.MOUNT_tank = MapRoutes.BUILD_Tank;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The key point to remember when doing this is that the route table that exists must be on the right side of the equation. In this case, we have created routes for multiple attack goals and a mount goal that are the same as our example routing to build the tank.&lt;br /&gt;
&lt;br /&gt;
These should be placed in OnMapLoad as well, below the Maproutes table and above the Utility function that registers the routes:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 global InitializeRoutes = function()&lt;br /&gt;
 {&lt;br /&gt;
     MapRoutes =&lt;br /&gt;
     {&lt;br /&gt;
         BUILD_Tank =&lt;br /&gt;
         {&lt;br /&gt;
 	&lt;br /&gt;
         },&lt;br /&gt;
     };&lt;br /&gt;
   &lt;br /&gt;
     MapRoutes[&amp;quot;ATTACK_Depot_.*&amp;quot;] = MapRoutes.BUILD_tank;&lt;br /&gt;
     MapRoutes.MOUNT_tank = MapRoutes.BUILD_Tank;&lt;br /&gt;
   &lt;br /&gt;
     Util.Routes(MapRoutes);&lt;br /&gt;
 };&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Step 7: Toggling routes===&lt;br /&gt;
&lt;br /&gt;
Routes are treated very similar to map goals. They will show up in your list if you do a /bot show_goals. They can be turned on and off via scripting with the SetAvailableMapGoals function. As an example, say we have route that we want opened up when barrier is destroyed, then closed when that barrier is constructed. This can be done inside the OnTriggers for those events:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  Barrier_construct = function ()&lt;br /&gt;
  {&lt;br /&gt;
  	Util.DisableGoal( &amp;quot;ROUTE_routname&amp;quot; ); &lt;br /&gt;
  };&lt;br /&gt;
  &lt;br /&gt;
  Barrier_destroyed = function ()&lt;br /&gt;
  {&lt;br /&gt;
  	Util.EnableGoal( &amp;quot;ROUTE_routname&amp;quot; ); &lt;br /&gt;
  };&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Step 8: Route maker===&lt;br /&gt;
* Windows users can use the route maker tool to easily create the MapRoutes table.&lt;br /&gt;
* Download it from http://svn.assembla.com/svn/omnibot/Enemy-Territory/0.8/tools/route_tool/&lt;br /&gt;
* Extract both RouteMaker.zip and RouteMaker2.zip into the same folder.&lt;br /&gt;
* Run RouteMaker2.exe&lt;br /&gt;
* You must set rcon password on your Enemy Territory or RTCW server.&lt;br /&gt;
* Then use menu command File / Load From RCON&lt;br /&gt;
* Drag &amp;amp; drop goals from left panel into middle panel.&lt;br /&gt;
* Drag &amp;amp; drop routes from right panel into middle panel.&lt;br /&gt;
* Double-click to delete routes.&lt;br /&gt;
* Finally use menu command Write / Script&lt;br /&gt;
* Output script will be copied to the clipboard. Paste it into the InitializeRoutes function in your map gm script.&lt;br /&gt;
&lt;br /&gt;
===Step 9: Ask for help===&lt;br /&gt;
&lt;br /&gt;
If you are having trouble with the syntax, set up, or understanding the routing system, ask for help. This guide is by no means comprehensive and complex maps will offer different challenges. Please post in the forums if you have questions / problems / bug reports.&lt;/div&gt;</summary>
		<author><name>Palota</name></author>
	</entry>
	<entry>
		<id>https://mygamingtalk.com/wiki/index.php?title=Template:Baserouting&amp;diff=1778</id>
		<title>Template:Baserouting</title>
		<link rel="alternate" type="text/html" href="https://mygamingtalk.com/wiki/index.php?title=Template:Baserouting&amp;diff=1778"/>
		<updated>2025-06-23T06:11:27Z</updated>

		<summary type="html">&lt;p&gt;Palota: /* Step 8: Route maker */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:ET|Routing]]&lt;br /&gt;
[[Category:Doom 3|Routing]]&lt;br /&gt;
[[Category:Quake 4|Routing]]&lt;br /&gt;
[[Category:RTCW|Routing]]&lt;br /&gt;
[[Category:Waypointing]]&lt;br /&gt;
==Routing Overview==&lt;br /&gt;
&lt;br /&gt;
Until version 0.65, omni-bot path selection relied on the shortest path to a goal. While this typically provided for very focused attacks, game play became very predictable. The solution is Routing. Routing provides alternate goals for the bots to go to before heading to their main goal. When positioned correctly, these alternate goals provide the effect of bots choosing realistic and varied paths to their main goals.&lt;br /&gt;
&lt;br /&gt;
Routing requires some setup in script and in the waypoints, but the results are worth the effort.  The objective of this article is to provide an overview of how the routing system works and to clearly define how to set it up by walking through a working example on Goldrush.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:Gr_routes2.jpg|Goldrush Multiple Routes Example]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In this picture, Squares are route nodes and the Dots are potential paths. The color of the Dots correspond to the color of the Route nodes. Once they reach a route node, they will travel along the path(s) of the same color IF the route node is set up for their current main goal.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Walking through the picture, let’s say the tank construction goal is set up for an allied engineer within the AllySpawn route nodes, and that the engineer has the tank construct as its goal. The engineer will randomly choose whether to go to the green route node (as_right) or the yellow route node (depotgate). For the purpose of this example, let’s say the bot chose to go to the green route node. From there, he will randomly choose to go to the white or red route node.  The bot will continue to make these decisions until there are no route nodes left to go to. From that point, the bot will take the shortest path to the tank construct goal.&lt;br /&gt;
As you can see, this opens up several different points of attack for the bots; which creates a sense of realism in terms of predictability. Defenses will now need to be set up to be able to react to all of the entry points rather than focusing on easily predicted choke points if the shortest path is always used.&lt;br /&gt;
&lt;br /&gt;
==Setting It Up==&lt;br /&gt;
&lt;br /&gt;
Setting up Routes involves waypointing and scripting. This section will take you step by step through the process of setting up the routes in the Goldrush example. &lt;br /&gt;
&lt;br /&gt;
===Step 1: Setting up the script===&lt;br /&gt;
&lt;br /&gt;
The first requirement for routing is that the routes are defined in the map script. The method to do this consists of building a table for the routes and calling a utility function that will register the routes.&lt;br /&gt;
&lt;br /&gt;
If a map script does not exist yet, open up your favorite text editor and add the following to a new file:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 global InitializeRoutes = function()&lt;br /&gt;
 {&lt;br /&gt;
 }; &amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Save the file as &amp;lt;mapname&amp;gt;.gm in your Omni-Bot\et\nav folder. You are now ready to start building the routes.  Inside the InitializeRoutes function is where the route definitions are placed and they all start with a basic layout:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 global InitializeRoutes = function()&lt;br /&gt;
 {&lt;br /&gt;
     MapRoutes =&lt;br /&gt;
     {&lt;br /&gt;
     };&lt;br /&gt;
  &lt;br /&gt;
     Util.Routes(MapRoutes);&lt;br /&gt;
 }; &amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You now have a MapRoutes table defined and are registering everything within that table with the Util.Routes function.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Step 2: Adding route goal ===&lt;br /&gt;
&lt;br /&gt;
Route goals are fairly straight forward. They have two important properties; route name and radius. You can use any name you want for the route nodes, but they should be somewhat intuitive. To see the full guide on adding route goals see the [[Route_Goal]] page.&lt;br /&gt;
&lt;br /&gt;
Route goals are placed in positions where a bot might receive the goal you want them to use alternate paths for. The bot MUST be inside the route node radius when receiving a goal for it to work. Spawn points are good spots for route nodes because bots always receive a goal when they spawn. &lt;br /&gt;
&lt;br /&gt;
In the spawns area you need to place the goal over the spawn positions and give it a large radius to cover the spawn points. Issue the following commands in console:&lt;br /&gt;
&lt;br /&gt;
  /bot show_spawns&lt;br /&gt;
  /bot goal_create route AllySpawn&lt;br /&gt;
  /bot goal_setproperty radius 500&lt;br /&gt;
  /bot goal_finish &lt;br /&gt;
&lt;br /&gt;
The radius of the route nodes at spawn positions are very critical because the bots must be inside its radius for it to work. Be sure that the radius covers the entire spawn area. Bots do not always receive goals immediately at spawn. Sometimes they receive goals 2 seconds after spawn. That&#039;s why it&#039;s always better to set bigger radius. But be careful, route nodes must not overlap. &lt;br /&gt;
&lt;br /&gt;
For routing to be effective, you will need at least two defined because once they reach the route node, they will take the shortest path to their goal UNLESS there is another route node set up for them to go to. Continuing with our example, create a route node where the green square is in the picture and name it as_right:&lt;br /&gt;
&lt;br /&gt;
  /bot goal_create route as_right&lt;br /&gt;
  /bot goal_finish &lt;br /&gt;
&lt;br /&gt;
You now have two route nodes; meeting the requirement for working routes. In our example, we want the bots to use two paths from the spawn, so add the route node depicted by the yellow square at the depot gate:&lt;br /&gt;
&lt;br /&gt;
  /bot goal_create route depotgate&lt;br /&gt;
  /bot goal_finish &lt;br /&gt;
&lt;br /&gt;
Be sure to save the goals at this point. The next step is to set up the goals and route node selection in the script.&lt;br /&gt;
&lt;br /&gt;
  /bot goal_save&lt;br /&gt;
&lt;br /&gt;
===Step 3: Scripting the routes===&lt;br /&gt;
&lt;br /&gt;
The Maproutes table is set up with the following format:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  MapRoutes =&lt;br /&gt;
  {&lt;br /&gt;
      GOALNAME =&lt;br /&gt;
      {&lt;br /&gt;
          ROUTNAME = {},&lt;br /&gt;
      },&lt;br /&gt;
      GOALNAME2 =&lt;br /&gt;
      {&lt;br /&gt;
          ROUTENAME = {},&lt;br /&gt;
      },&lt;br /&gt;
  };&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you are new to map scripting, this may appear a bit intimidating. The key is to follow the steps and syntax exactly, then let the understanding of the syntax come naturally. If you are comfortable with gm scripting, the routing set up consists of nested tables. &lt;br /&gt;
&lt;br /&gt;
The goal name must match the output from show_goals and the route name is the waypoint name prepended with ROUTE_. For the Goldrush example, set up the tank construct routing as follows:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 global InitializeRoutes = function()&lt;br /&gt;
 {&lt;br /&gt;
 	MapRoutes =&lt;br /&gt;
 	{&lt;br /&gt;
 		BUILD_tank_construct =&lt;br /&gt;
 		{&lt;br /&gt;
 		},&lt;br /&gt;
 	};&lt;br /&gt;
 &lt;br /&gt;
 	Util.Routes(MapRoutes);&lt;br /&gt;
 }; &amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You have just added a map goal to the Maproutes table. The syntax of the goal name is VERY important. Be sure to double check the goal name with /bot show_goals. Once you are sure the goal name is correct, you can add the route nodes:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 global InitializeRoutes = function()&lt;br /&gt;
 {&lt;br /&gt;
 	MapRoutes =&lt;br /&gt;
 	{&lt;br /&gt;
 		BUILD_tank_construct =&lt;br /&gt;
 		{&lt;br /&gt;
 			ROUTE_AllySpawn = {},&lt;br /&gt;
 		},&lt;br /&gt;
 	};&lt;br /&gt;
 &lt;br /&gt;
 	Util.Routes(MapRoutes);&lt;br /&gt;
 }; &amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The AllySpawn route node is now a valid route node for the tank construct goal. If a bot spawns within its radius and receives the tank construct as a goal, it will use that route node. In and of itself, this route node will not do anything because at spawn the bot is already at it. So let’s add the two path options we want to give the bots from the Allied Spawn:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
global InitializeRoutes = function()&lt;br /&gt;
{&lt;br /&gt;
    MapRoutes =&lt;br /&gt;
    {&lt;br /&gt;
        BUILD_tank_construct =&lt;br /&gt;
        {&lt;br /&gt;
            ROUTE_AllySpawn =&lt;br /&gt;
            {&lt;br /&gt;
                ROUTE_as_right = {},&lt;br /&gt;
                ROUTE_depotgate = {},&lt;br /&gt;
            },&lt;br /&gt;
        },&lt;br /&gt;
    };&lt;br /&gt;
&lt;br /&gt;
    Util.Routes(MapRoutes);&lt;br /&gt;
}; &amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It’s important to understand what we just did with this:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 ROUTE_AllySpawn = &lt;br /&gt;
 {&lt;br /&gt;
     ROUTE_as_right = {},&lt;br /&gt;
     ROUTE_depotgate = {},&lt;br /&gt;
 },&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The bot reaches the AllySpawn route node by default when it spawns; and because we have added the two routes inside the brackets, the bots will randomly choose between them. At this point, you have randomized routes for Allied engineers with the tank construct goal. Half the time they will choose to go to route as_right and half the time they will choose to go to route depotgate.&lt;br /&gt;
&lt;br /&gt;
Let’s make them even less predictable. Looking at the example picture, you can see that we want them to have a couple different options once they reach the route nodes we just set up. Repeating step 2, add the rest of the route nodes depicted by the colored squares.&lt;br /&gt;
&lt;br /&gt;
The scripting for the path options in the picture is as follows:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 global InitializeRoutes = function()&lt;br /&gt;
 {&lt;br /&gt;
     MapRoutes =&lt;br /&gt;
     {&lt;br /&gt;
         BUILD_tank_construct =&lt;br /&gt;
         {&lt;br /&gt;
             ROUTE_AllySpawn = &lt;br /&gt;
             {    &lt;br /&gt;
                 ROUTE_as_right =&lt;br /&gt;
                 {&lt;br /&gt;
                     ROUTE_as_rightsplit1 = {},&lt;br /&gt;
                     ROUTE_as_rightsplit2 =&lt;br /&gt;
                     {&lt;br /&gt;
                         ROUTE_depotflank = {},&lt;br /&gt;
                     },&lt;br /&gt;
                 },&lt;br /&gt;
                 ROUTE_depotgate = &lt;br /&gt;
                 {&lt;br /&gt;
                     ROUTE_cproute = {},&lt;br /&gt;
                     ROUTE_depotgatesplit = {},&lt;br /&gt;
                     ROUTE_as_rightsplit1 = {},&lt;br /&gt;
                 },&lt;br /&gt;
             },&lt;br /&gt;
         },&lt;br /&gt;
     };&lt;br /&gt;
 &lt;br /&gt;
     Util.Routes(Maproutes);&lt;br /&gt;
 }; &amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Step 4: Testing the routes===&lt;br /&gt;
&lt;br /&gt;
Testing the routes is by far the most important step. It is recommended that you test routes individually as you start to learn the routing system. Once you are comfortable with the setup, you may want to add routes for an entire phase and then test them to make the process a bit faster. &lt;br /&gt;
&lt;br /&gt;
If the routing is not working as expected, there are some basic troubleshooting options. It’s important to remember the criteria for the routes; the bot must be within the radius of the route node when receiving the goal, and the route node must be set up to support the goal. The basic troubleshooting steps are:&lt;br /&gt;
&lt;br /&gt;
# Check in console when the map loads for any error messages. It should list any goal names not found when initializing the routes.&lt;br /&gt;
# Check the radius of the route where the bot receives the goal&lt;br /&gt;
# Make sure the bot can reach the goal &lt;br /&gt;
# Make sure the bot is getting the expected goal&lt;br /&gt;
&lt;br /&gt;
For numbers 2 and 3, consider using the command /bot debugbot all goals with only one bot connected. In console, it should give success / failure messages for short term and long term goals. An example of a known problem is if there are priority type goals (like radar parts stealing) that are active when they aren’t reachable. The solution is to set them to be not active in OnMapLoad if they are unreachable.&lt;br /&gt;
&lt;br /&gt;
===Step 5: Adding priorities to routes===&lt;br /&gt;
&lt;br /&gt;
In some cases, you may want bots to use a certain route more often than others. This can be done by adding a “weight” to the route table:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 ROUTE_as_right =&lt;br /&gt;
 {&lt;br /&gt;
     Weight = 2,&lt;br /&gt;
     ROUTE_as_rightsplit1 = {},&lt;br /&gt;
     ROUTE_as_rightsplit2 =&lt;br /&gt;
     {&lt;br /&gt;
 	  Weight = 2,&lt;br /&gt;
 	  ROUTE_depotflank = {},&lt;br /&gt;
     },&lt;br /&gt;
 },&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this example, the bots will randomly choose to go to route as_right twice as much as route depotgate. And then they will choose to go to route as_rightsplit2 twice as much as route as_rightsplit1.&lt;br /&gt;
&lt;br /&gt;
===Step 6: Copying routes===&lt;br /&gt;
&lt;br /&gt;
If you have more than one goal that you want to share the same routing with, you can copy the routing. In the Goldrush example, say we have some attack goals in the yard that we want to route to. Rather than writing out the tables for each attack goal, we can copy them like this:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 MapRoutes[&amp;quot;ATTACK_Depot_.*&amp;quot;] = MapRoutes.BUILD_tank;&lt;br /&gt;
 MapRoutes.MOUNT_tank = MapRoutes.BUILD_Tank;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The key point to remember when doing this is that the route table that exists must be on the right side of the equation. In this case, we have created routes for multiple attack goals and a mount goal that are the same as our example routing to build the tank.&lt;br /&gt;
&lt;br /&gt;
These should be placed in OnMapLoad as well, below the Maproutes table and above the Utility function that registers the routes:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 global InitializeRoutes = function()&lt;br /&gt;
 {&lt;br /&gt;
     MapRoutes =&lt;br /&gt;
     {&lt;br /&gt;
         BUILD_Tank =&lt;br /&gt;
         {&lt;br /&gt;
 	&lt;br /&gt;
         },&lt;br /&gt;
     };&lt;br /&gt;
   &lt;br /&gt;
     MapRoutes[&amp;quot;ATTACK_Depot_.*&amp;quot;] = MapRoutes.BUILD_tank;&lt;br /&gt;
     MapRoutes.MOUNT_tank = MapRoutes.BUILD_Tank;&lt;br /&gt;
   &lt;br /&gt;
     Util.Routes(MapRoutes);&lt;br /&gt;
 };&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Step 7: Toggling routes===&lt;br /&gt;
&lt;br /&gt;
Routes are treated very similar to map goals. They will show up in your list if you do a /bot show_goals. They can be turned on and off via scripting with the SetAvailableMapGoals function. As an example, say we have route that we want opened up when barrier is destroyed, then closed when that barrier is constructed. This can be done inside the OnTriggers for those events:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  Barrier_construct = function ()&lt;br /&gt;
  {&lt;br /&gt;
  	Util.DisableGoal( &amp;quot;ROUTE_routname&amp;quot; ); &lt;br /&gt;
  };&lt;br /&gt;
  &lt;br /&gt;
  Barrier_destroyed = function ()&lt;br /&gt;
  {&lt;br /&gt;
  	Util.EnableGoal( &amp;quot;ROUTE_routname&amp;quot; ); &lt;br /&gt;
  };&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Step 8: Route maker===&lt;br /&gt;
* Windows users can use the route maker tool to easily create the MapRoutes table.&lt;br /&gt;
* Download it from http://svn.assembla.com/svn/omnibot/Enemy-Territory/0.8/tools/route_tool/&lt;br /&gt;
* Extract both RouteMaker.zip and RouteMaker2.zip into the same folder.&lt;br /&gt;
* Run RouteMaker2.exe&lt;br /&gt;
* You must set rcon password on your Enemy Territory or RTCW server.&lt;br /&gt;
* Then use menu command File / Load From RCON&lt;br /&gt;
* Drag &amp;amp; drop goals from left panel into middle panel.&lt;br /&gt;
* Drag &amp;amp; drop routes from right panel into middle panel.&lt;br /&gt;
* Double-click to delete routes.&lt;br /&gt;
* Finally use menu command Write / Script&lt;br /&gt;
* Output script will be copied to the clipboard. Paste it into the InitializeRoutes function in your map gm script.&lt;br /&gt;
&lt;br /&gt;
===Step 9: Ask for help===&lt;br /&gt;
&lt;br /&gt;
If you are having trouble with the syntax, set up, or understanding the routing system, ask for help. This guide is by no means comprehensive and complex maps will offer different challenges. Please post in the forums if you have questions / problems / bug reports.&lt;/div&gt;</summary>
		<author><name>Palota</name></author>
	</entry>
	<entry>
		<id>https://mygamingtalk.com/wiki/index.php?title=CAT&amp;diff=1777</id>
		<title>CAT</title>
		<link rel="alternate" type="text/html" href="https://mygamingtalk.com/wiki/index.php?title=CAT&amp;diff=1777"/>
		<updated>2025-06-22T17:36:46Z</updated>

		<summary type="html">&lt;p&gt;Palota: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{process header&lt;br /&gt;
 | title    = Category Constant&lt;br /&gt;
 | section  =&lt;br /&gt;
 | previous = [[Omni-bot_Script_Reference | Script Reference]]&lt;br /&gt;
 | next     = &lt;br /&gt;
 | shortcut =&lt;br /&gt;
 | notes    =&lt;br /&gt;
}}&lt;br /&gt;
[[Category:Constants]]&lt;br /&gt;
== Common Categories == &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 CAT.AUTODEFENSE&lt;br /&gt;
 CAT.AVOID - landmine, dynamite, satchel, smokemarker, grenade&lt;br /&gt;
 CAT.MISC - corpse&lt;br /&gt;
 CAT.MOUNTED_WPN - mg42&lt;br /&gt;
 CAT.MOVER&lt;br /&gt;
 CAT.OBSTACLE - breakable, landmine, vehicle, MOVER&lt;br /&gt;
 CAT.PICKUP&lt;br /&gt;
 CAT.PICKUP_AMMO&lt;br /&gt;
 CAT.PICKUP_HEALTH&lt;br /&gt;
 CAT.PICKUP_WEAPON&lt;br /&gt;
 CAT.PLAYER&lt;br /&gt;
 CAT.PROJECTILE - smokebomb, dynamite, satchel, smokemarker, grenade&lt;br /&gt;
 CAT.SHOOTABLE&lt;br /&gt;
 CAT.TRIGGER - button&lt;br /&gt;
 CAT.STATIC - MOVER, vehicle, button&lt;br /&gt;
 CAT.VEHICLE - tank, truck, tug&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Enemy Territory Categories ==&lt;br /&gt;
 CAT.MINE&lt;br /&gt;
&lt;br /&gt;
== Fortress Forever Categories ==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 CAT.BUILDABLE&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
See also: [[Bot_Library#GetEntCategory|GetEntCategory]], [[Bot_Library#OnTriggerRegion|OnTriggerRegion]]&lt;/div&gt;</summary>
		<author><name>Palota</name></author>
	</entry>
	<entry>
		<id>https://mygamingtalk.com/wiki/index.php?title=CAT&amp;diff=1776</id>
		<title>CAT</title>
		<link rel="alternate" type="text/html" href="https://mygamingtalk.com/wiki/index.php?title=CAT&amp;diff=1776"/>
		<updated>2025-06-22T17:02:42Z</updated>

		<summary type="html">&lt;p&gt;Palota: /* Common Categories */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{process header&lt;br /&gt;
 | title    = Category Constant&lt;br /&gt;
 | section  =&lt;br /&gt;
 | previous = [[Omni-bot_Script_Reference | Script Reference]]&lt;br /&gt;
 | next     = &lt;br /&gt;
 | shortcut =&lt;br /&gt;
 | notes    =&lt;br /&gt;
}}&lt;br /&gt;
[[Category:Constants]]&lt;br /&gt;
== Common Categories == &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 CAT.AUTODEFENSE&lt;br /&gt;
 CAT.AVOID&lt;br /&gt;
 CAT.MISC&lt;br /&gt;
 CAT.MOUNTED_WPN&lt;br /&gt;
 CAT.MOVER&lt;br /&gt;
 CAT.OBSTACLE&lt;br /&gt;
 CAT.PICKUP&lt;br /&gt;
 CAT.PICKUP_AMMO&lt;br /&gt;
 CAT.PICKUP_HEALTH&lt;br /&gt;
 CAT.PICKUP_WEAPON&lt;br /&gt;
 CAT.PLAYER&lt;br /&gt;
 CAT.PROJECTILE&lt;br /&gt;
 CAT.SHOOTABLE&lt;br /&gt;
 CAT.TRIGGER&lt;br /&gt;
 CAT.STATIC&lt;br /&gt;
 CAT.VEHICLE&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Fortress Forever Categories ==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 CAT.BUILDABLE&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
See also: [[Bot_Library#GetEntCategory|GetEntCategory]], [[Bot_Library#OnTriggerRegion|OnTriggerRegion]]&lt;/div&gt;</summary>
		<author><name>Palota</name></author>
	</entry>
	<entry>
		<id>https://mygamingtalk.com/wiki/index.php?title=Bot_Library&amp;diff=1775</id>
		<title>Bot Library</title>
		<link rel="alternate" type="text/html" href="https://mygamingtalk.com/wiki/index.php?title=Bot_Library&amp;diff=1775"/>
		<updated>2025-06-08T12:50:18Z</updated>

		<summary type="html">&lt;p&gt;Palota: /* SetAvailableMapGoals */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{process header&lt;br /&gt;
 | title    = Bot Library&lt;br /&gt;
 | section  =&lt;br /&gt;
 | previous = [[Omni-bot_Script_Reference | Script Reference]]&lt;br /&gt;
 | next     = &lt;br /&gt;
 | shortcut =&lt;br /&gt;
 | notes    =&lt;br /&gt;
}}&lt;br /&gt;
{{TOCright}}&lt;br /&gt;
== Global Bot Functions ==&lt;br /&gt;
&lt;br /&gt;
=== AddBot ===&lt;br /&gt;
Adds a bot to the game, and optionally specifies team, class, and name for the bot.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; ()&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (team)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (team, class)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (team, class, name)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (table)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 AddBot();&lt;br /&gt;
 // OR&lt;br /&gt;
 AddBot(TEAM.AXIS);&lt;br /&gt;
 // OR&lt;br /&gt;
 AddBot(TEAM.AXIS, CLASS.SOLDIER);&lt;br /&gt;
 // OR&lt;br /&gt;
 AddBot(TEAM.AXIS, CLASS.SOLDIER, &amp;quot;SomeDude&amp;quot;);&lt;br /&gt;
 // OR&lt;br /&gt;
 // not all fields are valid for all games, here&#039;s a quake 4 example&lt;br /&gt;
 // not all fields are required. any left out will use sensible default values&lt;br /&gt;
 tbl =&lt;br /&gt;
 {&lt;br /&gt;
     name=&amp;quot;SomeDude&amp;quot;,&lt;br /&gt;
     team=TEAM.STROGG,&lt;br /&gt;
     class=CLASS.PLAYER,&lt;br /&gt;
     spawnpoint=&amp;quot;somespawnpointname&amp;quot;,&lt;br /&gt;
     model=&amp;quot;model_player_kane_strogg&amp;quot;,&lt;br /&gt;
     skin=&amp;quot;base&amp;quot;,&lt;br /&gt;
 };&lt;br /&gt;
 AddBot(tbl);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;See Also:&#039;&#039;&#039; &lt;br /&gt;
[[Bot Library#KickBot| KickBot]], [[Bot Library#KickAll| KickAll]]&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== AllocGoalSerialNum ===&lt;br /&gt;
Gets unique goal serial number.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; integer&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== CalcTrajectory ===&lt;br /&gt;
Calculates a projectile trajectory, and returns the results in a table, or null if no trajectory exists for the parameters given.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (Vector3 start position, Vector3 target position, projectile speed, projectile gravity)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; table or null&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 mypos = Vector3(10,10,10); // get a valid position from somewhere&lt;br /&gt;
 targpos = Vector3(20,20,20); // get a valid position from somewhere&lt;br /&gt;
 projVel = 1000;&lt;br /&gt;
 projGrav = 0.5;&lt;br /&gt;
 traj = CalcTrajectory(mypos, targpos, projVel, projGrav);&lt;br /&gt;
 if(traj)&lt;br /&gt;
 {&lt;br /&gt;
     // if a table was returned, there can be 1 or 2 trajectories stored in it.&lt;br /&gt;
     // the 1st trajectory is the most direct trajectory&lt;br /&gt;
     // the 2nd trajectory is normally a mortar trajectory with a high degree of arc.&lt;br /&gt;
     // both trajectories are a unit length facing vector&lt;br /&gt;
     b.TurnToFacing(traj[0]);&lt;br /&gt;
     // OR&lt;br /&gt;
     b.TurnToFacing(traj[1]);&lt;br /&gt;
 }&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== CheatsEnabled ===&lt;br /&gt;
Checks if cheat mode is enabled in the game. Useful for debug or development scripts that use functions that are only available in cheat mode.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; true if cheats are enabled, false if not&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 if(CheatsEnabled())&lt;br /&gt;
 {&lt;br /&gt;
     // do something&lt;br /&gt;
 }&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;See Also:&#039;&#039;&#039; &lt;br /&gt;
[[Bot Library#EntityKill| EntityKill]], [[Bot Library#ServerCommand| ServerCommand]]&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== CheckEntityBoundsIntersect ===&lt;br /&gt;
Checks if entities intersect.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (entity1, entity2)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; true/false&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== ClearGoalRole ===&lt;br /&gt;
Clears one or more roles of one or more MapGoals.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (expression or table, role or table)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 example: ClearGoalRole( &amp;quot;FLAG_Gold&amp;quot;, ROLE.ATTACKER ); //1 goal, 1 role&lt;br /&gt;
 example: ClearGoalRole( &amp;quot;DEFEND_City[4567]&amp;quot;, { ROLE.DEFENDER2, ROLE.DEFENDER3}); //4 goals, 2 roles&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;See Also:&#039;&#039;&#039; [[Roles]]&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== ConfigGet ===&lt;br /&gt;
Gets a config value from omni-bot.cfg. Sets a config value if it does not exist yet and if the third parameter is not null.&lt;br /&gt;
&lt;br /&gt;
Type of the return value is string, int or float according to the third parameter. If you call ConfigGet with only 2 parameters, it will return string.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (section, config parameter name, config parameter value[optional])&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; config parameter value&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
ft = ConfigGet(&amp;quot;FireTeam&amp;quot;, &amp;quot;enabled&amp;quot;, 1);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;See Also:&#039;&#039;&#039; &lt;br /&gt;
[[Bot Library#ConfigSet|ConfigSet]]&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== ConfigSet ===&lt;br /&gt;
Sets a config value in omni-bot.cfg.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (section, config parameter name, config parameter value)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;ConfigSet(&amp;quot;FireTeam&amp;quot;, &amp;quot;enabled&amp;quot;, 0);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;See Also:&#039;&#039;&#039; &lt;br /&gt;
[[Bot Library#ConfigGet|ConfigGet]]&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== CreateMapGoal ===&lt;br /&gt;
Creates a new goal.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (type)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; MapGoal object&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== Debug Functions ===&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== DrawAABB ====&lt;br /&gt;
&#039;&#039;&#039;See:&#039;&#039;&#039; &lt;br /&gt;
[[Bot Library#DrawDebugAABB | DrawDebugAABB]]&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== DrawArrow ====&lt;br /&gt;
Draws an arrow. Used for facing or AimVectors.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (Vector3 start, Vector3 end, color, duration)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== DrawDebugAABB ====&lt;br /&gt;
Draws a box.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (AABB, color, duration)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 AABB box; // initialize it with something&lt;br /&gt;
 // draw it in red for 5 seconds&lt;br /&gt;
 DrawDebugAABB(box, COLOR.RED, 5);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;See Also:&#039;&#039;&#039; &lt;br /&gt;
[[Bot Library#DrawDebugLine | DrawDebugLine]], [[Bot Library#GetEntWorldAABB | GetEntWorldAABB]]&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== DrawDebugLine ====&lt;br /&gt;
Draws a line in the environment. Useful for debugging.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (Vector3 start, Vector3 end, color, duration)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 start = Vector3(0,0,0);&lt;br /&gt;
 end = Vector3(20,20,20);&lt;br /&gt;
 // draw it in red for 5 seconds&lt;br /&gt;
 DrawDebugLine(start, end, COLOR.RED, 5);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;See Also:&#039;&#039;&#039; &lt;br /&gt;
[[Bot Library#DrawDebugAABB | DrawDebugAABB]], [[Bot Library#GetEntWorldAABB | GetEntWorldAABB]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== DrawEntityAABB ====&lt;br /&gt;
Draws a bounding box around an entity. The box is usually much bigger than the entity.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (entity, duration, color)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; true/false&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== DrawEntityOBB ====&lt;br /&gt;
Draws an oriented box around an entity.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (entity, duration, color)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; true/false&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== DrawLine ====&lt;br /&gt;
&#039;&#039;&#039;See:&#039;&#039;&#039; &lt;br /&gt;
[[Bot Library#DrawDebugLine | DrawDebugLine]]&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== DrawRadius ====&lt;br /&gt;
Draws radius.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (position, radius, color, duration)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== DrawText3d ====&lt;br /&gt;
Draws text.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (position, string, color, duration, maxDistanceFromPlayer[optional, default 1024])&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== DrawTrajectory ====&lt;br /&gt;
Draws trajectory of grenade, mortar, airstrike or smokebomb.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; ( {Position, Velocity, Interval, Duration, BounceLoss, GravityMultiplier, StopAtHit, TraceBounce }, color, duration)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; target position&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== DumpConsoleToFile ====&lt;br /&gt;
Saves debug console, only if debug window is enabled.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (file name)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== EchoToScreen ====&lt;br /&gt;
Prints a message to the screen. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (duration, message)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 EchoToScreen(5,&amp;quot;Hello World!&amp;quot;);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== EnableDebugWindow ====&lt;br /&gt;
Enables or disables [[Debug_Window|debug window]]. Does not work in release build of omnibot dynamic link library. You must use omnibot_et.dll from dw_enabled subfolder on [[Assembla]].&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (true/false, width[optional, default 1024], height[optional, default 768], bitsPerPixel[optional, default 32])&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== Error ====&lt;br /&gt;
Prints an error to the games output console.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (error message)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 Error(&amp;quot;Somethin bad happened&amp;quot;);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== Log ====&lt;br /&gt;
Writes a string to the omnibot log file.&lt;br /&gt;
&lt;br /&gt;
The second parameter: 0=info, 1=warning, 2=error, 3=critical&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; logs are disabled if cvar omnibot_logsize is zero or negative&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; logs can also be disabled in omni-bot.cfg&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (string, level[optinal, default 0])&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 Log(&amp;quot;Something cool happened&amp;quot;);&lt;br /&gt;
 Log(&amp;quot;Something bad happened&amp;quot;, 2);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== ShowPaths ====&lt;br /&gt;
Debug Information function. Prints Omni-bot version, revision, and revision date, along with file system paths.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 ShowPaths();&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== TransformAndDrawLineList ====&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (veclist, color, duration, position, euler)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 TransformAndDrawLineList({Vec3(20,80,0), Vec3(20,-60,0), Vec3(-90,70,30), Vec3(-90,-50,30)}, &lt;br /&gt;
  COLOR.RED, 5, GetLocalPosition(), Vec3(DegToRad(45),0,0));&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== DeleteTriggerRegion ===&lt;br /&gt;
Deletes a trigger region previously created with [[Bot Library#OnTriggerRegion| OnTriggerRegion]]. Because regions aren&#039;t required to have unique names, DeleteTriggerRegion will delete all regions that match the provided name. This  allows grouping of different trigger regions by shared names.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (name)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (serial #)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 // creates a sphere trigger 256 units in radius around 0,0,0, then delete it immediately.&lt;br /&gt;
 triggerInfo =&lt;br /&gt;
 {&lt;br /&gt;
 	Name=&amp;quot;TestTrigger&amp;quot;,&lt;br /&gt;
 	TriggerOnClass=CLASS.ANYPLAYER,&lt;br /&gt;
 	OnEnter = function(ent)&lt;br /&gt;
 	{&lt;br /&gt;
 		print(GetEntName(ent),&amp;quot;entered aabb trigger&amp;quot;);&lt;br /&gt;
 	},&lt;br /&gt;
 	OnExit = function(ent)&lt;br /&gt;
 	{&lt;br /&gt;
 		print(GetEntName(ent),&amp;quot;exited aabb trigger&amp;quot;);&lt;br /&gt;
 	},&lt;br /&gt;
 };&lt;br /&gt;
 serial = OnTriggerRegion(Vector3(0,0,0),256,triggerInfo);&lt;br /&gt;
&lt;br /&gt;
 DeleteTriggerRegion(serial);&lt;br /&gt;
 // OR&lt;br /&gt;
 DeleteTriggerRegion(&amp;quot;TestTrigger&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;See Also:&#039;&#039;&#039; &lt;br /&gt;
[[Bot Library#OnTriggerRegion| OnTriggerRegion]]&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== DistanceBetween ===&lt;br /&gt;
Utility function for checking distances between 2 objects. This function takes 2 parameters, but the parameter types can vary.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (object1, object2)&lt;br /&gt;
&lt;br /&gt;
For this function, each parameter can be one of the following types.&lt;br /&gt;
* Vector3&lt;br /&gt;
* GameEntity&lt;br /&gt;
* GameId&lt;br /&gt;
* MapGoal&lt;br /&gt;
&lt;br /&gt;
This provides a flexible and fast function that allows a script to check the distance between a variety of source and destination object, and reduces the need for the script to convert between GameEntity or GameId, or to get the position of the GameEntity itself.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; distance between the objects&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 // assume entity1 is a GameEntity from another source, such as GetAllType&lt;br /&gt;
 if(DistanceBetween(b.GetGameEntity(), entity1))&lt;br /&gt;
 {&lt;br /&gt;
 }&lt;br /&gt;
 // OR&lt;br /&gt;
 if(DistanceBetween(b.GetGameEntity(), Vector3(10,20,30))&lt;br /&gt;
 {&lt;br /&gt;
 }&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== DynamicPathsUpdated ===&lt;br /&gt;
Finds new path for bots in teams specified if paths go through waypoint which has dynamic flag.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (teamId, ...)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== Entity Functions ===&lt;br /&gt;
&lt;br /&gt;
==== EntityIsOutside ====&lt;br /&gt;
Checks if a given entity is outside. Added in 0.83&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (entity)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; true/false&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== EntityIsValid ====&lt;br /&gt;
Checks if a given entity exists. Parameter can be entity handle or entity ID.&lt;br /&gt;
Since 0.92 it does not throw exception but returns false if parameter is null.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (entity)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; true/false&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== EntityKill ====&lt;br /&gt;
Kills an entity. Requires cheats to be enabled.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (GameEntity/GameId)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; true if successful, false if not&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 EntityKill(GetEntityByName(&amp;quot;truck&amp;quot;));&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;See Also:&#039;&#039;&#039; &lt;br /&gt;
[[Bot Library#CheatsEnabled | CheatsEnabled ]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== GetEntBonePosition ====&lt;br /&gt;
Gets the world position of a specific bone on an entity. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; This function may not be implemented for all games. It&#039;s not implemented  in ET.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (GameEntity/GameId, BoneId)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; Vector3 world bone position, or null if bone not found&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 headpos = GetEntBonePosition(someent, BONE.HEAD);&lt;br /&gt;
 if(headpos)&lt;br /&gt;
 {&lt;br /&gt;
     // got head position&lt;br /&gt;
 }&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== GetEntCategory ====&lt;br /&gt;
Checks if the entity belongs to one or more entity categories. This function takes one or more categories, and returns true if the entity belongs to all the provided categories.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (GameEntity/GameId, Category, ...)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; true if the entity belongs to all provided categories.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 if(GetEntCategory(someent, CAT.PROJECTILE))&lt;br /&gt;
 {&lt;br /&gt;
 } &lt;br /&gt;
 if(GetEntCategory(someent, CAT.PLAYER, CAT.VEHICLE))&lt;br /&gt;
 {&lt;br /&gt;
 } &amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;See also:&#039;&#039;&#039; [[CAT]]&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== GetEntClass ====&lt;br /&gt;
Gets the class of the entity.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (GameEntity/GameId)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; class of entity, or null if there was an error&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 if(GetEntClass(someent) == CLASS.SOLDIER)&lt;br /&gt;
 {&lt;br /&gt;
 }&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;See also:&#039;&#039;&#039; [[CLASS]]&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== GetEntEquippedWeapon ====&lt;br /&gt;
Gets current weapon of a player.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (GameEntity/GameId)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; weaponId&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 weapon = GetEntEquippedWeapon(this.TargetEntity);&lt;br /&gt;
 &amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== GetEntEyePosition ====&lt;br /&gt;
Gets the world eye position of an entity.&lt;br /&gt;
&lt;br /&gt;
Note: position is not correct if bot is looking up or down&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (GameEntity/GameId)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; Vector3 eye position, or null if there was an error&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 eyepos = GetEntEyePosition(someent);&lt;br /&gt;
 if(eyepos)&lt;br /&gt;
 {&lt;br /&gt;
     // got eye position&lt;br /&gt;
 }&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== GetEntFacing ====&lt;br /&gt;
Gets the world facing vector of an entity&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (GameEntity/GameId)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; Vector3 facing, or null if there was an error&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 face = GetEntFacing(someent);&lt;br /&gt;
 if(face)&lt;br /&gt;
 {&lt;br /&gt;
     // got face vector, as a direction vector&lt;br /&gt;
 }&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== GetEntFlags ====&lt;br /&gt;
Checks if the entity has one or more entity flags.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (GameEntity/GameId, Entity Flag, ...)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; true if the entity has any of provided entity flags.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 if(GetEntFlags(someent, ENTFLAG.CROUCHED))&lt;br /&gt;
 {&lt;br /&gt;
 } &lt;br /&gt;
 if(GetEntFlags(someent, ENTFLAG.CROUCHED, ENTFLAG.RELOADING))&lt;br /&gt;
 {&lt;br /&gt;
 } &amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;See also:&#039;&#039;&#039; [[ENTFLAG]]&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== GetEntHealthAndArmor ====&lt;br /&gt;
Gets health and armor of an entity.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (GameEntity/GameId, table)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; true if successful, false if not&lt;br /&gt;
&lt;br /&gt;
Properties stored into table:&lt;br /&gt;
* Health - Current Health&lt;br /&gt;
* MaxHealth - Max Health&lt;br /&gt;
* Armor - Current Armor&lt;br /&gt;
* MaxArmor - Max Armor&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
healthArmor = {};&lt;br /&gt;
if(GetEntHealthAndArmor(someentity, healthArmor))&lt;br /&gt;
{&lt;br /&gt;
	if(healthArmor.Health &amp;lt; 20)&lt;br /&gt;
	{&lt;br /&gt;
		b.Say(&amp;quot;I&#039;m Hurt!&amp;quot;);&lt;br /&gt;
	}&lt;br /&gt;
} &amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;See also:&#039;&#039;&#039;  [[Utility_Functions#Util.GetEntHealth|Util.GetEntHealth]]&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== GetEntName ====&lt;br /&gt;
&#039;&#039;&#039;See:&#039;&#039;&#039; &lt;br /&gt;
[[Bot Library#GetEntityName | GetEntityName]]&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== GetEntOwner ====&lt;br /&gt;
Gets the owner of an entity. Typically used for entities that can be held or carried.&lt;br /&gt;
&lt;br /&gt;
Note: If player who is carrying objective is kicked, GetEntOwner will return invalid entity till end of match. This bug is in all ET mods (except the last version of omnibot mod).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (GameEntity/GameId)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; GameId of owner, or null if none or error&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 owner = GetEntOwner(someent);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== GetEntPosition ====&lt;br /&gt;
Gets the world position of an entity.&lt;br /&gt;
&lt;br /&gt;
Note: old mods return wrong position (NoQuarter 1.2.5,  ETpub 0.9.0, Jaymod 2.1.7, ...).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (GameEntity/GameId)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; Vector3 world position, or null if error&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 p = GetEntPosition(someent);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== GetEntPowerups ====&lt;br /&gt;
Checks if the entity has one or more powerups. This function takes one or more powerups, and returns true if the entity has all of them.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (GameEntity/GameId, PowerUp, ...)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; true if the entity has all powerups.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 if(GetEntPowerups(someent, POWERUP.INVINCIBLE))&lt;br /&gt;
 {&lt;br /&gt;
 } &lt;br /&gt;
 if(GetEntPowerups(someent, POWERUP.QUADDAMAGE, POWERUP.BERSERK))&lt;br /&gt;
 {&lt;br /&gt;
 } &amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== GetEntRotationMatrix ====&lt;br /&gt;
Gets the Matrix3 full transform of an entity.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (GameEntity/GameId, Matrix3&amp;lt;optional&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
If you pass an Matrix3 as the 2nd parameter, that object will be filled in instead of a new Matrix3 returned. This can save memory allocations in a script that calls the function often by re-using the same object.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; true if Matrix3 passed as 2nd parameter and filled in successfully, if no Matrix3 provided, returns Matrix3 for entity. Both return null on an error.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 entMat = GetEntRotationMatrix(someent);&lt;br /&gt;
 if(entMat)&lt;br /&gt;
 {&lt;br /&gt;
      // do something&lt;br /&gt;
 }&lt;br /&gt;
 // re-use the same Matrix3 later&lt;br /&gt;
 if(GetEntRotationMatrix(someent, entMat))&lt;br /&gt;
 {&lt;br /&gt;
 } &amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== GetEntTeam ====&lt;br /&gt;
Gets the team id that the entity belongs to.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (GameEntity/GameId)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; Team Id of entity, or null if error&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 if(GetEntTeam(someent) == TEAM.RED)&lt;br /&gt;
 {&lt;br /&gt;
 }&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;See also:&#039;&#039;&#039; [[TEAM]]&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== GetEntVelocity ====&lt;br /&gt;
Gets the world velocity of an entity.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (GameEntity/GameId)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; Vector3 world velocity, or null if error&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 vel = GetEntVelocity(someent);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== GetEntWorldAABB ====&lt;br /&gt;
Gets the bounding box for an entity. The box is usually much bigger than the entity. Center of the box is not equal to entity position.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (GameEntity/GameId, AABB&amp;lt;optional&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
If you pass an AABB as the 2nd parameter, that object will be filled in instead of a new AABB returned. This can save memory allocations in a script that calls the function often by re-using the same object.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; true if AABB passed as 2nd parameter and filled in successfully, if no AABB provided, returns AABB for entity. Both return null on an error.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 entAABB = GetEntWorldAABB(someent);&lt;br /&gt;
 if(entAABB)&lt;br /&gt;
 {&lt;br /&gt;
      // do something&lt;br /&gt;
 }&lt;br /&gt;
 // re-use the same AABB later&lt;br /&gt;
 if(GetEntWorldAABB(someent, entAABB))&lt;br /&gt;
 {&lt;br /&gt;
 } &amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== GetEntityByName ====&lt;br /&gt;
Finds entity by target name. In ET you can use command &#039;&#039;&#039;/entitylist&#039;&#039;&#039; to see entity names.&lt;br /&gt;
&lt;br /&gt;
Unfortunately this functions can&#039;t find entities which have only script name, but don&#039;t have target name. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (name)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; GameEntity found, or null if none found&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== GetEntityInSphere ====&lt;br /&gt;
Finds an entity within a radius around a point that matches a particular class Id. It is set up so that it can be used in a loop to find all entities.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (Vector3 position, radius, classid, start entity)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; GameEntity found, or null if none found&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 p = Vector3(10,10,10);&lt;br /&gt;
 radius = 20;&lt;br /&gt;
 ent = GetEntityInSphere(p, radius, CLASS.ANYPLAYER, null);&lt;br /&gt;
 while(ent)&lt;br /&gt;
 {&lt;br /&gt;
     // do something with it?&lt;br /&gt;
     // get the next one found&lt;br /&gt;
     ent = GetEntityInSphere(p, radius, CLASS.ANYPLAYER, ent);&lt;br /&gt;
 }&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== GetEntityLocalSpace ====&lt;br /&gt;
Converts a world position into a local space position of a specified entity.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (GameEntity/GameId, Vector3 world position)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; Vector3 local space position, or null if error&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 worldpos = Vector3(10,10,10);&lt;br /&gt;
 localpos = GetEntityLocalSpace(someent, worldpos); &amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;See Also:&#039;&#039;&#039; &lt;br /&gt;
[[Bot Library#GetEntityWorldSpace | GetEntityWorldSpace]]&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== GetEntityName ====&lt;br /&gt;
Gets the name of an entity. In ET you can use command &#039;&#039;&#039;/entitylist&#039;&#039;&#039; to see all entity names.&lt;br /&gt;
&lt;br /&gt;
If entity has defined both script name and target name, GetEntityName returns script name.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (GameEntity/GameId)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; name of entity, or null if error&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 entName = GetEntityName(someent);&lt;br /&gt;
 if(entName == &amp;quot;SomeName&amp;quot;)&lt;br /&gt;
 {&lt;br /&gt;
      // do something&lt;br /&gt;
 }&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== GetEntityStat ====&lt;br /&gt;
Generic function for getting information about an entity, by name.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (GameEntity/GameId, stat name)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; stat, or null if error or stat doesn&#039;t exist. The type depends on the stat.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 kills = GetEntityStat(someent, &amp;quot;kills&amp;quot;);&lt;br /&gt;
 deaths = GetEntityStat(someent, &amp;quot;deaths&amp;quot;);&lt;br /&gt;
 xp = GetEntityStat(bot.GetGameEntity(), &amp;quot;xp&amp;quot;);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== GetEntityWorldSpace ====&lt;br /&gt;
Converts a local space position into a world space position of a specified entity.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (GameEntity/GameId, Vector3 local position)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; Vector3 world space position, or null if error&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 localpos = Vector3(10,10,10);&lt;br /&gt;
 worldpos = GetEntityWorldSpace(someent, localpos); &amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;See Also:&#039;&#039;&#039; &lt;br /&gt;
[[Bot Library#GetEntityLocalSpace | GetEntityLocalSpace]]&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== GetGameEntityFromId ====&lt;br /&gt;
Converts a GameId to a GameEntity.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (GameId)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; GameEntity&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 ent = GetGameEntityFromId(2); &amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;See Also:&#039;&#039;&#039; &lt;br /&gt;
[[Bot Library#GetGameIdFromEntity | GetGameIdFromEntity ]]&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== GetGameIdFromEntity ====&lt;br /&gt;
Converts a GameEntity to a GameId.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (GameEntity)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; GameId&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 id = GetGameIdFromEntity(someent); &amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;See Also:&#039;&#039;&#039; &lt;br /&gt;
[[Bot Library#GetGameEntityFromId | GetGameEntityFromId ]]&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== ExecCommand ===&lt;br /&gt;
This function executes a bot command as if it came from the games input console.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (command string)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 ExecCommand(&amp;quot;addbot 1 2&amp;quot;)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== ExecCommandOnClient ===&lt;br /&gt;
Executes a command for the entity. Usually equivilent to console commands.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (GameEntity/GameId, command string)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 ExecCommandOnClient(bot.GetGameEntity(), &amp;quot;setviewpos 1200 2300 150 0&amp;quot;);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== ExecScript ===&lt;br /&gt;
Attempts to execute a script file. File is searched in scripts folder, global_scripts folder or game folder (omni-bot/et).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (filename)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; true if successful, false if not&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 ExecScript(&amp;quot;myscript.gm&amp;quot;);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== GetClassNameFromId ===&lt;br /&gt;
Gets the current class name from a class id.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (classId)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; string&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== GetGameName ===&lt;br /&gt;
Gets the name of the currently running game.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; name of game&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 if(GetGameName() == &amp;quot;Enemy Territory&amp;quot;)&lt;br /&gt;
 {&lt;br /&gt;
 }&lt;br /&gt;
 else if(GetGameName() == &amp;quot;Quake 4&amp;quot;)&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;
=== GetGameState ===&lt;br /&gt;
Gets the current state of the game (Playing, Warm-up, Warm-up Countdown, Intermission, Waiting for Players, Paused, Invalid).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; name of game state&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 if(GetGameState() == &amp;quot;Playing&amp;quot;)&lt;br /&gt;
 {&lt;br /&gt;
 }&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== GetGameTimeLeft ===&lt;br /&gt;
Gets the current amount of time remaining in the game round.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; time left, in seconds&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 if(GetGameTimeLeft() &amp;lt; 30)&lt;br /&gt;
 {&lt;br /&gt;
 }&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== GetGoal ===&lt;br /&gt;
Gets a reference to a map goal by name. The goal name is case sensitive.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (name of map goal to get)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; MapGoal if found, null if not&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 mg = GetGoal(&amp;quot;MAP_FLAG_redflag&amp;quot;);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;See Also:&#039;&#039;&#039; &lt;br /&gt;
[[MapGoal]]&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== GetGoals ===&lt;br /&gt;
Gets any number of map goals that match a regular expression. Stores the matching reference in the first table parameter. The previous table content is cleared since omni-bot 0.84. It&#039;s not possible to call GetGoals multiple times to accumulate results. The last optional parameter is table of parameters to filter result (Group, Role,  SkipNoInProgress, SkipNoInUse, SkipInUse) or sort result (parameter Sort, values are &amp;quot;none&amp;quot;, &amp;quot;priority&amp;quot;, &amp;quot;name&amp;quot;, &amp;quot;priority_name&amp;quot;, &amp;quot;random&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (table, team, expression, params[optional])&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 goals = {};&lt;br /&gt;
 GetGoals(goals, TEAM.AXIS, &amp;quot;FLAG.*&amp;quot;, { Sort=&amp;quot;priority&amp;quot; });&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;See Also:&#039;&#039;&#039; &lt;br /&gt;
[[Utility_Functions#Util.GoalTable|Util.GoalTable]], [[Bot Library#GetGoal| GetGoal]]&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== GetGravity ===&lt;br /&gt;
Gets the current gravity of the game.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; gravity&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 grav = GetGravity();&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== GetLocalAABB ===&lt;br /&gt;
Gets bounding box of local player.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; AABB &lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== GetLocalAimNormal ===&lt;br /&gt;
Gets normal at aim position of local player.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (collision mask[optional, default floodfill])&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; Vector3&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== GetLocalAimPosition ===&lt;br /&gt;
Gets aim position of local player.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (collision mask[optional, default floodfill])&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; Vector3&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== GetLocalEntity ===&lt;br /&gt;
Gets local player.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; GameEntity&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== GetLocalEyePosition ===&lt;br /&gt;
Gets eye position of local player.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; Vector3&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== GetLocalCommand ===&lt;br /&gt;
Gets name of just running console command. It is useful if you use same script for multiple commands.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; string or null &lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
=== GetLocalFacing ===&lt;br /&gt;
Gets facing vector of local player.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; Vector3&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== GetLocalGroundPosition ===&lt;br /&gt;
Gets ground position of local player.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; Vector3 or null&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== GetLocalPosition ===&lt;br /&gt;
Gets position of local player.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; Vector3&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== GetMapExtents ===&lt;br /&gt;
Gets the AABB map extents. Map extends are the bounds of the entire map.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (AABB&amp;lt;optional&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; If no AABB passed as parameter, function will return the map AABB, otherwise the AABB parameter will be filled in with the results, and the function will return nothing.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 aabb = GetMapExtents();&lt;br /&gt;
 // or&lt;br /&gt;
 AABB aabb;&lt;br /&gt;
 GetMapExtents(aabb);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== GetMapName ===&lt;br /&gt;
Get the name of the current map.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; name of map&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 if(GetMapName() == &amp;quot;oasis&amp;quot;)&lt;br /&gt;
 {&lt;br /&gt;
 }&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== GetModName ===&lt;br /&gt;
Gets the name of the currently running mod.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; name of mod&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 if(GetModName() == &amp;quot;etpub&amp;quot;)&lt;br /&gt;
 {&lt;br /&gt;
 }&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== GetModVersion ===&lt;br /&gt;
Gets the version of the current mod.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; version of mod&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 if(GetModVersion() == &amp;quot;DOOM 1.3&amp;quot;)&lt;br /&gt;
 {&lt;br /&gt;
 }&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== GetNearestNonSolid ===&lt;br /&gt;
This function is similar to TraceLine, but ignores solids.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (start, end, trace mask[optional])&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; position&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== GetPointContents ===&lt;br /&gt;
Gets the contents bits for a given position.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (Vector3 position)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; contents bits. Use bitwise manipulators along with constants from the global [[CONTENT]] table to check for specific content bits.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 contents = GetPointContents(Vector3(10,10,10));&lt;br /&gt;
 if(contents &amp;amp; CONTENT.WATER)&lt;br /&gt;
 {&lt;br /&gt;
 }&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== GetTeamStat ===&lt;br /&gt;
Generic function for getting information about a team, by name. It&#039;s not implemented in ET.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (Team Id, stat name)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; stat, or null if error or stat doesn&#039;t exist. The type depends on the stat.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 score = GetTeamStat(TEAM.RED, &amp;quot;score&amp;quot;);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== GetTime ===&lt;br /&gt;
Gets the current time elapsed in the game.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; time, in seconds&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 if(GetTime() &amp;gt; 30)&lt;br /&gt;
 {&lt;br /&gt;
 }&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== GetWeapon ===&lt;br /&gt;
Gets weapon object by ID.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (weaponId)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; [[Weapon]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== GetWeaponIdFromClassId ===&lt;br /&gt;
Converts classId to weaponId.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (classId)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; weaponId&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== GroundPoint ===&lt;br /&gt;
Returns a point on the ground directly below the provided point.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (position)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; ground position&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== KickAll ===&lt;br /&gt;
Kicks all bots from the game.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 KickAll();&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== KickBot ===&lt;br /&gt;
Kicks a bot by name.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (name)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 KickBot(&amp;quot;Fred&amp;quot;);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== KickBotFromTeam ===&lt;br /&gt;
Kicks last bot from team.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (teamId)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 KickBot(TEAM.AXIS);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== MoveBotToAnotherTeam ===&lt;br /&gt;
Moves a bot from a team to another team.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (source teamId, destination teamId)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== OnTrigger ===&lt;br /&gt;
Registers a script function callback for a given trigger string.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (trigger string, script function)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 global Map =&lt;br /&gt;
 {&lt;br /&gt;
  myfunc = function(trigger)&lt;br /&gt;
  {&lt;br /&gt;
    direction = ToVector(trigger.Action);&lt;br /&gt;
    entityName = GetEntName(trigger.Entity);&lt;br /&gt;
  }&lt;br /&gt;
 };&lt;br /&gt;
 global OnMapLoad = function()&lt;br /&gt;
 { &lt;br /&gt;
  OnTrigger( &amp;quot;cargo_lift_goto&amp;quot;, Map.myfunc);&lt;br /&gt;
 };&lt;br /&gt;
 &amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;See Also:&#039;&#039;&#039; &lt;br /&gt;
[[Triggers]]&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== OnTriggerRegion===&lt;br /&gt;
Creates one of several types of trigger regions. A trigger region is an area that watches for entities of certain types to touch them and calls script callback functions for enter and exit. Useful if you want an easy way to be notified when certain entities go to certain areas of the map.&lt;br /&gt;
&lt;br /&gt;
This function takes a table as the last parameter to define a number of flexible options for the trigger region. Here is a list of available key/value options for the table.&lt;br /&gt;
* Name - Optional name to give the region. Does not need to be unique.&lt;br /&gt;
* OnEnter - script function to call when an entity touches the region.&lt;br /&gt;
* OnExit - script function to call when an entity stops touching the region.&lt;br /&gt;
* TriggerOnClass - Define the class id you want the region to trigger on. This field may also be an indexed table with up to 8 class ids.&lt;br /&gt;
* TriggerOnCategory - Category of entities to watch for. This field may also be an indexed table with as many categories as you want to limit the trigger to.&lt;br /&gt;
* TriggerOnEntity - A specific entity to trigger on. This field may also be an indexed table with up to 8 entities you want to limit the trigger to.&lt;br /&gt;
&lt;br /&gt;
The following region types are supported. The type is dependent on which parameters of the function are used.&lt;br /&gt;
* AABB - Axis aligned bounding box.&lt;br /&gt;
* Sphere - A radius around a position.&lt;br /&gt;
&lt;br /&gt;
Triggers may be rendered for reference with &#039;&#039;/bot drawtriggers 1&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (AABB, table)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (position, radius, table)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; unique serial number of region&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 // creates a sphere trigger 256 units in radius around 0,0,0&lt;br /&gt;
 triggerInfo =&lt;br /&gt;
 {&lt;br /&gt;
 	Name=&amp;quot;TestTrigger&amp;quot;,&lt;br /&gt;
 	TriggerOnClass=CLASS.ANYPLAYER,&lt;br /&gt;
 	OnEnter = function(ent)&lt;br /&gt;
 	{&lt;br /&gt;
 		print(GetEntName(ent),&amp;quot;entered aabb trigger&amp;quot;);&lt;br /&gt;
 	},&lt;br /&gt;
 	OnExit = function(ent)&lt;br /&gt;
 	{&lt;br /&gt;
 		print(GetEntName(ent),&amp;quot;exited aabb trigger&amp;quot;);&lt;br /&gt;
 	},&lt;br /&gt;
 };&lt;br /&gt;
 serial = OnTriggerRegion(Vector3(0,0,0),256,triggerInfo);&lt;br /&gt;
 &amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;See Also:&#039;&#039;&#039; &lt;br /&gt;
[[Bot Library#DeleteTriggerRegion| DeleteTriggerRegion]]&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== RegisterDefaultProfile ===&lt;br /&gt;
Registers a default profile that will be loaded for any bot that joins a specified class.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (Class Id, script name)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 RegisterDefaultProfile(CLASS.SOLDIER, &amp;quot;def_bot.gm&amp;quot;);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== ReloadGoalScripts ===&lt;br /&gt;
Executes all goal scripts. You must also kick all bots because any changes will be applied to newly added bots.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== RunScript ===&lt;br /&gt;
&#039;&#039;&#039;See:&#039;&#039;&#039; &lt;br /&gt;
[[Bot Library#ExecScript| ExecScript]]&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== SendTrigger ===&lt;br /&gt;
It is used by goal scripts to call function in map script.&lt;br /&gt;
Parameter TagName is string which must be same as the first parameter of function [[Bot Library#OnTrigger|OnTrigger]].&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; ( { TagName, Entity, Activator, Action } )&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
SendTrigger({&lt;br /&gt;
 Entity = ent,&lt;br /&gt;
 Activator = null,&lt;br /&gt;
 TagName = GetEntName(ent) + &amp;quot; at location&amp;quot;,&lt;br /&gt;
 Action = &amp;quot;arrived&amp;quot;&lt;br /&gt;
});&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== ServerCommand ===&lt;br /&gt;
Executes a server command. Requires cheats to be enabled.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; true if cheats are enabled, false if not&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 ServerCommand(&amp;quot;map oasis&amp;quot;);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;See Also:&#039;&#039;&#039; &lt;br /&gt;
[[Bot Library#CheatsEnabled | CheatsEnabled ]]&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== ServerScriptFunction ===&lt;br /&gt;
Not implemented in ET.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (entity name, function name, parameters[optinal])&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== SetAvailableMapGoals ===&lt;br /&gt;
Enables/Disables the available status of one or more map goals that match a regular expression, for a specific team.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (Team Id, enable/disable, mapgoal expression string or table, ignoreErrors[optional])&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; number of goals that match regular expression&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 SetAvailableMapGoals( TEAM.ALLIES, false, &amp;quot;ATTACK.*&amp;quot; );&lt;br /&gt;
 SetAvailableMapGoals( TEAM.AXIS, true, { &amp;quot;DEFEND_gate.*&amp;quot;, &amp;quot;MOUNTMG42_bunker&amp;quot;, &amp;quot;SNIPE_tower.*&amp;quot; } );&lt;br /&gt;
 SetAvailableMapGoals( TEAM.AXIS, false, &amp;quot;DEFUSE_Gate.*&amp;quot;, true );&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;See Also:&#039;&#039;&#039; &lt;br /&gt;
[[Availability]], [[Bot Library#GetGoal| GetGoal]], [[Bot Library#GetGoals| GetGoals]]&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== SetGoalGroup ===&lt;br /&gt;
Sets the goal or table of goals group name.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (goalname or table, groupname)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 SetGoalGroup( &amp;quot;SomeGoalName&amp;quot;, &amp;quot;SomeGroupName&amp;quot; );&lt;br /&gt;
 SetGoalGroup( { &amp;quot;ROUTE_route1&amp;quot;, &amp;quot;ROUTE_route2&amp;quot;, &amp;quot;someothergoal&amp;quot; }, &amp;quot;MyGroup&amp;quot; );&lt;br /&gt;
 &amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;See Also:&#039;&#039;&#039; &lt;br /&gt;
[[Utility Functions#Util.DisableGroup| Util.DisableGroup]],&lt;br /&gt;
[[Utility Functions#Util.EnableGroup| Util.EnableGroup]],&lt;br /&gt;
[[Utility Functions#Util.GetGroup| Util.GetGroup]],&lt;br /&gt;
[[Utility Functions#Util.SetGroup| Util.SetGroup]],&lt;br /&gt;
[[Utility Functions#Util.ShowGroup| Util.ShowGroup]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== SetGoalPriority===&lt;br /&gt;
Sets priority of one or more MapGoals for specified team and class. The last parameter must be true for dynamically created goals (FLAG_dropped, FLAGRETURN, DEFUSE ...).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (expression or table, priority, teamId[optional, default 0], classId[optional, default 0], persistent[optional])&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 example: SetGoalPriority( &amp;quot;FLAG_Gold&amp;quot;, 0.7 ); //all teams and all classes&lt;br /&gt;
 example: SetGoalPriority( &amp;quot;CHECKPOINT_City&amp;quot;, 0.8, TEAM.AXIS); //axis only all classes&lt;br /&gt;
 example: SetGoalPriority( &amp;quot;DEFUSE_somedyno.*&amp;quot;, 0.0, TEAM.AXIS, CLASS.ENGINEER, true ); //the persistent parameter is used for dynamic goals that may not have been created yet &amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;See Also:&#039;&#039;&#039; [[Priority]]&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== SetGoalRole ===&lt;br /&gt;
Sets one or more roles of one or more MapGoals. The last parameter must be true for dynamically created goals (FLAG_dropped, FLAGRETURN, DEFUSE ...).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (expression or table, role or table, persistent[optional])&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 example: SetGoalRole( &amp;quot;FLAG_Gold&amp;quot;, ROLE.ATTACKER ); //1 goal, 1 role&lt;br /&gt;
 example: SetGoalRole( &amp;quot;DEFEND_City[4567]&amp;quot;, { ROLE.DEFENDER2, ROLE.DEFENDER3}); //4 goals, 2 roles&lt;br /&gt;
 example: SetGoalRole( &amp;quot;DEFUSE_somedyno.*&amp;quot;, ROLE.DEFENDER2, true ); //the persistent parameter is used for dynamic goals that may not have been created yet &amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;See Also:&#039;&#039;&#039; [[Roles]]&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== SetMapGoalProperties===&lt;br /&gt;
Passes a table full of properties along to all matching map goals to attempt to set their properties.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (expression or table, table of properties)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 // Set the camp time for all attack and defend goals&lt;br /&gt;
 SetMapGoalProperties( &amp;quot;ATTACK_.*&amp;quot;, {mincamptime=15, maxcamptime=30});&lt;br /&gt;
 SetMapGoalProperties( &amp;quot;DEFEND_.*&amp;quot;, {mincamptime=15, maxcamptime=30});&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;See Also:&#039;&#039;&#039; &lt;br /&gt;
[[Goal specific instructions]] for a list of properties for each map goal type.&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== TraceLine ===&lt;br /&gt;
Performs a traceline collision test, and returns the results in a table. TraceLine calls are useful for testing visibility, line of sight, or for getting a collision point along a line.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (Vector3 start, Vector3 end, AABB, collision mask, ignore user GameId, use PVS)&lt;br /&gt;
&lt;br /&gt;
* Vector3 start - Start position of trace line.&lt;br /&gt;
* Vector3 end - End position of trace line.&lt;br /&gt;
* AABB - Pass an AABB if you with the line to have volume, otherwise pass null.&lt;br /&gt;
* Collision Mask - Mask of collision types to test. See global [[TRACE]] table.&lt;br /&gt;
* GameId - Ignore this GameId in the traceline. Usually the entity or bot it originates from.&lt;br /&gt;
* UsePVS - true to use PVS (Potentially visible set), false to ignore PVS&lt;br /&gt;
&lt;br /&gt;
Always pass false to not UsePVS if you need collision information from the call to TraceLine. UsePVS=true is useful when all you need to know is whether or not something is blocking the path from start to end, it will not give you the collision position. It is slightly faster in most cases to use PVS as an early out test, but doing so limits the amount of useful information you get back from the function. In many cases you don&#039;t need this information, so the extra speed is useful.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; table of results&lt;br /&gt;
&lt;br /&gt;
Results table contains the following information.&lt;br /&gt;
* fraction - 0.0 to 1.0 The ratio along the line the collision took place. Not always valid if UsePVS=true. Example: 0.5 means ray hit half way between the start and end.&lt;br /&gt;
* startsolid - true/false The traceline started inside a solid object. Not always valid if UsePVS=true&lt;br /&gt;
&lt;br /&gt;
Additional properties are available if UsePVS=false and there was a collision.&lt;br /&gt;
* entity - May be null, the GameEntity that was hit in the collision.&lt;br /&gt;
* normal - The Vector3 normal of the collision point.&lt;br /&gt;
* end - The Vector3 world position of the collision.&lt;br /&gt;
* contents - water etc., see global [[CONTENT]] table.&lt;br /&gt;
* surface - ice, ladder, see global [[SURFACE]] table.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 // Do a traceline along a bots facing 1024 units out&lt;br /&gt;
 start = b.GetEyePosition();&lt;br /&gt;
 end = start + b.GetFacing() * 1024;&lt;br /&gt;
 tr = TraceLine(start, end, null, TRACE.SHOT, b.GetGameId(), false);&lt;br /&gt;
&lt;br /&gt;
 // the fraction value tells us of a collision or not. If it&#039;s 1, there was no collision. If less than 1 there was a collision.&lt;br /&gt;
 if(tr.fraction &amp;lt; 1)&lt;br /&gt;
 {&lt;br /&gt;
     // tr.startsolid&lt;br /&gt;
     // tr.entity&lt;br /&gt;
     // tr.normal&lt;br /&gt;
     // tr.end&lt;br /&gt;
     // tr.contents&lt;br /&gt;
     // tr.surface&lt;br /&gt;
 }&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== Enemy Territory Addendum ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== GetCabinetData ===&lt;br /&gt;
Gets information about health or ammo cabinet. Properties CurrentAmount, MaxAmount, Rate are stored into table.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (entity, table)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; true if successful, null if not&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
cab = {};&lt;br /&gt;
if (GetCabinetData( GetGoal(&amp;quot;AMMOCAB_north&amp;quot;).GetEntity(), cab)){&lt;br /&gt;
	print( cab.CurrentAmount );&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== GetCvar ===&lt;br /&gt;
Gets a game cvar. Returns zero if the cvar does not exists or if its value cannot be converted to integer.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (name)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; integer&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
friendlyFire = GetCvar(&amp;quot;g_friendlyfire&amp;quot;);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== GetGameType ===&lt;br /&gt;
Gets the current game type:&lt;br /&gt;
&lt;br /&gt;
2 - single-map objective, 3 - stopwatch, 4 - campaign, 5 - last man standing&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; integer&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== IsWaitingForMedic ===&lt;br /&gt;
Deprecated.&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== SetCvar ===&lt;br /&gt;
Sets a game cvar.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (name, value)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; true if successful, false if not &lt;br /&gt;
----&lt;/div&gt;</summary>
		<author><name>Palota</name></author>
	</entry>
	<entry>
		<id>https://mygamingtalk.com/wiki/index.php?title=Utility_Functions&amp;diff=1774</id>
		<title>Utility Functions</title>
		<link rel="alternate" type="text/html" href="https://mygamingtalk.com/wiki/index.php?title=Utility_Functions&amp;diff=1774"/>
		<updated>2025-06-08T07:39:49Z</updated>

		<summary type="html">&lt;p&gt;Palota: /* Util.SetGoalRange */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{process header&lt;br /&gt;
 | title    = Utility Functions&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;
{{TOCright}}&lt;br /&gt;
&lt;br /&gt;
=== Util ===&lt;br /&gt;
&lt;br /&gt;
==== Util.AddUsePoint ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: Util.AddUsePoint(goalname, &amp;lt;Vector3 or table&amp;gt;);&lt;br /&gt;
  example: Util.AddUsePoint(&amp;quot;PLANT_wall&amp;quot;,{Vec3(12,34,5),Vec3(23,5,67)});&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
used to add use points for a goal at given positions. Goals can have multiple use points. You must set RandomUsePoint property to 1, otherwise bots will always choose the nearest use point.&lt;br /&gt;
&lt;br /&gt;
==== Util.AddUseWp ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: Util.AddUseWp(goalname, &amp;lt;waypointname or table&amp;gt;);&lt;br /&gt;
  example: Util.AddUseWp( &amp;quot;somegoalname&amp;quot;, &amp;quot;somewaypointname&amp;quot; );&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
used to add use points for a goal at given waypoints positions. Goals can have multiple use points. You must set RandomUsePoint property to 1, otherwise bots will always choose the nearest use point.&lt;br /&gt;
&lt;br /&gt;
==== Util.AliveCount ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: Util.AliveCount( team, class );&lt;br /&gt;
  example: Util.AliveCount( TEAM.AXIS, CLASS.MEDIC ); &amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
returns the number of bots alive on a team with a given class&lt;br /&gt;
&lt;br /&gt;
==== Util.BotChat ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: Util.BotChat(Team, msgType, Msg, NumBots);&lt;br /&gt;
  example: Util.BotChat(TEAM.ALLIES, &amp;quot;vsay&amp;quot;, VOICE.G_CHEER, 2);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
See [[Talking_bots]] page&lt;br /&gt;
&lt;br /&gt;
==== Util.BotHasAnyRole ====&lt;br /&gt;
&lt;br /&gt;
This function is deprecated. Use [[Bot#HasRole|HasRole]]&lt;br /&gt;
&lt;br /&gt;
==== Util.CanBotSnipe ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: Util.CanBotSnipe(bot);&lt;br /&gt;
  example: if ( Util.CanBotSnipe(bot) ) {&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
returns true if bot has a sniper weapon.&lt;br /&gt;
&lt;br /&gt;
==== Util.CappointForFlag ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: Util.CappointForFlag( flag_goalname, cappoint_goalname );&lt;br /&gt;
  example: Util.CappointForFlag( &amp;quot;FLAG_axis_gold&amp;quot;, &amp;quot;CAPPOINT_Truck&amp;quot; );&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
used if there are multiple active cappoint goals. It should be called from _Taken triggers.&lt;br /&gt;
&lt;br /&gt;
==== Util.ChangeBotSpawn ====&lt;br /&gt;
This function is deprecated. See [[Changing spawns]].&lt;br /&gt;
&lt;br /&gt;
==== Util.ChangeCrucialClassForRole ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: Util.ChangeCrucialClassForRole ( team, role, class );&lt;br /&gt;
  example: Util.ChangeCrucialClassForRole(TEAM.AXIS, ROLE.DEFENDER1, CLASS.COVERTOPS);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sets new crucialClass in the Map.Roles table.&lt;br /&gt;
&lt;br /&gt;
==== Util.ChangeSpawn ====&lt;br /&gt;
&lt;br /&gt;
This function is deprecated. See [[Changing spawns]].&lt;br /&gt;
&lt;br /&gt;
==== Util.ChangeSpawnForRole ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: Util.ChangeSpawnForRole( &amp;lt;team&amp;gt;, &amp;lt;role&amp;gt;, &amp;lt;spawnpoint&amp;gt; );&lt;br /&gt;
  example: Util.ChangeSpawnForRole(TEAM.ALLIES, ROLE.ATTACKER, 1);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Set the spawn point for all bots on the given team with the given role&lt;br /&gt;
&lt;br /&gt;
see also: [[Roles]] Page&lt;br /&gt;
&lt;br /&gt;
==== Util.ChangeToSniperWeapons ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: Util.ChangeToSniperWeapons( bot, &amp;lt;optional viewDistance&amp;gt; );&lt;br /&gt;
  example: Util.ChangeToSniperWeapons(bot);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
called from OnBotJoin on sniper maps.&lt;br /&gt;
&lt;br /&gt;
see also: [[Sniper_and_Panzer_maps]]&lt;br /&gt;
&lt;br /&gt;
==== Util.ClearRoleForGoals ====&lt;br /&gt;
&lt;br /&gt;
This function is deprecated. Use [[Bot_Library#ClearGoalRole|ClearGoalRole]]&lt;br /&gt;
&lt;br /&gt;
==== Util.ClearRoleForGroup ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: Util.ClearRoleForGroup( group, &amp;lt;role or table&amp;gt; );&lt;br /&gt;
  example: Util.ClearRoleForGroup( &amp;quot;someGroup&amp;quot;, ROLE.DEFENDER );&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
used to remove roles from a given group of goals&lt;br /&gt;
&lt;br /&gt;
see also: [[Roles]] Page&lt;br /&gt;
&lt;br /&gt;
==== Util.ClearRoleForTable ====&lt;br /&gt;
&lt;br /&gt;
This function is deprecated. Use [[Bot_Library#ClearGoalRole|ClearGoalRole]]&lt;br /&gt;
&lt;br /&gt;
==== Util.DisableGoal ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: Util.DisableGoal(goalname, &amp;lt;optional true&amp;gt;);&lt;br /&gt;
  example: Util.DisableGoal(&amp;quot;FLAG_someflag&amp;quot;); &amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
disables the goal for both teams. the optional true parameter is used to disable all goals except for ROUTE goals.&lt;br /&gt;
&lt;br /&gt;
==== Util.DisableGroup ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: Util.DisableGroup(groupname, team);&lt;br /&gt;
  example: Util.DisableGroup( &amp;quot;somegroupname&amp;quot;, TEAM.ALLIES );&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
used to disable a set of goals in the given group for a given team&lt;br /&gt;
&lt;br /&gt;
==== Util.EnableGoal ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: Util.EnableGoal(goalname);&lt;br /&gt;
  example: Util.EnableGoal(&amp;quot;FLAG_someflag&amp;quot;);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
enables the goal for both teams.&lt;br /&gt;
&lt;br /&gt;
==== Util.EnableGroup ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: Util.EnableGroup(groupname, team);&lt;br /&gt;
  example: Util.EnableGroup( &amp;quot;somegroupname&amp;quot;, TEAM.SOMETEAM );&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
used to enable a set of goals in the given group for a given team&lt;br /&gt;
&lt;br /&gt;
==== Util.ExcludeClass ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: Util.ExcludeClass( goalname, team, class1, class2, class3, class4 );&lt;br /&gt;
  example: Util.ExcludeClass( &amp;quot;DEFEND_somegoal.*&amp;quot;, TEAM.AXIS, CLASS.MEDIC );&lt;br /&gt;
  example: Util.ExcludeClass( &amp;quot;MOUNTMG42_.*&amp;quot;, TEAM.ALLIES, CLASS.FIELDOPS, CLASS.ENGINEER );&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
limit given goal usage to specific classes by team. class2, class3, and class4 are optional.&lt;br /&gt;
&lt;br /&gt;
==== Util.ForceRouting ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: Util.ForceRouting(goalName, true/false);&lt;br /&gt;
  example: Util.ForceRouting( &amp;quot;BUILD_Tank&amp;quot;, true );&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
disables BUILD goal offsets and enables routes to the goal. You should set ForceRouting to true only when a vehicle is at known position (in OnMapLoad or at tank barriers). You must set it to false when a vehicle is repaired.&lt;br /&gt;
&lt;br /&gt;
==== Util.GetEntHealth ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: Util.GetEntHealth(entity);&lt;br /&gt;
  example: health = Util.GetEntHealth(this.TargetEntity);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
returns entity health.&lt;br /&gt;
&lt;br /&gt;
==== Util.GetGroup ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: Util.GetGroup(groupname);&lt;br /&gt;
  example: Util.GetGroup(&amp;quot;somegroupname&amp;quot;);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
this function will return a table of goals belonging to the given group name&lt;br /&gt;
&lt;br /&gt;
==== Util.GetRandomFromTable ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: Util.GetRandomFromTable( tbl );&lt;br /&gt;
  example: index = Util.GetRandomFromTable( someTable );&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
used to get a randomly selected index from a given table. Returns -1 if invalid. Table keys must be integers from 0 to (count - 1).&lt;br /&gt;
&lt;br /&gt;
==== Util.GetRandomTableValue====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: Util.GetRandomTableValue( tbl );&lt;br /&gt;
  example: value = Util.GetRandomTableValue( someTable );&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
used to get a randomly selected value from a given table. Returns null if the table is empty or invalid. Table keys must be integers from 0 to (count - 1).&lt;br /&gt;
&lt;br /&gt;
==== Util.GoalTable ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: Util.GoalTable( &amp;lt;optional expression&amp;gt;, &amp;lt;optional teamId&amp;gt; );&lt;br /&gt;
  example: goals = Util.GoalTable(&amp;quot;PLANT_Back_Door&amp;quot;);&lt;br /&gt;
  example: goals = Util.GoalTable(&amp;quot;FLAG.*&amp;quot;, TEAM.AXIS);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
returns table of map goals that match a regular expression. &lt;br /&gt;
&lt;br /&gt;
==== Util.IgnoreTargetGoal ====&lt;br /&gt;
&lt;br /&gt;
This function is deprecated. Use [[Bot#IgnoreTarget|IgnoreTarget]]&lt;br /&gt;
&lt;br /&gt;
==== Util.IgnoreTargetGoalTable ====&lt;br /&gt;
&lt;br /&gt;
This function is deprecated. Use [[Bot#IgnoreTarget|IgnoreTarget]]&lt;br /&gt;
&lt;br /&gt;
==== Util.IsBot ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: Util.IsBot(entity);&lt;br /&gt;
  example: bot = Util.IsBot(ent); &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
returns Bot object from entity or null if entity is not a bot. Usually used in region triggers if the TriggerOnClass is CLASS.ANYPLAYER.&lt;br /&gt;
&lt;br /&gt;
==== Util.LimitToClass ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: Util.LimitToClass(goalname, team, class1, class2, class3, class4);&lt;br /&gt;
  example: Util.LimitToClass(&amp;quot;CHECKPOINT.*&amp;quot;, TEAM.ALLIES, CLASS.SOLDIER); //only soldiers on the allied team&lt;br /&gt;
  example: Util.LimitToClass(&amp;quot;CHECKPOINT.*&amp;quot;, TEAM.ALLIES, CLASS.SOLDIER, CLASS.MEDIC); //only soldiers and medics&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
used to limit specific goals to a specific class or classes&lt;br /&gt;
&lt;br /&gt;
==== Util.LimitToTeam ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: Util.LimitToTeam(team, goal);&lt;br /&gt;
  example: Util.LimitToTeam(TEAM.AXIS, &amp;quot;SWITCH_gate_depot&amp;quot;);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
limits goals to a certain team without the need to disable for 1 team&lt;br /&gt;
&lt;br /&gt;
==== Util.MapDebugPrint ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: Util.MapDebugPrint( &amp;quot;Text&amp;quot;, &amp;lt;optional message only&amp;gt; );&lt;br /&gt;
  example: Util.MapDebugPrint( &amp;quot;East_Barrier_Destroyed&amp;quot; );&lt;br /&gt;
  example: Util.MapDebugPrint( &amp;quot;East_Barrier_Destroyed&amp;quot;, true ); // only print the message&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
used to print text &amp;amp; list of available goals in the console when in debug mode&lt;br /&gt;
&lt;br /&gt;
see also: [[Debugging_tips]]&lt;br /&gt;
&lt;br /&gt;
==== Util.OnTriggerPosition ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: Util.OnTriggerPosition( goalname, wpname or position, tolerance, wpfunction );&lt;br /&gt;
  example: Util.OnTriggerPosition( &amp;quot;MOVER_train1&amp;quot;, &amp;quot;depotyard&amp;quot;, 200.0, Map.tug_depotyard );&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
note: used for setting up positional triggers for movers.&lt;br /&gt;
&lt;br /&gt;
==== Util.RandomBotSpawn ====&lt;br /&gt;
&lt;br /&gt;
This function is deprecated. See [[Changing spawns]].&lt;br /&gt;
&lt;br /&gt;
==== Util.RandomSpawn ====&lt;br /&gt;
&lt;br /&gt;
This function is deprecated. See [[Changing spawns]].&lt;br /&gt;
&lt;br /&gt;
==== Util.RemoveGoal ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: Util.RemoveGoal( goalnames );&lt;br /&gt;
  example: Util.RemoveGoal( &amp;quot;MOVER_truck&amp;quot; );&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
removes the goals from the map goal table. It should only be used for invalid goals which are badly detected by the game.&lt;br /&gt;
&lt;br /&gt;
==== Util.Routes ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: Util.Routes( &amp;lt;table&amp;gt; );&lt;br /&gt;
  example: Util.Routes(MapRoutes);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
initializes routes&lt;br /&gt;
&lt;br /&gt;
see also: [[Template:Baserouting|Routing]]&lt;br /&gt;
&lt;br /&gt;
==== Util.SetGoalOffset ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: Util.SetGoalOffset( x, y, z, GoalName );&lt;br /&gt;
  info x = North, -x = South y = East, -y = West, z = Up, -z =Down&lt;br /&gt;
  example: Util.SetGoalOffset( 0, -20, -10, &amp;quot;MOUNTMG42_boat&amp;quot; );&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
the x y and z parameters are added to the origin of the goal to move the location of where bots will look for the goal. It is sometimes needed for MOUNTMG42 and REPAIRMG42 goals because some mg42 cannot be mounted or repaired if it&#039;s position is not corrected.&lt;br /&gt;
&lt;br /&gt;
==== Util.SetGoalPosition ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: Util.SetGoalPosition( x, y, z, GoalName );&lt;br /&gt;
  example: Util.SetGoalPosition( 4534, 2168, -199, &amp;quot;BUILD_construct&amp;quot; )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
used to give the goal a new origin.&lt;br /&gt;
&lt;br /&gt;
note: it&#039;s  usually much better to use function Util.AddUsePoint to set position of BUILD or PLANT goals.&lt;br /&gt;
&lt;br /&gt;
note: console command &amp;quot;/bot mypos&amp;quot; prints your body position, command &amp;quot;/viewpos&amp;quot; prints your eye position rounded to integer.&lt;br /&gt;
&lt;br /&gt;
==== Util.SetGoalRange ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: Util.SetGoalRange( goalNames, distance or AABB );&lt;br /&gt;
  examples:&lt;br /&gt;
  Util.SetGoalRange(&amp;quot;GRENADE_tower.*&amp;quot;, 800);&lt;br /&gt;
  Util.SetGoalRange(&amp;quot;PLANT_SideGate&amp;quot;, AABB(-2785,-3579,65,2702,-1306,257));&lt;br /&gt;
  //reset to unlimited&lt;br /&gt;
  Util.SetGoalRange(&amp;quot;GRENADE_tower.*&amp;quot;, 0);&lt;br /&gt;
  Util.SetGoalRange(&amp;quot;PLANT_SideGate&amp;quot;, AABB());&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
sets the range for map goals.  It can be int radius or AABB box or both. The QueryGoals functions does not return goals which are out of range. Default range for all goals is unlimited. Goals will not be interrupted if the range changes after the bot has already activated the goal.&lt;br /&gt;
&lt;br /&gt;
==== Util.SetGroup ====&lt;br /&gt;
&lt;br /&gt;
This function is deprecated. Use [[Bot_Library#SetGoalGroup|SetGoalGroup]]&lt;br /&gt;
&lt;br /&gt;
==== Util.SetGroupForTable ====&lt;br /&gt;
&lt;br /&gt;
This function is deprecated. Use [[Bot_Library#SetGoalGroup|SetGoalGroup]]&lt;br /&gt;
&lt;br /&gt;
==== Util.SetMaxUsers ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: Util.SetMaxUsers( botnum, goal );&lt;br /&gt;
  example: Util.SetMaxUsers( 1, &amp;quot;ATTACK_.*&amp;quot; );&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
used to limit number of bots using a particular goal(s). this function sets both In_Use and In_Progress&lt;br /&gt;
&lt;br /&gt;
==== Util.SetMaxUsersInProgress ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: Util.SetMaxUsersInProgress( Users, GoalNames );&lt;br /&gt;
  example: Util.SetMaxUsersInProgress( 15, &amp;quot;CHECKPOINT.*&amp;quot; );&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
used to set the maximum number of bots going for a particular goal(s).&lt;br /&gt;
&lt;br /&gt;
==== Util.SetMaxUsersInUse ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: Util.SetMaxUsersInUse( Users, GoalNames );&lt;br /&gt;
  example: Util.SetMaxUsersInUse( 1, &amp;quot;MOUNT_.*&amp;quot; );&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
used to set the maximum number of bots using a particular goal(s).&lt;br /&gt;
&lt;br /&gt;
==== Util.SetPercentInProgress ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: Util.SetPercentInProgress(%, goal);&lt;br /&gt;
  example: Util.SetPercentInProgress(70, &amp;quot;FLAG_docs&amp;quot;);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
sets a percentage of bots to use a particular goal(s).&lt;br /&gt;
&lt;br /&gt;
note: number of bots is calculated only once when this function is called. It does not work well after bots are added or kicked.&lt;br /&gt;
&lt;br /&gt;
==== Util.SetPositionGoal ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: Util.SetPositionGoal( goalname1, goalname2 );&lt;br /&gt;
  example: Util.SetPositionGoal( &amp;quot;BUILD_Tank&amp;quot;, &amp;quot;MOVER_tank&amp;quot; );&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
sets the origin of one goal to match the origin of another. This function was used in Omni-bot 0.66. Current Omni-bot version automatically sets positions of BUILD goals.&lt;br /&gt;
&lt;br /&gt;
==== Util.SetRoleForGoals ====&lt;br /&gt;
&lt;br /&gt;
This function is deprecated. Use [[Bot_Library#SetGoalRole|SetGoalRole]]&lt;br /&gt;
&lt;br /&gt;
==== Util.SetRoleForGroup ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: Util.SetRoleForGroup( &amp;lt;goal group&amp;gt;, &amp;lt;role or table&amp;gt; );&lt;br /&gt;
  example: Util.SetRoleForGroup( &amp;quot;myGroup&amp;quot;, ROLE.DEFENDER );&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
sets the given roles for the given group of goals.&lt;br /&gt;
&lt;br /&gt;
==== Util.SetRoleForTable ====&lt;br /&gt;
&lt;br /&gt;
This function is deprecated. Use [[Bot_Library#SetGoalRole|SetGoalRole]]&lt;br /&gt;
&lt;br /&gt;
see also: [[Roles]] Page&lt;br /&gt;
&lt;br /&gt;
==== Util.ShowGroup ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: Util.ShowGroup(groupname);&lt;br /&gt;
  example: Util.ShowGroup(&amp;quot;somegroupname&amp;quot;);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
this function will list all goals in the given group in the console.&lt;br /&gt;
&lt;br /&gt;
==== Util.UpdateSwitchData ====&lt;br /&gt;
&lt;br /&gt;
This function is deprecated. Use [[Switch_Goal]]&lt;br /&gt;
&lt;br /&gt;
==== Util.WpNameInfo ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: Util.WpNameInfo(waypointName);&lt;br /&gt;
  example: wpInfo = Util.WpNameInfo(&amp;quot;rNadeHall&amp;quot;);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
finds waypoint by name and returns table which contains position, facing, radius, flags, property. It is often used in paththrough navigation.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== ETUtil ===&lt;br /&gt;
These functions are available only in the Enemy Territory game.&lt;br /&gt;
&lt;br /&gt;
==== ETUtil.ChangeToPanzer ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: ETUtil.ChangeToPanzer( bot );&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
called from OnBotJoin on panzer maps.&lt;br /&gt;
&lt;br /&gt;
see also: [[Sniper_and_Panzer_maps]]&lt;br /&gt;
&lt;br /&gt;
==== ETUtil.CountClass ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: ETUtil.CountClass( team, class );&lt;br /&gt;
  example: ETUtil.CountClass( TEAM.ALLIES, CLASS.ENGINEER ); &amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
can be used to determine if a team has enough of a critical class for the map&lt;br /&gt;
&lt;br /&gt;
==== ETUtil.GetReinforceTime ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: ETUtil.GetReinforceTime(TEAM.AXIS);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
returns time to next respawn, or null if no bot exists in the team.&lt;br /&gt;
&lt;br /&gt;
==== ETUtil.GetTimeElapsed ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: ETUtil.GetTimeElapsed();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
returns time since map start.&lt;br /&gt;
&lt;br /&gt;
==== ETUtil.IsTeamClassDead ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: ETUtil.IsTeamClassDead( team, class );&lt;br /&gt;
  example: ETUtil.IsTeamClassDead( TEAM.AXIS, CLASS.MEDIC ); &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
returns true if all the players of the given class on the given team are dead.&lt;br /&gt;
&lt;br /&gt;
==== ETUtil.IsTeamDead ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: ETUtil.IsTeamDead( team );&lt;br /&gt;
  example: ETUtil.IsTeamDead( TEAM.AXIS );&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
returns true if all players on the given team are dead.&lt;br /&gt;
&lt;br /&gt;
==== ETUtil.KillTeam ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: ETUtil.KillTeam( team, &amp;lt;optional maxTime&amp;gt; );&lt;br /&gt;
  example: ETUtil.KillTeam( TEAM.AXIS, 15 );&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
waits for next respawn and then kills all bots in the team, but only if time to next respawn is not greater than maxTime.&lt;br /&gt;
&lt;br /&gt;
==== ETUtil.LosingChat ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: ETUtil.LosingChat(team);&lt;br /&gt;
  example: ETUtil.LosingChat( TEAM.AXIS );&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
See [[Talking_bots]] page&lt;br /&gt;
&lt;br /&gt;
==== ETUtil.SelectWeapon ====&lt;br /&gt;
&lt;br /&gt;
This function does not work since version 0.82. Now you have to use [[Utility_Functions#WeaponTable|WeaponTable.SetWeaponAvailability]].&lt;br /&gt;
&lt;br /&gt;
==== ETUtil.SetAimModeForMount====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: ETUtil.SetAimModeForMount(goalName, aimType);&lt;br /&gt;
  example: ETUtil.SetAimModeForMount(&amp;quot;MOUNT_ship&amp;quot;, Vec3(-340, 1530, 90));&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sets AimMode property of MOUNT goal. Valid values are &amp;quot;velocity&amp;quot;, &amp;quot;opposite&amp;quot;, &amp;quot;random&amp;quot; or Vector3.&lt;br /&gt;
&lt;br /&gt;
==== ETUtil.SetCabinets ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: ETUtil.SetCabinets();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
disables health &amp;amp; ammo cabinets for Medic &amp;amp; FieldOp Classes&lt;br /&gt;
&lt;br /&gt;
==== ETUtil.SetExcludeIndexes ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: ETUtil.SetExcludeIndexes( goal, { offset } );&lt;br /&gt;
  example: ETUtil.SetExcludeIndexes( &amp;quot;BUILD_Truck&amp;quot;, { 4, 5, 6 } ); // Disable offset 4, 5 &amp;amp; 6&lt;br /&gt;
  example: ETUtil.SetExcludeIndexes( &amp;quot;BUILD_Truck&amp;quot;, {} ); // Removes Disabled offsets&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
disables vehicle offsets, used when an offset cannot be reached. Used only by goals BUILD, ESCORT, MOUNT, RIDE.&lt;br /&gt;
&lt;br /&gt;
==== ETUtil.SetStartIndex ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: ETUtil.SetStartIndex(goal, offset);&lt;br /&gt;
  example: ETUtil.SetStartIndex(&amp;quot;ESCORT_tank&amp;quot;, 2); // Use Offset 2&lt;br /&gt;
  example: ETUtil.SetStartIndex(&amp;quot;ESCORT_tank&amp;quot;, -1); // Random&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
used to make a bot start from a certain vehicle offset in mover goals that have offsets defined. Normally set in OnMapLoad then reset inside a trigger. Used only by goals BUILD, ESCORT, MOUNT, RIDE.&lt;br /&gt;
&lt;br /&gt;
==== ETUtil.SuicideSpawn ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: ETUtil.SuicideSpawn( team, spawn, numbots, class);&lt;br /&gt;
  example: ETUtil.SuicideSpawn( TEAM.AXIS, 2, 1, CLASS.ENGINEER ); // 2 bots spawn at spawnpoint 2&lt;br /&gt;
  example: ETUtil.SuicideSpawn( TEAM.AXIS, 2, -1, CLASS.ENGINEER ); // all axis engineer bots spawn at spawnpoint 2&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
used to make bots self kill and change to a new spawn, often used in maps to defend areas when players have sneaked past.&lt;br /&gt;
&lt;br /&gt;
==== ETUtil.SwitchWeapon ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: ETUtil.SwitchWeapon(weapon);&lt;br /&gt;
  example: ETUtil.SwitchWeapon(WEAPON.PANZERFAUST); //all soldiers will switch to panzer&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This function is deprecated since version 0.82 because it only kills bot and does not change his weapon.&lt;br /&gt;
&lt;br /&gt;
==== ETUtil.WaitForSpawn ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: ETUtil.WaitForSpawn(Team);&lt;br /&gt;
  example: ETUtil.WaitForSpawn( TEAM.ALLIES );&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sleeps until next respawn of the team. Returns 0.15 seconds before respawn.&lt;br /&gt;
&lt;br /&gt;
==== ETUtil.WinningChat ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: ETUtil.WinningChat(Team);&lt;br /&gt;
  example: ETUtil.WinningChat( TEAM.ALLIES );&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
See [[Talking_bots]] page&lt;br /&gt;
&lt;br /&gt;
=== RTCWUtil ===&lt;br /&gt;
These functions are available only in the Return to Castle Wolfenstein game.&lt;br /&gt;
&lt;br /&gt;
==== RTCWUtil.BotDisableCombatCrouch ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: RTCWUtil.BotDisableCombatCrouch( bot, bool enable );&lt;br /&gt;
  example: RTCWUtil.BotDisableCombatCrouch( bot, true );&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
used to disable crouching in combat for the given bot&lt;br /&gt;
&lt;br /&gt;
==== RTCWUtil.ChangeClass ====&lt;br /&gt;
&lt;br /&gt;
This function is deprecated. Use Server.MinClassCount.&lt;br /&gt;
&lt;br /&gt;
==== RTCWUtil.ChangeSpawnNoDefenders ====&lt;br /&gt;
&lt;br /&gt;
This function is deprecated. See [[Changing spawns]].&lt;br /&gt;
&lt;br /&gt;
==== RTCWUtil.ClearMainGoals ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: RTCWUtil.ClearMainGoals();&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
This function will deactivate all main goals for both teams.&lt;br /&gt;
  &lt;br /&gt;
   goals deactivated: PLANT MOUNTMG42 MOVER CHECKPOINT FLAG&lt;br /&gt;
&lt;br /&gt;
==== RTCWUtil.ClearSecondaryGoals ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: RTCWUtil.ClearSecondaryGoals();&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  This function will deactivate all secondary goals for both teams.&lt;br /&gt;
  &lt;br /&gt;
  goals deactivated: ARTILLERY REPAIR&lt;br /&gt;
&lt;br /&gt;
==== RTCWUtil.CountClass ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: RTCWUtil.CountClass( team, class );&lt;br /&gt;
  example: RTCWUtil.CountClass( TEAM.ALLIES, CLASS.ENGINEER ); &amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
can be used to determine if a team has enough of a critical class for the map&lt;br /&gt;
&lt;br /&gt;
==== RTCWUtil.CountTeam ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: RTCWUtil.DisableGoal(goalname, &amp;lt;optional true&amp;gt;);&lt;br /&gt;
  example: RTCWUtil.DisableGoal(&amp;quot;FLAG_someflag&amp;quot;); &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
disables the goal for both teams. the optional true parameter is used to disable all goals except for ROUTE goals.&lt;br /&gt;
&lt;br /&gt;
==== RTCWUtil.IsPlantGoalAvailable ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: RTCWUtil.IsPlantGoalAvailable();&lt;br /&gt;
  example: RTCWUtil.IsPlantGoalAvailable();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
returns true if there is a plant goal available&lt;br /&gt;
&lt;br /&gt;
==== RTCWUtil.IsTeamClassDead ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: RTCWUtil.IsTeamClassDead( team, class );&lt;br /&gt;
  example: RTCWUtil.IsTeamClassDead( TEAM.AXIS, CLASS.ENGINEER )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
returns true if there are no living players or bots of a given class on the given team&lt;br /&gt;
&lt;br /&gt;
==== RTCWUtil.IsTeamDead ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: RTCWUtil.IsTeamDead( team, minbots );&lt;br /&gt;
  example: RTCWUtil.IsTeamDead( TEAM.AXIS, 2 );&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
returns true if the number of living players on the given team is less than minbots.&lt;br /&gt;
&lt;br /&gt;
note: minbots is optional as it defaults to 1&lt;br /&gt;
&lt;br /&gt;
==== RTCWUtil.KillEntities ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: RTCWUtil.KillEntities( table or int );&lt;br /&gt;
  example: RTCWUtil.KillEntities( 123 );&lt;br /&gt;
  example: RTCWUtil.KillEntities( {123, 124} );&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
used to remove entities from the map. typically called from OnMapLoad&lt;br /&gt;
&lt;br /&gt;
==== RTCWUtil.NoSnipe ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: syntax: RTCWUtil.NoSnipe(bot);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
soldier bots will not choose a mauser when selecting a weapon&lt;br /&gt;
 &lt;br /&gt;
note: this is typically called in OnBotJoin&lt;br /&gt;
&lt;br /&gt;
==== RTCWUtil.SelectSoldierWeapons ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: RTCWUtil.SelectSoldierWeapons(team, bot, weap1, weap2, weap3);&lt;br /&gt;
  soldiers will only select weapons passed in as parameters&lt;br /&gt;
  &lt;br /&gt;
  note: typically used in OnBotJoin to have soldiers choose between given weapons&lt;br /&gt;
  example: RTCWUtil.SelectSoldierWeapons(TEAM.AXIS, bot, WEAPON.MAUSER, WEAPON.PANZERFAUST); //axis soldiers randomly select panzer or mauser&lt;br /&gt;
  example: RTCWUtil.SelectSoldierWeapons(0, bot, WEAPON.MAUSER, WEAPON.PANZERFAUST); //all soldiers randomly select panzer or mauser&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
&lt;br /&gt;
==== RTCWUtil.SelectWeapon ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: RTCWUtil.SelectWeapon(bot, weapon, isFog);&lt;br /&gt;
  example: RTCWUtil.SelectWeapon(bot, WEAPON.MAUSER);&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
the given bot will switch to the given weapon if it is the correct class for the weapon&lt;br /&gt;
 &lt;br /&gt;
note: typically used in OnBotJoin to have soldiers choose a specific weapon&lt;br /&gt;
         the isFog parameter is optional and disables extra view distance given to snipers&lt;br /&gt;
&lt;br /&gt;
==== RTCWUtil.SetPrimaryGoals ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: RTCWUtil.SetPrimaryGoals(priority);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
used for setting priorities of common goals.&lt;br /&gt;
  &lt;br /&gt;
note: this is typically called in OnMapLoad and effects the following goals (in order of priority):&lt;br /&gt;
         CAPPOINT FLAGRETURN PLANT CHECKPOINT FLAG&lt;br /&gt;
&lt;br /&gt;
==== RTCWUtil.SetSuicide ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: RTCWUtil.SetSuicide(team, class, suicide, persistant);&lt;br /&gt;
  sets all classes on the given team so they commit suicide two seconds before the next spawn&lt;br /&gt;
         the persistant parameter if set will have them do it every spawn until it is turned off ( or round ends)&lt;br /&gt;
 &lt;br /&gt;
  example: RTCWUtil.SetSuicide(TEAM.ALLIES, CLASS.LIEUTENANT, 1, 1); //commit suicide 2 seconds before every spawn&lt;br /&gt;
  example: RTCWUtil.SetSuicide(TEAM.ALLIES, CLASS.LIEUTENANT, 0, 0); //disable the suicide flag for them&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== RTCWUtil.SetTeamSuicide ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: RTCWUtil.SetSuicide(team, suicide, persistant);&lt;br /&gt;
  sets all bots on the given team so they commit suicide two seconds before the next spawn&lt;br /&gt;
         the persistant parameter if set will have them do it every spawn until it is turned off ( or round ends)&lt;br /&gt;
 &lt;br /&gt;
  example: RTCWUtil.SetTeamSuicide(TEAM.ALLIES, 1, 1); //commit suicide 2 seconds before every spawn&lt;br /&gt;
  example: RTCWUtil.SetTeamSuicide(TEAM.ALLIES, 0, 0); //disable the suicide flag for them&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== RTCWUtil.StopSniping ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: RTCWUtil.StopSniping();&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
all bots currently using a sniper weapon will switch to a different weapon&lt;br /&gt;
  &lt;br /&gt;
note: this is typically called inside trigger functions&lt;br /&gt;
&lt;br /&gt;
==== RTCWUtil.SwitchSoldierWeapons ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: RTCWUtil.SwitchSoldierWeapons(team, bot, weap1, weap2, weap3);&lt;br /&gt;
  soldiers will only select weapons passed in as parameters&lt;br /&gt;
  &lt;br /&gt;
  note: typically used in triggers to have soldiers choose between given weapons&lt;br /&gt;
  example: RTCWUtil.SwitchSoldierWeapons(TEAM.AXIS, bot, WEAPON.MAUSER, WEAPON.PANZERFAUST); //axis soldiers randomly select panzer or mauser&lt;br /&gt;
  example: RTCWUtil.SwitchSoldierWeapons(0, bot, WEAPON.MAUSER, WEAPON.PANZERFAUST); //all soldiers randomly select panzer or mauser&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
==== RTCWUtil.SwitchWeapon ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: RTCWUtil.SwitchWeapon(weapon);&lt;br /&gt;
  all qualifying bots will switch to the given weapon&lt;br /&gt;
  &lt;br /&gt;
  example: RTCWUtil.SwitchWeapon(WEAPON.PANZERFAUST); //all soldiers will switch to panzer&lt;br /&gt;
  note: typically used in trigger functions&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== RTCWUtil.TeamDisableCombatCrouch ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: RTCWUtil.TeamDisableCombatCrouch( team );&lt;br /&gt;
  example: RTCWUtil.TeamDisableCombatCrouch( TEAM.AXIS );&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
disables combat crouching for the given team&lt;br /&gt;
&lt;br /&gt;
==== RTCWUtil.ToggleFlag ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: RTCWUtil.ToggleFlag( goal, time in seconds );&lt;br /&gt;
  example: thread(RTCWUtil.ToggleFlag, &amp;quot;CHECKPOINT.someFlag&amp;quot;, 300);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
used in dual objective maps like mp_depot to set availability of the checkpoint goal for the opposite team in the given interval&lt;br /&gt;
note: this should be called as a gm thread.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== WeaponTable ===&lt;br /&gt;
&lt;br /&gt;
==== WeaponTable.ListWeaponAvailability ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: WeaponTable.ListWeaponAvailability();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
prints current availability of all weapons&lt;br /&gt;
&lt;br /&gt;
==== WeaponTable.SetWeaponAvailability ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: WeaponTable.SetWeaponAvailability( class, weapon, &amp;lt;true/false&amp;gt;);&lt;br /&gt;
  example: WeaponTable.SetWeaponAvailability( CLASS.SOLDIER, WEAPON.FLAMETHROWER, false );&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
enables or disables specified weapon for class. The weapon parameter can be table.&lt;br /&gt;
The class parameter can be null to set availability for all classes.&lt;br /&gt;
&lt;br /&gt;
note: allied PANZERFAUST is automatically converted to BAZOOKA or LAW in Noquarter or ETnam&lt;br /&gt;
&lt;br /&gt;
note: bots select random available weapon every spawn (in limbo)&lt;br /&gt;
&lt;br /&gt;
==== WeaponTable.SetWeaponTeamAvailability ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: WeaponTable.SetWeaponTeamAvailability( team, class, weapon, &amp;lt;true/false&amp;gt;);&lt;br /&gt;
  example: WeaponTable.SetWeaponTeamAvailability( TEAM.AXIS, CLASS.ENGINEER, WEAPON.KAR98, false );&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
enables or disables weapon for team and class.&lt;br /&gt;
&lt;br /&gt;
==== WeaponTable.Shotgun ====&lt;br /&gt;
&lt;br /&gt;
The Shotgun property has value WEAPON.SHOTGUN, WEAPON.ITHACA, WEAPON.M97 or null.&lt;/div&gt;</summary>
		<author><name>Palota</name></author>
	</entry>
	<entry>
		<id>https://mygamingtalk.com/wiki/index.php?title=Utility_Functions&amp;diff=1773</id>
		<title>Utility Functions</title>
		<link rel="alternate" type="text/html" href="https://mygamingtalk.com/wiki/index.php?title=Utility_Functions&amp;diff=1773"/>
		<updated>2025-05-25T17:31:07Z</updated>

		<summary type="html">&lt;p&gt;Palota: /* ETUtil.IsTeamDead */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{process header&lt;br /&gt;
 | title    = Utility Functions&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;
{{TOCright}}&lt;br /&gt;
&lt;br /&gt;
=== Util ===&lt;br /&gt;
&lt;br /&gt;
==== Util.AddUsePoint ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: Util.AddUsePoint(goalname, &amp;lt;Vector3 or table&amp;gt;);&lt;br /&gt;
  example: Util.AddUsePoint(&amp;quot;PLANT_wall&amp;quot;,{Vec3(12,34,5),Vec3(23,5,67)});&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
used to add use points for a goal at given positions. Goals can have multiple use points. You must set RandomUsePoint property to 1, otherwise bots will always choose the nearest use point.&lt;br /&gt;
&lt;br /&gt;
==== Util.AddUseWp ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: Util.AddUseWp(goalname, &amp;lt;waypointname or table&amp;gt;);&lt;br /&gt;
  example: Util.AddUseWp( &amp;quot;somegoalname&amp;quot;, &amp;quot;somewaypointname&amp;quot; );&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
used to add use points for a goal at given waypoints positions. Goals can have multiple use points. You must set RandomUsePoint property to 1, otherwise bots will always choose the nearest use point.&lt;br /&gt;
&lt;br /&gt;
==== Util.AliveCount ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: Util.AliveCount( team, class );&lt;br /&gt;
  example: Util.AliveCount( TEAM.AXIS, CLASS.MEDIC ); &amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
returns the number of bots alive on a team with a given class&lt;br /&gt;
&lt;br /&gt;
==== Util.BotChat ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: Util.BotChat(Team, msgType, Msg, NumBots);&lt;br /&gt;
  example: Util.BotChat(TEAM.ALLIES, &amp;quot;vsay&amp;quot;, VOICE.G_CHEER, 2);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
See [[Talking_bots]] page&lt;br /&gt;
&lt;br /&gt;
==== Util.BotHasAnyRole ====&lt;br /&gt;
&lt;br /&gt;
This function is deprecated. Use [[Bot#HasRole|HasRole]]&lt;br /&gt;
&lt;br /&gt;
==== Util.CanBotSnipe ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: Util.CanBotSnipe(bot);&lt;br /&gt;
  example: if ( Util.CanBotSnipe(bot) ) {&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
returns true if bot has a sniper weapon.&lt;br /&gt;
&lt;br /&gt;
==== Util.CappointForFlag ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: Util.CappointForFlag( flag_goalname, cappoint_goalname );&lt;br /&gt;
  example: Util.CappointForFlag( &amp;quot;FLAG_axis_gold&amp;quot;, &amp;quot;CAPPOINT_Truck&amp;quot; );&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
used if there are multiple active cappoint goals. It should be called from _Taken triggers.&lt;br /&gt;
&lt;br /&gt;
==== Util.ChangeBotSpawn ====&lt;br /&gt;
This function is deprecated. See [[Changing spawns]].&lt;br /&gt;
&lt;br /&gt;
==== Util.ChangeCrucialClassForRole ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: Util.ChangeCrucialClassForRole ( team, role, class );&lt;br /&gt;
  example: Util.ChangeCrucialClassForRole(TEAM.AXIS, ROLE.DEFENDER1, CLASS.COVERTOPS);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sets new crucialClass in the Map.Roles table.&lt;br /&gt;
&lt;br /&gt;
==== Util.ChangeSpawn ====&lt;br /&gt;
&lt;br /&gt;
This function is deprecated. See [[Changing spawns]].&lt;br /&gt;
&lt;br /&gt;
==== Util.ChangeSpawnForRole ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: Util.ChangeSpawnForRole( &amp;lt;team&amp;gt;, &amp;lt;role&amp;gt;, &amp;lt;spawnpoint&amp;gt; );&lt;br /&gt;
  example: Util.ChangeSpawnForRole(TEAM.ALLIES, ROLE.ATTACKER, 1);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Set the spawn point for all bots on the given team with the given role&lt;br /&gt;
&lt;br /&gt;
see also: [[Roles]] Page&lt;br /&gt;
&lt;br /&gt;
==== Util.ChangeToSniperWeapons ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: Util.ChangeToSniperWeapons( bot, &amp;lt;optional viewDistance&amp;gt; );&lt;br /&gt;
  example: Util.ChangeToSniperWeapons(bot);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
called from OnBotJoin on sniper maps.&lt;br /&gt;
&lt;br /&gt;
see also: [[Sniper_and_Panzer_maps]]&lt;br /&gt;
&lt;br /&gt;
==== Util.ClearRoleForGoals ====&lt;br /&gt;
&lt;br /&gt;
This function is deprecated. Use [[Bot_Library#ClearGoalRole|ClearGoalRole]]&lt;br /&gt;
&lt;br /&gt;
==== Util.ClearRoleForGroup ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: Util.ClearRoleForGroup( group, &amp;lt;role or table&amp;gt; );&lt;br /&gt;
  example: Util.ClearRoleForGroup( &amp;quot;someGroup&amp;quot;, ROLE.DEFENDER );&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
used to remove roles from a given group of goals&lt;br /&gt;
&lt;br /&gt;
see also: [[Roles]] Page&lt;br /&gt;
&lt;br /&gt;
==== Util.ClearRoleForTable ====&lt;br /&gt;
&lt;br /&gt;
This function is deprecated. Use [[Bot_Library#ClearGoalRole|ClearGoalRole]]&lt;br /&gt;
&lt;br /&gt;
==== Util.DisableGoal ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: Util.DisableGoal(goalname, &amp;lt;optional true&amp;gt;);&lt;br /&gt;
  example: Util.DisableGoal(&amp;quot;FLAG_someflag&amp;quot;); &amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
disables the goal for both teams. the optional true parameter is used to disable all goals except for ROUTE goals.&lt;br /&gt;
&lt;br /&gt;
==== Util.DisableGroup ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: Util.DisableGroup(groupname, team);&lt;br /&gt;
  example: Util.DisableGroup( &amp;quot;somegroupname&amp;quot;, TEAM.ALLIES );&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
used to disable a set of goals in the given group for a given team&lt;br /&gt;
&lt;br /&gt;
==== Util.EnableGoal ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: Util.EnableGoal(goalname);&lt;br /&gt;
  example: Util.EnableGoal(&amp;quot;FLAG_someflag&amp;quot;);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
enables the goal for both teams.&lt;br /&gt;
&lt;br /&gt;
==== Util.EnableGroup ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: Util.EnableGroup(groupname, team);&lt;br /&gt;
  example: Util.EnableGroup( &amp;quot;somegroupname&amp;quot;, TEAM.SOMETEAM );&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
used to enable a set of goals in the given group for a given team&lt;br /&gt;
&lt;br /&gt;
==== Util.ExcludeClass ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: Util.ExcludeClass( goalname, team, class1, class2, class3, class4 );&lt;br /&gt;
  example: Util.ExcludeClass( &amp;quot;DEFEND_somegoal.*&amp;quot;, TEAM.AXIS, CLASS.MEDIC );&lt;br /&gt;
  example: Util.ExcludeClass( &amp;quot;MOUNTMG42_.*&amp;quot;, TEAM.ALLIES, CLASS.FIELDOPS, CLASS.ENGINEER );&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
limit given goal usage to specific classes by team. class2, class3, and class4 are optional.&lt;br /&gt;
&lt;br /&gt;
==== Util.ForceRouting ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: Util.ForceRouting(goalName, true/false);&lt;br /&gt;
  example: Util.ForceRouting( &amp;quot;BUILD_Tank&amp;quot;, true );&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
disables BUILD goal offsets and enables routes to the goal. You should set ForceRouting to true only when a vehicle is at known position (in OnMapLoad or at tank barriers). You must set it to false when a vehicle is repaired.&lt;br /&gt;
&lt;br /&gt;
==== Util.GetEntHealth ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: Util.GetEntHealth(entity);&lt;br /&gt;
  example: health = Util.GetEntHealth(this.TargetEntity);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
returns entity health.&lt;br /&gt;
&lt;br /&gt;
==== Util.GetGroup ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: Util.GetGroup(groupname);&lt;br /&gt;
  example: Util.GetGroup(&amp;quot;somegroupname&amp;quot;);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
this function will return a table of goals belonging to the given group name&lt;br /&gt;
&lt;br /&gt;
==== Util.GetRandomFromTable ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: Util.GetRandomFromTable( tbl );&lt;br /&gt;
  example: index = Util.GetRandomFromTable( someTable );&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
used to get a randomly selected index from a given table. Returns -1 if invalid. Table keys must be integers from 0 to (count - 1).&lt;br /&gt;
&lt;br /&gt;
==== Util.GetRandomTableValue====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: Util.GetRandomTableValue( tbl );&lt;br /&gt;
  example: value = Util.GetRandomTableValue( someTable );&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
used to get a randomly selected value from a given table. Returns null if the table is empty or invalid. Table keys must be integers from 0 to (count - 1).&lt;br /&gt;
&lt;br /&gt;
==== Util.GoalTable ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: Util.GoalTable( &amp;lt;optional expression&amp;gt;, &amp;lt;optional teamId&amp;gt; );&lt;br /&gt;
  example: goals = Util.GoalTable(&amp;quot;PLANT_Back_Door&amp;quot;);&lt;br /&gt;
  example: goals = Util.GoalTable(&amp;quot;FLAG.*&amp;quot;, TEAM.AXIS);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
returns table of map goals that match a regular expression. &lt;br /&gt;
&lt;br /&gt;
==== Util.IgnoreTargetGoal ====&lt;br /&gt;
&lt;br /&gt;
This function is deprecated. Use [[Bot#IgnoreTarget|IgnoreTarget]]&lt;br /&gt;
&lt;br /&gt;
==== Util.IgnoreTargetGoalTable ====&lt;br /&gt;
&lt;br /&gt;
This function is deprecated. Use [[Bot#IgnoreTarget|IgnoreTarget]]&lt;br /&gt;
&lt;br /&gt;
==== Util.IsBot ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: Util.IsBot(entity);&lt;br /&gt;
  example: bot = Util.IsBot(ent); &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
returns Bot object from entity or null if entity is not a bot. Usually used in region triggers if the TriggerOnClass is CLASS.ANYPLAYER.&lt;br /&gt;
&lt;br /&gt;
==== Util.LimitToClass ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: Util.LimitToClass(goalname, team, class1, class2, class3, class4);&lt;br /&gt;
  example: Util.LimitToClass(&amp;quot;CHECKPOINT.*&amp;quot;, TEAM.ALLIES, CLASS.SOLDIER); //only soldiers on the allied team&lt;br /&gt;
  example: Util.LimitToClass(&amp;quot;CHECKPOINT.*&amp;quot;, TEAM.ALLIES, CLASS.SOLDIER, CLASS.MEDIC); //only soldiers and medics&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
used to limit specific goals to a specific class or classes&lt;br /&gt;
&lt;br /&gt;
==== Util.LimitToTeam ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: Util.LimitToTeam(team, goal);&lt;br /&gt;
  example: Util.LimitToTeam(TEAM.AXIS, &amp;quot;SWITCH_gate_depot&amp;quot;);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
limits goals to a certain team without the need to disable for 1 team&lt;br /&gt;
&lt;br /&gt;
==== Util.MapDebugPrint ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: Util.MapDebugPrint( &amp;quot;Text&amp;quot;, &amp;lt;optional message only&amp;gt; );&lt;br /&gt;
  example: Util.MapDebugPrint( &amp;quot;East_Barrier_Destroyed&amp;quot; );&lt;br /&gt;
  example: Util.MapDebugPrint( &amp;quot;East_Barrier_Destroyed&amp;quot;, true ); // only print the message&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
used to print text &amp;amp; list of available goals in the console when in debug mode&lt;br /&gt;
&lt;br /&gt;
see also: [[Debugging_tips]]&lt;br /&gt;
&lt;br /&gt;
==== Util.OnTriggerPosition ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: Util.OnTriggerPosition( goalname, wpname or position, tolerance, wpfunction );&lt;br /&gt;
  example: Util.OnTriggerPosition( &amp;quot;MOVER_train1&amp;quot;, &amp;quot;depotyard&amp;quot;, 200.0, Map.tug_depotyard );&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
note: used for setting up positional triggers for movers.&lt;br /&gt;
&lt;br /&gt;
==== Util.RandomBotSpawn ====&lt;br /&gt;
&lt;br /&gt;
This function is deprecated. See [[Changing spawns]].&lt;br /&gt;
&lt;br /&gt;
==== Util.RandomSpawn ====&lt;br /&gt;
&lt;br /&gt;
This function is deprecated. See [[Changing spawns]].&lt;br /&gt;
&lt;br /&gt;
==== Util.RemoveGoal ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: Util.RemoveGoal( goalnames );&lt;br /&gt;
  example: Util.RemoveGoal( &amp;quot;MOVER_truck&amp;quot; );&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
removes the goals from the map goal table. It should only be used for invalid goals which are badly detected by the game.&lt;br /&gt;
&lt;br /&gt;
==== Util.Routes ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: Util.Routes( &amp;lt;table&amp;gt; );&lt;br /&gt;
  example: Util.Routes(MapRoutes);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
initializes routes&lt;br /&gt;
&lt;br /&gt;
see also: [[Template:Baserouting|Routing]]&lt;br /&gt;
&lt;br /&gt;
==== Util.SetGoalOffset ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: Util.SetGoalOffset( x, y, z, GoalName );&lt;br /&gt;
  info x = North, -x = South y = East, -y = West, z = Up, -z =Down&lt;br /&gt;
  example: Util.SetGoalOffset( 0, -20, -10, &amp;quot;MOUNTMG42_boat&amp;quot; );&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
the x y and z parameters are added to the origin of the goal to move the location of where bots will look for the goal. It is sometimes needed for MOUNTMG42 and REPAIRMG42 goals because some mg42 cannot be mounted or repaired if it&#039;s position is not corrected.&lt;br /&gt;
&lt;br /&gt;
==== Util.SetGoalPosition ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: Util.SetGoalPosition( x, y, z, GoalName );&lt;br /&gt;
  example: Util.SetGoalPosition( 4534, 2168, -199, &amp;quot;BUILD_construct&amp;quot; )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
used to give the goal a new origin.&lt;br /&gt;
&lt;br /&gt;
note: it&#039;s  usually much better to use function Util.AddUsePoint to set position of BUILD or PLANT goals.&lt;br /&gt;
&lt;br /&gt;
note: console command &amp;quot;/bot mypos&amp;quot; prints your body position, command &amp;quot;/viewpos&amp;quot; prints your eye position rounded to integer.&lt;br /&gt;
&lt;br /&gt;
==== Util.SetGoalRange ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: Util.SetGoalRange( goalNames, distance );&lt;br /&gt;
  example: Util.SetGoalRange(&amp;quot;GRENADE_tower.*&amp;quot;, 800);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
sets the range for map goals. The goals will not be available for bots that are out of range. Default range for all goals is 0 which means unlimited.&lt;br /&gt;
&lt;br /&gt;
==== Util.SetGroup ====&lt;br /&gt;
&lt;br /&gt;
This function is deprecated. Use [[Bot_Library#SetGoalGroup|SetGoalGroup]]&lt;br /&gt;
&lt;br /&gt;
==== Util.SetGroupForTable ====&lt;br /&gt;
&lt;br /&gt;
This function is deprecated. Use [[Bot_Library#SetGoalGroup|SetGoalGroup]]&lt;br /&gt;
&lt;br /&gt;
==== Util.SetMaxUsers ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: Util.SetMaxUsers( botnum, goal );&lt;br /&gt;
  example: Util.SetMaxUsers( 1, &amp;quot;ATTACK_.*&amp;quot; );&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
used to limit number of bots using a particular goal(s). this function sets both In_Use and In_Progress&lt;br /&gt;
&lt;br /&gt;
==== Util.SetMaxUsersInProgress ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: Util.SetMaxUsersInProgress( Users, GoalNames );&lt;br /&gt;
  example: Util.SetMaxUsersInProgress( 15, &amp;quot;CHECKPOINT.*&amp;quot; );&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
used to set the maximum number of bots going for a particular goal(s).&lt;br /&gt;
&lt;br /&gt;
==== Util.SetMaxUsersInUse ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: Util.SetMaxUsersInUse( Users, GoalNames );&lt;br /&gt;
  example: Util.SetMaxUsersInUse( 1, &amp;quot;MOUNT_.*&amp;quot; );&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
used to set the maximum number of bots using a particular goal(s).&lt;br /&gt;
&lt;br /&gt;
==== Util.SetPercentInProgress ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: Util.SetPercentInProgress(%, goal);&lt;br /&gt;
  example: Util.SetPercentInProgress(70, &amp;quot;FLAG_docs&amp;quot;);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
sets a percentage of bots to use a particular goal(s).&lt;br /&gt;
&lt;br /&gt;
note: number of bots is calculated only once when this function is called. It does not work well after bots are added or kicked.&lt;br /&gt;
&lt;br /&gt;
==== Util.SetPositionGoal ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: Util.SetPositionGoal( goalname1, goalname2 );&lt;br /&gt;
  example: Util.SetPositionGoal( &amp;quot;BUILD_Tank&amp;quot;, &amp;quot;MOVER_tank&amp;quot; );&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
sets the origin of one goal to match the origin of another. This function was used in Omni-bot 0.66. Current Omni-bot version automatically sets positions of BUILD goals.&lt;br /&gt;
&lt;br /&gt;
==== Util.SetRoleForGoals ====&lt;br /&gt;
&lt;br /&gt;
This function is deprecated. Use [[Bot_Library#SetGoalRole|SetGoalRole]]&lt;br /&gt;
&lt;br /&gt;
==== Util.SetRoleForGroup ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: Util.SetRoleForGroup( &amp;lt;goal group&amp;gt;, &amp;lt;role or table&amp;gt; );&lt;br /&gt;
  example: Util.SetRoleForGroup( &amp;quot;myGroup&amp;quot;, ROLE.DEFENDER );&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
sets the given roles for the given group of goals.&lt;br /&gt;
&lt;br /&gt;
==== Util.SetRoleForTable ====&lt;br /&gt;
&lt;br /&gt;
This function is deprecated. Use [[Bot_Library#SetGoalRole|SetGoalRole]]&lt;br /&gt;
&lt;br /&gt;
see also: [[Roles]] Page&lt;br /&gt;
&lt;br /&gt;
==== Util.ShowGroup ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: Util.ShowGroup(groupname);&lt;br /&gt;
  example: Util.ShowGroup(&amp;quot;somegroupname&amp;quot;);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
this function will list all goals in the given group in the console.&lt;br /&gt;
&lt;br /&gt;
==== Util.UpdateSwitchData ====&lt;br /&gt;
&lt;br /&gt;
This function is deprecated. Use [[Switch_Goal]]&lt;br /&gt;
&lt;br /&gt;
==== Util.WpNameInfo ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: Util.WpNameInfo(waypointName);&lt;br /&gt;
  example: wpInfo = Util.WpNameInfo(&amp;quot;rNadeHall&amp;quot;);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
finds waypoint by name and returns table which contains position, facing, radius, flags, property. It is often used in paththrough navigation.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== ETUtil ===&lt;br /&gt;
These functions are available only in the Enemy Territory game.&lt;br /&gt;
&lt;br /&gt;
==== ETUtil.ChangeToPanzer ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: ETUtil.ChangeToPanzer( bot );&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
called from OnBotJoin on panzer maps.&lt;br /&gt;
&lt;br /&gt;
see also: [[Sniper_and_Panzer_maps]]&lt;br /&gt;
&lt;br /&gt;
==== ETUtil.CountClass ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: ETUtil.CountClass( team, class );&lt;br /&gt;
  example: ETUtil.CountClass( TEAM.ALLIES, CLASS.ENGINEER ); &amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
can be used to determine if a team has enough of a critical class for the map&lt;br /&gt;
&lt;br /&gt;
==== ETUtil.GetReinforceTime ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: ETUtil.GetReinforceTime(TEAM.AXIS);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
returns time to next respawn, or null if no bot exists in the team.&lt;br /&gt;
&lt;br /&gt;
==== ETUtil.GetTimeElapsed ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: ETUtil.GetTimeElapsed();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
returns time since map start.&lt;br /&gt;
&lt;br /&gt;
==== ETUtil.IsTeamClassDead ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: ETUtil.IsTeamClassDead( team, class );&lt;br /&gt;
  example: ETUtil.IsTeamClassDead( TEAM.AXIS, CLASS.MEDIC ); &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
returns true if all the players of the given class on the given team are dead.&lt;br /&gt;
&lt;br /&gt;
==== ETUtil.IsTeamDead ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: ETUtil.IsTeamDead( team );&lt;br /&gt;
  example: ETUtil.IsTeamDead( TEAM.AXIS );&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
returns true if all players on the given team are dead.&lt;br /&gt;
&lt;br /&gt;
==== ETUtil.KillTeam ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: ETUtil.KillTeam( team, &amp;lt;optional maxTime&amp;gt; );&lt;br /&gt;
  example: ETUtil.KillTeam( TEAM.AXIS, 15 );&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
waits for next respawn and then kills all bots in the team, but only if time to next respawn is not greater than maxTime.&lt;br /&gt;
&lt;br /&gt;
==== ETUtil.LosingChat ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: ETUtil.LosingChat(team);&lt;br /&gt;
  example: ETUtil.LosingChat( TEAM.AXIS );&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
See [[Talking_bots]] page&lt;br /&gt;
&lt;br /&gt;
==== ETUtil.SelectWeapon ====&lt;br /&gt;
&lt;br /&gt;
This function does not work since version 0.82. Now you have to use [[Utility_Functions#WeaponTable|WeaponTable.SetWeaponAvailability]].&lt;br /&gt;
&lt;br /&gt;
==== ETUtil.SetAimModeForMount====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: ETUtil.SetAimModeForMount(goalName, aimType);&lt;br /&gt;
  example: ETUtil.SetAimModeForMount(&amp;quot;MOUNT_ship&amp;quot;, Vec3(-340, 1530, 90));&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sets AimMode property of MOUNT goal. Valid values are &amp;quot;velocity&amp;quot;, &amp;quot;opposite&amp;quot;, &amp;quot;random&amp;quot; or Vector3.&lt;br /&gt;
&lt;br /&gt;
==== ETUtil.SetCabinets ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: ETUtil.SetCabinets();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
disables health &amp;amp; ammo cabinets for Medic &amp;amp; FieldOp Classes&lt;br /&gt;
&lt;br /&gt;
==== ETUtil.SetExcludeIndexes ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: ETUtil.SetExcludeIndexes( goal, { offset } );&lt;br /&gt;
  example: ETUtil.SetExcludeIndexes( &amp;quot;BUILD_Truck&amp;quot;, { 4, 5, 6 } ); // Disable offset 4, 5 &amp;amp; 6&lt;br /&gt;
  example: ETUtil.SetExcludeIndexes( &amp;quot;BUILD_Truck&amp;quot;, {} ); // Removes Disabled offsets&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
disables vehicle offsets, used when an offset cannot be reached. Used only by goals BUILD, ESCORT, MOUNT, RIDE.&lt;br /&gt;
&lt;br /&gt;
==== ETUtil.SetStartIndex ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: ETUtil.SetStartIndex(goal, offset);&lt;br /&gt;
  example: ETUtil.SetStartIndex(&amp;quot;ESCORT_tank&amp;quot;, 2); // Use Offset 2&lt;br /&gt;
  example: ETUtil.SetStartIndex(&amp;quot;ESCORT_tank&amp;quot;, -1); // Random&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
used to make a bot start from a certain vehicle offset in mover goals that have offsets defined. Normally set in OnMapLoad then reset inside a trigger. Used only by goals BUILD, ESCORT, MOUNT, RIDE.&lt;br /&gt;
&lt;br /&gt;
==== ETUtil.SuicideSpawn ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: ETUtil.SuicideSpawn( team, spawn, numbots, class);&lt;br /&gt;
  example: ETUtil.SuicideSpawn( TEAM.AXIS, 2, 1, CLASS.ENGINEER ); // 2 bots spawn at spawnpoint 2&lt;br /&gt;
  example: ETUtil.SuicideSpawn( TEAM.AXIS, 2, -1, CLASS.ENGINEER ); // all axis engineer bots spawn at spawnpoint 2&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
used to make bots self kill and change to a new spawn, often used in maps to defend areas when players have sneaked past.&lt;br /&gt;
&lt;br /&gt;
==== ETUtil.SwitchWeapon ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: ETUtil.SwitchWeapon(weapon);&lt;br /&gt;
  example: ETUtil.SwitchWeapon(WEAPON.PANZERFAUST); //all soldiers will switch to panzer&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This function is deprecated since version 0.82 because it only kills bot and does not change his weapon.&lt;br /&gt;
&lt;br /&gt;
==== ETUtil.WaitForSpawn ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: ETUtil.WaitForSpawn(Team);&lt;br /&gt;
  example: ETUtil.WaitForSpawn( TEAM.ALLIES );&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sleeps until next respawn of the team. Returns 0.15 seconds before respawn.&lt;br /&gt;
&lt;br /&gt;
==== ETUtil.WinningChat ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: ETUtil.WinningChat(Team);&lt;br /&gt;
  example: ETUtil.WinningChat( TEAM.ALLIES );&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
See [[Talking_bots]] page&lt;br /&gt;
&lt;br /&gt;
=== RTCWUtil ===&lt;br /&gt;
These functions are available only in the Return to Castle Wolfenstein game.&lt;br /&gt;
&lt;br /&gt;
==== RTCWUtil.BotDisableCombatCrouch ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: RTCWUtil.BotDisableCombatCrouch( bot, bool enable );&lt;br /&gt;
  example: RTCWUtil.BotDisableCombatCrouch( bot, true );&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
used to disable crouching in combat for the given bot&lt;br /&gt;
&lt;br /&gt;
==== RTCWUtil.ChangeClass ====&lt;br /&gt;
&lt;br /&gt;
This function is deprecated. Use Server.MinClassCount.&lt;br /&gt;
&lt;br /&gt;
==== RTCWUtil.ChangeSpawnNoDefenders ====&lt;br /&gt;
&lt;br /&gt;
This function is deprecated. See [[Changing spawns]].&lt;br /&gt;
&lt;br /&gt;
==== RTCWUtil.ClearMainGoals ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: RTCWUtil.ClearMainGoals();&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
This function will deactivate all main goals for both teams.&lt;br /&gt;
  &lt;br /&gt;
   goals deactivated: PLANT MOUNTMG42 MOVER CHECKPOINT FLAG&lt;br /&gt;
&lt;br /&gt;
==== RTCWUtil.ClearSecondaryGoals ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: RTCWUtil.ClearSecondaryGoals();&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  This function will deactivate all secondary goals for both teams.&lt;br /&gt;
  &lt;br /&gt;
  goals deactivated: ARTILLERY REPAIR&lt;br /&gt;
&lt;br /&gt;
==== RTCWUtil.CountClass ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: RTCWUtil.CountClass( team, class );&lt;br /&gt;
  example: RTCWUtil.CountClass( TEAM.ALLIES, CLASS.ENGINEER ); &amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
can be used to determine if a team has enough of a critical class for the map&lt;br /&gt;
&lt;br /&gt;
==== RTCWUtil.CountTeam ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: RTCWUtil.DisableGoal(goalname, &amp;lt;optional true&amp;gt;);&lt;br /&gt;
  example: RTCWUtil.DisableGoal(&amp;quot;FLAG_someflag&amp;quot;); &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
disables the goal for both teams. the optional true parameter is used to disable all goals except for ROUTE goals.&lt;br /&gt;
&lt;br /&gt;
==== RTCWUtil.IsPlantGoalAvailable ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: RTCWUtil.IsPlantGoalAvailable();&lt;br /&gt;
  example: RTCWUtil.IsPlantGoalAvailable();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
returns true if there is a plant goal available&lt;br /&gt;
&lt;br /&gt;
==== RTCWUtil.IsTeamClassDead ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: RTCWUtil.IsTeamClassDead( team, class );&lt;br /&gt;
  example: RTCWUtil.IsTeamClassDead( TEAM.AXIS, CLASS.ENGINEER )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
returns true if there are no living players or bots of a given class on the given team&lt;br /&gt;
&lt;br /&gt;
==== RTCWUtil.IsTeamDead ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: RTCWUtil.IsTeamDead( team, minbots );&lt;br /&gt;
  example: RTCWUtil.IsTeamDead( TEAM.AXIS, 2 );&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
returns true if the number of living players on the given team is less than minbots.&lt;br /&gt;
&lt;br /&gt;
note: minbots is optional as it defaults to 1&lt;br /&gt;
&lt;br /&gt;
==== RTCWUtil.KillEntities ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: RTCWUtil.KillEntities( table or int );&lt;br /&gt;
  example: RTCWUtil.KillEntities( 123 );&lt;br /&gt;
  example: RTCWUtil.KillEntities( {123, 124} );&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
used to remove entities from the map. typically called from OnMapLoad&lt;br /&gt;
&lt;br /&gt;
==== RTCWUtil.NoSnipe ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: syntax: RTCWUtil.NoSnipe(bot);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
soldier bots will not choose a mauser when selecting a weapon&lt;br /&gt;
 &lt;br /&gt;
note: this is typically called in OnBotJoin&lt;br /&gt;
&lt;br /&gt;
==== RTCWUtil.SelectSoldierWeapons ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: RTCWUtil.SelectSoldierWeapons(team, bot, weap1, weap2, weap3);&lt;br /&gt;
  soldiers will only select weapons passed in as parameters&lt;br /&gt;
  &lt;br /&gt;
  note: typically used in OnBotJoin to have soldiers choose between given weapons&lt;br /&gt;
  example: RTCWUtil.SelectSoldierWeapons(TEAM.AXIS, bot, WEAPON.MAUSER, WEAPON.PANZERFAUST); //axis soldiers randomly select panzer or mauser&lt;br /&gt;
  example: RTCWUtil.SelectSoldierWeapons(0, bot, WEAPON.MAUSER, WEAPON.PANZERFAUST); //all soldiers randomly select panzer or mauser&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
&lt;br /&gt;
==== RTCWUtil.SelectWeapon ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: RTCWUtil.SelectWeapon(bot, weapon, isFog);&lt;br /&gt;
  example: RTCWUtil.SelectWeapon(bot, WEAPON.MAUSER);&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
the given bot will switch to the given weapon if it is the correct class for the weapon&lt;br /&gt;
 &lt;br /&gt;
note: typically used in OnBotJoin to have soldiers choose a specific weapon&lt;br /&gt;
         the isFog parameter is optional and disables extra view distance given to snipers&lt;br /&gt;
&lt;br /&gt;
==== RTCWUtil.SetPrimaryGoals ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: RTCWUtil.SetPrimaryGoals(priority);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
used for setting priorities of common goals.&lt;br /&gt;
  &lt;br /&gt;
note: this is typically called in OnMapLoad and effects the following goals (in order of priority):&lt;br /&gt;
         CAPPOINT FLAGRETURN PLANT CHECKPOINT FLAG&lt;br /&gt;
&lt;br /&gt;
==== RTCWUtil.SetSuicide ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: RTCWUtil.SetSuicide(team, class, suicide, persistant);&lt;br /&gt;
  sets all classes on the given team so they commit suicide two seconds before the next spawn&lt;br /&gt;
         the persistant parameter if set will have them do it every spawn until it is turned off ( or round ends)&lt;br /&gt;
 &lt;br /&gt;
  example: RTCWUtil.SetSuicide(TEAM.ALLIES, CLASS.LIEUTENANT, 1, 1); //commit suicide 2 seconds before every spawn&lt;br /&gt;
  example: RTCWUtil.SetSuicide(TEAM.ALLIES, CLASS.LIEUTENANT, 0, 0); //disable the suicide flag for them&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== RTCWUtil.SetTeamSuicide ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: RTCWUtil.SetSuicide(team, suicide, persistant);&lt;br /&gt;
  sets all bots on the given team so they commit suicide two seconds before the next spawn&lt;br /&gt;
         the persistant parameter if set will have them do it every spawn until it is turned off ( or round ends)&lt;br /&gt;
 &lt;br /&gt;
  example: RTCWUtil.SetTeamSuicide(TEAM.ALLIES, 1, 1); //commit suicide 2 seconds before every spawn&lt;br /&gt;
  example: RTCWUtil.SetTeamSuicide(TEAM.ALLIES, 0, 0); //disable the suicide flag for them&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== RTCWUtil.StopSniping ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: RTCWUtil.StopSniping();&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
all bots currently using a sniper weapon will switch to a different weapon&lt;br /&gt;
  &lt;br /&gt;
note: this is typically called inside trigger functions&lt;br /&gt;
&lt;br /&gt;
==== RTCWUtil.SwitchSoldierWeapons ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: RTCWUtil.SwitchSoldierWeapons(team, bot, weap1, weap2, weap3);&lt;br /&gt;
  soldiers will only select weapons passed in as parameters&lt;br /&gt;
  &lt;br /&gt;
  note: typically used in triggers to have soldiers choose between given weapons&lt;br /&gt;
  example: RTCWUtil.SwitchSoldierWeapons(TEAM.AXIS, bot, WEAPON.MAUSER, WEAPON.PANZERFAUST); //axis soldiers randomly select panzer or mauser&lt;br /&gt;
  example: RTCWUtil.SwitchSoldierWeapons(0, bot, WEAPON.MAUSER, WEAPON.PANZERFAUST); //all soldiers randomly select panzer or mauser&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
==== RTCWUtil.SwitchWeapon ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: RTCWUtil.SwitchWeapon(weapon);&lt;br /&gt;
  all qualifying bots will switch to the given weapon&lt;br /&gt;
  &lt;br /&gt;
  example: RTCWUtil.SwitchWeapon(WEAPON.PANZERFAUST); //all soldiers will switch to panzer&lt;br /&gt;
  note: typically used in trigger functions&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== RTCWUtil.TeamDisableCombatCrouch ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: RTCWUtil.TeamDisableCombatCrouch( team );&lt;br /&gt;
  example: RTCWUtil.TeamDisableCombatCrouch( TEAM.AXIS );&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
disables combat crouching for the given team&lt;br /&gt;
&lt;br /&gt;
==== RTCWUtil.ToggleFlag ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: RTCWUtil.ToggleFlag( goal, time in seconds );&lt;br /&gt;
  example: thread(RTCWUtil.ToggleFlag, &amp;quot;CHECKPOINT.someFlag&amp;quot;, 300);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
used in dual objective maps like mp_depot to set availability of the checkpoint goal for the opposite team in the given interval&lt;br /&gt;
note: this should be called as a gm thread.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== WeaponTable ===&lt;br /&gt;
&lt;br /&gt;
==== WeaponTable.ListWeaponAvailability ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: WeaponTable.ListWeaponAvailability();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
prints current availability of all weapons&lt;br /&gt;
&lt;br /&gt;
==== WeaponTable.SetWeaponAvailability ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: WeaponTable.SetWeaponAvailability( class, weapon, &amp;lt;true/false&amp;gt;);&lt;br /&gt;
  example: WeaponTable.SetWeaponAvailability( CLASS.SOLDIER, WEAPON.FLAMETHROWER, false );&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
enables or disables specified weapon for class. The weapon parameter can be table.&lt;br /&gt;
The class parameter can be null to set availability for all classes.&lt;br /&gt;
&lt;br /&gt;
note: allied PANZERFAUST is automatically converted to BAZOOKA or LAW in Noquarter or ETnam&lt;br /&gt;
&lt;br /&gt;
note: bots select random available weapon every spawn (in limbo)&lt;br /&gt;
&lt;br /&gt;
==== WeaponTable.SetWeaponTeamAvailability ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: WeaponTable.SetWeaponTeamAvailability( team, class, weapon, &amp;lt;true/false&amp;gt;);&lt;br /&gt;
  example: WeaponTable.SetWeaponTeamAvailability( TEAM.AXIS, CLASS.ENGINEER, WEAPON.KAR98, false );&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
enables or disables weapon for team and class.&lt;br /&gt;
&lt;br /&gt;
==== WeaponTable.Shotgun ====&lt;br /&gt;
&lt;br /&gt;
The Shotgun property has value WEAPON.SHOTGUN, WEAPON.ITHACA, WEAPON.M97 or null.&lt;/div&gt;</summary>
		<author><name>Palota</name></author>
	</entry>
	<entry>
		<id>https://mygamingtalk.com/wiki/index.php?title=Utility_Functions&amp;diff=1772</id>
		<title>Utility Functions</title>
		<link rel="alternate" type="text/html" href="https://mygamingtalk.com/wiki/index.php?title=Utility_Functions&amp;diff=1772"/>
		<updated>2025-05-25T17:14:34Z</updated>

		<summary type="html">&lt;p&gt;Palota: /* ETUtil.WinningChat */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{process header&lt;br /&gt;
 | title    = Utility Functions&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;
{{TOCright}}&lt;br /&gt;
&lt;br /&gt;
=== Util ===&lt;br /&gt;
&lt;br /&gt;
==== Util.AddUsePoint ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: Util.AddUsePoint(goalname, &amp;lt;Vector3 or table&amp;gt;);&lt;br /&gt;
  example: Util.AddUsePoint(&amp;quot;PLANT_wall&amp;quot;,{Vec3(12,34,5),Vec3(23,5,67)});&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
used to add use points for a goal at given positions. Goals can have multiple use points. You must set RandomUsePoint property to 1, otherwise bots will always choose the nearest use point.&lt;br /&gt;
&lt;br /&gt;
==== Util.AddUseWp ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: Util.AddUseWp(goalname, &amp;lt;waypointname or table&amp;gt;);&lt;br /&gt;
  example: Util.AddUseWp( &amp;quot;somegoalname&amp;quot;, &amp;quot;somewaypointname&amp;quot; );&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
used to add use points for a goal at given waypoints positions. Goals can have multiple use points. You must set RandomUsePoint property to 1, otherwise bots will always choose the nearest use point.&lt;br /&gt;
&lt;br /&gt;
==== Util.AliveCount ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: Util.AliveCount( team, class );&lt;br /&gt;
  example: Util.AliveCount( TEAM.AXIS, CLASS.MEDIC ); &amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
returns the number of bots alive on a team with a given class&lt;br /&gt;
&lt;br /&gt;
==== Util.BotChat ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: Util.BotChat(Team, msgType, Msg, NumBots);&lt;br /&gt;
  example: Util.BotChat(TEAM.ALLIES, &amp;quot;vsay&amp;quot;, VOICE.G_CHEER, 2);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
See [[Talking_bots]] page&lt;br /&gt;
&lt;br /&gt;
==== Util.BotHasAnyRole ====&lt;br /&gt;
&lt;br /&gt;
This function is deprecated. Use [[Bot#HasRole|HasRole]]&lt;br /&gt;
&lt;br /&gt;
==== Util.CanBotSnipe ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: Util.CanBotSnipe(bot);&lt;br /&gt;
  example: if ( Util.CanBotSnipe(bot) ) {&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
returns true if bot has a sniper weapon.&lt;br /&gt;
&lt;br /&gt;
==== Util.CappointForFlag ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: Util.CappointForFlag( flag_goalname, cappoint_goalname );&lt;br /&gt;
  example: Util.CappointForFlag( &amp;quot;FLAG_axis_gold&amp;quot;, &amp;quot;CAPPOINT_Truck&amp;quot; );&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
used if there are multiple active cappoint goals. It should be called from _Taken triggers.&lt;br /&gt;
&lt;br /&gt;
==== Util.ChangeBotSpawn ====&lt;br /&gt;
This function is deprecated. See [[Changing spawns]].&lt;br /&gt;
&lt;br /&gt;
==== Util.ChangeCrucialClassForRole ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: Util.ChangeCrucialClassForRole ( team, role, class );&lt;br /&gt;
  example: Util.ChangeCrucialClassForRole(TEAM.AXIS, ROLE.DEFENDER1, CLASS.COVERTOPS);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sets new crucialClass in the Map.Roles table.&lt;br /&gt;
&lt;br /&gt;
==== Util.ChangeSpawn ====&lt;br /&gt;
&lt;br /&gt;
This function is deprecated. See [[Changing spawns]].&lt;br /&gt;
&lt;br /&gt;
==== Util.ChangeSpawnForRole ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: Util.ChangeSpawnForRole( &amp;lt;team&amp;gt;, &amp;lt;role&amp;gt;, &amp;lt;spawnpoint&amp;gt; );&lt;br /&gt;
  example: Util.ChangeSpawnForRole(TEAM.ALLIES, ROLE.ATTACKER, 1);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Set the spawn point for all bots on the given team with the given role&lt;br /&gt;
&lt;br /&gt;
see also: [[Roles]] Page&lt;br /&gt;
&lt;br /&gt;
==== Util.ChangeToSniperWeapons ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: Util.ChangeToSniperWeapons( bot, &amp;lt;optional viewDistance&amp;gt; );&lt;br /&gt;
  example: Util.ChangeToSniperWeapons(bot);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
called from OnBotJoin on sniper maps.&lt;br /&gt;
&lt;br /&gt;
see also: [[Sniper_and_Panzer_maps]]&lt;br /&gt;
&lt;br /&gt;
==== Util.ClearRoleForGoals ====&lt;br /&gt;
&lt;br /&gt;
This function is deprecated. Use [[Bot_Library#ClearGoalRole|ClearGoalRole]]&lt;br /&gt;
&lt;br /&gt;
==== Util.ClearRoleForGroup ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: Util.ClearRoleForGroup( group, &amp;lt;role or table&amp;gt; );&lt;br /&gt;
  example: Util.ClearRoleForGroup( &amp;quot;someGroup&amp;quot;, ROLE.DEFENDER );&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
used to remove roles from a given group of goals&lt;br /&gt;
&lt;br /&gt;
see also: [[Roles]] Page&lt;br /&gt;
&lt;br /&gt;
==== Util.ClearRoleForTable ====&lt;br /&gt;
&lt;br /&gt;
This function is deprecated. Use [[Bot_Library#ClearGoalRole|ClearGoalRole]]&lt;br /&gt;
&lt;br /&gt;
==== Util.DisableGoal ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: Util.DisableGoal(goalname, &amp;lt;optional true&amp;gt;);&lt;br /&gt;
  example: Util.DisableGoal(&amp;quot;FLAG_someflag&amp;quot;); &amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
disables the goal for both teams. the optional true parameter is used to disable all goals except for ROUTE goals.&lt;br /&gt;
&lt;br /&gt;
==== Util.DisableGroup ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: Util.DisableGroup(groupname, team);&lt;br /&gt;
  example: Util.DisableGroup( &amp;quot;somegroupname&amp;quot;, TEAM.ALLIES );&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
used to disable a set of goals in the given group for a given team&lt;br /&gt;
&lt;br /&gt;
==== Util.EnableGoal ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: Util.EnableGoal(goalname);&lt;br /&gt;
  example: Util.EnableGoal(&amp;quot;FLAG_someflag&amp;quot;);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
enables the goal for both teams.&lt;br /&gt;
&lt;br /&gt;
==== Util.EnableGroup ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: Util.EnableGroup(groupname, team);&lt;br /&gt;
  example: Util.EnableGroup( &amp;quot;somegroupname&amp;quot;, TEAM.SOMETEAM );&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
used to enable a set of goals in the given group for a given team&lt;br /&gt;
&lt;br /&gt;
==== Util.ExcludeClass ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: Util.ExcludeClass( goalname, team, class1, class2, class3, class4 );&lt;br /&gt;
  example: Util.ExcludeClass( &amp;quot;DEFEND_somegoal.*&amp;quot;, TEAM.AXIS, CLASS.MEDIC );&lt;br /&gt;
  example: Util.ExcludeClass( &amp;quot;MOUNTMG42_.*&amp;quot;, TEAM.ALLIES, CLASS.FIELDOPS, CLASS.ENGINEER );&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
limit given goal usage to specific classes by team. class2, class3, and class4 are optional.&lt;br /&gt;
&lt;br /&gt;
==== Util.ForceRouting ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: Util.ForceRouting(goalName, true/false);&lt;br /&gt;
  example: Util.ForceRouting( &amp;quot;BUILD_Tank&amp;quot;, true );&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
disables BUILD goal offsets and enables routes to the goal. You should set ForceRouting to true only when a vehicle is at known position (in OnMapLoad or at tank barriers). You must set it to false when a vehicle is repaired.&lt;br /&gt;
&lt;br /&gt;
==== Util.GetEntHealth ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: Util.GetEntHealth(entity);&lt;br /&gt;
  example: health = Util.GetEntHealth(this.TargetEntity);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
returns entity health.&lt;br /&gt;
&lt;br /&gt;
==== Util.GetGroup ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: Util.GetGroup(groupname);&lt;br /&gt;
  example: Util.GetGroup(&amp;quot;somegroupname&amp;quot;);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
this function will return a table of goals belonging to the given group name&lt;br /&gt;
&lt;br /&gt;
==== Util.GetRandomFromTable ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: Util.GetRandomFromTable( tbl );&lt;br /&gt;
  example: index = Util.GetRandomFromTable( someTable );&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
used to get a randomly selected index from a given table. Returns -1 if invalid. Table keys must be integers from 0 to (count - 1).&lt;br /&gt;
&lt;br /&gt;
==== Util.GetRandomTableValue====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: Util.GetRandomTableValue( tbl );&lt;br /&gt;
  example: value = Util.GetRandomTableValue( someTable );&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
used to get a randomly selected value from a given table. Returns null if the table is empty or invalid. Table keys must be integers from 0 to (count - 1).&lt;br /&gt;
&lt;br /&gt;
==== Util.GoalTable ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: Util.GoalTable( &amp;lt;optional expression&amp;gt;, &amp;lt;optional teamId&amp;gt; );&lt;br /&gt;
  example: goals = Util.GoalTable(&amp;quot;PLANT_Back_Door&amp;quot;);&lt;br /&gt;
  example: goals = Util.GoalTable(&amp;quot;FLAG.*&amp;quot;, TEAM.AXIS);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
returns table of map goals that match a regular expression. &lt;br /&gt;
&lt;br /&gt;
==== Util.IgnoreTargetGoal ====&lt;br /&gt;
&lt;br /&gt;
This function is deprecated. Use [[Bot#IgnoreTarget|IgnoreTarget]]&lt;br /&gt;
&lt;br /&gt;
==== Util.IgnoreTargetGoalTable ====&lt;br /&gt;
&lt;br /&gt;
This function is deprecated. Use [[Bot#IgnoreTarget|IgnoreTarget]]&lt;br /&gt;
&lt;br /&gt;
==== Util.IsBot ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: Util.IsBot(entity);&lt;br /&gt;
  example: bot = Util.IsBot(ent); &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
returns Bot object from entity or null if entity is not a bot. Usually used in region triggers if the TriggerOnClass is CLASS.ANYPLAYER.&lt;br /&gt;
&lt;br /&gt;
==== Util.LimitToClass ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: Util.LimitToClass(goalname, team, class1, class2, class3, class4);&lt;br /&gt;
  example: Util.LimitToClass(&amp;quot;CHECKPOINT.*&amp;quot;, TEAM.ALLIES, CLASS.SOLDIER); //only soldiers on the allied team&lt;br /&gt;
  example: Util.LimitToClass(&amp;quot;CHECKPOINT.*&amp;quot;, TEAM.ALLIES, CLASS.SOLDIER, CLASS.MEDIC); //only soldiers and medics&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
used to limit specific goals to a specific class or classes&lt;br /&gt;
&lt;br /&gt;
==== Util.LimitToTeam ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: Util.LimitToTeam(team, goal);&lt;br /&gt;
  example: Util.LimitToTeam(TEAM.AXIS, &amp;quot;SWITCH_gate_depot&amp;quot;);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
limits goals to a certain team without the need to disable for 1 team&lt;br /&gt;
&lt;br /&gt;
==== Util.MapDebugPrint ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: Util.MapDebugPrint( &amp;quot;Text&amp;quot;, &amp;lt;optional message only&amp;gt; );&lt;br /&gt;
  example: Util.MapDebugPrint( &amp;quot;East_Barrier_Destroyed&amp;quot; );&lt;br /&gt;
  example: Util.MapDebugPrint( &amp;quot;East_Barrier_Destroyed&amp;quot;, true ); // only print the message&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
used to print text &amp;amp; list of available goals in the console when in debug mode&lt;br /&gt;
&lt;br /&gt;
see also: [[Debugging_tips]]&lt;br /&gt;
&lt;br /&gt;
==== Util.OnTriggerPosition ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: Util.OnTriggerPosition( goalname, wpname or position, tolerance, wpfunction );&lt;br /&gt;
  example: Util.OnTriggerPosition( &amp;quot;MOVER_train1&amp;quot;, &amp;quot;depotyard&amp;quot;, 200.0, Map.tug_depotyard );&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
note: used for setting up positional triggers for movers.&lt;br /&gt;
&lt;br /&gt;
==== Util.RandomBotSpawn ====&lt;br /&gt;
&lt;br /&gt;
This function is deprecated. See [[Changing spawns]].&lt;br /&gt;
&lt;br /&gt;
==== Util.RandomSpawn ====&lt;br /&gt;
&lt;br /&gt;
This function is deprecated. See [[Changing spawns]].&lt;br /&gt;
&lt;br /&gt;
==== Util.RemoveGoal ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: Util.RemoveGoal( goalnames );&lt;br /&gt;
  example: Util.RemoveGoal( &amp;quot;MOVER_truck&amp;quot; );&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
removes the goals from the map goal table. It should only be used for invalid goals which are badly detected by the game.&lt;br /&gt;
&lt;br /&gt;
==== Util.Routes ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: Util.Routes( &amp;lt;table&amp;gt; );&lt;br /&gt;
  example: Util.Routes(MapRoutes);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
initializes routes&lt;br /&gt;
&lt;br /&gt;
see also: [[Template:Baserouting|Routing]]&lt;br /&gt;
&lt;br /&gt;
==== Util.SetGoalOffset ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: Util.SetGoalOffset( x, y, z, GoalName );&lt;br /&gt;
  info x = North, -x = South y = East, -y = West, z = Up, -z =Down&lt;br /&gt;
  example: Util.SetGoalOffset( 0, -20, -10, &amp;quot;MOUNTMG42_boat&amp;quot; );&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
the x y and z parameters are added to the origin of the goal to move the location of where bots will look for the goal. It is sometimes needed for MOUNTMG42 and REPAIRMG42 goals because some mg42 cannot be mounted or repaired if it&#039;s position is not corrected.&lt;br /&gt;
&lt;br /&gt;
==== Util.SetGoalPosition ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: Util.SetGoalPosition( x, y, z, GoalName );&lt;br /&gt;
  example: Util.SetGoalPosition( 4534, 2168, -199, &amp;quot;BUILD_construct&amp;quot; )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
used to give the goal a new origin.&lt;br /&gt;
&lt;br /&gt;
note: it&#039;s  usually much better to use function Util.AddUsePoint to set position of BUILD or PLANT goals.&lt;br /&gt;
&lt;br /&gt;
note: console command &amp;quot;/bot mypos&amp;quot; prints your body position, command &amp;quot;/viewpos&amp;quot; prints your eye position rounded to integer.&lt;br /&gt;
&lt;br /&gt;
==== Util.SetGoalRange ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: Util.SetGoalRange( goalNames, distance );&lt;br /&gt;
  example: Util.SetGoalRange(&amp;quot;GRENADE_tower.*&amp;quot;, 800);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
sets the range for map goals. The goals will not be available for bots that are out of range. Default range for all goals is 0 which means unlimited.&lt;br /&gt;
&lt;br /&gt;
==== Util.SetGroup ====&lt;br /&gt;
&lt;br /&gt;
This function is deprecated. Use [[Bot_Library#SetGoalGroup|SetGoalGroup]]&lt;br /&gt;
&lt;br /&gt;
==== Util.SetGroupForTable ====&lt;br /&gt;
&lt;br /&gt;
This function is deprecated. Use [[Bot_Library#SetGoalGroup|SetGoalGroup]]&lt;br /&gt;
&lt;br /&gt;
==== Util.SetMaxUsers ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: Util.SetMaxUsers( botnum, goal );&lt;br /&gt;
  example: Util.SetMaxUsers( 1, &amp;quot;ATTACK_.*&amp;quot; );&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
used to limit number of bots using a particular goal(s). this function sets both In_Use and In_Progress&lt;br /&gt;
&lt;br /&gt;
==== Util.SetMaxUsersInProgress ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: Util.SetMaxUsersInProgress( Users, GoalNames );&lt;br /&gt;
  example: Util.SetMaxUsersInProgress( 15, &amp;quot;CHECKPOINT.*&amp;quot; );&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
used to set the maximum number of bots going for a particular goal(s).&lt;br /&gt;
&lt;br /&gt;
==== Util.SetMaxUsersInUse ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: Util.SetMaxUsersInUse( Users, GoalNames );&lt;br /&gt;
  example: Util.SetMaxUsersInUse( 1, &amp;quot;MOUNT_.*&amp;quot; );&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
used to set the maximum number of bots using a particular goal(s).&lt;br /&gt;
&lt;br /&gt;
==== Util.SetPercentInProgress ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: Util.SetPercentInProgress(%, goal);&lt;br /&gt;
  example: Util.SetPercentInProgress(70, &amp;quot;FLAG_docs&amp;quot;);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
sets a percentage of bots to use a particular goal(s).&lt;br /&gt;
&lt;br /&gt;
note: number of bots is calculated only once when this function is called. It does not work well after bots are added or kicked.&lt;br /&gt;
&lt;br /&gt;
==== Util.SetPositionGoal ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: Util.SetPositionGoal( goalname1, goalname2 );&lt;br /&gt;
  example: Util.SetPositionGoal( &amp;quot;BUILD_Tank&amp;quot;, &amp;quot;MOVER_tank&amp;quot; );&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
sets the origin of one goal to match the origin of another. This function was used in Omni-bot 0.66. Current Omni-bot version automatically sets positions of BUILD goals.&lt;br /&gt;
&lt;br /&gt;
==== Util.SetRoleForGoals ====&lt;br /&gt;
&lt;br /&gt;
This function is deprecated. Use [[Bot_Library#SetGoalRole|SetGoalRole]]&lt;br /&gt;
&lt;br /&gt;
==== Util.SetRoleForGroup ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: Util.SetRoleForGroup( &amp;lt;goal group&amp;gt;, &amp;lt;role or table&amp;gt; );&lt;br /&gt;
  example: Util.SetRoleForGroup( &amp;quot;myGroup&amp;quot;, ROLE.DEFENDER );&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
sets the given roles for the given group of goals.&lt;br /&gt;
&lt;br /&gt;
==== Util.SetRoleForTable ====&lt;br /&gt;
&lt;br /&gt;
This function is deprecated. Use [[Bot_Library#SetGoalRole|SetGoalRole]]&lt;br /&gt;
&lt;br /&gt;
see also: [[Roles]] Page&lt;br /&gt;
&lt;br /&gt;
==== Util.ShowGroup ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: Util.ShowGroup(groupname);&lt;br /&gt;
  example: Util.ShowGroup(&amp;quot;somegroupname&amp;quot;);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
this function will list all goals in the given group in the console.&lt;br /&gt;
&lt;br /&gt;
==== Util.UpdateSwitchData ====&lt;br /&gt;
&lt;br /&gt;
This function is deprecated. Use [[Switch_Goal]]&lt;br /&gt;
&lt;br /&gt;
==== Util.WpNameInfo ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: Util.WpNameInfo(waypointName);&lt;br /&gt;
  example: wpInfo = Util.WpNameInfo(&amp;quot;rNadeHall&amp;quot;);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
finds waypoint by name and returns table which contains position, facing, radius, flags, property. It is often used in paththrough navigation.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== ETUtil ===&lt;br /&gt;
These functions are available only in the Enemy Territory game.&lt;br /&gt;
&lt;br /&gt;
==== ETUtil.ChangeToPanzer ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: ETUtil.ChangeToPanzer( bot );&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
called from OnBotJoin on panzer maps.&lt;br /&gt;
&lt;br /&gt;
see also: [[Sniper_and_Panzer_maps]]&lt;br /&gt;
&lt;br /&gt;
==== ETUtil.CountClass ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: ETUtil.CountClass( team, class );&lt;br /&gt;
  example: ETUtil.CountClass( TEAM.ALLIES, CLASS.ENGINEER ); &amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
can be used to determine if a team has enough of a critical class for the map&lt;br /&gt;
&lt;br /&gt;
==== ETUtil.GetReinforceTime ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: ETUtil.GetReinforceTime(TEAM.AXIS);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
returns time to next respawn, or null if no bot exists in the team.&lt;br /&gt;
&lt;br /&gt;
==== ETUtil.GetTimeElapsed ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: ETUtil.GetTimeElapsed();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
returns time since map start.&lt;br /&gt;
&lt;br /&gt;
==== ETUtil.IsTeamClassDead ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: ETUtil.IsTeamClassDead( team, class );&lt;br /&gt;
  example: ETUtil.IsTeamClassDead( TEAM.AXIS, CLASS.MEDIC ); &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
returns true if all the players of the given class on the given team are dead.&lt;br /&gt;
&lt;br /&gt;
==== ETUtil.IsTeamDead ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: ETUtil.IsTeamDead( team );&lt;br /&gt;
  example: ETUtil.IsTeamDead( TEAM.AXIS );&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
returns true if all players on the given team are dead.&lt;br /&gt;
&lt;br /&gt;
==== ETUtil.LosingChat ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: ETUtil.LosingChat(team);&lt;br /&gt;
  example: ETUtil.LosingChat( TEAM.AXIS );&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
See [[Talking_bots]] page&lt;br /&gt;
&lt;br /&gt;
==== ETUtil.SelectWeapon ====&lt;br /&gt;
&lt;br /&gt;
This function does not work since version 0.82. Now you have to use [[Utility_Functions#WeaponTable|WeaponTable.SetWeaponAvailability]].&lt;br /&gt;
&lt;br /&gt;
==== ETUtil.SetAimModeForMount====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: ETUtil.SetAimModeForMount(goalName, aimType);&lt;br /&gt;
  example: ETUtil.SetAimModeForMount(&amp;quot;MOUNT_ship&amp;quot;, Vec3(-340, 1530, 90));&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sets AimMode property of MOUNT goal. Valid values are &amp;quot;velocity&amp;quot;, &amp;quot;opposite&amp;quot;, &amp;quot;random&amp;quot; or Vector3.&lt;br /&gt;
&lt;br /&gt;
==== ETUtil.SetCabinets ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: ETUtil.SetCabinets();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
disables health &amp;amp; ammo cabinets for Medic &amp;amp; FieldOp Classes&lt;br /&gt;
&lt;br /&gt;
==== ETUtil.SetExcludeIndexes ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: ETUtil.SetExcludeIndexes( goal, { offset } );&lt;br /&gt;
  example: ETUtil.SetExcludeIndexes( &amp;quot;BUILD_Truck&amp;quot;, { 4, 5, 6 } ); // Disable offset 4, 5 &amp;amp; 6&lt;br /&gt;
  example: ETUtil.SetExcludeIndexes( &amp;quot;BUILD_Truck&amp;quot;, {} ); // Removes Disabled offsets&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
disables vehicle offsets, used when an offset cannot be reached. Used only by goals BUILD, ESCORT, MOUNT, RIDE.&lt;br /&gt;
&lt;br /&gt;
==== ETUtil.SetStartIndex ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: ETUtil.SetStartIndex(goal, offset);&lt;br /&gt;
  example: ETUtil.SetStartIndex(&amp;quot;ESCORT_tank&amp;quot;, 2); // Use Offset 2&lt;br /&gt;
  example: ETUtil.SetStartIndex(&amp;quot;ESCORT_tank&amp;quot;, -1); // Random&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
used to make a bot start from a certain vehicle offset in mover goals that have offsets defined. Normally set in OnMapLoad then reset inside a trigger. Used only by goals BUILD, ESCORT, MOUNT, RIDE.&lt;br /&gt;
&lt;br /&gt;
==== ETUtil.SuicideSpawn ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: ETUtil.SuicideSpawn( team, spawn, numbots, class);&lt;br /&gt;
  example: ETUtil.SuicideSpawn( TEAM.AXIS, 2, 1, CLASS.ENGINEER ); // 2 bots spawn at spawnpoint 2&lt;br /&gt;
  example: ETUtil.SuicideSpawn( TEAM.AXIS, 2, -1, CLASS.ENGINEER ); // all axis engineer bots spawn at spawnpoint 2&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
used to make bots self kill and change to a new spawn, often used in maps to defend areas when players have sneaked past.&lt;br /&gt;
&lt;br /&gt;
==== ETUtil.SwitchWeapon ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: ETUtil.SwitchWeapon(weapon);&lt;br /&gt;
  example: ETUtil.SwitchWeapon(WEAPON.PANZERFAUST); //all soldiers will switch to panzer&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This function is deprecated since version 0.82 because it only kills bot and does not change his weapon.&lt;br /&gt;
&lt;br /&gt;
==== ETUtil.WaitForSpawn ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: ETUtil.WaitForSpawn(Team);&lt;br /&gt;
  example: ETUtil.WaitForSpawn( TEAM.ALLIES );&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sleeps until next respawn of the team. Returns 0.15 seconds before respawn.&lt;br /&gt;
&lt;br /&gt;
==== ETUtil.WinningChat ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: ETUtil.WinningChat(Team);&lt;br /&gt;
  example: ETUtil.WinningChat( TEAM.ALLIES );&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
See [[Talking_bots]] page&lt;br /&gt;
&lt;br /&gt;
=== RTCWUtil ===&lt;br /&gt;
These functions are available only in the Return to Castle Wolfenstein game.&lt;br /&gt;
&lt;br /&gt;
==== RTCWUtil.BotDisableCombatCrouch ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: RTCWUtil.BotDisableCombatCrouch( bot, bool enable );&lt;br /&gt;
  example: RTCWUtil.BotDisableCombatCrouch( bot, true );&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
used to disable crouching in combat for the given bot&lt;br /&gt;
&lt;br /&gt;
==== RTCWUtil.ChangeClass ====&lt;br /&gt;
&lt;br /&gt;
This function is deprecated. Use Server.MinClassCount.&lt;br /&gt;
&lt;br /&gt;
==== RTCWUtil.ChangeSpawnNoDefenders ====&lt;br /&gt;
&lt;br /&gt;
This function is deprecated. See [[Changing spawns]].&lt;br /&gt;
&lt;br /&gt;
==== RTCWUtil.ClearMainGoals ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: RTCWUtil.ClearMainGoals();&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
This function will deactivate all main goals for both teams.&lt;br /&gt;
  &lt;br /&gt;
   goals deactivated: PLANT MOUNTMG42 MOVER CHECKPOINT FLAG&lt;br /&gt;
&lt;br /&gt;
==== RTCWUtil.ClearSecondaryGoals ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: RTCWUtil.ClearSecondaryGoals();&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  This function will deactivate all secondary goals for both teams.&lt;br /&gt;
  &lt;br /&gt;
  goals deactivated: ARTILLERY REPAIR&lt;br /&gt;
&lt;br /&gt;
==== RTCWUtil.CountClass ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: RTCWUtil.CountClass( team, class );&lt;br /&gt;
  example: RTCWUtil.CountClass( TEAM.ALLIES, CLASS.ENGINEER ); &amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
can be used to determine if a team has enough of a critical class for the map&lt;br /&gt;
&lt;br /&gt;
==== RTCWUtil.CountTeam ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: RTCWUtil.DisableGoal(goalname, &amp;lt;optional true&amp;gt;);&lt;br /&gt;
  example: RTCWUtil.DisableGoal(&amp;quot;FLAG_someflag&amp;quot;); &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
disables the goal for both teams. the optional true parameter is used to disable all goals except for ROUTE goals.&lt;br /&gt;
&lt;br /&gt;
==== RTCWUtil.IsPlantGoalAvailable ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: RTCWUtil.IsPlantGoalAvailable();&lt;br /&gt;
  example: RTCWUtil.IsPlantGoalAvailable();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
returns true if there is a plant goal available&lt;br /&gt;
&lt;br /&gt;
==== RTCWUtil.IsTeamClassDead ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: RTCWUtil.IsTeamClassDead( team, class );&lt;br /&gt;
  example: RTCWUtil.IsTeamClassDead( TEAM.AXIS, CLASS.ENGINEER )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
returns true if there are no living players or bots of a given class on the given team&lt;br /&gt;
&lt;br /&gt;
==== RTCWUtil.IsTeamDead ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: RTCWUtil.IsTeamDead( team, minbots );&lt;br /&gt;
  example: RTCWUtil.IsTeamDead( TEAM.AXIS, 2 );&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
returns true if the number of living players on the given team is less than minbots.&lt;br /&gt;
&lt;br /&gt;
note: minbots is optional as it defaults to 1&lt;br /&gt;
&lt;br /&gt;
==== RTCWUtil.KillEntities ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: RTCWUtil.KillEntities( table or int );&lt;br /&gt;
  example: RTCWUtil.KillEntities( 123 );&lt;br /&gt;
  example: RTCWUtil.KillEntities( {123, 124} );&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
used to remove entities from the map. typically called from OnMapLoad&lt;br /&gt;
&lt;br /&gt;
==== RTCWUtil.NoSnipe ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: syntax: RTCWUtil.NoSnipe(bot);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
soldier bots will not choose a mauser when selecting a weapon&lt;br /&gt;
 &lt;br /&gt;
note: this is typically called in OnBotJoin&lt;br /&gt;
&lt;br /&gt;
==== RTCWUtil.SelectSoldierWeapons ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: RTCWUtil.SelectSoldierWeapons(team, bot, weap1, weap2, weap3);&lt;br /&gt;
  soldiers will only select weapons passed in as parameters&lt;br /&gt;
  &lt;br /&gt;
  note: typically used in OnBotJoin to have soldiers choose between given weapons&lt;br /&gt;
  example: RTCWUtil.SelectSoldierWeapons(TEAM.AXIS, bot, WEAPON.MAUSER, WEAPON.PANZERFAUST); //axis soldiers randomly select panzer or mauser&lt;br /&gt;
  example: RTCWUtil.SelectSoldierWeapons(0, bot, WEAPON.MAUSER, WEAPON.PANZERFAUST); //all soldiers randomly select panzer or mauser&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
&lt;br /&gt;
==== RTCWUtil.SelectWeapon ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: RTCWUtil.SelectWeapon(bot, weapon, isFog);&lt;br /&gt;
  example: RTCWUtil.SelectWeapon(bot, WEAPON.MAUSER);&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
the given bot will switch to the given weapon if it is the correct class for the weapon&lt;br /&gt;
 &lt;br /&gt;
note: typically used in OnBotJoin to have soldiers choose a specific weapon&lt;br /&gt;
         the isFog parameter is optional and disables extra view distance given to snipers&lt;br /&gt;
&lt;br /&gt;
==== RTCWUtil.SetPrimaryGoals ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: RTCWUtil.SetPrimaryGoals(priority);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
used for setting priorities of common goals.&lt;br /&gt;
  &lt;br /&gt;
note: this is typically called in OnMapLoad and effects the following goals (in order of priority):&lt;br /&gt;
         CAPPOINT FLAGRETURN PLANT CHECKPOINT FLAG&lt;br /&gt;
&lt;br /&gt;
==== RTCWUtil.SetSuicide ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: RTCWUtil.SetSuicide(team, class, suicide, persistant);&lt;br /&gt;
  sets all classes on the given team so they commit suicide two seconds before the next spawn&lt;br /&gt;
         the persistant parameter if set will have them do it every spawn until it is turned off ( or round ends)&lt;br /&gt;
 &lt;br /&gt;
  example: RTCWUtil.SetSuicide(TEAM.ALLIES, CLASS.LIEUTENANT, 1, 1); //commit suicide 2 seconds before every spawn&lt;br /&gt;
  example: RTCWUtil.SetSuicide(TEAM.ALLIES, CLASS.LIEUTENANT, 0, 0); //disable the suicide flag for them&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== RTCWUtil.SetTeamSuicide ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: RTCWUtil.SetSuicide(team, suicide, persistant);&lt;br /&gt;
  sets all bots on the given team so they commit suicide two seconds before the next spawn&lt;br /&gt;
         the persistant parameter if set will have them do it every spawn until it is turned off ( or round ends)&lt;br /&gt;
 &lt;br /&gt;
  example: RTCWUtil.SetTeamSuicide(TEAM.ALLIES, 1, 1); //commit suicide 2 seconds before every spawn&lt;br /&gt;
  example: RTCWUtil.SetTeamSuicide(TEAM.ALLIES, 0, 0); //disable the suicide flag for them&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== RTCWUtil.StopSniping ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: RTCWUtil.StopSniping();&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
all bots currently using a sniper weapon will switch to a different weapon&lt;br /&gt;
  &lt;br /&gt;
note: this is typically called inside trigger functions&lt;br /&gt;
&lt;br /&gt;
==== RTCWUtil.SwitchSoldierWeapons ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: RTCWUtil.SwitchSoldierWeapons(team, bot, weap1, weap2, weap3);&lt;br /&gt;
  soldiers will only select weapons passed in as parameters&lt;br /&gt;
  &lt;br /&gt;
  note: typically used in triggers to have soldiers choose between given weapons&lt;br /&gt;
  example: RTCWUtil.SwitchSoldierWeapons(TEAM.AXIS, bot, WEAPON.MAUSER, WEAPON.PANZERFAUST); //axis soldiers randomly select panzer or mauser&lt;br /&gt;
  example: RTCWUtil.SwitchSoldierWeapons(0, bot, WEAPON.MAUSER, WEAPON.PANZERFAUST); //all soldiers randomly select panzer or mauser&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
==== RTCWUtil.SwitchWeapon ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: RTCWUtil.SwitchWeapon(weapon);&lt;br /&gt;
  all qualifying bots will switch to the given weapon&lt;br /&gt;
  &lt;br /&gt;
  example: RTCWUtil.SwitchWeapon(WEAPON.PANZERFAUST); //all soldiers will switch to panzer&lt;br /&gt;
  note: typically used in trigger functions&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== RTCWUtil.TeamDisableCombatCrouch ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: RTCWUtil.TeamDisableCombatCrouch( team );&lt;br /&gt;
  example: RTCWUtil.TeamDisableCombatCrouch( TEAM.AXIS );&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
disables combat crouching for the given team&lt;br /&gt;
&lt;br /&gt;
==== RTCWUtil.ToggleFlag ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: RTCWUtil.ToggleFlag( goal, time in seconds );&lt;br /&gt;
  example: thread(RTCWUtil.ToggleFlag, &amp;quot;CHECKPOINT.someFlag&amp;quot;, 300);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
used in dual objective maps like mp_depot to set availability of the checkpoint goal for the opposite team in the given interval&lt;br /&gt;
note: this should be called as a gm thread.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== WeaponTable ===&lt;br /&gt;
&lt;br /&gt;
==== WeaponTable.ListWeaponAvailability ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: WeaponTable.ListWeaponAvailability();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
prints current availability of all weapons&lt;br /&gt;
&lt;br /&gt;
==== WeaponTable.SetWeaponAvailability ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: WeaponTable.SetWeaponAvailability( class, weapon, &amp;lt;true/false&amp;gt;);&lt;br /&gt;
  example: WeaponTable.SetWeaponAvailability( CLASS.SOLDIER, WEAPON.FLAMETHROWER, false );&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
enables or disables specified weapon for class. The weapon parameter can be table.&lt;br /&gt;
The class parameter can be null to set availability for all classes.&lt;br /&gt;
&lt;br /&gt;
note: allied PANZERFAUST is automatically converted to BAZOOKA or LAW in Noquarter or ETnam&lt;br /&gt;
&lt;br /&gt;
note: bots select random available weapon every spawn (in limbo)&lt;br /&gt;
&lt;br /&gt;
==== WeaponTable.SetWeaponTeamAvailability ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: WeaponTable.SetWeaponTeamAvailability( team, class, weapon, &amp;lt;true/false&amp;gt;);&lt;br /&gt;
  example: WeaponTable.SetWeaponTeamAvailability( TEAM.AXIS, CLASS.ENGINEER, WEAPON.KAR98, false );&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
enables or disables weapon for team and class.&lt;br /&gt;
&lt;br /&gt;
==== WeaponTable.Shotgun ====&lt;br /&gt;
&lt;br /&gt;
The Shotgun property has value WEAPON.SHOTGUN, WEAPON.ITHACA, WEAPON.M97 or null.&lt;/div&gt;</summary>
		<author><name>Palota</name></author>
	</entry>
	<entry>
		<id>https://mygamingtalk.com/wiki/index.php?title=Utility_Functions&amp;diff=1771</id>
		<title>Utility Functions</title>
		<link rel="alternate" type="text/html" href="https://mygamingtalk.com/wiki/index.php?title=Utility_Functions&amp;diff=1771"/>
		<updated>2025-05-25T17:07:46Z</updated>

		<summary type="html">&lt;p&gt;Palota: /* ETUtil.SelectWeapon */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{process header&lt;br /&gt;
 | title    = Utility Functions&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;
{{TOCright}}&lt;br /&gt;
&lt;br /&gt;
=== Util ===&lt;br /&gt;
&lt;br /&gt;
==== Util.AddUsePoint ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: Util.AddUsePoint(goalname, &amp;lt;Vector3 or table&amp;gt;);&lt;br /&gt;
  example: Util.AddUsePoint(&amp;quot;PLANT_wall&amp;quot;,{Vec3(12,34,5),Vec3(23,5,67)});&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
used to add use points for a goal at given positions. Goals can have multiple use points. You must set RandomUsePoint property to 1, otherwise bots will always choose the nearest use point.&lt;br /&gt;
&lt;br /&gt;
==== Util.AddUseWp ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: Util.AddUseWp(goalname, &amp;lt;waypointname or table&amp;gt;);&lt;br /&gt;
  example: Util.AddUseWp( &amp;quot;somegoalname&amp;quot;, &amp;quot;somewaypointname&amp;quot; );&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
used to add use points for a goal at given waypoints positions. Goals can have multiple use points. You must set RandomUsePoint property to 1, otherwise bots will always choose the nearest use point.&lt;br /&gt;
&lt;br /&gt;
==== Util.AliveCount ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: Util.AliveCount( team, class );&lt;br /&gt;
  example: Util.AliveCount( TEAM.AXIS, CLASS.MEDIC ); &amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
returns the number of bots alive on a team with a given class&lt;br /&gt;
&lt;br /&gt;
==== Util.BotChat ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: Util.BotChat(Team, msgType, Msg, NumBots);&lt;br /&gt;
  example: Util.BotChat(TEAM.ALLIES, &amp;quot;vsay&amp;quot;, VOICE.G_CHEER, 2);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
See [[Talking_bots]] page&lt;br /&gt;
&lt;br /&gt;
==== Util.BotHasAnyRole ====&lt;br /&gt;
&lt;br /&gt;
This function is deprecated. Use [[Bot#HasRole|HasRole]]&lt;br /&gt;
&lt;br /&gt;
==== Util.CanBotSnipe ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: Util.CanBotSnipe(bot);&lt;br /&gt;
  example: if ( Util.CanBotSnipe(bot) ) {&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
returns true if bot has a sniper weapon.&lt;br /&gt;
&lt;br /&gt;
==== Util.CappointForFlag ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: Util.CappointForFlag( flag_goalname, cappoint_goalname );&lt;br /&gt;
  example: Util.CappointForFlag( &amp;quot;FLAG_axis_gold&amp;quot;, &amp;quot;CAPPOINT_Truck&amp;quot; );&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
used if there are multiple active cappoint goals. It should be called from _Taken triggers.&lt;br /&gt;
&lt;br /&gt;
==== Util.ChangeBotSpawn ====&lt;br /&gt;
This function is deprecated. See [[Changing spawns]].&lt;br /&gt;
&lt;br /&gt;
==== Util.ChangeCrucialClassForRole ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: Util.ChangeCrucialClassForRole ( team, role, class );&lt;br /&gt;
  example: Util.ChangeCrucialClassForRole(TEAM.AXIS, ROLE.DEFENDER1, CLASS.COVERTOPS);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sets new crucialClass in the Map.Roles table.&lt;br /&gt;
&lt;br /&gt;
==== Util.ChangeSpawn ====&lt;br /&gt;
&lt;br /&gt;
This function is deprecated. See [[Changing spawns]].&lt;br /&gt;
&lt;br /&gt;
==== Util.ChangeSpawnForRole ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: Util.ChangeSpawnForRole( &amp;lt;team&amp;gt;, &amp;lt;role&amp;gt;, &amp;lt;spawnpoint&amp;gt; );&lt;br /&gt;
  example: Util.ChangeSpawnForRole(TEAM.ALLIES, ROLE.ATTACKER, 1);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Set the spawn point for all bots on the given team with the given role&lt;br /&gt;
&lt;br /&gt;
see also: [[Roles]] Page&lt;br /&gt;
&lt;br /&gt;
==== Util.ChangeToSniperWeapons ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: Util.ChangeToSniperWeapons( bot, &amp;lt;optional viewDistance&amp;gt; );&lt;br /&gt;
  example: Util.ChangeToSniperWeapons(bot);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
called from OnBotJoin on sniper maps.&lt;br /&gt;
&lt;br /&gt;
see also: [[Sniper_and_Panzer_maps]]&lt;br /&gt;
&lt;br /&gt;
==== Util.ClearRoleForGoals ====&lt;br /&gt;
&lt;br /&gt;
This function is deprecated. Use [[Bot_Library#ClearGoalRole|ClearGoalRole]]&lt;br /&gt;
&lt;br /&gt;
==== Util.ClearRoleForGroup ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: Util.ClearRoleForGroup( group, &amp;lt;role or table&amp;gt; );&lt;br /&gt;
  example: Util.ClearRoleForGroup( &amp;quot;someGroup&amp;quot;, ROLE.DEFENDER );&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
used to remove roles from a given group of goals&lt;br /&gt;
&lt;br /&gt;
see also: [[Roles]] Page&lt;br /&gt;
&lt;br /&gt;
==== Util.ClearRoleForTable ====&lt;br /&gt;
&lt;br /&gt;
This function is deprecated. Use [[Bot_Library#ClearGoalRole|ClearGoalRole]]&lt;br /&gt;
&lt;br /&gt;
==== Util.DisableGoal ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: Util.DisableGoal(goalname, &amp;lt;optional true&amp;gt;);&lt;br /&gt;
  example: Util.DisableGoal(&amp;quot;FLAG_someflag&amp;quot;); &amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
disables the goal for both teams. the optional true parameter is used to disable all goals except for ROUTE goals.&lt;br /&gt;
&lt;br /&gt;
==== Util.DisableGroup ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: Util.DisableGroup(groupname, team);&lt;br /&gt;
  example: Util.DisableGroup( &amp;quot;somegroupname&amp;quot;, TEAM.ALLIES );&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
used to disable a set of goals in the given group for a given team&lt;br /&gt;
&lt;br /&gt;
==== Util.EnableGoal ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: Util.EnableGoal(goalname);&lt;br /&gt;
  example: Util.EnableGoal(&amp;quot;FLAG_someflag&amp;quot;);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
enables the goal for both teams.&lt;br /&gt;
&lt;br /&gt;
==== Util.EnableGroup ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: Util.EnableGroup(groupname, team);&lt;br /&gt;
  example: Util.EnableGroup( &amp;quot;somegroupname&amp;quot;, TEAM.SOMETEAM );&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
used to enable a set of goals in the given group for a given team&lt;br /&gt;
&lt;br /&gt;
==== Util.ExcludeClass ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: Util.ExcludeClass( goalname, team, class1, class2, class3, class4 );&lt;br /&gt;
  example: Util.ExcludeClass( &amp;quot;DEFEND_somegoal.*&amp;quot;, TEAM.AXIS, CLASS.MEDIC );&lt;br /&gt;
  example: Util.ExcludeClass( &amp;quot;MOUNTMG42_.*&amp;quot;, TEAM.ALLIES, CLASS.FIELDOPS, CLASS.ENGINEER );&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
limit given goal usage to specific classes by team. class2, class3, and class4 are optional.&lt;br /&gt;
&lt;br /&gt;
==== Util.ForceRouting ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: Util.ForceRouting(goalName, true/false);&lt;br /&gt;
  example: Util.ForceRouting( &amp;quot;BUILD_Tank&amp;quot;, true );&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
disables BUILD goal offsets and enables routes to the goal. You should set ForceRouting to true only when a vehicle is at known position (in OnMapLoad or at tank barriers). You must set it to false when a vehicle is repaired.&lt;br /&gt;
&lt;br /&gt;
==== Util.GetEntHealth ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: Util.GetEntHealth(entity);&lt;br /&gt;
  example: health = Util.GetEntHealth(this.TargetEntity);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
returns entity health.&lt;br /&gt;
&lt;br /&gt;
==== Util.GetGroup ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: Util.GetGroup(groupname);&lt;br /&gt;
  example: Util.GetGroup(&amp;quot;somegroupname&amp;quot;);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
this function will return a table of goals belonging to the given group name&lt;br /&gt;
&lt;br /&gt;
==== Util.GetRandomFromTable ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: Util.GetRandomFromTable( tbl );&lt;br /&gt;
  example: index = Util.GetRandomFromTable( someTable );&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
used to get a randomly selected index from a given table. Returns -1 if invalid. Table keys must be integers from 0 to (count - 1).&lt;br /&gt;
&lt;br /&gt;
==== Util.GetRandomTableValue====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: Util.GetRandomTableValue( tbl );&lt;br /&gt;
  example: value = Util.GetRandomTableValue( someTable );&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
used to get a randomly selected value from a given table. Returns null if the table is empty or invalid. Table keys must be integers from 0 to (count - 1).&lt;br /&gt;
&lt;br /&gt;
==== Util.GoalTable ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: Util.GoalTable( &amp;lt;optional expression&amp;gt;, &amp;lt;optional teamId&amp;gt; );&lt;br /&gt;
  example: goals = Util.GoalTable(&amp;quot;PLANT_Back_Door&amp;quot;);&lt;br /&gt;
  example: goals = Util.GoalTable(&amp;quot;FLAG.*&amp;quot;, TEAM.AXIS);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
returns table of map goals that match a regular expression. &lt;br /&gt;
&lt;br /&gt;
==== Util.IgnoreTargetGoal ====&lt;br /&gt;
&lt;br /&gt;
This function is deprecated. Use [[Bot#IgnoreTarget|IgnoreTarget]]&lt;br /&gt;
&lt;br /&gt;
==== Util.IgnoreTargetGoalTable ====&lt;br /&gt;
&lt;br /&gt;
This function is deprecated. Use [[Bot#IgnoreTarget|IgnoreTarget]]&lt;br /&gt;
&lt;br /&gt;
==== Util.IsBot ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: Util.IsBot(entity);&lt;br /&gt;
  example: bot = Util.IsBot(ent); &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
returns Bot object from entity or null if entity is not a bot. Usually used in region triggers if the TriggerOnClass is CLASS.ANYPLAYER.&lt;br /&gt;
&lt;br /&gt;
==== Util.LimitToClass ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: Util.LimitToClass(goalname, team, class1, class2, class3, class4);&lt;br /&gt;
  example: Util.LimitToClass(&amp;quot;CHECKPOINT.*&amp;quot;, TEAM.ALLIES, CLASS.SOLDIER); //only soldiers on the allied team&lt;br /&gt;
  example: Util.LimitToClass(&amp;quot;CHECKPOINT.*&amp;quot;, TEAM.ALLIES, CLASS.SOLDIER, CLASS.MEDIC); //only soldiers and medics&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
used to limit specific goals to a specific class or classes&lt;br /&gt;
&lt;br /&gt;
==== Util.LimitToTeam ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: Util.LimitToTeam(team, goal);&lt;br /&gt;
  example: Util.LimitToTeam(TEAM.AXIS, &amp;quot;SWITCH_gate_depot&amp;quot;);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
limits goals to a certain team without the need to disable for 1 team&lt;br /&gt;
&lt;br /&gt;
==== Util.MapDebugPrint ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: Util.MapDebugPrint( &amp;quot;Text&amp;quot;, &amp;lt;optional message only&amp;gt; );&lt;br /&gt;
  example: Util.MapDebugPrint( &amp;quot;East_Barrier_Destroyed&amp;quot; );&lt;br /&gt;
  example: Util.MapDebugPrint( &amp;quot;East_Barrier_Destroyed&amp;quot;, true ); // only print the message&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
used to print text &amp;amp; list of available goals in the console when in debug mode&lt;br /&gt;
&lt;br /&gt;
see also: [[Debugging_tips]]&lt;br /&gt;
&lt;br /&gt;
==== Util.OnTriggerPosition ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: Util.OnTriggerPosition( goalname, wpname or position, tolerance, wpfunction );&lt;br /&gt;
  example: Util.OnTriggerPosition( &amp;quot;MOVER_train1&amp;quot;, &amp;quot;depotyard&amp;quot;, 200.0, Map.tug_depotyard );&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
note: used for setting up positional triggers for movers.&lt;br /&gt;
&lt;br /&gt;
==== Util.RandomBotSpawn ====&lt;br /&gt;
&lt;br /&gt;
This function is deprecated. See [[Changing spawns]].&lt;br /&gt;
&lt;br /&gt;
==== Util.RandomSpawn ====&lt;br /&gt;
&lt;br /&gt;
This function is deprecated. See [[Changing spawns]].&lt;br /&gt;
&lt;br /&gt;
==== Util.RemoveGoal ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: Util.RemoveGoal( goalnames );&lt;br /&gt;
  example: Util.RemoveGoal( &amp;quot;MOVER_truck&amp;quot; );&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
removes the goals from the map goal table. It should only be used for invalid goals which are badly detected by the game.&lt;br /&gt;
&lt;br /&gt;
==== Util.Routes ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: Util.Routes( &amp;lt;table&amp;gt; );&lt;br /&gt;
  example: Util.Routes(MapRoutes);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
initializes routes&lt;br /&gt;
&lt;br /&gt;
see also: [[Template:Baserouting|Routing]]&lt;br /&gt;
&lt;br /&gt;
==== Util.SetGoalOffset ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: Util.SetGoalOffset( x, y, z, GoalName );&lt;br /&gt;
  info x = North, -x = South y = East, -y = West, z = Up, -z =Down&lt;br /&gt;
  example: Util.SetGoalOffset( 0, -20, -10, &amp;quot;MOUNTMG42_boat&amp;quot; );&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
the x y and z parameters are added to the origin of the goal to move the location of where bots will look for the goal. It is sometimes needed for MOUNTMG42 and REPAIRMG42 goals because some mg42 cannot be mounted or repaired if it&#039;s position is not corrected.&lt;br /&gt;
&lt;br /&gt;
==== Util.SetGoalPosition ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: Util.SetGoalPosition( x, y, z, GoalName );&lt;br /&gt;
  example: Util.SetGoalPosition( 4534, 2168, -199, &amp;quot;BUILD_construct&amp;quot; )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
used to give the goal a new origin.&lt;br /&gt;
&lt;br /&gt;
note: it&#039;s  usually much better to use function Util.AddUsePoint to set position of BUILD or PLANT goals.&lt;br /&gt;
&lt;br /&gt;
note: console command &amp;quot;/bot mypos&amp;quot; prints your body position, command &amp;quot;/viewpos&amp;quot; prints your eye position rounded to integer.&lt;br /&gt;
&lt;br /&gt;
==== Util.SetGoalRange ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: Util.SetGoalRange( goalNames, distance );&lt;br /&gt;
  example: Util.SetGoalRange(&amp;quot;GRENADE_tower.*&amp;quot;, 800);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
sets the range for map goals. The goals will not be available for bots that are out of range. Default range for all goals is 0 which means unlimited.&lt;br /&gt;
&lt;br /&gt;
==== Util.SetGroup ====&lt;br /&gt;
&lt;br /&gt;
This function is deprecated. Use [[Bot_Library#SetGoalGroup|SetGoalGroup]]&lt;br /&gt;
&lt;br /&gt;
==== Util.SetGroupForTable ====&lt;br /&gt;
&lt;br /&gt;
This function is deprecated. Use [[Bot_Library#SetGoalGroup|SetGoalGroup]]&lt;br /&gt;
&lt;br /&gt;
==== Util.SetMaxUsers ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: Util.SetMaxUsers( botnum, goal );&lt;br /&gt;
  example: Util.SetMaxUsers( 1, &amp;quot;ATTACK_.*&amp;quot; );&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
used to limit number of bots using a particular goal(s). this function sets both In_Use and In_Progress&lt;br /&gt;
&lt;br /&gt;
==== Util.SetMaxUsersInProgress ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: Util.SetMaxUsersInProgress( Users, GoalNames );&lt;br /&gt;
  example: Util.SetMaxUsersInProgress( 15, &amp;quot;CHECKPOINT.*&amp;quot; );&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
used to set the maximum number of bots going for a particular goal(s).&lt;br /&gt;
&lt;br /&gt;
==== Util.SetMaxUsersInUse ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: Util.SetMaxUsersInUse( Users, GoalNames );&lt;br /&gt;
  example: Util.SetMaxUsersInUse( 1, &amp;quot;MOUNT_.*&amp;quot; );&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
used to set the maximum number of bots using a particular goal(s).&lt;br /&gt;
&lt;br /&gt;
==== Util.SetPercentInProgress ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: Util.SetPercentInProgress(%, goal);&lt;br /&gt;
  example: Util.SetPercentInProgress(70, &amp;quot;FLAG_docs&amp;quot;);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
sets a percentage of bots to use a particular goal(s).&lt;br /&gt;
&lt;br /&gt;
note: number of bots is calculated only once when this function is called. It does not work well after bots are added or kicked.&lt;br /&gt;
&lt;br /&gt;
==== Util.SetPositionGoal ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: Util.SetPositionGoal( goalname1, goalname2 );&lt;br /&gt;
  example: Util.SetPositionGoal( &amp;quot;BUILD_Tank&amp;quot;, &amp;quot;MOVER_tank&amp;quot; );&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
sets the origin of one goal to match the origin of another. This function was used in Omni-bot 0.66. Current Omni-bot version automatically sets positions of BUILD goals.&lt;br /&gt;
&lt;br /&gt;
==== Util.SetRoleForGoals ====&lt;br /&gt;
&lt;br /&gt;
This function is deprecated. Use [[Bot_Library#SetGoalRole|SetGoalRole]]&lt;br /&gt;
&lt;br /&gt;
==== Util.SetRoleForGroup ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: Util.SetRoleForGroup( &amp;lt;goal group&amp;gt;, &amp;lt;role or table&amp;gt; );&lt;br /&gt;
  example: Util.SetRoleForGroup( &amp;quot;myGroup&amp;quot;, ROLE.DEFENDER );&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
sets the given roles for the given group of goals.&lt;br /&gt;
&lt;br /&gt;
==== Util.SetRoleForTable ====&lt;br /&gt;
&lt;br /&gt;
This function is deprecated. Use [[Bot_Library#SetGoalRole|SetGoalRole]]&lt;br /&gt;
&lt;br /&gt;
see also: [[Roles]] Page&lt;br /&gt;
&lt;br /&gt;
==== Util.ShowGroup ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: Util.ShowGroup(groupname);&lt;br /&gt;
  example: Util.ShowGroup(&amp;quot;somegroupname&amp;quot;);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
this function will list all goals in the given group in the console.&lt;br /&gt;
&lt;br /&gt;
==== Util.UpdateSwitchData ====&lt;br /&gt;
&lt;br /&gt;
This function is deprecated. Use [[Switch_Goal]]&lt;br /&gt;
&lt;br /&gt;
==== Util.WpNameInfo ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: Util.WpNameInfo(waypointName);&lt;br /&gt;
  example: wpInfo = Util.WpNameInfo(&amp;quot;rNadeHall&amp;quot;);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
finds waypoint by name and returns table which contains position, facing, radius, flags, property. It is often used in paththrough navigation.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== ETUtil ===&lt;br /&gt;
These functions are available only in the Enemy Territory game.&lt;br /&gt;
&lt;br /&gt;
==== ETUtil.ChangeToPanzer ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: ETUtil.ChangeToPanzer( bot );&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
called from OnBotJoin on panzer maps.&lt;br /&gt;
&lt;br /&gt;
see also: [[Sniper_and_Panzer_maps]]&lt;br /&gt;
&lt;br /&gt;
==== ETUtil.CountClass ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: ETUtil.CountClass( team, class );&lt;br /&gt;
  example: ETUtil.CountClass( TEAM.ALLIES, CLASS.ENGINEER ); &amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
can be used to determine if a team has enough of a critical class for the map&lt;br /&gt;
&lt;br /&gt;
==== ETUtil.GetReinforceTime ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: ETUtil.GetReinforceTime(TEAM.AXIS);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
returns time to next respawn, or null if no bot exists in the team.&lt;br /&gt;
&lt;br /&gt;
==== ETUtil.GetTimeElapsed ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: ETUtil.GetTimeElapsed();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
returns time since map start.&lt;br /&gt;
&lt;br /&gt;
==== ETUtil.IsTeamClassDead ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: ETUtil.IsTeamClassDead( team, class );&lt;br /&gt;
  example: ETUtil.IsTeamClassDead( TEAM.AXIS, CLASS.MEDIC ); &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
returns true if all the players of the given class on the given team are dead.&lt;br /&gt;
&lt;br /&gt;
==== ETUtil.IsTeamDead ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: ETUtil.IsTeamDead( team );&lt;br /&gt;
  example: ETUtil.IsTeamDead( TEAM.AXIS );&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
returns true if all players on the given team are dead.&lt;br /&gt;
&lt;br /&gt;
==== ETUtil.LosingChat ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: ETUtil.LosingChat(team);&lt;br /&gt;
  example: ETUtil.LosingChat( TEAM.AXIS );&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
See [[Talking_bots]] page&lt;br /&gt;
&lt;br /&gt;
==== ETUtil.SelectWeapon ====&lt;br /&gt;
&lt;br /&gt;
This function does not work since version 0.82. Now you have to use [[Utility_Functions#WeaponTable|WeaponTable.SetWeaponAvailability]].&lt;br /&gt;
&lt;br /&gt;
==== ETUtil.SetAimModeForMount====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: ETUtil.SetAimModeForMount(goalName, aimType);&lt;br /&gt;
  example: ETUtil.SetAimModeForMount(&amp;quot;MOUNT_ship&amp;quot;, Vec3(-340, 1530, 90));&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sets AimMode property of MOUNT goal. Valid values are &amp;quot;velocity&amp;quot;, &amp;quot;opposite&amp;quot;, &amp;quot;random&amp;quot; or Vector3.&lt;br /&gt;
&lt;br /&gt;
==== ETUtil.SetCabinets ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: ETUtil.SetCabinets();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
disables health &amp;amp; ammo cabinets for Medic &amp;amp; FieldOp Classes&lt;br /&gt;
&lt;br /&gt;
==== ETUtil.SetExcludeIndexes ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: ETUtil.SetExcludeIndexes( goal, { offset } );&lt;br /&gt;
  example: ETUtil.SetExcludeIndexes( &amp;quot;BUILD_Truck&amp;quot;, { 4, 5, 6 } ); // Disable offset 4, 5 &amp;amp; 6&lt;br /&gt;
  example: ETUtil.SetExcludeIndexes( &amp;quot;BUILD_Truck&amp;quot;, {} ); // Removes Disabled offsets&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
disables vehicle offsets, used when an offset cannot be reached. Used only by goals BUILD, ESCORT, MOUNT, RIDE.&lt;br /&gt;
&lt;br /&gt;
==== ETUtil.SetStartIndex ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: ETUtil.SetStartIndex(goal, offset);&lt;br /&gt;
  example: ETUtil.SetStartIndex(&amp;quot;ESCORT_tank&amp;quot;, 2); // Use Offset 2&lt;br /&gt;
  example: ETUtil.SetStartIndex(&amp;quot;ESCORT_tank&amp;quot;, -1); // Random&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
used to make a bot start from a certain vehicle offset in mover goals that have offsets defined. Normally set in OnMapLoad then reset inside a trigger. Used only by goals BUILD, ESCORT, MOUNT, RIDE.&lt;br /&gt;
&lt;br /&gt;
==== ETUtil.SuicideSpawn ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: ETUtil.SuicideSpawn( team, spawn, numbots, class);&lt;br /&gt;
  example: ETUtil.SuicideSpawn( TEAM.AXIS, 2, 1, CLASS.ENGINEER ); // 2 bots spawn at spawnpoint 2&lt;br /&gt;
  example: ETUtil.SuicideSpawn( TEAM.AXIS, 2, -1, CLASS.ENGINEER ); // all axis engineer bots spawn at spawnpoint 2&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
used to make bots self kill and change to a new spawn, often used in maps to defend areas when players have sneaked past.&lt;br /&gt;
&lt;br /&gt;
==== ETUtil.SwitchWeapon ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: ETUtil.SwitchWeapon(weapon);&lt;br /&gt;
  example: ETUtil.SwitchWeapon(WEAPON.PANZERFAUST); //all soldiers will switch to panzer&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This function is deprecated since version 0.82 because it only kills bot and does not change his weapon.&lt;br /&gt;
&lt;br /&gt;
==== ETUtil.WinningChat ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: ETUtil.WinningChat(Team);&lt;br /&gt;
  example: ETUtil.WinningChat( TEAM.ALLIES );&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
See [[Talking_bots]] page&lt;br /&gt;
&lt;br /&gt;
=== RTCWUtil ===&lt;br /&gt;
These functions are available only in the Return to Castle Wolfenstein game.&lt;br /&gt;
&lt;br /&gt;
==== RTCWUtil.BotDisableCombatCrouch ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: RTCWUtil.BotDisableCombatCrouch( bot, bool enable );&lt;br /&gt;
  example: RTCWUtil.BotDisableCombatCrouch( bot, true );&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
used to disable crouching in combat for the given bot&lt;br /&gt;
&lt;br /&gt;
==== RTCWUtil.ChangeClass ====&lt;br /&gt;
&lt;br /&gt;
This function is deprecated. Use Server.MinClassCount.&lt;br /&gt;
&lt;br /&gt;
==== RTCWUtil.ChangeSpawnNoDefenders ====&lt;br /&gt;
&lt;br /&gt;
This function is deprecated. See [[Changing spawns]].&lt;br /&gt;
&lt;br /&gt;
==== RTCWUtil.ClearMainGoals ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: RTCWUtil.ClearMainGoals();&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
This function will deactivate all main goals for both teams.&lt;br /&gt;
  &lt;br /&gt;
   goals deactivated: PLANT MOUNTMG42 MOVER CHECKPOINT FLAG&lt;br /&gt;
&lt;br /&gt;
==== RTCWUtil.ClearSecondaryGoals ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: RTCWUtil.ClearSecondaryGoals();&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  This function will deactivate all secondary goals for both teams.&lt;br /&gt;
  &lt;br /&gt;
  goals deactivated: ARTILLERY REPAIR&lt;br /&gt;
&lt;br /&gt;
==== RTCWUtil.CountClass ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: RTCWUtil.CountClass( team, class );&lt;br /&gt;
  example: RTCWUtil.CountClass( TEAM.ALLIES, CLASS.ENGINEER ); &amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
can be used to determine if a team has enough of a critical class for the map&lt;br /&gt;
&lt;br /&gt;
==== RTCWUtil.CountTeam ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: RTCWUtil.DisableGoal(goalname, &amp;lt;optional true&amp;gt;);&lt;br /&gt;
  example: RTCWUtil.DisableGoal(&amp;quot;FLAG_someflag&amp;quot;); &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
disables the goal for both teams. the optional true parameter is used to disable all goals except for ROUTE goals.&lt;br /&gt;
&lt;br /&gt;
==== RTCWUtil.IsPlantGoalAvailable ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: RTCWUtil.IsPlantGoalAvailable();&lt;br /&gt;
  example: RTCWUtil.IsPlantGoalAvailable();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
returns true if there is a plant goal available&lt;br /&gt;
&lt;br /&gt;
==== RTCWUtil.IsTeamClassDead ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: RTCWUtil.IsTeamClassDead( team, class );&lt;br /&gt;
  example: RTCWUtil.IsTeamClassDead( TEAM.AXIS, CLASS.ENGINEER )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
returns true if there are no living players or bots of a given class on the given team&lt;br /&gt;
&lt;br /&gt;
==== RTCWUtil.IsTeamDead ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: RTCWUtil.IsTeamDead( team, minbots );&lt;br /&gt;
  example: RTCWUtil.IsTeamDead( TEAM.AXIS, 2 );&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
returns true if the number of living players on the given team is less than minbots.&lt;br /&gt;
&lt;br /&gt;
note: minbots is optional as it defaults to 1&lt;br /&gt;
&lt;br /&gt;
==== RTCWUtil.KillEntities ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: RTCWUtil.KillEntities( table or int );&lt;br /&gt;
  example: RTCWUtil.KillEntities( 123 );&lt;br /&gt;
  example: RTCWUtil.KillEntities( {123, 124} );&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
used to remove entities from the map. typically called from OnMapLoad&lt;br /&gt;
&lt;br /&gt;
==== RTCWUtil.NoSnipe ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: syntax: RTCWUtil.NoSnipe(bot);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
soldier bots will not choose a mauser when selecting a weapon&lt;br /&gt;
 &lt;br /&gt;
note: this is typically called in OnBotJoin&lt;br /&gt;
&lt;br /&gt;
==== RTCWUtil.SelectSoldierWeapons ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: RTCWUtil.SelectSoldierWeapons(team, bot, weap1, weap2, weap3);&lt;br /&gt;
  soldiers will only select weapons passed in as parameters&lt;br /&gt;
  &lt;br /&gt;
  note: typically used in OnBotJoin to have soldiers choose between given weapons&lt;br /&gt;
  example: RTCWUtil.SelectSoldierWeapons(TEAM.AXIS, bot, WEAPON.MAUSER, WEAPON.PANZERFAUST); //axis soldiers randomly select panzer or mauser&lt;br /&gt;
  example: RTCWUtil.SelectSoldierWeapons(0, bot, WEAPON.MAUSER, WEAPON.PANZERFAUST); //all soldiers randomly select panzer or mauser&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
&lt;br /&gt;
==== RTCWUtil.SelectWeapon ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: RTCWUtil.SelectWeapon(bot, weapon, isFog);&lt;br /&gt;
  example: RTCWUtil.SelectWeapon(bot, WEAPON.MAUSER);&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
the given bot will switch to the given weapon if it is the correct class for the weapon&lt;br /&gt;
 &lt;br /&gt;
note: typically used in OnBotJoin to have soldiers choose a specific weapon&lt;br /&gt;
         the isFog parameter is optional and disables extra view distance given to snipers&lt;br /&gt;
&lt;br /&gt;
==== RTCWUtil.SetPrimaryGoals ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: RTCWUtil.SetPrimaryGoals(priority);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
used for setting priorities of common goals.&lt;br /&gt;
  &lt;br /&gt;
note: this is typically called in OnMapLoad and effects the following goals (in order of priority):&lt;br /&gt;
         CAPPOINT FLAGRETURN PLANT CHECKPOINT FLAG&lt;br /&gt;
&lt;br /&gt;
==== RTCWUtil.SetSuicide ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: RTCWUtil.SetSuicide(team, class, suicide, persistant);&lt;br /&gt;
  sets all classes on the given team so they commit suicide two seconds before the next spawn&lt;br /&gt;
         the persistant parameter if set will have them do it every spawn until it is turned off ( or round ends)&lt;br /&gt;
 &lt;br /&gt;
  example: RTCWUtil.SetSuicide(TEAM.ALLIES, CLASS.LIEUTENANT, 1, 1); //commit suicide 2 seconds before every spawn&lt;br /&gt;
  example: RTCWUtil.SetSuicide(TEAM.ALLIES, CLASS.LIEUTENANT, 0, 0); //disable the suicide flag for them&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== RTCWUtil.SetTeamSuicide ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: RTCWUtil.SetSuicide(team, suicide, persistant);&lt;br /&gt;
  sets all bots on the given team so they commit suicide two seconds before the next spawn&lt;br /&gt;
         the persistant parameter if set will have them do it every spawn until it is turned off ( or round ends)&lt;br /&gt;
 &lt;br /&gt;
  example: RTCWUtil.SetTeamSuicide(TEAM.ALLIES, 1, 1); //commit suicide 2 seconds before every spawn&lt;br /&gt;
  example: RTCWUtil.SetTeamSuicide(TEAM.ALLIES, 0, 0); //disable the suicide flag for them&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== RTCWUtil.StopSniping ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: RTCWUtil.StopSniping();&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
all bots currently using a sniper weapon will switch to a different weapon&lt;br /&gt;
  &lt;br /&gt;
note: this is typically called inside trigger functions&lt;br /&gt;
&lt;br /&gt;
==== RTCWUtil.SwitchSoldierWeapons ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: RTCWUtil.SwitchSoldierWeapons(team, bot, weap1, weap2, weap3);&lt;br /&gt;
  soldiers will only select weapons passed in as parameters&lt;br /&gt;
  &lt;br /&gt;
  note: typically used in triggers to have soldiers choose between given weapons&lt;br /&gt;
  example: RTCWUtil.SwitchSoldierWeapons(TEAM.AXIS, bot, WEAPON.MAUSER, WEAPON.PANZERFAUST); //axis soldiers randomly select panzer or mauser&lt;br /&gt;
  example: RTCWUtil.SwitchSoldierWeapons(0, bot, WEAPON.MAUSER, WEAPON.PANZERFAUST); //all soldiers randomly select panzer or mauser&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
==== RTCWUtil.SwitchWeapon ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: RTCWUtil.SwitchWeapon(weapon);&lt;br /&gt;
  all qualifying bots will switch to the given weapon&lt;br /&gt;
  &lt;br /&gt;
  example: RTCWUtil.SwitchWeapon(WEAPON.PANZERFAUST); //all soldiers will switch to panzer&lt;br /&gt;
  note: typically used in trigger functions&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== RTCWUtil.TeamDisableCombatCrouch ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: RTCWUtil.TeamDisableCombatCrouch( team );&lt;br /&gt;
  example: RTCWUtil.TeamDisableCombatCrouch( TEAM.AXIS );&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
disables combat crouching for the given team&lt;br /&gt;
&lt;br /&gt;
==== RTCWUtil.ToggleFlag ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: RTCWUtil.ToggleFlag( goal, time in seconds );&lt;br /&gt;
  example: thread(RTCWUtil.ToggleFlag, &amp;quot;CHECKPOINT.someFlag&amp;quot;, 300);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
used in dual objective maps like mp_depot to set availability of the checkpoint goal for the opposite team in the given interval&lt;br /&gt;
note: this should be called as a gm thread.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== WeaponTable ===&lt;br /&gt;
&lt;br /&gt;
==== WeaponTable.ListWeaponAvailability ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: WeaponTable.ListWeaponAvailability();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
prints current availability of all weapons&lt;br /&gt;
&lt;br /&gt;
==== WeaponTable.SetWeaponAvailability ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: WeaponTable.SetWeaponAvailability( class, weapon, &amp;lt;true/false&amp;gt;);&lt;br /&gt;
  example: WeaponTable.SetWeaponAvailability( CLASS.SOLDIER, WEAPON.FLAMETHROWER, false );&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
enables or disables specified weapon for class. The weapon parameter can be table.&lt;br /&gt;
The class parameter can be null to set availability for all classes.&lt;br /&gt;
&lt;br /&gt;
note: allied PANZERFAUST is automatically converted to BAZOOKA or LAW in Noquarter or ETnam&lt;br /&gt;
&lt;br /&gt;
note: bots select random available weapon every spawn (in limbo)&lt;br /&gt;
&lt;br /&gt;
==== WeaponTable.SetWeaponTeamAvailability ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: WeaponTable.SetWeaponTeamAvailability( team, class, weapon, &amp;lt;true/false&amp;gt;);&lt;br /&gt;
  example: WeaponTable.SetWeaponTeamAvailability( TEAM.AXIS, CLASS.ENGINEER, WEAPON.KAR98, false );&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
enables or disables weapon for team and class.&lt;br /&gt;
&lt;br /&gt;
==== WeaponTable.Shotgun ====&lt;br /&gt;
&lt;br /&gt;
The Shotgun property has value WEAPON.SHOTGUN, WEAPON.ITHACA, WEAPON.M97 or null.&lt;/div&gt;</summary>
		<author><name>Palota</name></author>
	</entry>
	<entry>
		<id>https://mygamingtalk.com/wiki/index.php?title=Utility_Functions&amp;diff=1770</id>
		<title>Utility Functions</title>
		<link rel="alternate" type="text/html" href="https://mygamingtalk.com/wiki/index.php?title=Utility_Functions&amp;diff=1770"/>
		<updated>2025-05-25T16:55:42Z</updated>

		<summary type="html">&lt;p&gt;Palota: /* ETUtil.GetReinforceTime */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{process header&lt;br /&gt;
 | title    = Utility Functions&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;
{{TOCright}}&lt;br /&gt;
&lt;br /&gt;
=== Util ===&lt;br /&gt;
&lt;br /&gt;
==== Util.AddUsePoint ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: Util.AddUsePoint(goalname, &amp;lt;Vector3 or table&amp;gt;);&lt;br /&gt;
  example: Util.AddUsePoint(&amp;quot;PLANT_wall&amp;quot;,{Vec3(12,34,5),Vec3(23,5,67)});&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
used to add use points for a goal at given positions. Goals can have multiple use points. You must set RandomUsePoint property to 1, otherwise bots will always choose the nearest use point.&lt;br /&gt;
&lt;br /&gt;
==== Util.AddUseWp ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: Util.AddUseWp(goalname, &amp;lt;waypointname or table&amp;gt;);&lt;br /&gt;
  example: Util.AddUseWp( &amp;quot;somegoalname&amp;quot;, &amp;quot;somewaypointname&amp;quot; );&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
used to add use points for a goal at given waypoints positions. Goals can have multiple use points. You must set RandomUsePoint property to 1, otherwise bots will always choose the nearest use point.&lt;br /&gt;
&lt;br /&gt;
==== Util.AliveCount ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: Util.AliveCount( team, class );&lt;br /&gt;
  example: Util.AliveCount( TEAM.AXIS, CLASS.MEDIC ); &amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
returns the number of bots alive on a team with a given class&lt;br /&gt;
&lt;br /&gt;
==== Util.BotChat ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: Util.BotChat(Team, msgType, Msg, NumBots);&lt;br /&gt;
  example: Util.BotChat(TEAM.ALLIES, &amp;quot;vsay&amp;quot;, VOICE.G_CHEER, 2);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
See [[Talking_bots]] page&lt;br /&gt;
&lt;br /&gt;
==== Util.BotHasAnyRole ====&lt;br /&gt;
&lt;br /&gt;
This function is deprecated. Use [[Bot#HasRole|HasRole]]&lt;br /&gt;
&lt;br /&gt;
==== Util.CanBotSnipe ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: Util.CanBotSnipe(bot);&lt;br /&gt;
  example: if ( Util.CanBotSnipe(bot) ) {&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
returns true if bot has a sniper weapon.&lt;br /&gt;
&lt;br /&gt;
==== Util.CappointForFlag ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: Util.CappointForFlag( flag_goalname, cappoint_goalname );&lt;br /&gt;
  example: Util.CappointForFlag( &amp;quot;FLAG_axis_gold&amp;quot;, &amp;quot;CAPPOINT_Truck&amp;quot; );&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
used if there are multiple active cappoint goals. It should be called from _Taken triggers.&lt;br /&gt;
&lt;br /&gt;
==== Util.ChangeBotSpawn ====&lt;br /&gt;
This function is deprecated. See [[Changing spawns]].&lt;br /&gt;
&lt;br /&gt;
==== Util.ChangeCrucialClassForRole ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: Util.ChangeCrucialClassForRole ( team, role, class );&lt;br /&gt;
  example: Util.ChangeCrucialClassForRole(TEAM.AXIS, ROLE.DEFENDER1, CLASS.COVERTOPS);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sets new crucialClass in the Map.Roles table.&lt;br /&gt;
&lt;br /&gt;
==== Util.ChangeSpawn ====&lt;br /&gt;
&lt;br /&gt;
This function is deprecated. See [[Changing spawns]].&lt;br /&gt;
&lt;br /&gt;
==== Util.ChangeSpawnForRole ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: Util.ChangeSpawnForRole( &amp;lt;team&amp;gt;, &amp;lt;role&amp;gt;, &amp;lt;spawnpoint&amp;gt; );&lt;br /&gt;
  example: Util.ChangeSpawnForRole(TEAM.ALLIES, ROLE.ATTACKER, 1);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Set the spawn point for all bots on the given team with the given role&lt;br /&gt;
&lt;br /&gt;
see also: [[Roles]] Page&lt;br /&gt;
&lt;br /&gt;
==== Util.ChangeToSniperWeapons ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: Util.ChangeToSniperWeapons( bot, &amp;lt;optional viewDistance&amp;gt; );&lt;br /&gt;
  example: Util.ChangeToSniperWeapons(bot);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
called from OnBotJoin on sniper maps.&lt;br /&gt;
&lt;br /&gt;
see also: [[Sniper_and_Panzer_maps]]&lt;br /&gt;
&lt;br /&gt;
==== Util.ClearRoleForGoals ====&lt;br /&gt;
&lt;br /&gt;
This function is deprecated. Use [[Bot_Library#ClearGoalRole|ClearGoalRole]]&lt;br /&gt;
&lt;br /&gt;
==== Util.ClearRoleForGroup ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: Util.ClearRoleForGroup( group, &amp;lt;role or table&amp;gt; );&lt;br /&gt;
  example: Util.ClearRoleForGroup( &amp;quot;someGroup&amp;quot;, ROLE.DEFENDER );&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
used to remove roles from a given group of goals&lt;br /&gt;
&lt;br /&gt;
see also: [[Roles]] Page&lt;br /&gt;
&lt;br /&gt;
==== Util.ClearRoleForTable ====&lt;br /&gt;
&lt;br /&gt;
This function is deprecated. Use [[Bot_Library#ClearGoalRole|ClearGoalRole]]&lt;br /&gt;
&lt;br /&gt;
==== Util.DisableGoal ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: Util.DisableGoal(goalname, &amp;lt;optional true&amp;gt;);&lt;br /&gt;
  example: Util.DisableGoal(&amp;quot;FLAG_someflag&amp;quot;); &amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
disables the goal for both teams. the optional true parameter is used to disable all goals except for ROUTE goals.&lt;br /&gt;
&lt;br /&gt;
==== Util.DisableGroup ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: Util.DisableGroup(groupname, team);&lt;br /&gt;
  example: Util.DisableGroup( &amp;quot;somegroupname&amp;quot;, TEAM.ALLIES );&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
used to disable a set of goals in the given group for a given team&lt;br /&gt;
&lt;br /&gt;
==== Util.EnableGoal ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: Util.EnableGoal(goalname);&lt;br /&gt;
  example: Util.EnableGoal(&amp;quot;FLAG_someflag&amp;quot;);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
enables the goal for both teams.&lt;br /&gt;
&lt;br /&gt;
==== Util.EnableGroup ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: Util.EnableGroup(groupname, team);&lt;br /&gt;
  example: Util.EnableGroup( &amp;quot;somegroupname&amp;quot;, TEAM.SOMETEAM );&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
used to enable a set of goals in the given group for a given team&lt;br /&gt;
&lt;br /&gt;
==== Util.ExcludeClass ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: Util.ExcludeClass( goalname, team, class1, class2, class3, class4 );&lt;br /&gt;
  example: Util.ExcludeClass( &amp;quot;DEFEND_somegoal.*&amp;quot;, TEAM.AXIS, CLASS.MEDIC );&lt;br /&gt;
  example: Util.ExcludeClass( &amp;quot;MOUNTMG42_.*&amp;quot;, TEAM.ALLIES, CLASS.FIELDOPS, CLASS.ENGINEER );&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
limit given goal usage to specific classes by team. class2, class3, and class4 are optional.&lt;br /&gt;
&lt;br /&gt;
==== Util.ForceRouting ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: Util.ForceRouting(goalName, true/false);&lt;br /&gt;
  example: Util.ForceRouting( &amp;quot;BUILD_Tank&amp;quot;, true );&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
disables BUILD goal offsets and enables routes to the goal. You should set ForceRouting to true only when a vehicle is at known position (in OnMapLoad or at tank barriers). You must set it to false when a vehicle is repaired.&lt;br /&gt;
&lt;br /&gt;
==== Util.GetEntHealth ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: Util.GetEntHealth(entity);&lt;br /&gt;
  example: health = Util.GetEntHealth(this.TargetEntity);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
returns entity health.&lt;br /&gt;
&lt;br /&gt;
==== Util.GetGroup ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: Util.GetGroup(groupname);&lt;br /&gt;
  example: Util.GetGroup(&amp;quot;somegroupname&amp;quot;);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
this function will return a table of goals belonging to the given group name&lt;br /&gt;
&lt;br /&gt;
==== Util.GetRandomFromTable ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: Util.GetRandomFromTable( tbl );&lt;br /&gt;
  example: index = Util.GetRandomFromTable( someTable );&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
used to get a randomly selected index from a given table. Returns -1 if invalid. Table keys must be integers from 0 to (count - 1).&lt;br /&gt;
&lt;br /&gt;
==== Util.GetRandomTableValue====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: Util.GetRandomTableValue( tbl );&lt;br /&gt;
  example: value = Util.GetRandomTableValue( someTable );&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
used to get a randomly selected value from a given table. Returns null if the table is empty or invalid. Table keys must be integers from 0 to (count - 1).&lt;br /&gt;
&lt;br /&gt;
==== Util.GoalTable ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: Util.GoalTable( &amp;lt;optional expression&amp;gt;, &amp;lt;optional teamId&amp;gt; );&lt;br /&gt;
  example: goals = Util.GoalTable(&amp;quot;PLANT_Back_Door&amp;quot;);&lt;br /&gt;
  example: goals = Util.GoalTable(&amp;quot;FLAG.*&amp;quot;, TEAM.AXIS);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
returns table of map goals that match a regular expression. &lt;br /&gt;
&lt;br /&gt;
==== Util.IgnoreTargetGoal ====&lt;br /&gt;
&lt;br /&gt;
This function is deprecated. Use [[Bot#IgnoreTarget|IgnoreTarget]]&lt;br /&gt;
&lt;br /&gt;
==== Util.IgnoreTargetGoalTable ====&lt;br /&gt;
&lt;br /&gt;
This function is deprecated. Use [[Bot#IgnoreTarget|IgnoreTarget]]&lt;br /&gt;
&lt;br /&gt;
==== Util.IsBot ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: Util.IsBot(entity);&lt;br /&gt;
  example: bot = Util.IsBot(ent); &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
returns Bot object from entity or null if entity is not a bot. Usually used in region triggers if the TriggerOnClass is CLASS.ANYPLAYER.&lt;br /&gt;
&lt;br /&gt;
==== Util.LimitToClass ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: Util.LimitToClass(goalname, team, class1, class2, class3, class4);&lt;br /&gt;
  example: Util.LimitToClass(&amp;quot;CHECKPOINT.*&amp;quot;, TEAM.ALLIES, CLASS.SOLDIER); //only soldiers on the allied team&lt;br /&gt;
  example: Util.LimitToClass(&amp;quot;CHECKPOINT.*&amp;quot;, TEAM.ALLIES, CLASS.SOLDIER, CLASS.MEDIC); //only soldiers and medics&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
used to limit specific goals to a specific class or classes&lt;br /&gt;
&lt;br /&gt;
==== Util.LimitToTeam ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: Util.LimitToTeam(team, goal);&lt;br /&gt;
  example: Util.LimitToTeam(TEAM.AXIS, &amp;quot;SWITCH_gate_depot&amp;quot;);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
limits goals to a certain team without the need to disable for 1 team&lt;br /&gt;
&lt;br /&gt;
==== Util.MapDebugPrint ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: Util.MapDebugPrint( &amp;quot;Text&amp;quot;, &amp;lt;optional message only&amp;gt; );&lt;br /&gt;
  example: Util.MapDebugPrint( &amp;quot;East_Barrier_Destroyed&amp;quot; );&lt;br /&gt;
  example: Util.MapDebugPrint( &amp;quot;East_Barrier_Destroyed&amp;quot;, true ); // only print the message&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
used to print text &amp;amp; list of available goals in the console when in debug mode&lt;br /&gt;
&lt;br /&gt;
see also: [[Debugging_tips]]&lt;br /&gt;
&lt;br /&gt;
==== Util.OnTriggerPosition ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: Util.OnTriggerPosition( goalname, wpname or position, tolerance, wpfunction );&lt;br /&gt;
  example: Util.OnTriggerPosition( &amp;quot;MOVER_train1&amp;quot;, &amp;quot;depotyard&amp;quot;, 200.0, Map.tug_depotyard );&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
note: used for setting up positional triggers for movers.&lt;br /&gt;
&lt;br /&gt;
==== Util.RandomBotSpawn ====&lt;br /&gt;
&lt;br /&gt;
This function is deprecated. See [[Changing spawns]].&lt;br /&gt;
&lt;br /&gt;
==== Util.RandomSpawn ====&lt;br /&gt;
&lt;br /&gt;
This function is deprecated. See [[Changing spawns]].&lt;br /&gt;
&lt;br /&gt;
==== Util.RemoveGoal ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: Util.RemoveGoal( goalnames );&lt;br /&gt;
  example: Util.RemoveGoal( &amp;quot;MOVER_truck&amp;quot; );&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
removes the goals from the map goal table. It should only be used for invalid goals which are badly detected by the game.&lt;br /&gt;
&lt;br /&gt;
==== Util.Routes ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: Util.Routes( &amp;lt;table&amp;gt; );&lt;br /&gt;
  example: Util.Routes(MapRoutes);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
initializes routes&lt;br /&gt;
&lt;br /&gt;
see also: [[Template:Baserouting|Routing]]&lt;br /&gt;
&lt;br /&gt;
==== Util.SetGoalOffset ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: Util.SetGoalOffset( x, y, z, GoalName );&lt;br /&gt;
  info x = North, -x = South y = East, -y = West, z = Up, -z =Down&lt;br /&gt;
  example: Util.SetGoalOffset( 0, -20, -10, &amp;quot;MOUNTMG42_boat&amp;quot; );&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
the x y and z parameters are added to the origin of the goal to move the location of where bots will look for the goal. It is sometimes needed for MOUNTMG42 and REPAIRMG42 goals because some mg42 cannot be mounted or repaired if it&#039;s position is not corrected.&lt;br /&gt;
&lt;br /&gt;
==== Util.SetGoalPosition ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: Util.SetGoalPosition( x, y, z, GoalName );&lt;br /&gt;
  example: Util.SetGoalPosition( 4534, 2168, -199, &amp;quot;BUILD_construct&amp;quot; )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
used to give the goal a new origin.&lt;br /&gt;
&lt;br /&gt;
note: it&#039;s  usually much better to use function Util.AddUsePoint to set position of BUILD or PLANT goals.&lt;br /&gt;
&lt;br /&gt;
note: console command &amp;quot;/bot mypos&amp;quot; prints your body position, command &amp;quot;/viewpos&amp;quot; prints your eye position rounded to integer.&lt;br /&gt;
&lt;br /&gt;
==== Util.SetGoalRange ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: Util.SetGoalRange( goalNames, distance );&lt;br /&gt;
  example: Util.SetGoalRange(&amp;quot;GRENADE_tower.*&amp;quot;, 800);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
sets the range for map goals. The goals will not be available for bots that are out of range. Default range for all goals is 0 which means unlimited.&lt;br /&gt;
&lt;br /&gt;
==== Util.SetGroup ====&lt;br /&gt;
&lt;br /&gt;
This function is deprecated. Use [[Bot_Library#SetGoalGroup|SetGoalGroup]]&lt;br /&gt;
&lt;br /&gt;
==== Util.SetGroupForTable ====&lt;br /&gt;
&lt;br /&gt;
This function is deprecated. Use [[Bot_Library#SetGoalGroup|SetGoalGroup]]&lt;br /&gt;
&lt;br /&gt;
==== Util.SetMaxUsers ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: Util.SetMaxUsers( botnum, goal );&lt;br /&gt;
  example: Util.SetMaxUsers( 1, &amp;quot;ATTACK_.*&amp;quot; );&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
used to limit number of bots using a particular goal(s). this function sets both In_Use and In_Progress&lt;br /&gt;
&lt;br /&gt;
==== Util.SetMaxUsersInProgress ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: Util.SetMaxUsersInProgress( Users, GoalNames );&lt;br /&gt;
  example: Util.SetMaxUsersInProgress( 15, &amp;quot;CHECKPOINT.*&amp;quot; );&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
used to set the maximum number of bots going for a particular goal(s).&lt;br /&gt;
&lt;br /&gt;
==== Util.SetMaxUsersInUse ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: Util.SetMaxUsersInUse( Users, GoalNames );&lt;br /&gt;
  example: Util.SetMaxUsersInUse( 1, &amp;quot;MOUNT_.*&amp;quot; );&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
used to set the maximum number of bots using a particular goal(s).&lt;br /&gt;
&lt;br /&gt;
==== Util.SetPercentInProgress ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: Util.SetPercentInProgress(%, goal);&lt;br /&gt;
  example: Util.SetPercentInProgress(70, &amp;quot;FLAG_docs&amp;quot;);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
sets a percentage of bots to use a particular goal(s).&lt;br /&gt;
&lt;br /&gt;
note: number of bots is calculated only once when this function is called. It does not work well after bots are added or kicked.&lt;br /&gt;
&lt;br /&gt;
==== Util.SetPositionGoal ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: Util.SetPositionGoal( goalname1, goalname2 );&lt;br /&gt;
  example: Util.SetPositionGoal( &amp;quot;BUILD_Tank&amp;quot;, &amp;quot;MOVER_tank&amp;quot; );&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
sets the origin of one goal to match the origin of another. This function was used in Omni-bot 0.66. Current Omni-bot version automatically sets positions of BUILD goals.&lt;br /&gt;
&lt;br /&gt;
==== Util.SetRoleForGoals ====&lt;br /&gt;
&lt;br /&gt;
This function is deprecated. Use [[Bot_Library#SetGoalRole|SetGoalRole]]&lt;br /&gt;
&lt;br /&gt;
==== Util.SetRoleForGroup ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: Util.SetRoleForGroup( &amp;lt;goal group&amp;gt;, &amp;lt;role or table&amp;gt; );&lt;br /&gt;
  example: Util.SetRoleForGroup( &amp;quot;myGroup&amp;quot;, ROLE.DEFENDER );&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
sets the given roles for the given group of goals.&lt;br /&gt;
&lt;br /&gt;
==== Util.SetRoleForTable ====&lt;br /&gt;
&lt;br /&gt;
This function is deprecated. Use [[Bot_Library#SetGoalRole|SetGoalRole]]&lt;br /&gt;
&lt;br /&gt;
see also: [[Roles]] Page&lt;br /&gt;
&lt;br /&gt;
==== Util.ShowGroup ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: Util.ShowGroup(groupname);&lt;br /&gt;
  example: Util.ShowGroup(&amp;quot;somegroupname&amp;quot;);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
this function will list all goals in the given group in the console.&lt;br /&gt;
&lt;br /&gt;
==== Util.UpdateSwitchData ====&lt;br /&gt;
&lt;br /&gt;
This function is deprecated. Use [[Switch_Goal]]&lt;br /&gt;
&lt;br /&gt;
==== Util.WpNameInfo ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: Util.WpNameInfo(waypointName);&lt;br /&gt;
  example: wpInfo = Util.WpNameInfo(&amp;quot;rNadeHall&amp;quot;);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
finds waypoint by name and returns table which contains position, facing, radius, flags, property. It is often used in paththrough navigation.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== ETUtil ===&lt;br /&gt;
These functions are available only in the Enemy Territory game.&lt;br /&gt;
&lt;br /&gt;
==== ETUtil.ChangeToPanzer ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: ETUtil.ChangeToPanzer( bot );&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
called from OnBotJoin on panzer maps.&lt;br /&gt;
&lt;br /&gt;
see also: [[Sniper_and_Panzer_maps]]&lt;br /&gt;
&lt;br /&gt;
==== ETUtil.CountClass ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: ETUtil.CountClass( team, class );&lt;br /&gt;
  example: ETUtil.CountClass( TEAM.ALLIES, CLASS.ENGINEER ); &amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
can be used to determine if a team has enough of a critical class for the map&lt;br /&gt;
&lt;br /&gt;
==== ETUtil.GetReinforceTime ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: ETUtil.GetReinforceTime(TEAM.AXIS);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
returns time to next respawn, or null if no bot exists in the team.&lt;br /&gt;
&lt;br /&gt;
==== ETUtil.GetTimeElapsed ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: ETUtil.GetTimeElapsed();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
returns time since map start.&lt;br /&gt;
&lt;br /&gt;
==== ETUtil.IsTeamClassDead ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: ETUtil.IsTeamClassDead( team, class );&lt;br /&gt;
  example: ETUtil.IsTeamClassDead( TEAM.AXIS, CLASS.MEDIC ); &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
returns true if all the players of the given class on the given team are dead.&lt;br /&gt;
&lt;br /&gt;
==== ETUtil.IsTeamDead ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: ETUtil.IsTeamDead( team );&lt;br /&gt;
  example: ETUtil.IsTeamDead( TEAM.AXIS );&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
returns true if all players on the given team are dead.&lt;br /&gt;
&lt;br /&gt;
==== ETUtil.LosingChat ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: ETUtil.LosingChat(team);&lt;br /&gt;
  example: ETUtil.LosingChat( TEAM.AXIS );&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
See [[Talking_bots]] page&lt;br /&gt;
&lt;br /&gt;
==== ETUtil.SelectWeapon ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: ETUtil.SelectWeapon(bot, weapon);&lt;br /&gt;
  example: ETUtil.SelectWeapon(bot, WEAPON.PANZERFAUST);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This function is deprecated since version 0.82 because it only kills bot and does not change his weapon.&lt;br /&gt;
&lt;br /&gt;
==== ETUtil.SetAimModeForMount====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: ETUtil.SetAimModeForMount(goalName, aimType);&lt;br /&gt;
  example: ETUtil.SetAimModeForMount(&amp;quot;MOUNT_ship&amp;quot;, Vec3(-340, 1530, 90));&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sets AimMode property of MOUNT goal. Valid values are &amp;quot;velocity&amp;quot;, &amp;quot;opposite&amp;quot;, &amp;quot;random&amp;quot; or Vector3.&lt;br /&gt;
&lt;br /&gt;
==== ETUtil.SetCabinets ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: ETUtil.SetCabinets();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
disables health &amp;amp; ammo cabinets for Medic &amp;amp; FieldOp Classes&lt;br /&gt;
&lt;br /&gt;
==== ETUtil.SetExcludeIndexes ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: ETUtil.SetExcludeIndexes( goal, { offset } );&lt;br /&gt;
  example: ETUtil.SetExcludeIndexes( &amp;quot;BUILD_Truck&amp;quot;, { 4, 5, 6 } ); // Disable offset 4, 5 &amp;amp; 6&lt;br /&gt;
  example: ETUtil.SetExcludeIndexes( &amp;quot;BUILD_Truck&amp;quot;, {} ); // Removes Disabled offsets&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
disables vehicle offsets, used when an offset cannot be reached. Used only by goals BUILD, ESCORT, MOUNT, RIDE.&lt;br /&gt;
&lt;br /&gt;
==== ETUtil.SetStartIndex ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: ETUtil.SetStartIndex(goal, offset);&lt;br /&gt;
  example: ETUtil.SetStartIndex(&amp;quot;ESCORT_tank&amp;quot;, 2); // Use Offset 2&lt;br /&gt;
  example: ETUtil.SetStartIndex(&amp;quot;ESCORT_tank&amp;quot;, -1); // Random&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
used to make a bot start from a certain vehicle offset in mover goals that have offsets defined. Normally set in OnMapLoad then reset inside a trigger. Used only by goals BUILD, ESCORT, MOUNT, RIDE.&lt;br /&gt;
&lt;br /&gt;
==== ETUtil.SuicideSpawn ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: ETUtil.SuicideSpawn( team, spawn, numbots, class);&lt;br /&gt;
  example: ETUtil.SuicideSpawn( TEAM.AXIS, 2, 1, CLASS.ENGINEER ); // 2 bots spawn at spawnpoint 2&lt;br /&gt;
  example: ETUtil.SuicideSpawn( TEAM.AXIS, 2, -1, CLASS.ENGINEER ); // all axis engineer bots spawn at spawnpoint 2&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
used to make bots self kill and change to a new spawn, often used in maps to defend areas when players have sneaked past.&lt;br /&gt;
&lt;br /&gt;
==== ETUtil.SwitchWeapon ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: ETUtil.SwitchWeapon(weapon);&lt;br /&gt;
  example: ETUtil.SwitchWeapon(WEAPON.PANZERFAUST); //all soldiers will switch to panzer&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This function is deprecated since version 0.82 because it only kills bot and does not change his weapon.&lt;br /&gt;
&lt;br /&gt;
==== ETUtil.WinningChat ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: ETUtil.WinningChat(Team);&lt;br /&gt;
  example: ETUtil.WinningChat( TEAM.ALLIES );&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
See [[Talking_bots]] page&lt;br /&gt;
&lt;br /&gt;
=== RTCWUtil ===&lt;br /&gt;
These functions are available only in the Return to Castle Wolfenstein game.&lt;br /&gt;
&lt;br /&gt;
==== RTCWUtil.BotDisableCombatCrouch ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: RTCWUtil.BotDisableCombatCrouch( bot, bool enable );&lt;br /&gt;
  example: RTCWUtil.BotDisableCombatCrouch( bot, true );&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
used to disable crouching in combat for the given bot&lt;br /&gt;
&lt;br /&gt;
==== RTCWUtil.ChangeClass ====&lt;br /&gt;
&lt;br /&gt;
This function is deprecated. Use Server.MinClassCount.&lt;br /&gt;
&lt;br /&gt;
==== RTCWUtil.ChangeSpawnNoDefenders ====&lt;br /&gt;
&lt;br /&gt;
This function is deprecated. See [[Changing spawns]].&lt;br /&gt;
&lt;br /&gt;
==== RTCWUtil.ClearMainGoals ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: RTCWUtil.ClearMainGoals();&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
This function will deactivate all main goals for both teams.&lt;br /&gt;
  &lt;br /&gt;
   goals deactivated: PLANT MOUNTMG42 MOVER CHECKPOINT FLAG&lt;br /&gt;
&lt;br /&gt;
==== RTCWUtil.ClearSecondaryGoals ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: RTCWUtil.ClearSecondaryGoals();&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  This function will deactivate all secondary goals for both teams.&lt;br /&gt;
  &lt;br /&gt;
  goals deactivated: ARTILLERY REPAIR&lt;br /&gt;
&lt;br /&gt;
==== RTCWUtil.CountClass ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: RTCWUtil.CountClass( team, class );&lt;br /&gt;
  example: RTCWUtil.CountClass( TEAM.ALLIES, CLASS.ENGINEER ); &amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
can be used to determine if a team has enough of a critical class for the map&lt;br /&gt;
&lt;br /&gt;
==== RTCWUtil.CountTeam ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: RTCWUtil.DisableGoal(goalname, &amp;lt;optional true&amp;gt;);&lt;br /&gt;
  example: RTCWUtil.DisableGoal(&amp;quot;FLAG_someflag&amp;quot;); &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
disables the goal for both teams. the optional true parameter is used to disable all goals except for ROUTE goals.&lt;br /&gt;
&lt;br /&gt;
==== RTCWUtil.IsPlantGoalAvailable ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: RTCWUtil.IsPlantGoalAvailable();&lt;br /&gt;
  example: RTCWUtil.IsPlantGoalAvailable();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
returns true if there is a plant goal available&lt;br /&gt;
&lt;br /&gt;
==== RTCWUtil.IsTeamClassDead ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: RTCWUtil.IsTeamClassDead( team, class );&lt;br /&gt;
  example: RTCWUtil.IsTeamClassDead( TEAM.AXIS, CLASS.ENGINEER )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
returns true if there are no living players or bots of a given class on the given team&lt;br /&gt;
&lt;br /&gt;
==== RTCWUtil.IsTeamDead ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: RTCWUtil.IsTeamDead( team, minbots );&lt;br /&gt;
  example: RTCWUtil.IsTeamDead( TEAM.AXIS, 2 );&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
returns true if the number of living players on the given team is less than minbots.&lt;br /&gt;
&lt;br /&gt;
note: minbots is optional as it defaults to 1&lt;br /&gt;
&lt;br /&gt;
==== RTCWUtil.KillEntities ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: RTCWUtil.KillEntities( table or int );&lt;br /&gt;
  example: RTCWUtil.KillEntities( 123 );&lt;br /&gt;
  example: RTCWUtil.KillEntities( {123, 124} );&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
used to remove entities from the map. typically called from OnMapLoad&lt;br /&gt;
&lt;br /&gt;
==== RTCWUtil.NoSnipe ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: syntax: RTCWUtil.NoSnipe(bot);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
soldier bots will not choose a mauser when selecting a weapon&lt;br /&gt;
 &lt;br /&gt;
note: this is typically called in OnBotJoin&lt;br /&gt;
&lt;br /&gt;
==== RTCWUtil.SelectSoldierWeapons ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: RTCWUtil.SelectSoldierWeapons(team, bot, weap1, weap2, weap3);&lt;br /&gt;
  soldiers will only select weapons passed in as parameters&lt;br /&gt;
  &lt;br /&gt;
  note: typically used in OnBotJoin to have soldiers choose between given weapons&lt;br /&gt;
  example: RTCWUtil.SelectSoldierWeapons(TEAM.AXIS, bot, WEAPON.MAUSER, WEAPON.PANZERFAUST); //axis soldiers randomly select panzer or mauser&lt;br /&gt;
  example: RTCWUtil.SelectSoldierWeapons(0, bot, WEAPON.MAUSER, WEAPON.PANZERFAUST); //all soldiers randomly select panzer or mauser&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
&lt;br /&gt;
==== RTCWUtil.SelectWeapon ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: RTCWUtil.SelectWeapon(bot, weapon, isFog);&lt;br /&gt;
  example: RTCWUtil.SelectWeapon(bot, WEAPON.MAUSER);&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
the given bot will switch to the given weapon if it is the correct class for the weapon&lt;br /&gt;
 &lt;br /&gt;
note: typically used in OnBotJoin to have soldiers choose a specific weapon&lt;br /&gt;
         the isFog parameter is optional and disables extra view distance given to snipers&lt;br /&gt;
&lt;br /&gt;
==== RTCWUtil.SetPrimaryGoals ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: RTCWUtil.SetPrimaryGoals(priority);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
used for setting priorities of common goals.&lt;br /&gt;
  &lt;br /&gt;
note: this is typically called in OnMapLoad and effects the following goals (in order of priority):&lt;br /&gt;
         CAPPOINT FLAGRETURN PLANT CHECKPOINT FLAG&lt;br /&gt;
&lt;br /&gt;
==== RTCWUtil.SetSuicide ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: RTCWUtil.SetSuicide(team, class, suicide, persistant);&lt;br /&gt;
  sets all classes on the given team so they commit suicide two seconds before the next spawn&lt;br /&gt;
         the persistant parameter if set will have them do it every spawn until it is turned off ( or round ends)&lt;br /&gt;
 &lt;br /&gt;
  example: RTCWUtil.SetSuicide(TEAM.ALLIES, CLASS.LIEUTENANT, 1, 1); //commit suicide 2 seconds before every spawn&lt;br /&gt;
  example: RTCWUtil.SetSuicide(TEAM.ALLIES, CLASS.LIEUTENANT, 0, 0); //disable the suicide flag for them&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== RTCWUtil.SetTeamSuicide ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: RTCWUtil.SetSuicide(team, suicide, persistant);&lt;br /&gt;
  sets all bots on the given team so they commit suicide two seconds before the next spawn&lt;br /&gt;
         the persistant parameter if set will have them do it every spawn until it is turned off ( or round ends)&lt;br /&gt;
 &lt;br /&gt;
  example: RTCWUtil.SetTeamSuicide(TEAM.ALLIES, 1, 1); //commit suicide 2 seconds before every spawn&lt;br /&gt;
  example: RTCWUtil.SetTeamSuicide(TEAM.ALLIES, 0, 0); //disable the suicide flag for them&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== RTCWUtil.StopSniping ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: RTCWUtil.StopSniping();&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
all bots currently using a sniper weapon will switch to a different weapon&lt;br /&gt;
  &lt;br /&gt;
note: this is typically called inside trigger functions&lt;br /&gt;
&lt;br /&gt;
==== RTCWUtil.SwitchSoldierWeapons ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: RTCWUtil.SwitchSoldierWeapons(team, bot, weap1, weap2, weap3);&lt;br /&gt;
  soldiers will only select weapons passed in as parameters&lt;br /&gt;
  &lt;br /&gt;
  note: typically used in triggers to have soldiers choose between given weapons&lt;br /&gt;
  example: RTCWUtil.SwitchSoldierWeapons(TEAM.AXIS, bot, WEAPON.MAUSER, WEAPON.PANZERFAUST); //axis soldiers randomly select panzer or mauser&lt;br /&gt;
  example: RTCWUtil.SwitchSoldierWeapons(0, bot, WEAPON.MAUSER, WEAPON.PANZERFAUST); //all soldiers randomly select panzer or mauser&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
==== RTCWUtil.SwitchWeapon ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: RTCWUtil.SwitchWeapon(weapon);&lt;br /&gt;
  all qualifying bots will switch to the given weapon&lt;br /&gt;
  &lt;br /&gt;
  example: RTCWUtil.SwitchWeapon(WEAPON.PANZERFAUST); //all soldiers will switch to panzer&lt;br /&gt;
  note: typically used in trigger functions&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== RTCWUtil.TeamDisableCombatCrouch ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: RTCWUtil.TeamDisableCombatCrouch( team );&lt;br /&gt;
  example: RTCWUtil.TeamDisableCombatCrouch( TEAM.AXIS );&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
disables combat crouching for the given team&lt;br /&gt;
&lt;br /&gt;
==== RTCWUtil.ToggleFlag ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: RTCWUtil.ToggleFlag( goal, time in seconds );&lt;br /&gt;
  example: thread(RTCWUtil.ToggleFlag, &amp;quot;CHECKPOINT.someFlag&amp;quot;, 300);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
used in dual objective maps like mp_depot to set availability of the checkpoint goal for the opposite team in the given interval&lt;br /&gt;
note: this should be called as a gm thread.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== WeaponTable ===&lt;br /&gt;
&lt;br /&gt;
==== WeaponTable.ListWeaponAvailability ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: WeaponTable.ListWeaponAvailability();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
prints current availability of all weapons&lt;br /&gt;
&lt;br /&gt;
==== WeaponTable.SetWeaponAvailability ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: WeaponTable.SetWeaponAvailability( class, weapon, &amp;lt;true/false&amp;gt;);&lt;br /&gt;
  example: WeaponTable.SetWeaponAvailability( CLASS.SOLDIER, WEAPON.FLAMETHROWER, false );&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
enables or disables specified weapon for class. The weapon parameter can be table.&lt;br /&gt;
The class parameter can be null to set availability for all classes.&lt;br /&gt;
&lt;br /&gt;
note: allied PANZERFAUST is automatically converted to BAZOOKA or LAW in Noquarter or ETnam&lt;br /&gt;
&lt;br /&gt;
note: bots select random available weapon every spawn (in limbo)&lt;br /&gt;
&lt;br /&gt;
==== WeaponTable.SetWeaponTeamAvailability ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  syntax: WeaponTable.SetWeaponTeamAvailability( team, class, weapon, &amp;lt;true/false&amp;gt;);&lt;br /&gt;
  example: WeaponTable.SetWeaponTeamAvailability( TEAM.AXIS, CLASS.ENGINEER, WEAPON.KAR98, false );&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
enables or disables weapon for team and class.&lt;br /&gt;
&lt;br /&gt;
==== WeaponTable.Shotgun ====&lt;br /&gt;
&lt;br /&gt;
The Shotgun property has value WEAPON.SHOTGUN, WEAPON.ITHACA, WEAPON.M97 or null.&lt;/div&gt;</summary>
		<author><name>Palota</name></author>
	</entry>
	<entry>
		<id>https://mygamingtalk.com/wiki/index.php?title=ScriptGoal&amp;diff=1769</id>
		<title>ScriptGoal</title>
		<link rel="alternate" type="text/html" href="https://mygamingtalk.com/wiki/index.php?title=ScriptGoal&amp;diff=1769"/>
		<updated>2025-05-25T16:51:04Z</updated>

		<summary type="html">&lt;p&gt;Palota: /* AlwaysRecieveEvents */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{process header&lt;br /&gt;
 | title    = Script Goal&lt;br /&gt;
 | section  =&lt;br /&gt;
 | previous = [[Omni-bot_Script_Reference | Script Reference]]&lt;br /&gt;
 | next     = &lt;br /&gt;
 | shortcut =&lt;br /&gt;
 | notes    =&lt;br /&gt;
}}&lt;br /&gt;
{{TOCright}}&lt;br /&gt;
[[Category:ET|Script Goals]]&lt;br /&gt;
[[Category:Doom 3|Script Goals]]&lt;br /&gt;
[[Category:Quake 4|Script Goals]]&lt;br /&gt;
[[Category:RTCW|Script Goals]]&lt;br /&gt;
&lt;br /&gt;
==ScriptGoal Properties==&lt;br /&gt;
===Name===&lt;br /&gt;
The name of the script goal. Important for other scripts to refer to by name, and the name it is displayed under in the [[Debug Window]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;this.Name = &amp;quot;MyGoalName&amp;quot;;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Parent===&lt;br /&gt;
The name of the parent goal. This should be set up once in the script and left alone. It controls where in the behavior tree the goal is inserted. The location of the goal in the state tree effects how it is evaluated.&lt;br /&gt;
&lt;br /&gt;
Users should stick to one of the following 2 parents.&lt;br /&gt;
* HighLevel - Puts the goal under the HighLevel parent. Because the goal is under the HighLevel state, only one state at a time can run. This is useful for goals that take control of the bot, that shouldn&#039;t be interrupted by other script goals or built in goals.&lt;br /&gt;
* LowLevel - Puts the goal under the LowLevel parent. All states under the LowLevel state are run simultaneously, and so is a good location for scripts that control things that don&#039;t necessarily take total control over the bot, or don&#039;t wish to interrupt the execution of other goals. Some examples might be calling for medic, calling for ammo, most communication scripts.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;this.Parent = &amp;quot;HighLevel&amp;quot;;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===InsertBefore===&lt;br /&gt;
It controls where in the behavior tree the goal is inserted. InsertBefore property is ignored if Parent has been set. &lt;br /&gt;
&lt;br /&gt;
===InsertAfter===&lt;br /&gt;
It controls where in the behavior tree the goal is inserted. InsertAfter property is ignored if Parent or InsertBefore has been set. &lt;br /&gt;
&lt;br /&gt;
===Disable===&lt;br /&gt;
Enables/Disables the goal for consideration. The goal will no longer be considered for execution. Disabled goals have specific coloring in the [[Debug Window]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;this.Disable = true;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===AimVector===&lt;br /&gt;
This Vector3 is used by any active aim request the script goal has registered. You usually do not need to use this property directly, because function AddAimRequest sets this property.&lt;br /&gt;
&lt;br /&gt;
===AlwaysRecieveEvents===&lt;br /&gt;
Normally goals receive events only when active. Setting this to true will allow the goal to receive events even when it&#039;s not running. This is useful for when you want to have the goal sit idle and only activate when receiving a certain event, or you want to track and store information in the goal from events.&lt;br /&gt;
&lt;br /&gt;
Since version 0.92 events are not sent to bots with wrong class if LimitToClass was set.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;this.AlwaysRecieveEvents = true;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Events===&lt;br /&gt;
Accesses the Events table of the goal, in order to set up script functions that will be called when the bot receives events. By default, goals only receive events when they are active. This can be overridden with [[ScriptGoal#AlwaysRecieveEvents| AlwaysRecieveEvents]], which will allow goals to receive events even when not active.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 this.Events[EVENT.FEEL_PAIN] = function(Inflictor, PreviousHealth, CurrentHealth)&lt;br /&gt;
 {&lt;br /&gt;
   whoDoneIt = GetEntName(Inflictor);&lt;br /&gt;
   print( format(&amp;quot;%s: %s Hurt me: Was %d, now %d&amp;quot;, &lt;br /&gt;
    this.Bot.GetName(), whoDoneIt, PreviousHealth, CurrentHealth) );&lt;br /&gt;
 };&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Bot===&lt;br /&gt;
This provides an accessor to the bot that is running the goal. The &#039;this&#039; within script goals is always the script goal itself, so in the frequent case of needing to access the bot, use this property.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;this.Bot.Say(&amp;quot;Wassup&amp;quot;);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Priority===&lt;br /&gt;
Priority is a property rather than a return value of [[ScriptGoal#GetPriority| GetPriority]] in order to support the useful threading nature of script goals. It is possible to completely leave out a [[ScriptGoal#GetPriority| GetPriority]] function, and set the priority through this property somewhere else, such as in an event callback. This property will automatically be reset internally when the state exits, to prevent a script goal from activating in a loop from the user forgetting to reset the Priority.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;this.Priority = 1;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SkipGetPriorityWhenActive===&lt;br /&gt;
Set SkipGetPriorityWhenActive to true if function GetPriority should not be called while the goal is active.&lt;br /&gt;
&lt;br /&gt;
===GetPriorityDelay===&lt;br /&gt;
Delay in seconds between GetPriority calls. Default is 0.&lt;br /&gt;
&lt;br /&gt;
===MapGoal===&lt;br /&gt;
Current MapGoal or null if the script goal is not active. This property is not set automatically. You must assign map goal to this property in GetPriority and clear it in Exit.&lt;br /&gt;
&lt;br /&gt;
===AutoReleaseAim===&lt;br /&gt;
Function ReleaseAimRequest is automatically called in Exit. Default is true.&lt;br /&gt;
&lt;br /&gt;
===AutoReleaseWeapon===&lt;br /&gt;
Function ReleaseWeaponRequest is automatically called in Exit. Default is true.&lt;br /&gt;
&lt;br /&gt;
===AutoReleaseTrackers===&lt;br /&gt;
Function Trackers::Reset is automatically called in Exit. Default is true.&lt;br /&gt;
&lt;br /&gt;
===AutoFinishOnUnAvailable===&lt;br /&gt;
The goal is automatically finished if current MapGoal is not available. Default is true.&lt;br /&gt;
&lt;br /&gt;
===AutoFinishOnNoProgressSlots===&lt;br /&gt;
The goal is automatically finished if MarkInProgress has not been called yet and MapGoal has no TRACK_INPROGRESS slots available. Default is true.&lt;br /&gt;
&lt;br /&gt;
===AutoFinishOnNoUseSlots===&lt;br /&gt;
The goal is automatically finished if MarkInUse has not been called yet and MapGoal has no TRACK_INUSE slots available. Default is true.&lt;br /&gt;
&lt;br /&gt;
===AutoAdd===&lt;br /&gt;
Set AutoAdd to false if the script should not be loaded for every map, because it&#039;s deprecated or used only for debugging (RideTram, TestEvents, ...).&lt;br /&gt;
&lt;br /&gt;
===DebugString===&lt;br /&gt;
Debug strings are displayed if you use command &amp;quot;/bot debugbot all fpinfo&amp;quot; and then spectate bots. If DebugString is null, MapGoal name is displayed.&lt;br /&gt;
&lt;br /&gt;
===Debug===&lt;br /&gt;
Set this property at the beginning of gm file so that all your debug messages or debug drawing can be easily enabled or disabled.&lt;br /&gt;
&lt;br /&gt;
===Commands===&lt;br /&gt;
Table of console commands which are executed on the script goal for every bot.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 this.Commands[&amp;quot;command_name&amp;quot;] = {&lt;br /&gt;
  Func = function( _params )&lt;br /&gt;
  { &lt;br /&gt;
  },&lt;br /&gt;
  Help = { &amp;quot;description&amp;quot; },&lt;br /&gt;
 };&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==ScriptGoal Callbacks==&lt;br /&gt;
These functions are available only in 0.7 and later.&lt;br /&gt;
&lt;br /&gt;
===Initialize===&lt;br /&gt;
This function is called exactly once per bot, when the bot is added and initialized. It is typically used to perform one time initialization code.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 this.Initialize() = function()&lt;br /&gt;
 {&lt;br /&gt;
 };&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===OnSpawn===&lt;br /&gt;
This function is called every time the bot spawns. Spawning in Omni-bot means any time the bot re-enters his Main active state. This could mean an actual respawn, a revival from an incapacitated state, or something similar.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 this.OnSpawn() = function()&lt;br /&gt;
 {&lt;br /&gt;
 };&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===GetPriority===&lt;br /&gt;
This function is most often the place to evaluate whether you want the script goal to run. Take care in the complexity of the code here, as it is called pretty often, and can be a source of considerable performance overhead.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 this.GetPriority() = function()&lt;br /&gt;
 {&lt;br /&gt;
 };&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===Enter===&lt;br /&gt;
This function is called when a state is chosen to run, right before it begins running. This function is only called once when the state enters, and will not be called again until the state is exited.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 this.Enter() = function()&lt;br /&gt;
 {&lt;br /&gt;
 };&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;See Also:&#039;&#039;&#039; &lt;br /&gt;
[[ScriptGoal#Exit| Exit]]&lt;br /&gt;
----&lt;br /&gt;
===Exit===&lt;br /&gt;
This function is called when a state finishes running, or is overridden by a higher priority state. It is often used to release aim or weapon requests that were used by the goal.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 this.Exit() = function()&lt;br /&gt;
 {&lt;br /&gt;
 };&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;See Also:&#039;&#039;&#039; &lt;br /&gt;
[[ScriptGoal#Enter| Enter]]&lt;br /&gt;
----&lt;br /&gt;
===Update===&lt;br /&gt;
This function is the meat of a script goal. Once a goal is chosen to run, and [[ScriptGoal#Enter| Enter]] is called, the Update function begins getting called at frequent regular intervals. The state stays active until another goal overrides it, or until [[ScriptGoal#Finished| Finished]] is called, after which the [[ScriptGoal#Exit| Exit]] function is called.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 this.Update() = function()&lt;br /&gt;
 {&lt;br /&gt;
   // do stuff&lt;br /&gt;
   this.Finished(); // when we&#039;re done running&lt;br /&gt;
 };&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;See Also:&#039;&#039;&#039; &lt;br /&gt;
[[ScriptGoal#Enter| Enter]], [[ScriptGoal#Exit| Exit]]&lt;br /&gt;
----&lt;br /&gt;
===OnPathThrough===&lt;br /&gt;
This function is called if bot comes to waypoint which has paththrough property set and its value is goalName:data.&lt;br /&gt;
Paththrough is activated if OnPathThrough function returns true.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 this.OnPathThrough = function(data)&lt;br /&gt;
 {&lt;br /&gt;
  navigation = Map.Navigation[data];&lt;br /&gt;
  if(navigation)&lt;br /&gt;
  {&lt;br /&gt;
   this.CurrentNavigation = data;&lt;br /&gt;
   return true;&lt;br /&gt;
  }&lt;br /&gt;
  this.CurrentNavigation = null;&lt;br /&gt;
  return false;&lt;br /&gt;
 };&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==ScriptGoal Functions==&lt;br /&gt;
These functions are available only in 0.7 and later.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===AddFinishCriteria===&lt;br /&gt;
Finish Criteria are expressions set up from script that will be evaluated constantly in the code and when they are satisfied will cause the script goal to abort. These are useful when your script does alot of asynchronous operations(like Goto), but you want a way to abort the script goal, even if the main update script happens to be in an asynchronous or blocked call, sleep or yield.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (subject, expression, value[optional])&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (expression, value[optional])&lt;br /&gt;
&lt;br /&gt;
====Subject====&lt;br /&gt;
Subject must be an entity, if no entity is provided as the first parameter, it is assumed that the 2nd version of the function is called, which takes only and expression and an optional value. The need for a value is determined by what the expression actually is.&lt;br /&gt;
&lt;br /&gt;
====Expression====&lt;br /&gt;
Expression is a string containing 1 or more keywords that use a natural syntax for defining the conditions of the criteria. Additionally, some keywords expect an operator to be defined&lt;br /&gt;
{| align=&amp;quot;center&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!Keyword&lt;br /&gt;
!Operator Required&lt;br /&gt;
!Value&lt;br /&gt;
|-&lt;br /&gt;
|deleted&lt;br /&gt;
|No&lt;br /&gt;
|entity&lt;br /&gt;
|-&lt;br /&gt;
|health&lt;br /&gt;
|Yes&lt;br /&gt;
|health value to compare against(float or int)&lt;br /&gt;
|-&lt;br /&gt;
|hasentflag&lt;br /&gt;
|No&lt;br /&gt;
|entity flag to compare against. use not to negate test&lt;br /&gt;
|-&lt;br /&gt;
|weaponcharged&lt;br /&gt;
|No&lt;br /&gt;
|weapon Id(integer)&lt;br /&gt;
|-&lt;br /&gt;
|weaponequipped&lt;br /&gt;
|No&lt;br /&gt;
|weapon Id(integer)&lt;br /&gt;
|-&lt;br /&gt;
|weaponhasammo&lt;br /&gt;
|No&lt;br /&gt;
|weapon Id(integer)&lt;br /&gt;
|-&lt;br /&gt;
|velocity&lt;br /&gt;
|Yes&lt;br /&gt;
|vector3 velocity to compare against, OR float magnitude of velocity to compare against(speed)&lt;br /&gt;
|-&lt;br /&gt;
|mapgoalavailable&lt;br /&gt;
|No&lt;br /&gt;
|MapGoal object or name&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Valid Operators=====&lt;br /&gt;
* lessthan&lt;br /&gt;
* &amp;lt;&lt;br /&gt;
* greaterthan&lt;br /&gt;
* &amp;gt;&lt;br /&gt;
* equals&lt;br /&gt;
* ==&lt;br /&gt;
&lt;br /&gt;
In addition, some expressions can contain negation keywords in order to check for the negative of an expression, such as&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 this.AddFinishCriteria(this.TargetEntity,&amp;quot;not hasentflag&amp;quot;,ENTFLAG.DEAD); // as soon as the entity does not have the dead flag&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; true if criteria was created, false if not&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 this.AddFinishCriteria(this.TargetEntity,&amp;quot;deleted&amp;quot;); // finish the goal of the target is deleted&lt;br /&gt;
 this.AddFinishCriteria(this.TargetEntity,&amp;quot;health lessthan&amp;quot;,1); // or if they are dead(health &amp;lt;= 1)&lt;br /&gt;
 this.AddFinishCriteria(this.TargetEntity,&amp;quot;hasentflag&amp;quot;,ENTFLAG.LIMBO); // or if they tap out&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===ClearFinishCriteria===&lt;br /&gt;
Deletes finish criteria.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (clearpersistent[optional, default false])&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===Finished===&lt;br /&gt;
Notifies the goal that it is finished running. This function is normally called from the Update function when the goal is desired to finish.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (none)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 this.Finished();&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===LimitTo===&lt;br /&gt;
This function limits script execution based on a true value being returned from a user defined function. This function is useful if scripts should only be run based on some external logic; like a Map variable setting.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (function, delay, onlyactive[optional - default false])&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
LimitTo functions are script functions that are called at user defined intervals that can be used to update from script whether or not the script goal should be able to run or not. Returning false from this function effectively blocks the script goals ability to activate. It will remain in this state as long as the LimitTo function is defined. The 2nd parameter controls how often the callback is performed. Calling script functions too often can adversely effect performance, so it is recommended to choose a delay that is as infrequently as you can get away with. The &#039;onlyactive&#039; parameter is optional and defaults to false. If this parameter is set to true, the LimitTo function callback will ONLY be performed when the script goal is active. By default the LimitTo function will be called whether the goal is active or not, and returning false will prevent the goal from being able to activate. Passing true as the &#039;onlyactive&#039; flag means the goal can activate, and only then is the LimitTo function called. This is useful when you need to check more information regarding specific targets of the goal to validate whether the goal should continue running. This callback is effectively a way to define your own finish criteria. It is recommended that you only use LimitTo callbacks when FinishCriteria can&#039;t be used, since FinishCriteria are much faster and don&#039;t involve frequent calls into script. LimitTo functions might commonly be used to check the status of a map goal or some other world state that the goal relies on.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 //This function is typically set up in this.Initialize()&lt;br /&gt;
 this.LimitTo(Map.SomeFunction, 1.0); //Call Map.SomeFunction every second&lt;br /&gt;
 this.LimitTo(NULL); //clear the function&lt;br /&gt;
  &lt;br /&gt;
 //The script goal object is referenced in the passed function as &#039;this&#039;&lt;br /&gt;
 Map.SomeFunction = function()&lt;br /&gt;
 {&lt;br /&gt;
      if ( Map.SomeVariable == false )&lt;br /&gt;
          { this.Disable; } //disable the script&lt;br /&gt;
      else&lt;br /&gt;
          { return true; } //allow the script to run&lt;br /&gt;
 };&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===LimitToClass===&lt;br /&gt;
This function will only allow the script goal to be created if the owning bot is one of the classes provided. This is much more efficient than checking class in script in common cases where a goal only applies to a certain class of bot.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (classId, ...) Any number of class Ids&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 // This function can take any number of parameters.&lt;br /&gt;
 this.LimitToClass(CLASS.MEDIC);&lt;br /&gt;
 this.LimitToClass(CLASS.MEDIC, CLASS.ENGINEER);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===LimitToNoClass===&lt;br /&gt;
This function will only allow the script goal to be created if the owning bot is NOT one of the classes provided. This is much more efficient than checking class in script in common cases where a goal only applies to a certain class of bot.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (classId, ...) Any number of class Ids&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 // This function can take any number of parameters.&lt;br /&gt;
 this.LimitToNoClass(CLASS.MEDIC);&lt;br /&gt;
 this.LimitToNoClass(CLASS.MEDIC, CLASS.ENGINEER);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
===LimitToTeam===&lt;br /&gt;
This function will only allow the script goal to be created if the owning bot is one of the teams provided. This is much more efficient than checking team in script in common cases where a goal only applies to a certain team of bots.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (teamId, ...) Any number of class Ids&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 // This function can take any number of parameters.&lt;br /&gt;
 this.LimitToTeam(TEAM.BLUE);&lt;br /&gt;
 this.LimitToTeam(TEAM.BLUE, TEAM.RED);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===LimitToEntityFlag===&lt;br /&gt;
This function will only allow the script goal to be created if the owning bot has one or more entity flags set. This is much more efficient than checking entity flags in script in common cases where a goal only applies to specific cases where the bot has certain entity flags.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (ent flag, ...) Any number of entity flags&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 // This function can take any number of parameters.&lt;br /&gt;
 this.LimitToEntityFlag(ENTFLAG.INWATER);&lt;br /&gt;
 this.LimitToEntityFlag(ENTFLAG.INWATER, ENTFLAG.UNDERWATER);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===LimitToNoEntityFlag===&lt;br /&gt;
This function will only allow the script goal to be created if the owning bot does not have one or more entity flags set. This is much more efficient than checking entity flags in script in common cases where a goal only applies to specific cases where the bot does not have certain entity flags.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (ent flag, ...) Any number of entity flags&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 // This function can take any number of parameters.&lt;br /&gt;
 this.LimitToNoEntityFlag(ENTFLAG.INWATER);&lt;br /&gt;
 this.LimitToNoEntityFlag(ENTFLAG.INWATER, ENTFLAG.UNDERWATER);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===LimitToNoPowerup===&lt;br /&gt;
This function will only allow the script goal to be considered if the owning bot does not have the given powerups.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (powerup flag, ...) Any number of power up flags&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 // This function can take any number of parameters.&lt;br /&gt;
 this.LimitToNoPowerUp(ENTFLAG.INVINCIBLE);&lt;br /&gt;
 this.LimitToNoPowerUp(ENTFLAG.INVINCIBLE, ENTFLAG.QUADDAMAGE); &amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===LimitToNoTarget===&lt;br /&gt;
This function will only allow the script goal to be considered if the owning bot does not have a target. This is much more efficient than checking for a target in the GetPriority function in script in cases where the bot should not have a target. The goal will not be evaluated unless the bot does not have a target.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 // This function takes no parameters.&lt;br /&gt;
 this.LimitToNoTarget(); &amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===LimitToPowerUp===&lt;br /&gt;
This function will only allow the script goal to be created if the owning bot has one or more power up flags set. This is much more efficient than checking power up flags in script in common cases where a goal only applies to specific cases where the bot has certain power up flags.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (powerup flag, ...) Any number of power up flags&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 // This function can take any number of parameters.&lt;br /&gt;
 this.LimitToPowerUp(ENTFLAG.INVINCIBLE);&lt;br /&gt;
 this.LimitToPowerUp(ENTFLAG.INVINCIBLE, ENTFLAG.QUADDAMAGE);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===LimitToWeapon===&lt;br /&gt;
This function will only allow the script goal to be created if the owning bot has one or more weapons set by this function. This is much more efficient than checking the bots weapons in script in common cases where a goal only applies to specific cases where the bot has a certain weapon.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (weapon Id, ...) Any number of weapon Ids&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 // This function can take any number of parameters.&lt;br /&gt;
 this.LimitToWeapon(WEAPON.MOBILE_MG42);&lt;br /&gt;
 this.LimitToWeapon(WEAPON.MOBILE_MG42, WEAPON.MORTAR);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===LimitToTargetClass===&lt;br /&gt;
This function will only allow the script goal to be considered if the owning bot has a target of a specified class. This is much more efficient than checking class in the GetPriority function in script in cases where a goal only applies to specific cases where the bots target is a specific class. The goal will not be evaluated unless the bot has a target and the target is on one of the provided classes.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (classId, ...) Any number of target classes&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 // This function can take any number of parameters.&lt;br /&gt;
 this.LimitToTargetClass(CLASS.ANYPLAYER); // don&#039;t run unless we have any player class&lt;br /&gt;
 this.LimitToTargetClass(CLASS.ENGINEER, CLASS.MEDIC); // look for specific classes&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===LimitToTargetTeam===&lt;br /&gt;
This function will only allow the script goal to be considered if the owning bot has a target on a specified team. This is much more efficient than checking team in the GetPriority function in script in cases where a goal only applies to specific cases where the bots target is on a specific team. The goal will not be evaluated unless the bot has a target and the target is on one of the provided teams.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (teamId, ...) Any number of teams&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 // This function can take any number of parameters.&lt;br /&gt;
 this.LimitToTargetTeam(TEAM.RED); // don&#039;t run unless our target is on red team&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===LimitToTargetPowerUp===&lt;br /&gt;
This function will only allow the script goal to be considered if the owning bot has a target with one or more powerups. This is much more efficient than checking powerups in the GetPriority function in script in cases where a goal only applies to specific cases where the bots target has a powerup. The goal will not be evaluated unless the bot has a target and the target is on one of the provided powerups.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (powerup id, ...) Any number of power up flags&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 // This function can take any number of parameters.&lt;br /&gt;
 this.LimitToTargetPowerUp(POWERUP.QUADDAMAGE); // don&#039;t run unless our target has quad damage&lt;br /&gt;
 this.LimitToTargetPowerUp(ENTFLAG.INVINCIBLE, ENTFLAG.QUADDAMAGE);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===LimitToTargetNoPowerUp===&lt;br /&gt;
This function will only allow the script goal to be considered if the owning bot has a target without one or more powerups. This is much more efficient than checking powerups in the GetPriority function in script in cases where a goal only applies to specific cases where the bot&#039;s target hasn&#039;t a powerup. The goal will not be evaluated unless the bot has a target and the target doesn&#039;t have one of the provided powerups.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (powerup id, ...) Any number of power up flags&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 // This function can take any number of parameters.&lt;br /&gt;
 this.LimitToTargetNoPowerUp(POWERUP.QUADDAMAGE); // don&#039;t run if our target has quad damage&lt;br /&gt;
 this.LimitToTargetNoPowerUp(ENTFLAG.INVINCIBLE, ENTFLAG.QUADDAMAGE);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===LimitToTargetEntityFlag===&lt;br /&gt;
This function will only allow the script goal to be created if the target bot has one or more of the entity flags set. This is much more efficient than checking entity flags in script in common cases where a goal only applies to specific cases where the bot has certain entity flags.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (ent flag, ...) Any number of entity flags&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 // This function can take any number of parameters.&lt;br /&gt;
 this.LimitToTargetEntityFlag(ENTFLAG.INWATER);&lt;br /&gt;
 this.LimitToTargetEntityFlag(ENTFLAG.INWATER, ENTFLAG.UNDERWATER);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===LimitToTargetNoEntityFlag===&lt;br /&gt;
This function will only allow the script goal to be created if the target bot does not have one or more of the entity flags set. This is much more efficient than checking entity flags in script in common cases where a goal only applies to specific cases where the bot does not have certain entity flags.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (ent flag, ...) Any number of entity flags&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 // This function can take any number of parameters.&lt;br /&gt;
 this.LimitToTargetNoEntityFlag(ENTFLAG.INWATER);&lt;br /&gt;
 this.LimitToTargetNoEntityFlag(ENTFLAG.INWATER, ENTFLAG.UNDERWATER);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===LimitToTargetWeapon===&lt;br /&gt;
This function will only allow the script goal to be created if the bots has one or more weapons set by this function. This is much more efficient than checking the bots weapons in script in common cases where a goal only applies to specific cases where the bot&#039;s target has a certain weapon.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (weapon Id, ...) Any number of weapon Ids&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 // This function can take any number of parameters.&lt;br /&gt;
 this.LimitToTargetWeapon(WEAPON.MOBILE_MG42);&lt;br /&gt;
 this.LimitToTargetWeapon(WEAPON.MOBILE_MG42, WEAPON.MORTAR);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===LimitToRole===&lt;br /&gt;
This function will only allow the script goal to be created if the owning bot has one of the roles provided.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (roleId, ...) Any number of role Ids&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 this.LimitToRole(ROLE.DEFENDER);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===IsActive===&lt;br /&gt;
Checks if the script goal is currently active. An active script goal means it is currently running. This check is useful mostly in cases where you want an active script goal to remain active and not necessarily keep performing complex checks in its GetPriority function.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (none)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; true if active, false if not&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 this.GetPriority = function()&lt;br /&gt;
 {&lt;br /&gt;
   if(this.IsActive())&lt;br /&gt;
   {&lt;br /&gt;
     return 1.0;&lt;br /&gt;
   }&lt;br /&gt;
   else&lt;br /&gt;
   {&lt;br /&gt;
     // do some other check&lt;br /&gt;
   }&lt;br /&gt;
 }; &amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===Goto===&lt;br /&gt;
Tells the bot to go to a specific location, planning and running a path if necessary. This function is synchronous.&lt;br /&gt;
&lt;br /&gt;
The first parameter can be a table of positions, bot will choose destination which has the shortest path.&lt;br /&gt;
&lt;br /&gt;
Bot will walk if the last parameter is {MoveMode = MoveMode.Walk}.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (Vector3 position, tolerance, options[optional])&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (table of Vector3 positions, tolerance, options[optional])&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; EVENT.PATH_SUCCESS or EVENT.PATH_FAILED&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 wpinfo = table();&lt;br /&gt;
 wp = Wp.GetWaypointByName(&amp;quot;somewaypoint&amp;quot;, wpinfo);&lt;br /&gt;
 if( this.Goto(wpinfo.position, wpinfo.radius) == EVENT.PATH_SUCCESS )&lt;br /&gt;
 {&lt;br /&gt;
     print(&amp;quot;Made it!&amp;quot;);&lt;br /&gt;
 }&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===GotoAsync===&lt;br /&gt;
Tells the bot to go to a specific location, planning and running a path if necessary. This function is asynchronous. Typically a script would block after calling this to wait for a success or failure message.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (Vector3 position, tolerance, options[optional])&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 wpinfo = table();&lt;br /&gt;
 wp = Wp.GetWaypointByName(&amp;quot;somewaypoint&amp;quot;, wpinfo);&lt;br /&gt;
 this.GotoAsync(wpinfo.position, wpinfo.radius);&lt;br /&gt;
 if( block(EVENT.PATH_SUCCESS, EVENT.PATH_FAILED) == EVENT.PATH_SUCCESS )&lt;br /&gt;
 {&lt;br /&gt;
     print(&amp;quot;Made it!&amp;quot;);&lt;br /&gt;
 }&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===GotoRandom===&lt;br /&gt;
Goto random destination.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (tolerance, options[optional])&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; EVENT.PATH_SUCCESS or EVENT.PATH_FAILED&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===GotoRandomAsync===&lt;br /&gt;
Goto random destination (asynchronous).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (tolerance, options[optional])&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===RouteTo===&lt;br /&gt;
RouteTo is similar to Goto, but bots use routes which are defined for map goal. Routes are used only if bot is within radius of any ROUTE goal.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (mapGoal, tolerance, options[optional])&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; EVENT.PATH_SUCCESS or EVENT.PATH_FAILED&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===Stop===&lt;br /&gt;
Interrupts any active Goto and signals PATH_FAILED.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===DidPathSucceed===&lt;br /&gt;
Checks if the last Goto command succeeded. Success means the bot has reached the end of the desired path. Typically a goal will block on EVENT.PATH_SUCCESS or EVENT.PATH_FAILED events. [[ScriptGoal#DidPathSucceed| DidPathSucceed]] and [[ScriptGoal#DidPathFail| DidPathFail]] are included for cases where the script wishes to remain active and doing something during the path traversal, and it can poll the path success/failure during. If neither function returns true, then the bot should be moving along the path normally.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; true if path succeeded, false if not&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 if(this.DidPathSucceed())&lt;br /&gt;
 {&lt;br /&gt;
 }&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;See Also:&#039;&#039;&#039; &lt;br /&gt;
[[ScriptGoal#Goto| Goto]], [[ScriptGoal#DidPathSucceed| DidPathSucceed]]&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===DidPathFail===&lt;br /&gt;
Checks if the last Goto command failed. Failure means the path was either blocked(no path exists), or the bot has gotten stuck on the way. Typically a goal will block on EVENT.PATH_SUCCESS or EVENT.PATH_FAILED events. [[ScriptGoal#DidPathSucceed| DidPathSucceed]] and [[ScriptGoal#DidPathFail| DidPathFail]] are included for cases where the script wishes to remain active and doing something during the path traversal, and it can poll the path success/failure during. If neither function returns true, then the bot should be moving along the path normally.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; true if path failed, false if not&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 if(this.DidPathFail())&lt;br /&gt;
 {&lt;br /&gt;
 }&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;See Also:&#039;&#039;&#039; &lt;br /&gt;
[[ScriptGoal#Goto| Goto]], [[ScriptGoal#DidPathSucceed| DidPathSucceed]]&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===AddAimRequest ===&lt;br /&gt;
Adds a priority based aim request into the bots aiming system. Aim requests are favored based on their priority, with the highest priority aim request chosen at any given point. It is a much simpler and easier to manage setup in the cases of many competing goals that wish to control the bots aim. Each goal can add an aim request and will recieve notifications when the bot chooses and executes their request. This functions works together with the AimVector property to allow setting the aim type at any point. The script can recieve notification of a successful aiming by blocking on the EVENT.AIM_SUCCESS event.&lt;br /&gt;
&lt;br /&gt;
Aim requests can be viewed in the [[Debug Window]] under the Aimer state. They will take on the name of the script goal they were added in.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (priority, aim type&amp;lt;optional, default position&amp;gt;, aim position&amp;lt;optional&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
====Priority====&lt;br /&gt;
Most normal goals use a Priority.High priority, which leaves 2 higher levels of priority usable by scripts or important goals. &lt;br /&gt;
&lt;br /&gt;
Priority determines how to select a request when there are multiple requests active. Higher priorities are selected over lower priorities.&lt;br /&gt;
&lt;br /&gt;
* Priority.Zero&lt;br /&gt;
* Priority.Min&lt;br /&gt;
* Priority.Idle - FollowPath&lt;br /&gt;
* Priority.VeryLow - LookAround&lt;br /&gt;
* Priority.Low - CAMP, ESCORT, RIDE, MOUNT, ...&lt;br /&gt;
* Priority.LowMed - AttackTarget&lt;br /&gt;
* Priority.Medium - CALLARTILLERY, MOBILEMORTAR, ...&lt;br /&gt;
* Priority.High - BUILD, DEFUSE, GRENADE, REVIVE, SWITCH, ...&lt;br /&gt;
* Priority.VeryHigh&lt;br /&gt;
* Priority.Override&lt;br /&gt;
&lt;br /&gt;
====Aim Types====&lt;br /&gt;
* movedirection - Face in the direction of movement. Useful if you want to override the bots normal combat aiming, as in for a disguise goal where you don&#039;t want them to engage the target.&lt;br /&gt;
* facing - Face a given facing (direction) vector. In this case AimVector represents a facing vector.&lt;br /&gt;
** (1,0,0) - east, (-1,0,0) - west&lt;br /&gt;
** (0,1,0) - north, (0,-1,0) - south&lt;br /&gt;
** (0,0,1) - up, (0,0,-1) - down&lt;br /&gt;
* position - Face a given position vector. In this case AimVector represents a point in the 3D map space.&lt;br /&gt;
&lt;br /&gt;
If one of the above is not specified, the aim request is a positional request, and the AimVector of the script goal will be used as a raw position to aim at.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 aimPos = someAimPosition;&lt;br /&gt;
 aimPos2 = someAimPosition2;&lt;br /&gt;
&lt;br /&gt;
 this.AddAimRequest(Priority.High, &amp;quot;movedirection&amp;quot;); // requests the bot to face along its move direction at a 0.8 priority&lt;br /&gt;
 // OR&lt;br /&gt;
 this.AddAimRequest(Priority.High); // leave off optional parameters, defaults to AimPosition, so set it&lt;br /&gt;
 this.AimVector = aimPos; // this can be called at any time in the script goal&lt;br /&gt;
&lt;br /&gt;
 if(block(EVENT.AIM_SUCCESS) == EVENT.AIM_SUCCESS)&lt;br /&gt;
 {&lt;br /&gt;
    // we&#039;re on target, do something cool&lt;br /&gt;
 }&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;See Also:&#039;&#039;&#039; &lt;br /&gt;
[[ScriptGoal#ReleaseAimRequest | ReleaseAimRequest]]&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===ReleaseAimRequest ===&lt;br /&gt;
This function will release the Aim Request within the script goal; allowing other potential aim requests to have control.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 this.ReleaseAimRequest();&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;See Also:&#039;&#039;&#039; &lt;br /&gt;
[[ScriptGoal#AddAimRequest| AddAimRequest]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===AddWeaponRequest ===&lt;br /&gt;
Adds a priority based weapon equip request into the bots weapon system. Weapon requests are favored based on their priority, with the highest priority request chosen as the desired weapon. It is a much simpler and easier to manage setup in the cases of many competing goals that wish to control the bots equipped weapon. Each goal can add an weapon request and will receive notifications when the bot chooses and executes their request. &lt;br /&gt;
&lt;br /&gt;
Weapon requests can be view in the [[Debug Window]] under the WeaponSystem state. They will take on the name of the script goal they were added in.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (priority[optional], weapon Id)&lt;br /&gt;
&lt;br /&gt;
====Priority====&lt;br /&gt;
The first parameter is optional since version 0.92. Default value is Priority.High, which leaves 2 higher levels of priority usable by scripts or important goals.&lt;br /&gt;
&lt;br /&gt;
Priority determines how to select a request when there are multiple requests active. Higher priorities are selected over lower priorities.&lt;br /&gt;
&lt;br /&gt;
* Priority.Min&lt;br /&gt;
* Priority.Idle&lt;br /&gt;
* Priority.VeryLow&lt;br /&gt;
* Priority.Low&lt;br /&gt;
* Priority.Medium&lt;br /&gt;
* Priority.High&lt;br /&gt;
* Priority.VeryHigh&lt;br /&gt;
* Priority.Override&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 this.AddWeaponRequest(WEAPON.MEDKIT);&lt;br /&gt;
 this.AddWeaponRequest(Priority.Low, WEAPON.KNIFE); &amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;See Also:&#039;&#039;&#039; &lt;br /&gt;
[[ScriptGoal#ReleaseWeaponRequest | ReleaseWeaponRequest]]&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===ReleaseWeaponRequest ===&lt;br /&gt;
This function will release the weapon request within the script goal; allowing other potential weapon requests to have control.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 this.ReleaseWeaponRequest();&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;See Also:&#039;&#039;&#039; &lt;br /&gt;
[[ScriptGoal#AddWeaponRequest | AddWeaponRequest ]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===BlockForWeaponChange===&lt;br /&gt;
This function provides specialized script thread blocking functionality to wait for a weapon change to a certain weapon. This function takes the place of a call to block in the case you want to wait until the bot switches to a specific weapon.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (weaponId)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 this.BlockForWeaponChange(WEAPON.MEDKIT);&lt;br /&gt;
 this.Say(&amp;quot;Medkit Equipped!&amp;quot;);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===BlockForWeaponFire===&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===BlockForVoiceMacro===&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===QueryGoals===&lt;br /&gt;
&lt;br /&gt;
Finds goals available for this bot and stores them in the first table parameter. The previous table content is cleared since omni-bot 0.84. &lt;br /&gt;
&lt;br /&gt;
The last optional parameter is table of parameters to filter result (NoFilters, Group, Role, Team, SkipDelayed, SkipNoInProgress, SkipNoInUse, SkipInUse) or sort result (parameter Sort, values are &amp;quot;none&amp;quot;, &amp;quot;priority&amp;quot;, &amp;quot;name&amp;quot;, &amp;quot;random&amp;quot;, default is &amp;quot;priority&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (table, goal type hash, params[optional])&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (table, table of goal type hashes, params[optional])&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (table, expression, params[optional])&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; count of goals returned in table&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 count = this.QueryGoals(this.Bot.QueryGoalsTable, 0xc9326a43);&lt;br /&gt;
 count = this.QueryGoals(this.Bot.QueryGoalsTable, &amp;quot;BUILD_.*&amp;quot;);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===BlackboardDelay===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (time, mapGoal or serialNumber[optional])&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 this.BlackboardDelay(10);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===BlackboardIsDelayed===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (mapGoal or serialNumber)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; true if goal has been found on blackboard&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 if (this.BlackboardIsDelayed(serial))&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===MarkInProgress===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (mapGoal[optional])&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; true if empty slot has been found and marked&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 this.MarkInProgress(); //finish if no slot is available&lt;br /&gt;
&lt;br /&gt;
 if (!this.MarkInProgress(this.MapGoal)) {&lt;br /&gt;
   this.BlackboardDelay(5);&lt;br /&gt;
   this.Finished();&lt;br /&gt;
 }&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===MarkInUse===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (mapGoal[optional])&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; true if empty slot has been found and marked&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 this.MarkInUse(); //finish if no slot is available&lt;br /&gt;
&lt;br /&gt;
 if (!this.MarkInUse(this.MapGoal)) {&lt;br /&gt;
   this.BlackboardDelay(5);&lt;br /&gt;
   this.Finished();&lt;br /&gt;
 }&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===WatchForMapGoalsInRadius===&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===ClearWatchForMapGoalsInRadius===&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===WatchForEntityCategory===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; ( { Radius, Category, RequireLOS[optional, default 0] } )&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 this.WatchForEntityCategory({&lt;br /&gt;
   Radius = 350,&lt;br /&gt;
   Category = CAT.PROJECTILE,&lt;br /&gt;
   RequireLOS = TRACE.VISIBLE&lt;br /&gt;
 });&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===DelayGetPriority===&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===ForkThread===&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===KillThread===&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===Signal===&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== Script Goal Threading ==&lt;br /&gt;
&lt;br /&gt;
Script goals have been designed to be friendly to script threading, by providing some built in functionality to make it easier to manage multiple threads to be associated with the script goal.&lt;br /&gt;
&lt;br /&gt;
The script goal keeps track of the thread created when calling all the following functions.&lt;br /&gt;
* Initialize&lt;br /&gt;
* OnSpawn&lt;br /&gt;
* GetPriority&lt;br /&gt;
* Enter&lt;br /&gt;
* Exit&lt;br /&gt;
* Update&lt;br /&gt;
&lt;br /&gt;
You may use thread functions (block, yield, sleep), in any of the script goal functions, though you must understand that for efficiency, and to prevent runaway threads, the script goal will internally kill the threads associated with the function callbacks at certain times.&lt;br /&gt;
&lt;br /&gt;
Currently&lt;br /&gt;
* All threads will be killed when the state exits.&lt;br /&gt;
* All threads will be killed when the state is disabled. See [[ScriptGoal#Disable| Disable]]&lt;br /&gt;
* All threads will be killed when the state becomes unselectable. This is normally due to the limit functions.&lt;br /&gt;
&lt;br /&gt;
Note that this only applies to the thread that is created for the function calls themselves. If you really need a thread to run longer than these specifications allow, you can create your own thread normally with the thread() function. It is highly recommended that you script your goal within these functions, as it is easy to &#039;&#039;leak&#039;&#039; threads when creating them arbitrarily.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
== Script Goal Performance ==&lt;br /&gt;
&lt;br /&gt;
Executing script is much much slower than executing native code, so you should be aware that a script can have significant adverse effects on the performance of the bot as a whole. Here are some tips to keep performance as high as possible with script goals.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Only define what you need&#039;&#039;&#039; - None of the callback functions are required, so if you don&#039;t use them, don&#039;t define them. It is wasteful to have an empty function defined. If you don&#039;t need an Enter function, leave it out, if you don&#039;t need an Update function, leave it out. Same for Exit, GetPriority, Initialize.&lt;br /&gt;
* &#039;&#039;&#039;Use limit functions as much as possible&#039;&#039;&#039; - If the goal should only be considered for certain player classes, or for bots with certain powerups or entity flags, or for when the bot has a target that matches similar specific flags, use the Limit functions to set that up. They are much much faster than checking those properties in the GetPriority function. If the limit functions fail, the script will never be called, which is a huge optimization.&lt;br /&gt;
* &#039;&#039;&#039;Use thread functions&#039;&#039;&#039; - Normally, GetPriority is called often. You can control this behavior by using thread functions to keep a thread running, and delay priority evaluations with a loop and calls to sleep. GetPriority will not be called if there is still an active GetPriority thread.&lt;br /&gt;
* &#039;&#039;&#039;Keep your GetPriority function as lightweight as possible&#039;&#039;&#039; - The less work it does the better, because GetPriority is called frequently by the bot. This is especially important if the goal is placed under the &#039;&#039;LowLevel&#039;&#039; parent because all child states under &#039;&#039;LowLevel&#039;&#039; are evaluated and allowed to run simultaneously. &lt;br /&gt;
* &#039;&#039;&#039;Ditto for the Update function&#039;&#039;&#039; - The same applies to the Update function especially. Keep it as simple as possible to achieve the desired behavior, and use thread functions.&lt;br /&gt;
* &#039;&#039;&#039;Cache as much as possible&#039;&#039;&#039; - Take advantage of the fact that Initialize is called only once when the bot is added. Use this function to cache values the script goal might need. For example, if the script goal does things based on specific waypoints, it would be expensive to call functions like Wp.GetWaypointByName() in the priority or update functions. Instead collect all you might need up front in the Initialize function and store them in a table on the script goal so you have faster access to them later.&lt;br /&gt;
* &#039;&#039;&#039;Use events, and block() as much as possible&#039;&#039;&#039; - Most common operations that previously required expensive loops to perform have been converted to events. Choosing a weapon, aiming a weapon, going to some location, etc. Most can be followed by a call to block() which will suspend the execution of the script until the event is recieved. This is the single easiest to use and most useful for performance features available. See [[ScriptGoal#BlockForWeaponChange|BlockForWeaponChange]], [[ScriptGoal#Goto|Goto]], [[ScriptGoal#AddAimRequest|AddAimRequest]].&lt;br /&gt;
* &#039;&#039;&#039;Beware of loops&#039;&#039;&#039; - Be careful when looping, as they can silently cause large performance drains. Be wary of how much work is being done in a loop, and on how many elements. Expensive functionality can be updated less often, or split up over time. Use yield() or sleep(x) within loops to spread out the calculations over time.&lt;/div&gt;</summary>
		<author><name>Palota</name></author>
	</entry>
	<entry>
		<id>https://mygamingtalk.com/wiki/index.php?title=System_Library&amp;diff=1768</id>
		<title>System Library</title>
		<link rel="alternate" type="text/html" href="https://mygamingtalk.com/wiki/index.php?title=System_Library&amp;diff=1768"/>
		<updated>2025-05-25T16:45:00Z</updated>

		<summary type="html">&lt;p&gt;Palota: /* Write */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{process header&lt;br /&gt;
 | title    = System Library&lt;br /&gt;
 | section  =&lt;br /&gt;
 | previous = [[Omni-bot_Script_Reference | Script Reference]]&lt;br /&gt;
 | next     = &lt;br /&gt;
 | shortcut =&lt;br /&gt;
 | notes    =&lt;br /&gt;
}}&lt;br /&gt;
{{TOCright}}&lt;br /&gt;
==Global FileSystem Functions==&lt;br /&gt;
----&lt;br /&gt;
===FileDelete===&lt;br /&gt;
Deletes a file by name. This function is restricted to files under the user folder.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (filename)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; true if success, false if failed&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 FileDelete(&amp;quot;myfile.txt&amp;quot;);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===FileEnumerate===&lt;br /&gt;
Enumerates over all files in a directory. This function is restricted to files under the user folder. This function will call the provided script function with all files enumerated.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (folder name, script function)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; true if success, false if failed&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 myfunc = function(filename)&lt;br /&gt;
 {&lt;br /&gt;
 }&lt;br /&gt;
 FileEnumerate(&amp;quot;myfolder&amp;quot;, myfunc);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
===FileExists===&lt;br /&gt;
Checks if a file exists by name. This function is restricted to files under the user folder.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (filename)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; true if exists, false if not&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 if(FileExists(&amp;quot;myfile.txt&amp;quot;))&lt;br /&gt;
 {&lt;br /&gt;
 }&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
===Newline===&lt;br /&gt;
Returns a NewLine custom type. Used for writing newlines in text formatted files. It was a function in Omni-bot 0.71, but now it is a variable in Omni-bot 0.8.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 f = File();&lt;br /&gt;
 f.Open(&amp;quot;myfile.txt&amp;quot;, &amp;quot;text&amp;quot;, false);&lt;br /&gt;
 if(f.IsOpen())&lt;br /&gt;
 {&lt;br /&gt;
     f.Write(&amp;quot;Some test data&amp;quot;, System.NewLine);&lt;br /&gt;
 }&lt;br /&gt;
 f.Close();&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==File==&lt;br /&gt;
Creates a new File Object.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 f = File();&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===Close===&lt;br /&gt;
Closes the file object and commits changes to disk.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 f.Close();&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===EndOfFile===&lt;br /&gt;
Checks if the File Object is at the end of the file. Useful for read operations.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; true if end of file, false if not.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 eof = f.EndOfFile();&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===FileSize===&lt;br /&gt;
Gets the file size of the file, in bytes.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; size of file in bytes&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 size = f.FileSize();&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===Flush===&lt;br /&gt;
Flushes the file buffer to disk.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 f.Flush();&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===IsOpen===&lt;br /&gt;
Checks if the file is currently open. Usually used after a call to Open.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; true if file is open, false if not&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 if(f.IsOpen())&lt;br /&gt;
 {&lt;br /&gt;
 }&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===Open===&lt;br /&gt;
Creates a new File Object.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (filename, &amp;quot;text&amp;quot;/&amp;quot;binary&amp;quot;, readonly&amp;lt;optional&amp;gt;, append&amp;lt;optional&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; true if success, false if failed.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 if(f.Open(&amp;quot;myfile.txt&amp;quot;, &amp;quot;text&amp;quot;, false))&lt;br /&gt;
 {&lt;br /&gt;
 }&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===ReadFloat===&lt;br /&gt;
Reads a float from the file.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; float read, or null if there was an error&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 num = f.ReadFloat();&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===ReadInt===&lt;br /&gt;
Reads an integer from the file.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; integer read, or null if there was an error&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 num = f.ReadInt();&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===ReadLine===&lt;br /&gt;
Reads a string from a file until a newline or end of file is encountered.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; string read, or null if there was an error&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 str = f.ReadLine();&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===ReadString===&lt;br /&gt;
Reads a string from a file.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; string read, or null if there was an error&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 str = f.ReadString();&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===Seek===&lt;br /&gt;
Seeks the read/write position to a specified offset.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (byte offset to seek to)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 f.Seek(100); // seek 100 bytes into file&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===Tell===&lt;br /&gt;
Returns the current offset of the read/write position in the file.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; byte position in file&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 t = f.Tell();&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===Write===&lt;br /&gt;
Writes a value of varying types to the file, in whatever file mode was used to open the file.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (...)&lt;br /&gt;
&lt;br /&gt;
This function can take any number of parameters, of types integer, float, string, or System.NewLine.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; true if successful, false if not&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 f = File();&lt;br /&gt;
 f.Open(&amp;quot;myfile.txt&amp;quot;, &amp;quot;text&amp;quot;, false);&lt;br /&gt;
 if(f.IsOpen())&lt;br /&gt;
 {&lt;br /&gt;
     assert( f.Write(&amp;quot;Some test data&amp;quot;, System.NewLine) );&lt;br /&gt;
 }&lt;br /&gt;
 f.Close();&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
----&lt;/div&gt;</summary>
		<author><name>Palota</name></author>
	</entry>
	<entry>
		<id>https://mygamingtalk.com/wiki/index.php?title=ScriptGoal&amp;diff=1767</id>
		<title>ScriptGoal</title>
		<link rel="alternate" type="text/html" href="https://mygamingtalk.com/wiki/index.php?title=ScriptGoal&amp;diff=1767"/>
		<updated>2025-05-25T16:41:20Z</updated>

		<summary type="html">&lt;p&gt;Palota: /* AddWeaponRequest */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{process header&lt;br /&gt;
 | title    = Script Goal&lt;br /&gt;
 | section  =&lt;br /&gt;
 | previous = [[Omni-bot_Script_Reference | Script Reference]]&lt;br /&gt;
 | next     = &lt;br /&gt;
 | shortcut =&lt;br /&gt;
 | notes    =&lt;br /&gt;
}}&lt;br /&gt;
{{TOCright}}&lt;br /&gt;
[[Category:ET|Script Goals]]&lt;br /&gt;
[[Category:Doom 3|Script Goals]]&lt;br /&gt;
[[Category:Quake 4|Script Goals]]&lt;br /&gt;
[[Category:RTCW|Script Goals]]&lt;br /&gt;
&lt;br /&gt;
==ScriptGoal Properties==&lt;br /&gt;
===Name===&lt;br /&gt;
The name of the script goal. Important for other scripts to refer to by name, and the name it is displayed under in the [[Debug Window]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;this.Name = &amp;quot;MyGoalName&amp;quot;;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Parent===&lt;br /&gt;
The name of the parent goal. This should be set up once in the script and left alone. It controls where in the behavior tree the goal is inserted. The location of the goal in the state tree effects how it is evaluated.&lt;br /&gt;
&lt;br /&gt;
Users should stick to one of the following 2 parents.&lt;br /&gt;
* HighLevel - Puts the goal under the HighLevel parent. Because the goal is under the HighLevel state, only one state at a time can run. This is useful for goals that take control of the bot, that shouldn&#039;t be interrupted by other script goals or built in goals.&lt;br /&gt;
* LowLevel - Puts the goal under the LowLevel parent. All states under the LowLevel state are run simultaneously, and so is a good location for scripts that control things that don&#039;t necessarily take total control over the bot, or don&#039;t wish to interrupt the execution of other goals. Some examples might be calling for medic, calling for ammo, most communication scripts.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;this.Parent = &amp;quot;HighLevel&amp;quot;;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===InsertBefore===&lt;br /&gt;
It controls where in the behavior tree the goal is inserted. InsertBefore property is ignored if Parent has been set. &lt;br /&gt;
&lt;br /&gt;
===InsertAfter===&lt;br /&gt;
It controls where in the behavior tree the goal is inserted. InsertAfter property is ignored if Parent or InsertBefore has been set. &lt;br /&gt;
&lt;br /&gt;
===Disable===&lt;br /&gt;
Enables/Disables the goal for consideration. The goal will no longer be considered for execution. Disabled goals have specific coloring in the [[Debug Window]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;this.Disable = true;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===AimVector===&lt;br /&gt;
This Vector3 is used by any active aim request the script goal has registered. You usually do not need to use this property directly, because function AddAimRequest sets this property.&lt;br /&gt;
&lt;br /&gt;
===AlwaysRecieveEvents===&lt;br /&gt;
Normally goals receive events only when active. Setting this to true will allow the goal to receive events even when it&#039;s not running. This is useful for when you want to have the goal sit idle and only activate when receiving a certain event, or you want to track and store information in the goal from events.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;this.AlwaysRecieveEvents = true;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Events===&lt;br /&gt;
Accesses the Events table of the goal, in order to set up script functions that will be called when the bot receives events. By default, goals only receive events when they are active. This can be overridden with [[ScriptGoal#AlwaysRecieveEvents| AlwaysRecieveEvents]], which will allow goals to receive events even when not active.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 this.Events[EVENT.FEEL_PAIN] = function(Inflictor, PreviousHealth, CurrentHealth)&lt;br /&gt;
 {&lt;br /&gt;
   whoDoneIt = GetEntName(Inflictor);&lt;br /&gt;
   print( format(&amp;quot;%s: %s Hurt me: Was %d, now %d&amp;quot;, &lt;br /&gt;
    this.Bot.GetName(), whoDoneIt, PreviousHealth, CurrentHealth) );&lt;br /&gt;
 };&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Bot===&lt;br /&gt;
This provides an accessor to the bot that is running the goal. The &#039;this&#039; within script goals is always the script goal itself, so in the frequent case of needing to access the bot, use this property.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;this.Bot.Say(&amp;quot;Wassup&amp;quot;);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Priority===&lt;br /&gt;
Priority is a property rather than a return value of [[ScriptGoal#GetPriority| GetPriority]] in order to support the useful threading nature of script goals. It is possible to completely leave out a [[ScriptGoal#GetPriority| GetPriority]] function, and set the priority through this property somewhere else, such as in an event callback. This property will automatically be reset internally when the state exits, to prevent a script goal from activating in a loop from the user forgetting to reset the Priority.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;this.Priority = 1;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SkipGetPriorityWhenActive===&lt;br /&gt;
Set SkipGetPriorityWhenActive to true if function GetPriority should not be called while the goal is active.&lt;br /&gt;
&lt;br /&gt;
===GetPriorityDelay===&lt;br /&gt;
Delay in seconds between GetPriority calls. Default is 0.&lt;br /&gt;
&lt;br /&gt;
===MapGoal===&lt;br /&gt;
Current MapGoal or null if the script goal is not active. This property is not set automatically. You must assign map goal to this property in GetPriority and clear it in Exit.&lt;br /&gt;
&lt;br /&gt;
===AutoReleaseAim===&lt;br /&gt;
Function ReleaseAimRequest is automatically called in Exit. Default is true.&lt;br /&gt;
&lt;br /&gt;
===AutoReleaseWeapon===&lt;br /&gt;
Function ReleaseWeaponRequest is automatically called in Exit. Default is true.&lt;br /&gt;
&lt;br /&gt;
===AutoReleaseTrackers===&lt;br /&gt;
Function Trackers::Reset is automatically called in Exit. Default is true.&lt;br /&gt;
&lt;br /&gt;
===AutoFinishOnUnAvailable===&lt;br /&gt;
The goal is automatically finished if current MapGoal is not available. Default is true.&lt;br /&gt;
&lt;br /&gt;
===AutoFinishOnNoProgressSlots===&lt;br /&gt;
The goal is automatically finished if MarkInProgress has not been called yet and MapGoal has no TRACK_INPROGRESS slots available. Default is true.&lt;br /&gt;
&lt;br /&gt;
===AutoFinishOnNoUseSlots===&lt;br /&gt;
The goal is automatically finished if MarkInUse has not been called yet and MapGoal has no TRACK_INUSE slots available. Default is true.&lt;br /&gt;
&lt;br /&gt;
===AutoAdd===&lt;br /&gt;
Set AutoAdd to false if the script should not be loaded for every map, because it&#039;s deprecated or used only for debugging (RideTram, TestEvents, ...).&lt;br /&gt;
&lt;br /&gt;
===DebugString===&lt;br /&gt;
Debug strings are displayed if you use command &amp;quot;/bot debugbot all fpinfo&amp;quot; and then spectate bots. If DebugString is null, MapGoal name is displayed.&lt;br /&gt;
&lt;br /&gt;
===Debug===&lt;br /&gt;
Set this property at the beginning of gm file so that all your debug messages or debug drawing can be easily enabled or disabled.&lt;br /&gt;
&lt;br /&gt;
===Commands===&lt;br /&gt;
Table of console commands which are executed on the script goal for every bot.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 this.Commands[&amp;quot;command_name&amp;quot;] = {&lt;br /&gt;
  Func = function( _params )&lt;br /&gt;
  { &lt;br /&gt;
  },&lt;br /&gt;
  Help = { &amp;quot;description&amp;quot; },&lt;br /&gt;
 };&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==ScriptGoal Callbacks==&lt;br /&gt;
These functions are available only in 0.7 and later.&lt;br /&gt;
&lt;br /&gt;
===Initialize===&lt;br /&gt;
This function is called exactly once per bot, when the bot is added and initialized. It is typically used to perform one time initialization code.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 this.Initialize() = function()&lt;br /&gt;
 {&lt;br /&gt;
 };&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===OnSpawn===&lt;br /&gt;
This function is called every time the bot spawns. Spawning in Omni-bot means any time the bot re-enters his Main active state. This could mean an actual respawn, a revival from an incapacitated state, or something similar.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 this.OnSpawn() = function()&lt;br /&gt;
 {&lt;br /&gt;
 };&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===GetPriority===&lt;br /&gt;
This function is most often the place to evaluate whether you want the script goal to run. Take care in the complexity of the code here, as it is called pretty often, and can be a source of considerable performance overhead.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 this.GetPriority() = function()&lt;br /&gt;
 {&lt;br /&gt;
 };&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===Enter===&lt;br /&gt;
This function is called when a state is chosen to run, right before it begins running. This function is only called once when the state enters, and will not be called again until the state is exited.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 this.Enter() = function()&lt;br /&gt;
 {&lt;br /&gt;
 };&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;See Also:&#039;&#039;&#039; &lt;br /&gt;
[[ScriptGoal#Exit| Exit]]&lt;br /&gt;
----&lt;br /&gt;
===Exit===&lt;br /&gt;
This function is called when a state finishes running, or is overridden by a higher priority state. It is often used to release aim or weapon requests that were used by the goal.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 this.Exit() = function()&lt;br /&gt;
 {&lt;br /&gt;
 };&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;See Also:&#039;&#039;&#039; &lt;br /&gt;
[[ScriptGoal#Enter| Enter]]&lt;br /&gt;
----&lt;br /&gt;
===Update===&lt;br /&gt;
This function is the meat of a script goal. Once a goal is chosen to run, and [[ScriptGoal#Enter| Enter]] is called, the Update function begins getting called at frequent regular intervals. The state stays active until another goal overrides it, or until [[ScriptGoal#Finished| Finished]] is called, after which the [[ScriptGoal#Exit| Exit]] function is called.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 this.Update() = function()&lt;br /&gt;
 {&lt;br /&gt;
   // do stuff&lt;br /&gt;
   this.Finished(); // when we&#039;re done running&lt;br /&gt;
 };&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;See Also:&#039;&#039;&#039; &lt;br /&gt;
[[ScriptGoal#Enter| Enter]], [[ScriptGoal#Exit| Exit]]&lt;br /&gt;
----&lt;br /&gt;
===OnPathThrough===&lt;br /&gt;
This function is called if bot comes to waypoint which has paththrough property set and its value is goalName:data.&lt;br /&gt;
Paththrough is activated if OnPathThrough function returns true.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 this.OnPathThrough = function(data)&lt;br /&gt;
 {&lt;br /&gt;
  navigation = Map.Navigation[data];&lt;br /&gt;
  if(navigation)&lt;br /&gt;
  {&lt;br /&gt;
   this.CurrentNavigation = data;&lt;br /&gt;
   return true;&lt;br /&gt;
  }&lt;br /&gt;
  this.CurrentNavigation = null;&lt;br /&gt;
  return false;&lt;br /&gt;
 };&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==ScriptGoal Functions==&lt;br /&gt;
These functions are available only in 0.7 and later.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===AddFinishCriteria===&lt;br /&gt;
Finish Criteria are expressions set up from script that will be evaluated constantly in the code and when they are satisfied will cause the script goal to abort. These are useful when your script does alot of asynchronous operations(like Goto), but you want a way to abort the script goal, even if the main update script happens to be in an asynchronous or blocked call, sleep or yield.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (subject, expression, value[optional])&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (expression, value[optional])&lt;br /&gt;
&lt;br /&gt;
====Subject====&lt;br /&gt;
Subject must be an entity, if no entity is provided as the first parameter, it is assumed that the 2nd version of the function is called, which takes only and expression and an optional value. The need for a value is determined by what the expression actually is.&lt;br /&gt;
&lt;br /&gt;
====Expression====&lt;br /&gt;
Expression is a string containing 1 or more keywords that use a natural syntax for defining the conditions of the criteria. Additionally, some keywords expect an operator to be defined&lt;br /&gt;
{| align=&amp;quot;center&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!Keyword&lt;br /&gt;
!Operator Required&lt;br /&gt;
!Value&lt;br /&gt;
|-&lt;br /&gt;
|deleted&lt;br /&gt;
|No&lt;br /&gt;
|entity&lt;br /&gt;
|-&lt;br /&gt;
|health&lt;br /&gt;
|Yes&lt;br /&gt;
|health value to compare against(float or int)&lt;br /&gt;
|-&lt;br /&gt;
|hasentflag&lt;br /&gt;
|No&lt;br /&gt;
|entity flag to compare against. use not to negate test&lt;br /&gt;
|-&lt;br /&gt;
|weaponcharged&lt;br /&gt;
|No&lt;br /&gt;
|weapon Id(integer)&lt;br /&gt;
|-&lt;br /&gt;
|weaponequipped&lt;br /&gt;
|No&lt;br /&gt;
|weapon Id(integer)&lt;br /&gt;
|-&lt;br /&gt;
|weaponhasammo&lt;br /&gt;
|No&lt;br /&gt;
|weapon Id(integer)&lt;br /&gt;
|-&lt;br /&gt;
|velocity&lt;br /&gt;
|Yes&lt;br /&gt;
|vector3 velocity to compare against, OR float magnitude of velocity to compare against(speed)&lt;br /&gt;
|-&lt;br /&gt;
|mapgoalavailable&lt;br /&gt;
|No&lt;br /&gt;
|MapGoal object or name&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Valid Operators=====&lt;br /&gt;
* lessthan&lt;br /&gt;
* &amp;lt;&lt;br /&gt;
* greaterthan&lt;br /&gt;
* &amp;gt;&lt;br /&gt;
* equals&lt;br /&gt;
* ==&lt;br /&gt;
&lt;br /&gt;
In addition, some expressions can contain negation keywords in order to check for the negative of an expression, such as&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 this.AddFinishCriteria(this.TargetEntity,&amp;quot;not hasentflag&amp;quot;,ENTFLAG.DEAD); // as soon as the entity does not have the dead flag&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; true if criteria was created, false if not&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 this.AddFinishCriteria(this.TargetEntity,&amp;quot;deleted&amp;quot;); // finish the goal of the target is deleted&lt;br /&gt;
 this.AddFinishCriteria(this.TargetEntity,&amp;quot;health lessthan&amp;quot;,1); // or if they are dead(health &amp;lt;= 1)&lt;br /&gt;
 this.AddFinishCriteria(this.TargetEntity,&amp;quot;hasentflag&amp;quot;,ENTFLAG.LIMBO); // or if they tap out&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===ClearFinishCriteria===&lt;br /&gt;
Deletes finish criteria.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (clearpersistent[optional, default false])&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===Finished===&lt;br /&gt;
Notifies the goal that it is finished running. This function is normally called from the Update function when the goal is desired to finish.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (none)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 this.Finished();&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===LimitTo===&lt;br /&gt;
This function limits script execution based on a true value being returned from a user defined function. This function is useful if scripts should only be run based on some external logic; like a Map variable setting.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (function, delay, onlyactive[optional - default false])&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
LimitTo functions are script functions that are called at user defined intervals that can be used to update from script whether or not the script goal should be able to run or not. Returning false from this function effectively blocks the script goals ability to activate. It will remain in this state as long as the LimitTo function is defined. The 2nd parameter controls how often the callback is performed. Calling script functions too often can adversely effect performance, so it is recommended to choose a delay that is as infrequently as you can get away with. The &#039;onlyactive&#039; parameter is optional and defaults to false. If this parameter is set to true, the LimitTo function callback will ONLY be performed when the script goal is active. By default the LimitTo function will be called whether the goal is active or not, and returning false will prevent the goal from being able to activate. Passing true as the &#039;onlyactive&#039; flag means the goal can activate, and only then is the LimitTo function called. This is useful when you need to check more information regarding specific targets of the goal to validate whether the goal should continue running. This callback is effectively a way to define your own finish criteria. It is recommended that you only use LimitTo callbacks when FinishCriteria can&#039;t be used, since FinishCriteria are much faster and don&#039;t involve frequent calls into script. LimitTo functions might commonly be used to check the status of a map goal or some other world state that the goal relies on.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 //This function is typically set up in this.Initialize()&lt;br /&gt;
 this.LimitTo(Map.SomeFunction, 1.0); //Call Map.SomeFunction every second&lt;br /&gt;
 this.LimitTo(NULL); //clear the function&lt;br /&gt;
  &lt;br /&gt;
 //The script goal object is referenced in the passed function as &#039;this&#039;&lt;br /&gt;
 Map.SomeFunction = function()&lt;br /&gt;
 {&lt;br /&gt;
      if ( Map.SomeVariable == false )&lt;br /&gt;
          { this.Disable; } //disable the script&lt;br /&gt;
      else&lt;br /&gt;
          { return true; } //allow the script to run&lt;br /&gt;
 };&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===LimitToClass===&lt;br /&gt;
This function will only allow the script goal to be created if the owning bot is one of the classes provided. This is much more efficient than checking class in script in common cases where a goal only applies to a certain class of bot.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (classId, ...) Any number of class Ids&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 // This function can take any number of parameters.&lt;br /&gt;
 this.LimitToClass(CLASS.MEDIC);&lt;br /&gt;
 this.LimitToClass(CLASS.MEDIC, CLASS.ENGINEER);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===LimitToNoClass===&lt;br /&gt;
This function will only allow the script goal to be created if the owning bot is NOT one of the classes provided. This is much more efficient than checking class in script in common cases where a goal only applies to a certain class of bot.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (classId, ...) Any number of class Ids&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 // This function can take any number of parameters.&lt;br /&gt;
 this.LimitToNoClass(CLASS.MEDIC);&lt;br /&gt;
 this.LimitToNoClass(CLASS.MEDIC, CLASS.ENGINEER);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
===LimitToTeam===&lt;br /&gt;
This function will only allow the script goal to be created if the owning bot is one of the teams provided. This is much more efficient than checking team in script in common cases where a goal only applies to a certain team of bots.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (teamId, ...) Any number of class Ids&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 // This function can take any number of parameters.&lt;br /&gt;
 this.LimitToTeam(TEAM.BLUE);&lt;br /&gt;
 this.LimitToTeam(TEAM.BLUE, TEAM.RED);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===LimitToEntityFlag===&lt;br /&gt;
This function will only allow the script goal to be created if the owning bot has one or more entity flags set. This is much more efficient than checking entity flags in script in common cases where a goal only applies to specific cases where the bot has certain entity flags.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (ent flag, ...) Any number of entity flags&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 // This function can take any number of parameters.&lt;br /&gt;
 this.LimitToEntityFlag(ENTFLAG.INWATER);&lt;br /&gt;
 this.LimitToEntityFlag(ENTFLAG.INWATER, ENTFLAG.UNDERWATER);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===LimitToNoEntityFlag===&lt;br /&gt;
This function will only allow the script goal to be created if the owning bot does not have one or more entity flags set. This is much more efficient than checking entity flags in script in common cases where a goal only applies to specific cases where the bot does not have certain entity flags.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (ent flag, ...) Any number of entity flags&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 // This function can take any number of parameters.&lt;br /&gt;
 this.LimitToNoEntityFlag(ENTFLAG.INWATER);&lt;br /&gt;
 this.LimitToNoEntityFlag(ENTFLAG.INWATER, ENTFLAG.UNDERWATER);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===LimitToNoPowerup===&lt;br /&gt;
This function will only allow the script goal to be considered if the owning bot does not have the given powerups.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (powerup flag, ...) Any number of power up flags&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 // This function can take any number of parameters.&lt;br /&gt;
 this.LimitToNoPowerUp(ENTFLAG.INVINCIBLE);&lt;br /&gt;
 this.LimitToNoPowerUp(ENTFLAG.INVINCIBLE, ENTFLAG.QUADDAMAGE); &amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===LimitToNoTarget===&lt;br /&gt;
This function will only allow the script goal to be considered if the owning bot does not have a target. This is much more efficient than checking for a target in the GetPriority function in script in cases where the bot should not have a target. The goal will not be evaluated unless the bot does not have a target.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 // This function takes no parameters.&lt;br /&gt;
 this.LimitToNoTarget(); &amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===LimitToPowerUp===&lt;br /&gt;
This function will only allow the script goal to be created if the owning bot has one or more power up flags set. This is much more efficient than checking power up flags in script in common cases where a goal only applies to specific cases where the bot has certain power up flags.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (powerup flag, ...) Any number of power up flags&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 // This function can take any number of parameters.&lt;br /&gt;
 this.LimitToPowerUp(ENTFLAG.INVINCIBLE);&lt;br /&gt;
 this.LimitToPowerUp(ENTFLAG.INVINCIBLE, ENTFLAG.QUADDAMAGE);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===LimitToWeapon===&lt;br /&gt;
This function will only allow the script goal to be created if the owning bot has one or more weapons set by this function. This is much more efficient than checking the bots weapons in script in common cases where a goal only applies to specific cases where the bot has a certain weapon.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (weapon Id, ...) Any number of weapon Ids&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 // This function can take any number of parameters.&lt;br /&gt;
 this.LimitToWeapon(WEAPON.MOBILE_MG42);&lt;br /&gt;
 this.LimitToWeapon(WEAPON.MOBILE_MG42, WEAPON.MORTAR);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===LimitToTargetClass===&lt;br /&gt;
This function will only allow the script goal to be considered if the owning bot has a target of a specified class. This is much more efficient than checking class in the GetPriority function in script in cases where a goal only applies to specific cases where the bots target is a specific class. The goal will not be evaluated unless the bot has a target and the target is on one of the provided classes.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (classId, ...) Any number of target classes&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 // This function can take any number of parameters.&lt;br /&gt;
 this.LimitToTargetClass(CLASS.ANYPLAYER); // don&#039;t run unless we have any player class&lt;br /&gt;
 this.LimitToTargetClass(CLASS.ENGINEER, CLASS.MEDIC); // look for specific classes&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===LimitToTargetTeam===&lt;br /&gt;
This function will only allow the script goal to be considered if the owning bot has a target on a specified team. This is much more efficient than checking team in the GetPriority function in script in cases where a goal only applies to specific cases where the bots target is on a specific team. The goal will not be evaluated unless the bot has a target and the target is on one of the provided teams.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (teamId, ...) Any number of teams&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 // This function can take any number of parameters.&lt;br /&gt;
 this.LimitToTargetTeam(TEAM.RED); // don&#039;t run unless our target is on red team&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===LimitToTargetPowerUp===&lt;br /&gt;
This function will only allow the script goal to be considered if the owning bot has a target with one or more powerups. This is much more efficient than checking powerups in the GetPriority function in script in cases where a goal only applies to specific cases where the bots target has a powerup. The goal will not be evaluated unless the bot has a target and the target is on one of the provided powerups.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (powerup id, ...) Any number of power up flags&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 // This function can take any number of parameters.&lt;br /&gt;
 this.LimitToTargetPowerUp(POWERUP.QUADDAMAGE); // don&#039;t run unless our target has quad damage&lt;br /&gt;
 this.LimitToTargetPowerUp(ENTFLAG.INVINCIBLE, ENTFLAG.QUADDAMAGE);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===LimitToTargetNoPowerUp===&lt;br /&gt;
This function will only allow the script goal to be considered if the owning bot has a target without one or more powerups. This is much more efficient than checking powerups in the GetPriority function in script in cases where a goal only applies to specific cases where the bot&#039;s target hasn&#039;t a powerup. The goal will not be evaluated unless the bot has a target and the target doesn&#039;t have one of the provided powerups.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (powerup id, ...) Any number of power up flags&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 // This function can take any number of parameters.&lt;br /&gt;
 this.LimitToTargetNoPowerUp(POWERUP.QUADDAMAGE); // don&#039;t run if our target has quad damage&lt;br /&gt;
 this.LimitToTargetNoPowerUp(ENTFLAG.INVINCIBLE, ENTFLAG.QUADDAMAGE);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===LimitToTargetEntityFlag===&lt;br /&gt;
This function will only allow the script goal to be created if the target bot has one or more of the entity flags set. This is much more efficient than checking entity flags in script in common cases where a goal only applies to specific cases where the bot has certain entity flags.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (ent flag, ...) Any number of entity flags&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 // This function can take any number of parameters.&lt;br /&gt;
 this.LimitToTargetEntityFlag(ENTFLAG.INWATER);&lt;br /&gt;
 this.LimitToTargetEntityFlag(ENTFLAG.INWATER, ENTFLAG.UNDERWATER);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===LimitToTargetNoEntityFlag===&lt;br /&gt;
This function will only allow the script goal to be created if the target bot does not have one or more of the entity flags set. This is much more efficient than checking entity flags in script in common cases where a goal only applies to specific cases where the bot does not have certain entity flags.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (ent flag, ...) Any number of entity flags&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 // This function can take any number of parameters.&lt;br /&gt;
 this.LimitToTargetNoEntityFlag(ENTFLAG.INWATER);&lt;br /&gt;
 this.LimitToTargetNoEntityFlag(ENTFLAG.INWATER, ENTFLAG.UNDERWATER);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===LimitToTargetWeapon===&lt;br /&gt;
This function will only allow the script goal to be created if the bots has one or more weapons set by this function. This is much more efficient than checking the bots weapons in script in common cases where a goal only applies to specific cases where the bot&#039;s target has a certain weapon.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (weapon Id, ...) Any number of weapon Ids&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 // This function can take any number of parameters.&lt;br /&gt;
 this.LimitToTargetWeapon(WEAPON.MOBILE_MG42);&lt;br /&gt;
 this.LimitToTargetWeapon(WEAPON.MOBILE_MG42, WEAPON.MORTAR);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===LimitToRole===&lt;br /&gt;
This function will only allow the script goal to be created if the owning bot has one of the roles provided.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (roleId, ...) Any number of role Ids&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 this.LimitToRole(ROLE.DEFENDER);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===IsActive===&lt;br /&gt;
Checks if the script goal is currently active. An active script goal means it is currently running. This check is useful mostly in cases where you want an active script goal to remain active and not necessarily keep performing complex checks in its GetPriority function.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (none)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; true if active, false if not&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 this.GetPriority = function()&lt;br /&gt;
 {&lt;br /&gt;
   if(this.IsActive())&lt;br /&gt;
   {&lt;br /&gt;
     return 1.0;&lt;br /&gt;
   }&lt;br /&gt;
   else&lt;br /&gt;
   {&lt;br /&gt;
     // do some other check&lt;br /&gt;
   }&lt;br /&gt;
 }; &amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===Goto===&lt;br /&gt;
Tells the bot to go to a specific location, planning and running a path if necessary. This function is synchronous.&lt;br /&gt;
&lt;br /&gt;
The first parameter can be a table of positions, bot will choose destination which has the shortest path.&lt;br /&gt;
&lt;br /&gt;
Bot will walk if the last parameter is {MoveMode = MoveMode.Walk}.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (Vector3 position, tolerance, options[optional])&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (table of Vector3 positions, tolerance, options[optional])&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; EVENT.PATH_SUCCESS or EVENT.PATH_FAILED&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 wpinfo = table();&lt;br /&gt;
 wp = Wp.GetWaypointByName(&amp;quot;somewaypoint&amp;quot;, wpinfo);&lt;br /&gt;
 if( this.Goto(wpinfo.position, wpinfo.radius) == EVENT.PATH_SUCCESS )&lt;br /&gt;
 {&lt;br /&gt;
     print(&amp;quot;Made it!&amp;quot;);&lt;br /&gt;
 }&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===GotoAsync===&lt;br /&gt;
Tells the bot to go to a specific location, planning and running a path if necessary. This function is asynchronous. Typically a script would block after calling this to wait for a success or failure message.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (Vector3 position, tolerance, options[optional])&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 wpinfo = table();&lt;br /&gt;
 wp = Wp.GetWaypointByName(&amp;quot;somewaypoint&amp;quot;, wpinfo);&lt;br /&gt;
 this.GotoAsync(wpinfo.position, wpinfo.radius);&lt;br /&gt;
 if( block(EVENT.PATH_SUCCESS, EVENT.PATH_FAILED) == EVENT.PATH_SUCCESS )&lt;br /&gt;
 {&lt;br /&gt;
     print(&amp;quot;Made it!&amp;quot;);&lt;br /&gt;
 }&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===GotoRandom===&lt;br /&gt;
Goto random destination.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (tolerance, options[optional])&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; EVENT.PATH_SUCCESS or EVENT.PATH_FAILED&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===GotoRandomAsync===&lt;br /&gt;
Goto random destination (asynchronous).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (tolerance, options[optional])&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===RouteTo===&lt;br /&gt;
RouteTo is similar to Goto, but bots use routes which are defined for map goal. Routes are used only if bot is within radius of any ROUTE goal.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (mapGoal, tolerance, options[optional])&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; EVENT.PATH_SUCCESS or EVENT.PATH_FAILED&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===Stop===&lt;br /&gt;
Interrupts any active Goto and signals PATH_FAILED.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===DidPathSucceed===&lt;br /&gt;
Checks if the last Goto command succeeded. Success means the bot has reached the end of the desired path. Typically a goal will block on EVENT.PATH_SUCCESS or EVENT.PATH_FAILED events. [[ScriptGoal#DidPathSucceed| DidPathSucceed]] and [[ScriptGoal#DidPathFail| DidPathFail]] are included for cases where the script wishes to remain active and doing something during the path traversal, and it can poll the path success/failure during. If neither function returns true, then the bot should be moving along the path normally.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; true if path succeeded, false if not&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 if(this.DidPathSucceed())&lt;br /&gt;
 {&lt;br /&gt;
 }&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;See Also:&#039;&#039;&#039; &lt;br /&gt;
[[ScriptGoal#Goto| Goto]], [[ScriptGoal#DidPathSucceed| DidPathSucceed]]&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===DidPathFail===&lt;br /&gt;
Checks if the last Goto command failed. Failure means the path was either blocked(no path exists), or the bot has gotten stuck on the way. Typically a goal will block on EVENT.PATH_SUCCESS or EVENT.PATH_FAILED events. [[ScriptGoal#DidPathSucceed| DidPathSucceed]] and [[ScriptGoal#DidPathFail| DidPathFail]] are included for cases where the script wishes to remain active and doing something during the path traversal, and it can poll the path success/failure during. If neither function returns true, then the bot should be moving along the path normally.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; true if path failed, false if not&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 if(this.DidPathFail())&lt;br /&gt;
 {&lt;br /&gt;
 }&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;See Also:&#039;&#039;&#039; &lt;br /&gt;
[[ScriptGoal#Goto| Goto]], [[ScriptGoal#DidPathSucceed| DidPathSucceed]]&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===AddAimRequest ===&lt;br /&gt;
Adds a priority based aim request into the bots aiming system. Aim requests are favored based on their priority, with the highest priority aim request chosen at any given point. It is a much simpler and easier to manage setup in the cases of many competing goals that wish to control the bots aim. Each goal can add an aim request and will recieve notifications when the bot chooses and executes their request. This functions works together with the AimVector property to allow setting the aim type at any point. The script can recieve notification of a successful aiming by blocking on the EVENT.AIM_SUCCESS event.&lt;br /&gt;
&lt;br /&gt;
Aim requests can be viewed in the [[Debug Window]] under the Aimer state. They will take on the name of the script goal they were added in.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (priority, aim type&amp;lt;optional, default position&amp;gt;, aim position&amp;lt;optional&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
====Priority====&lt;br /&gt;
Most normal goals use a Priority.High priority, which leaves 2 higher levels of priority usable by scripts or important goals. &lt;br /&gt;
&lt;br /&gt;
Priority determines how to select a request when there are multiple requests active. Higher priorities are selected over lower priorities.&lt;br /&gt;
&lt;br /&gt;
* Priority.Zero&lt;br /&gt;
* Priority.Min&lt;br /&gt;
* Priority.Idle - FollowPath&lt;br /&gt;
* Priority.VeryLow - LookAround&lt;br /&gt;
* Priority.Low - CAMP, ESCORT, RIDE, MOUNT, ...&lt;br /&gt;
* Priority.LowMed - AttackTarget&lt;br /&gt;
* Priority.Medium - CALLARTILLERY, MOBILEMORTAR, ...&lt;br /&gt;
* Priority.High - BUILD, DEFUSE, GRENADE, REVIVE, SWITCH, ...&lt;br /&gt;
* Priority.VeryHigh&lt;br /&gt;
* Priority.Override&lt;br /&gt;
&lt;br /&gt;
====Aim Types====&lt;br /&gt;
* movedirection - Face in the direction of movement. Useful if you want to override the bots normal combat aiming, as in for a disguise goal where you don&#039;t want them to engage the target.&lt;br /&gt;
* facing - Face a given facing (direction) vector. In this case AimVector represents a facing vector.&lt;br /&gt;
** (1,0,0) - east, (-1,0,0) - west&lt;br /&gt;
** (0,1,0) - north, (0,-1,0) - south&lt;br /&gt;
** (0,0,1) - up, (0,0,-1) - down&lt;br /&gt;
* position - Face a given position vector. In this case AimVector represents a point in the 3D map space.&lt;br /&gt;
&lt;br /&gt;
If one of the above is not specified, the aim request is a positional request, and the AimVector of the script goal will be used as a raw position to aim at.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 aimPos = someAimPosition;&lt;br /&gt;
 aimPos2 = someAimPosition2;&lt;br /&gt;
&lt;br /&gt;
 this.AddAimRequest(Priority.High, &amp;quot;movedirection&amp;quot;); // requests the bot to face along its move direction at a 0.8 priority&lt;br /&gt;
 // OR&lt;br /&gt;
 this.AddAimRequest(Priority.High); // leave off optional parameters, defaults to AimPosition, so set it&lt;br /&gt;
 this.AimVector = aimPos; // this can be called at any time in the script goal&lt;br /&gt;
&lt;br /&gt;
 if(block(EVENT.AIM_SUCCESS) == EVENT.AIM_SUCCESS)&lt;br /&gt;
 {&lt;br /&gt;
    // we&#039;re on target, do something cool&lt;br /&gt;
 }&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;See Also:&#039;&#039;&#039; &lt;br /&gt;
[[ScriptGoal#ReleaseAimRequest | ReleaseAimRequest]]&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===ReleaseAimRequest ===&lt;br /&gt;
This function will release the Aim Request within the script goal; allowing other potential aim requests to have control.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 this.ReleaseAimRequest();&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;See Also:&#039;&#039;&#039; &lt;br /&gt;
[[ScriptGoal#AddAimRequest| AddAimRequest]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===AddWeaponRequest ===&lt;br /&gt;
Adds a priority based weapon equip request into the bots weapon system. Weapon requests are favored based on their priority, with the highest priority request chosen as the desired weapon. It is a much simpler and easier to manage setup in the cases of many competing goals that wish to control the bots equipped weapon. Each goal can add an weapon request and will receive notifications when the bot chooses and executes their request. &lt;br /&gt;
&lt;br /&gt;
Weapon requests can be view in the [[Debug Window]] under the WeaponSystem state. They will take on the name of the script goal they were added in.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (priority[optional], weapon Id)&lt;br /&gt;
&lt;br /&gt;
====Priority====&lt;br /&gt;
The first parameter is optional since version 0.92. Default value is Priority.High, which leaves 2 higher levels of priority usable by scripts or important goals.&lt;br /&gt;
&lt;br /&gt;
Priority determines how to select a request when there are multiple requests active. Higher priorities are selected over lower priorities.&lt;br /&gt;
&lt;br /&gt;
* Priority.Min&lt;br /&gt;
* Priority.Idle&lt;br /&gt;
* Priority.VeryLow&lt;br /&gt;
* Priority.Low&lt;br /&gt;
* Priority.Medium&lt;br /&gt;
* Priority.High&lt;br /&gt;
* Priority.VeryHigh&lt;br /&gt;
* Priority.Override&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 this.AddWeaponRequest(WEAPON.MEDKIT);&lt;br /&gt;
 this.AddWeaponRequest(Priority.Low, WEAPON.KNIFE); &amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;See Also:&#039;&#039;&#039; &lt;br /&gt;
[[ScriptGoal#ReleaseWeaponRequest | ReleaseWeaponRequest]]&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===ReleaseWeaponRequest ===&lt;br /&gt;
This function will release the weapon request within the script goal; allowing other potential weapon requests to have control.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 this.ReleaseWeaponRequest();&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;See Also:&#039;&#039;&#039; &lt;br /&gt;
[[ScriptGoal#AddWeaponRequest | AddWeaponRequest ]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===BlockForWeaponChange===&lt;br /&gt;
This function provides specialized script thread blocking functionality to wait for a weapon change to a certain weapon. This function takes the place of a call to block in the case you want to wait until the bot switches to a specific weapon.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (weaponId)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 this.BlockForWeaponChange(WEAPON.MEDKIT);&lt;br /&gt;
 this.Say(&amp;quot;Medkit Equipped!&amp;quot;);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===BlockForWeaponFire===&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===BlockForVoiceMacro===&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===QueryGoals===&lt;br /&gt;
&lt;br /&gt;
Finds goals available for this bot and stores them in the first table parameter. The previous table content is cleared since omni-bot 0.84. &lt;br /&gt;
&lt;br /&gt;
The last optional parameter is table of parameters to filter result (NoFilters, Group, Role, Team, SkipDelayed, SkipNoInProgress, SkipNoInUse, SkipInUse) or sort result (parameter Sort, values are &amp;quot;none&amp;quot;, &amp;quot;priority&amp;quot;, &amp;quot;name&amp;quot;, &amp;quot;random&amp;quot;, default is &amp;quot;priority&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (table, goal type hash, params[optional])&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (table, table of goal type hashes, params[optional])&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (table, expression, params[optional])&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; count of goals returned in table&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 count = this.QueryGoals(this.Bot.QueryGoalsTable, 0xc9326a43);&lt;br /&gt;
 count = this.QueryGoals(this.Bot.QueryGoalsTable, &amp;quot;BUILD_.*&amp;quot;);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===BlackboardDelay===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (time, mapGoal or serialNumber[optional])&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 this.BlackboardDelay(10);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===BlackboardIsDelayed===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (mapGoal or serialNumber)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; true if goal has been found on blackboard&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 if (this.BlackboardIsDelayed(serial))&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===MarkInProgress===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (mapGoal[optional])&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; true if empty slot has been found and marked&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 this.MarkInProgress(); //finish if no slot is available&lt;br /&gt;
&lt;br /&gt;
 if (!this.MarkInProgress(this.MapGoal)) {&lt;br /&gt;
   this.BlackboardDelay(5);&lt;br /&gt;
   this.Finished();&lt;br /&gt;
 }&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===MarkInUse===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (mapGoal[optional])&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; true if empty slot has been found and marked&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 this.MarkInUse(); //finish if no slot is available&lt;br /&gt;
&lt;br /&gt;
 if (!this.MarkInUse(this.MapGoal)) {&lt;br /&gt;
   this.BlackboardDelay(5);&lt;br /&gt;
   this.Finished();&lt;br /&gt;
 }&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===WatchForMapGoalsInRadius===&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===ClearWatchForMapGoalsInRadius===&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===WatchForEntityCategory===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; ( { Radius, Category, RequireLOS[optional, default 0] } )&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 this.WatchForEntityCategory({&lt;br /&gt;
   Radius = 350,&lt;br /&gt;
   Category = CAT.PROJECTILE,&lt;br /&gt;
   RequireLOS = TRACE.VISIBLE&lt;br /&gt;
 });&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===DelayGetPriority===&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===ForkThread===&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===KillThread===&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===Signal===&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== Script Goal Threading ==&lt;br /&gt;
&lt;br /&gt;
Script goals have been designed to be friendly to script threading, by providing some built in functionality to make it easier to manage multiple threads to be associated with the script goal.&lt;br /&gt;
&lt;br /&gt;
The script goal keeps track of the thread created when calling all the following functions.&lt;br /&gt;
* Initialize&lt;br /&gt;
* OnSpawn&lt;br /&gt;
* GetPriority&lt;br /&gt;
* Enter&lt;br /&gt;
* Exit&lt;br /&gt;
* Update&lt;br /&gt;
&lt;br /&gt;
You may use thread functions (block, yield, sleep), in any of the script goal functions, though you must understand that for efficiency, and to prevent runaway threads, the script goal will internally kill the threads associated with the function callbacks at certain times.&lt;br /&gt;
&lt;br /&gt;
Currently&lt;br /&gt;
* All threads will be killed when the state exits.&lt;br /&gt;
* All threads will be killed when the state is disabled. See [[ScriptGoal#Disable| Disable]]&lt;br /&gt;
* All threads will be killed when the state becomes unselectable. This is normally due to the limit functions.&lt;br /&gt;
&lt;br /&gt;
Note that this only applies to the thread that is created for the function calls themselves. If you really need a thread to run longer than these specifications allow, you can create your own thread normally with the thread() function. It is highly recommended that you script your goal within these functions, as it is easy to &#039;&#039;leak&#039;&#039; threads when creating them arbitrarily.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
== Script Goal Performance ==&lt;br /&gt;
&lt;br /&gt;
Executing script is much much slower than executing native code, so you should be aware that a script can have significant adverse effects on the performance of the bot as a whole. Here are some tips to keep performance as high as possible with script goals.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Only define what you need&#039;&#039;&#039; - None of the callback functions are required, so if you don&#039;t use them, don&#039;t define them. It is wasteful to have an empty function defined. If you don&#039;t need an Enter function, leave it out, if you don&#039;t need an Update function, leave it out. Same for Exit, GetPriority, Initialize.&lt;br /&gt;
* &#039;&#039;&#039;Use limit functions as much as possible&#039;&#039;&#039; - If the goal should only be considered for certain player classes, or for bots with certain powerups or entity flags, or for when the bot has a target that matches similar specific flags, use the Limit functions to set that up. They are much much faster than checking those properties in the GetPriority function. If the limit functions fail, the script will never be called, which is a huge optimization.&lt;br /&gt;
* &#039;&#039;&#039;Use thread functions&#039;&#039;&#039; - Normally, GetPriority is called often. You can control this behavior by using thread functions to keep a thread running, and delay priority evaluations with a loop and calls to sleep. GetPriority will not be called if there is still an active GetPriority thread.&lt;br /&gt;
* &#039;&#039;&#039;Keep your GetPriority function as lightweight as possible&#039;&#039;&#039; - The less work it does the better, because GetPriority is called frequently by the bot. This is especially important if the goal is placed under the &#039;&#039;LowLevel&#039;&#039; parent because all child states under &#039;&#039;LowLevel&#039;&#039; are evaluated and allowed to run simultaneously. &lt;br /&gt;
* &#039;&#039;&#039;Ditto for the Update function&#039;&#039;&#039; - The same applies to the Update function especially. Keep it as simple as possible to achieve the desired behavior, and use thread functions.&lt;br /&gt;
* &#039;&#039;&#039;Cache as much as possible&#039;&#039;&#039; - Take advantage of the fact that Initialize is called only once when the bot is added. Use this function to cache values the script goal might need. For example, if the script goal does things based on specific waypoints, it would be expensive to call functions like Wp.GetWaypointByName() in the priority or update functions. Instead collect all you might need up front in the Initialize function and store them in a table on the script goal so you have faster access to them later.&lt;br /&gt;
* &#039;&#039;&#039;Use events, and block() as much as possible&#039;&#039;&#039; - Most common operations that previously required expensive loops to perform have been converted to events. Choosing a weapon, aiming a weapon, going to some location, etc. Most can be followed by a call to block() which will suspend the execution of the script until the event is recieved. This is the single easiest to use and most useful for performance features available. See [[ScriptGoal#BlockForWeaponChange|BlockForWeaponChange]], [[ScriptGoal#Goto|Goto]], [[ScriptGoal#AddAimRequest|AddAimRequest]].&lt;br /&gt;
* &#039;&#039;&#039;Beware of loops&#039;&#039;&#039; - Be careful when looping, as they can silently cause large performance drains. Be wary of how much work is being done in a loop, and on how many elements. Expensive functionality can be updated less often, or split up over time. Use yield() or sleep(x) within loops to spread out the calculations over time.&lt;/div&gt;</summary>
		<author><name>Palota</name></author>
	</entry>
	<entry>
		<id>https://mygamingtalk.com/wiki/index.php?title=Bot_Library&amp;diff=1766</id>
		<title>Bot Library</title>
		<link rel="alternate" type="text/html" href="https://mygamingtalk.com/wiki/index.php?title=Bot_Library&amp;diff=1766"/>
		<updated>2025-05-25T16:37:45Z</updated>

		<summary type="html">&lt;p&gt;Palota: /* EntityIsValid */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{process header&lt;br /&gt;
 | title    = Bot Library&lt;br /&gt;
 | section  =&lt;br /&gt;
 | previous = [[Omni-bot_Script_Reference | Script Reference]]&lt;br /&gt;
 | next     = &lt;br /&gt;
 | shortcut =&lt;br /&gt;
 | notes    =&lt;br /&gt;
}}&lt;br /&gt;
{{TOCright}}&lt;br /&gt;
== Global Bot Functions ==&lt;br /&gt;
&lt;br /&gt;
=== AddBot ===&lt;br /&gt;
Adds a bot to the game, and optionally specifies team, class, and name for the bot.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; ()&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (team)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (team, class)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (team, class, name)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (table)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 AddBot();&lt;br /&gt;
 // OR&lt;br /&gt;
 AddBot(TEAM.AXIS);&lt;br /&gt;
 // OR&lt;br /&gt;
 AddBot(TEAM.AXIS, CLASS.SOLDIER);&lt;br /&gt;
 // OR&lt;br /&gt;
 AddBot(TEAM.AXIS, CLASS.SOLDIER, &amp;quot;SomeDude&amp;quot;);&lt;br /&gt;
 // OR&lt;br /&gt;
 // not all fields are valid for all games, here&#039;s a quake 4 example&lt;br /&gt;
 // not all fields are required. any left out will use sensible default values&lt;br /&gt;
 tbl =&lt;br /&gt;
 {&lt;br /&gt;
     name=&amp;quot;SomeDude&amp;quot;,&lt;br /&gt;
     team=TEAM.STROGG,&lt;br /&gt;
     class=CLASS.PLAYER,&lt;br /&gt;
     spawnpoint=&amp;quot;somespawnpointname&amp;quot;,&lt;br /&gt;
     model=&amp;quot;model_player_kane_strogg&amp;quot;,&lt;br /&gt;
     skin=&amp;quot;base&amp;quot;,&lt;br /&gt;
 };&lt;br /&gt;
 AddBot(tbl);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;See Also:&#039;&#039;&#039; &lt;br /&gt;
[[Bot Library#KickBot| KickBot]], [[Bot Library#KickAll| KickAll]]&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== AllocGoalSerialNum ===&lt;br /&gt;
Gets unique goal serial number.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; integer&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== CalcTrajectory ===&lt;br /&gt;
Calculates a projectile trajectory, and returns the results in a table, or null if no trajectory exists for the parameters given.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (Vector3 start position, Vector3 target position, projectile speed, projectile gravity)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; table or null&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 mypos = Vector3(10,10,10); // get a valid position from somewhere&lt;br /&gt;
 targpos = Vector3(20,20,20); // get a valid position from somewhere&lt;br /&gt;
 projVel = 1000;&lt;br /&gt;
 projGrav = 0.5;&lt;br /&gt;
 traj = CalcTrajectory(mypos, targpos, projVel, projGrav);&lt;br /&gt;
 if(traj)&lt;br /&gt;
 {&lt;br /&gt;
     // if a table was returned, there can be 1 or 2 trajectories stored in it.&lt;br /&gt;
     // the 1st trajectory is the most direct trajectory&lt;br /&gt;
     // the 2nd trajectory is normally a mortar trajectory with a high degree of arc.&lt;br /&gt;
     // both trajectories are a unit length facing vector&lt;br /&gt;
     b.TurnToFacing(traj[0]);&lt;br /&gt;
     // OR&lt;br /&gt;
     b.TurnToFacing(traj[1]);&lt;br /&gt;
 }&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== CheatsEnabled ===&lt;br /&gt;
Checks if cheat mode is enabled in the game. Useful for debug or development scripts that use functions that are only available in cheat mode.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; true if cheats are enabled, false if not&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 if(CheatsEnabled())&lt;br /&gt;
 {&lt;br /&gt;
     // do something&lt;br /&gt;
 }&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;See Also:&#039;&#039;&#039; &lt;br /&gt;
[[Bot Library#EntityKill| EntityKill]], [[Bot Library#ServerCommand| ServerCommand]]&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== CheckEntityBoundsIntersect ===&lt;br /&gt;
Checks if entities intersect.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (entity1, entity2)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; true/false&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== ClearGoalRole ===&lt;br /&gt;
Clears one or more roles of one or more MapGoals.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (expression or table, role or table)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 example: ClearGoalRole( &amp;quot;FLAG_Gold&amp;quot;, ROLE.ATTACKER ); //1 goal, 1 role&lt;br /&gt;
 example: ClearGoalRole( &amp;quot;DEFEND_City[4567]&amp;quot;, { ROLE.DEFENDER2, ROLE.DEFENDER3}); //4 goals, 2 roles&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;See Also:&#039;&#039;&#039; [[Roles]]&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== ConfigGet ===&lt;br /&gt;
Gets a config value from omni-bot.cfg. Sets a config value if it does not exist yet and if the third parameter is not null.&lt;br /&gt;
&lt;br /&gt;
Type of the return value is string, int or float according to the third parameter. If you call ConfigGet with only 2 parameters, it will return string.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (section, config parameter name, config parameter value[optional])&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; config parameter value&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
ft = ConfigGet(&amp;quot;FireTeam&amp;quot;, &amp;quot;enabled&amp;quot;, 1);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;See Also:&#039;&#039;&#039; &lt;br /&gt;
[[Bot Library#ConfigSet|ConfigSet]]&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== ConfigSet ===&lt;br /&gt;
Sets a config value in omni-bot.cfg.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (section, config parameter name, config parameter value)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;ConfigSet(&amp;quot;FireTeam&amp;quot;, &amp;quot;enabled&amp;quot;, 0);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;See Also:&#039;&#039;&#039; &lt;br /&gt;
[[Bot Library#ConfigGet|ConfigGet]]&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== CreateMapGoal ===&lt;br /&gt;
Creates a new goal.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (type)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; MapGoal object&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== Debug Functions ===&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== DrawAABB ====&lt;br /&gt;
&#039;&#039;&#039;See:&#039;&#039;&#039; &lt;br /&gt;
[[Bot Library#DrawDebugAABB | DrawDebugAABB]]&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== DrawArrow ====&lt;br /&gt;
Draws an arrow. Used for facing or AimVectors.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (Vector3 start, Vector3 end, color, duration)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== DrawDebugAABB ====&lt;br /&gt;
Draws a box.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (AABB, color, duration)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 AABB box; // initialize it with something&lt;br /&gt;
 // draw it in red for 5 seconds&lt;br /&gt;
 DrawDebugAABB(box, COLOR.RED, 5);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;See Also:&#039;&#039;&#039; &lt;br /&gt;
[[Bot Library#DrawDebugLine | DrawDebugLine]], [[Bot Library#GetEntWorldAABB | GetEntWorldAABB]]&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== DrawDebugLine ====&lt;br /&gt;
Draws a line in the environment. Useful for debugging.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (Vector3 start, Vector3 end, color, duration)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 start = Vector3(0,0,0);&lt;br /&gt;
 end = Vector3(20,20,20);&lt;br /&gt;
 // draw it in red for 5 seconds&lt;br /&gt;
 DrawDebugLine(start, end, COLOR.RED, 5);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;See Also:&#039;&#039;&#039; &lt;br /&gt;
[[Bot Library#DrawDebugAABB | DrawDebugAABB]], [[Bot Library#GetEntWorldAABB | GetEntWorldAABB]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== DrawEntityAABB ====&lt;br /&gt;
Draws a bounding box around an entity. The box is usually much bigger than the entity.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (entity, duration, color)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; true/false&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== DrawEntityOBB ====&lt;br /&gt;
Draws an oriented box around an entity.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (entity, duration, color)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; true/false&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== DrawLine ====&lt;br /&gt;
&#039;&#039;&#039;See:&#039;&#039;&#039; &lt;br /&gt;
[[Bot Library#DrawDebugLine | DrawDebugLine]]&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== DrawRadius ====&lt;br /&gt;
Draws radius.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (position, radius, color, duration)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== DrawText3d ====&lt;br /&gt;
Draws text.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (position, string, color, duration, maxDistanceFromPlayer[optional, default 1024])&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== DrawTrajectory ====&lt;br /&gt;
Draws trajectory of grenade, mortar, airstrike or smokebomb.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; ( {Position, Velocity, Interval, Duration, BounceLoss, GravityMultiplier, StopAtHit, TraceBounce }, color, duration)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; target position&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== DumpConsoleToFile ====&lt;br /&gt;
Saves debug console, only if debug window is enabled.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (file name)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== EchoToScreen ====&lt;br /&gt;
Prints a message to the screen. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (duration, message)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 EchoToScreen(5,&amp;quot;Hello World!&amp;quot;);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== EnableDebugWindow ====&lt;br /&gt;
Enables or disables [[Debug_Window|debug window]]. Does not work in release build of omnibot dynamic link library. You must use omnibot_et.dll from dw_enabled subfolder on [[Assembla]].&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (true/false, width[optional, default 1024], height[optional, default 768], bitsPerPixel[optional, default 32])&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== Error ====&lt;br /&gt;
Prints an error to the games output console.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (error message)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 Error(&amp;quot;Somethin bad happened&amp;quot;);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== Log ====&lt;br /&gt;
Writes a string to the omnibot log file.&lt;br /&gt;
&lt;br /&gt;
The second parameter: 0=info, 1=warning, 2=error, 3=critical&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; logs are disabled if cvar omnibot_logsize is zero or negative&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; logs can also be disabled in omni-bot.cfg&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (string, level[optinal, default 0])&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 Log(&amp;quot;Something cool happened&amp;quot;);&lt;br /&gt;
 Log(&amp;quot;Something bad happened&amp;quot;, 2);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== ShowPaths ====&lt;br /&gt;
Debug Information function. Prints Omni-bot version, revision, and revision date, along with file system paths.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 ShowPaths();&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== TransformAndDrawLineList ====&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (veclist, color, duration, position, euler)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 TransformAndDrawLineList({Vec3(20,80,0), Vec3(20,-60,0), Vec3(-90,70,30), Vec3(-90,-50,30)}, &lt;br /&gt;
  COLOR.RED, 5, GetLocalPosition(), Vec3(DegToRad(45),0,0));&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== DeleteTriggerRegion ===&lt;br /&gt;
Deletes a trigger region previously created with [[Bot Library#OnTriggerRegion| OnTriggerRegion]]. Because regions aren&#039;t required to have unique names, DeleteTriggerRegion will delete all regions that match the provided name. This  allows grouping of different trigger regions by shared names.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (name)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (serial #)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 // creates a sphere trigger 256 units in radius around 0,0,0, then delete it immediately.&lt;br /&gt;
 triggerInfo =&lt;br /&gt;
 {&lt;br /&gt;
 	Name=&amp;quot;TestTrigger&amp;quot;,&lt;br /&gt;
 	TriggerOnClass=CLASS.ANYPLAYER,&lt;br /&gt;
 	OnEnter = function(ent)&lt;br /&gt;
 	{&lt;br /&gt;
 		print(GetEntName(ent),&amp;quot;entered aabb trigger&amp;quot;);&lt;br /&gt;
 	},&lt;br /&gt;
 	OnExit = function(ent)&lt;br /&gt;
 	{&lt;br /&gt;
 		print(GetEntName(ent),&amp;quot;exited aabb trigger&amp;quot;);&lt;br /&gt;
 	},&lt;br /&gt;
 };&lt;br /&gt;
 serial = OnTriggerRegion(Vector3(0,0,0),256,triggerInfo);&lt;br /&gt;
&lt;br /&gt;
 DeleteTriggerRegion(serial);&lt;br /&gt;
 // OR&lt;br /&gt;
 DeleteTriggerRegion(&amp;quot;TestTrigger&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;See Also:&#039;&#039;&#039; &lt;br /&gt;
[[Bot Library#OnTriggerRegion| OnTriggerRegion]]&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== DistanceBetween ===&lt;br /&gt;
Utility function for checking distances between 2 objects. This function takes 2 parameters, but the parameter types can vary.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (object1, object2)&lt;br /&gt;
&lt;br /&gt;
For this function, each parameter can be one of the following types.&lt;br /&gt;
* Vector3&lt;br /&gt;
* GameEntity&lt;br /&gt;
* GameId&lt;br /&gt;
* MapGoal&lt;br /&gt;
&lt;br /&gt;
This provides a flexible and fast function that allows a script to check the distance between a variety of source and destination object, and reduces the need for the script to convert between GameEntity or GameId, or to get the position of the GameEntity itself.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; distance between the objects&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 // assume entity1 is a GameEntity from another source, such as GetAllType&lt;br /&gt;
 if(DistanceBetween(b.GetGameEntity(), entity1))&lt;br /&gt;
 {&lt;br /&gt;
 }&lt;br /&gt;
 // OR&lt;br /&gt;
 if(DistanceBetween(b.GetGameEntity(), Vector3(10,20,30))&lt;br /&gt;
 {&lt;br /&gt;
 }&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== DynamicPathsUpdated ===&lt;br /&gt;
Finds new path for bots in teams specified if paths go through waypoint which has dynamic flag.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (teamId, ...)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== Entity Functions ===&lt;br /&gt;
&lt;br /&gt;
==== EntityIsOutside ====&lt;br /&gt;
Checks if a given entity is outside. Added in 0.83&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (entity)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; true/false&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== EntityIsValid ====&lt;br /&gt;
Checks if a given entity exists. Parameter can be entity handle or entity ID.&lt;br /&gt;
Since 0.92 it does not throw exception but returns false if parameter is null.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (entity)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; true/false&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== EntityKill ====&lt;br /&gt;
Kills an entity. Requires cheats to be enabled.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (GameEntity/GameId)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; true if successful, false if not&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 EntityKill(GetEntityByName(&amp;quot;truck&amp;quot;));&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;See Also:&#039;&#039;&#039; &lt;br /&gt;
[[Bot Library#CheatsEnabled | CheatsEnabled ]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== GetEntBonePosition ====&lt;br /&gt;
Gets the world position of a specific bone on an entity. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; This function may not be implemented for all games. It&#039;s not implemented  in ET.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (GameEntity/GameId, BoneId)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; Vector3 world bone position, or null if bone not found&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 headpos = GetEntBonePosition(someent, BONE.HEAD);&lt;br /&gt;
 if(headpos)&lt;br /&gt;
 {&lt;br /&gt;
     // got head position&lt;br /&gt;
 }&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== GetEntCategory ====&lt;br /&gt;
Checks if the entity belongs to one or more entity categories. This function takes one or more categories, and returns true if the entity belongs to all the provided categories.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (GameEntity/GameId, Category, ...)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; true if the entity belongs to all provided categories.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 if(GetEntCategory(someent, CAT.PROJECTILE))&lt;br /&gt;
 {&lt;br /&gt;
 } &lt;br /&gt;
 if(GetEntCategory(someent, CAT.PLAYER, CAT.VEHICLE))&lt;br /&gt;
 {&lt;br /&gt;
 } &amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;See also:&#039;&#039;&#039; [[CAT]]&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== GetEntClass ====&lt;br /&gt;
Gets the class of the entity.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (GameEntity/GameId)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; class of entity, or null if there was an error&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 if(GetEntClass(someent) == CLASS.SOLDIER)&lt;br /&gt;
 {&lt;br /&gt;
 }&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;See also:&#039;&#039;&#039; [[CLASS]]&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== GetEntEquippedWeapon ====&lt;br /&gt;
Gets current weapon of a player.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (GameEntity/GameId)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; weaponId&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 weapon = GetEntEquippedWeapon(this.TargetEntity);&lt;br /&gt;
 &amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== GetEntEyePosition ====&lt;br /&gt;
Gets the world eye position of an entity.&lt;br /&gt;
&lt;br /&gt;
Note: position is not correct if bot is looking up or down&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (GameEntity/GameId)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; Vector3 eye position, or null if there was an error&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 eyepos = GetEntEyePosition(someent);&lt;br /&gt;
 if(eyepos)&lt;br /&gt;
 {&lt;br /&gt;
     // got eye position&lt;br /&gt;
 }&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== GetEntFacing ====&lt;br /&gt;
Gets the world facing vector of an entity&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (GameEntity/GameId)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; Vector3 facing, or null if there was an error&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 face = GetEntFacing(someent);&lt;br /&gt;
 if(face)&lt;br /&gt;
 {&lt;br /&gt;
     // got face vector, as a direction vector&lt;br /&gt;
 }&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== GetEntFlags ====&lt;br /&gt;
Checks if the entity has one or more entity flags.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (GameEntity/GameId, Entity Flag, ...)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; true if the entity has any of provided entity flags.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 if(GetEntFlags(someent, ENTFLAG.CROUCHED))&lt;br /&gt;
 {&lt;br /&gt;
 } &lt;br /&gt;
 if(GetEntFlags(someent, ENTFLAG.CROUCHED, ENTFLAG.RELOADING))&lt;br /&gt;
 {&lt;br /&gt;
 } &amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;See also:&#039;&#039;&#039; [[ENTFLAG]]&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== GetEntHealthAndArmor ====&lt;br /&gt;
Gets health and armor of an entity.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (GameEntity/GameId, table)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; true if successful, false if not&lt;br /&gt;
&lt;br /&gt;
Properties stored into table:&lt;br /&gt;
* Health - Current Health&lt;br /&gt;
* MaxHealth - Max Health&lt;br /&gt;
* Armor - Current Armor&lt;br /&gt;
* MaxArmor - Max Armor&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
healthArmor = {};&lt;br /&gt;
if(GetEntHealthAndArmor(someentity, healthArmor))&lt;br /&gt;
{&lt;br /&gt;
	if(healthArmor.Health &amp;lt; 20)&lt;br /&gt;
	{&lt;br /&gt;
		b.Say(&amp;quot;I&#039;m Hurt!&amp;quot;);&lt;br /&gt;
	}&lt;br /&gt;
} &amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;See also:&#039;&#039;&#039;  [[Utility_Functions#Util.GetEntHealth|Util.GetEntHealth]]&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== GetEntName ====&lt;br /&gt;
&#039;&#039;&#039;See:&#039;&#039;&#039; &lt;br /&gt;
[[Bot Library#GetEntityName | GetEntityName]]&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== GetEntOwner ====&lt;br /&gt;
Gets the owner of an entity. Typically used for entities that can be held or carried.&lt;br /&gt;
&lt;br /&gt;
Note: If player who is carrying objective is kicked, GetEntOwner will return invalid entity till end of match. This bug is in all ET mods (except the last version of omnibot mod).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (GameEntity/GameId)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; GameId of owner, or null if none or error&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 owner = GetEntOwner(someent);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== GetEntPosition ====&lt;br /&gt;
Gets the world position of an entity.&lt;br /&gt;
&lt;br /&gt;
Note: old mods return wrong position (NoQuarter 1.2.5,  ETpub 0.9.0, Jaymod 2.1.7, ...).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (GameEntity/GameId)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; Vector3 world position, or null if error&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 p = GetEntPosition(someent);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== GetEntPowerups ====&lt;br /&gt;
Checks if the entity has one or more powerups. This function takes one or more powerups, and returns true if the entity has all of them.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (GameEntity/GameId, PowerUp, ...)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; true if the entity has all powerups.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 if(GetEntPowerups(someent, POWERUP.INVINCIBLE))&lt;br /&gt;
 {&lt;br /&gt;
 } &lt;br /&gt;
 if(GetEntPowerups(someent, POWERUP.QUADDAMAGE, POWERUP.BERSERK))&lt;br /&gt;
 {&lt;br /&gt;
 } &amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== GetEntRotationMatrix ====&lt;br /&gt;
Gets the Matrix3 full transform of an entity.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (GameEntity/GameId, Matrix3&amp;lt;optional&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
If you pass an Matrix3 as the 2nd parameter, that object will be filled in instead of a new Matrix3 returned. This can save memory allocations in a script that calls the function often by re-using the same object.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; true if Matrix3 passed as 2nd parameter and filled in successfully, if no Matrix3 provided, returns Matrix3 for entity. Both return null on an error.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 entMat = GetEntRotationMatrix(someent);&lt;br /&gt;
 if(entMat)&lt;br /&gt;
 {&lt;br /&gt;
      // do something&lt;br /&gt;
 }&lt;br /&gt;
 // re-use the same Matrix3 later&lt;br /&gt;
 if(GetEntRotationMatrix(someent, entMat))&lt;br /&gt;
 {&lt;br /&gt;
 } &amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== GetEntTeam ====&lt;br /&gt;
Gets the team id that the entity belongs to.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (GameEntity/GameId)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; Team Id of entity, or null if error&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 if(GetEntTeam(someent) == TEAM.RED)&lt;br /&gt;
 {&lt;br /&gt;
 }&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;See also:&#039;&#039;&#039; [[TEAM]]&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== GetEntVelocity ====&lt;br /&gt;
Gets the world velocity of an entity.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (GameEntity/GameId)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; Vector3 world velocity, or null if error&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 vel = GetEntVelocity(someent);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== GetEntWorldAABB ====&lt;br /&gt;
Gets the bounding box for an entity. The box is usually much bigger than the entity. Center of the box is not equal to entity position.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (GameEntity/GameId, AABB&amp;lt;optional&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
If you pass an AABB as the 2nd parameter, that object will be filled in instead of a new AABB returned. This can save memory allocations in a script that calls the function often by re-using the same object.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; true if AABB passed as 2nd parameter and filled in successfully, if no AABB provided, returns AABB for entity. Both return null on an error.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 entAABB = GetEntWorldAABB(someent);&lt;br /&gt;
 if(entAABB)&lt;br /&gt;
 {&lt;br /&gt;
      // do something&lt;br /&gt;
 }&lt;br /&gt;
 // re-use the same AABB later&lt;br /&gt;
 if(GetEntWorldAABB(someent, entAABB))&lt;br /&gt;
 {&lt;br /&gt;
 } &amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== GetEntityByName ====&lt;br /&gt;
Finds entity by target name. In ET you can use command &#039;&#039;&#039;/entitylist&#039;&#039;&#039; to see entity names.&lt;br /&gt;
&lt;br /&gt;
Unfortunately this functions can&#039;t find entities which have only script name, but don&#039;t have target name. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (name)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; GameEntity found, or null if none found&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== GetEntityInSphere ====&lt;br /&gt;
Finds an entity within a radius around a point that matches a particular class Id. It is set up so that it can be used in a loop to find all entities.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (Vector3 position, radius, classid, start entity)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; GameEntity found, or null if none found&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 p = Vector3(10,10,10);&lt;br /&gt;
 radius = 20;&lt;br /&gt;
 ent = GetEntityInSphere(p, radius, CLASS.ANYPLAYER, null);&lt;br /&gt;
 while(ent)&lt;br /&gt;
 {&lt;br /&gt;
     // do something with it?&lt;br /&gt;
     // get the next one found&lt;br /&gt;
     ent = GetEntityInSphere(p, radius, CLASS.ANYPLAYER, ent);&lt;br /&gt;
 }&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== GetEntityLocalSpace ====&lt;br /&gt;
Converts a world position into a local space position of a specified entity.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (GameEntity/GameId, Vector3 world position)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; Vector3 local space position, or null if error&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 worldpos = Vector3(10,10,10);&lt;br /&gt;
 localpos = GetEntityLocalSpace(someent, worldpos); &amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;See Also:&#039;&#039;&#039; &lt;br /&gt;
[[Bot Library#GetEntityWorldSpace | GetEntityWorldSpace]]&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== GetEntityName ====&lt;br /&gt;
Gets the name of an entity. In ET you can use command &#039;&#039;&#039;/entitylist&#039;&#039;&#039; to see all entity names.&lt;br /&gt;
&lt;br /&gt;
If entity has defined both script name and target name, GetEntityName returns script name.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (GameEntity/GameId)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; name of entity, or null if error&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 entName = GetEntityName(someent);&lt;br /&gt;
 if(entName == &amp;quot;SomeName&amp;quot;)&lt;br /&gt;
 {&lt;br /&gt;
      // do something&lt;br /&gt;
 }&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== GetEntityStat ====&lt;br /&gt;
Generic function for getting information about an entity, by name.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (GameEntity/GameId, stat name)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; stat, or null if error or stat doesn&#039;t exist. The type depends on the stat.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 kills = GetEntityStat(someent, &amp;quot;kills&amp;quot;);&lt;br /&gt;
 deaths = GetEntityStat(someent, &amp;quot;deaths&amp;quot;);&lt;br /&gt;
 xp = GetEntityStat(bot.GetGameEntity(), &amp;quot;xp&amp;quot;);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== GetEntityWorldSpace ====&lt;br /&gt;
Converts a local space position into a world space position of a specified entity.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (GameEntity/GameId, Vector3 local position)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; Vector3 world space position, or null if error&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 localpos = Vector3(10,10,10);&lt;br /&gt;
 worldpos = GetEntityWorldSpace(someent, localpos); &amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;See Also:&#039;&#039;&#039; &lt;br /&gt;
[[Bot Library#GetEntityLocalSpace | GetEntityLocalSpace]]&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== GetGameEntityFromId ====&lt;br /&gt;
Converts a GameId to a GameEntity.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (GameId)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; GameEntity&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 ent = GetGameEntityFromId(2); &amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;See Also:&#039;&#039;&#039; &lt;br /&gt;
[[Bot Library#GetGameIdFromEntity | GetGameIdFromEntity ]]&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== GetGameIdFromEntity ====&lt;br /&gt;
Converts a GameEntity to a GameId.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (GameEntity)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; GameId&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 id = GetGameIdFromEntity(someent); &amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;See Also:&#039;&#039;&#039; &lt;br /&gt;
[[Bot Library#GetGameEntityFromId | GetGameEntityFromId ]]&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== ExecCommand ===&lt;br /&gt;
This function executes a bot command as if it came from the games input console.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (command string)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 ExecCommand(&amp;quot;addbot 1 2&amp;quot;)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== ExecCommandOnClient ===&lt;br /&gt;
Executes a command for the entity. Usually equivilent to console commands.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (GameEntity/GameId, command string)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 ExecCommandOnClient(bot.GetGameEntity(), &amp;quot;setviewpos 1200 2300 150 0&amp;quot;);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== ExecScript ===&lt;br /&gt;
Attempts to execute a script file. File is searched in scripts folder, global_scripts folder or game folder (omni-bot/et).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (filename)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; true if successful, false if not&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 ExecScript(&amp;quot;myscript.gm&amp;quot;);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== GetClassNameFromId ===&lt;br /&gt;
Gets the current class name from a class id.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (classId)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; string&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== GetGameName ===&lt;br /&gt;
Gets the name of the currently running game.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; name of game&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 if(GetGameName() == &amp;quot;Enemy Territory&amp;quot;)&lt;br /&gt;
 {&lt;br /&gt;
 }&lt;br /&gt;
 else if(GetGameName() == &amp;quot;Quake 4&amp;quot;)&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;
=== GetGameState ===&lt;br /&gt;
Gets the current state of the game (Playing, Warm-up, Warm-up Countdown, Intermission, Waiting for Players, Paused, Invalid).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; name of game state&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 if(GetGameState() == &amp;quot;Playing&amp;quot;)&lt;br /&gt;
 {&lt;br /&gt;
 }&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== GetGameTimeLeft ===&lt;br /&gt;
Gets the current amount of time remaining in the game round.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; time left, in seconds&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 if(GetGameTimeLeft() &amp;lt; 30)&lt;br /&gt;
 {&lt;br /&gt;
 }&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== GetGoal ===&lt;br /&gt;
Gets a reference to a map goal by name. The goal name is case sensitive.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (name of map goal to get)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; MapGoal if found, null if not&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 mg = GetGoal(&amp;quot;MAP_FLAG_redflag&amp;quot;);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;See Also:&#039;&#039;&#039; &lt;br /&gt;
[[MapGoal]]&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== GetGoals ===&lt;br /&gt;
Gets any number of map goals that match a regular expression. Stores the matching reference in the first table parameter. The previous table content is cleared since omni-bot 0.84. It&#039;s not possible to call GetGoals multiple times to accumulate results. The last optional parameter is table of parameters to filter result (Group, Role,  SkipNoInProgress, SkipNoInUse, SkipInUse) or sort result (parameter Sort, values are &amp;quot;none&amp;quot;, &amp;quot;priority&amp;quot;, &amp;quot;name&amp;quot;, &amp;quot;priority_name&amp;quot;, &amp;quot;random&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (table, team, expression, params[optional])&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 goals = {};&lt;br /&gt;
 GetGoals(goals, TEAM.AXIS, &amp;quot;FLAG.*&amp;quot;, { Sort=&amp;quot;priority&amp;quot; });&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;See Also:&#039;&#039;&#039; &lt;br /&gt;
[[Utility_Functions#Util.GoalTable|Util.GoalTable]], [[Bot Library#GetGoal| GetGoal]]&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== GetGravity ===&lt;br /&gt;
Gets the current gravity of the game.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; gravity&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 grav = GetGravity();&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== GetLocalAABB ===&lt;br /&gt;
Gets bounding box of local player.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; AABB &lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== GetLocalAimNormal ===&lt;br /&gt;
Gets normal at aim position of local player.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (collision mask[optional, default floodfill])&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; Vector3&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== GetLocalAimPosition ===&lt;br /&gt;
Gets aim position of local player.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (collision mask[optional, default floodfill])&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; Vector3&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== GetLocalEntity ===&lt;br /&gt;
Gets local player.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; GameEntity&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== GetLocalEyePosition ===&lt;br /&gt;
Gets eye position of local player.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; Vector3&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== GetLocalCommand ===&lt;br /&gt;
Gets name of just running console command. It is useful if you use same script for multiple commands.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; string or null &lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
=== GetLocalFacing ===&lt;br /&gt;
Gets facing vector of local player.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; Vector3&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== GetLocalGroundPosition ===&lt;br /&gt;
Gets ground position of local player.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; Vector3 or null&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== GetLocalPosition ===&lt;br /&gt;
Gets position of local player.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; Vector3&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== GetMapExtents ===&lt;br /&gt;
Gets the AABB map extents. Map extends are the bounds of the entire map.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (AABB&amp;lt;optional&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; If no AABB passed as parameter, function will return the map AABB, otherwise the AABB parameter will be filled in with the results, and the function will return nothing.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 aabb = GetMapExtents();&lt;br /&gt;
 // or&lt;br /&gt;
 AABB aabb;&lt;br /&gt;
 GetMapExtents(aabb);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== GetMapName ===&lt;br /&gt;
Get the name of the current map.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; name of map&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 if(GetMapName() == &amp;quot;oasis&amp;quot;)&lt;br /&gt;
 {&lt;br /&gt;
 }&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== GetModName ===&lt;br /&gt;
Gets the name of the currently running mod.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; name of mod&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 if(GetModName() == &amp;quot;etpub&amp;quot;)&lt;br /&gt;
 {&lt;br /&gt;
 }&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== GetModVersion ===&lt;br /&gt;
Gets the version of the current mod.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; version of mod&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 if(GetModVersion() == &amp;quot;DOOM 1.3&amp;quot;)&lt;br /&gt;
 {&lt;br /&gt;
 }&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== GetNearestNonSolid ===&lt;br /&gt;
This function is similar to TraceLine, but ignores solids.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (start, end, trace mask[optional])&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; position&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== GetPointContents ===&lt;br /&gt;
Gets the contents bits for a given position.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (Vector3 position)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; contents bits. Use bitwise manipulators along with constants from the global [[CONTENT]] table to check for specific content bits.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 contents = GetPointContents(Vector3(10,10,10));&lt;br /&gt;
 if(contents &amp;amp; CONTENT.WATER)&lt;br /&gt;
 {&lt;br /&gt;
 }&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== GetTeamStat ===&lt;br /&gt;
Generic function for getting information about a team, by name. It&#039;s not implemented in ET.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (Team Id, stat name)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; stat, or null if error or stat doesn&#039;t exist. The type depends on the stat.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 score = GetTeamStat(TEAM.RED, &amp;quot;score&amp;quot;);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== GetTime ===&lt;br /&gt;
Gets the current time elapsed in the game.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; time, in seconds&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 if(GetTime() &amp;gt; 30)&lt;br /&gt;
 {&lt;br /&gt;
 }&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== GetWeapon ===&lt;br /&gt;
Gets weapon object by ID.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (weaponId)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; [[Weapon]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== GetWeaponIdFromClassId ===&lt;br /&gt;
Converts classId to weaponId.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (classId)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; weaponId&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== GroundPoint ===&lt;br /&gt;
Returns a point on the ground directly below the provided point.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (position)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; ground position&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== KickAll ===&lt;br /&gt;
Kicks all bots from the game.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 KickAll();&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== KickBot ===&lt;br /&gt;
Kicks a bot by name.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (name)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 KickBot(&amp;quot;Fred&amp;quot;);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== KickBotFromTeam ===&lt;br /&gt;
Kicks last bot from team.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (teamId)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 KickBot(TEAM.AXIS);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== MoveBotToAnotherTeam ===&lt;br /&gt;
Moves a bot from a team to another team.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (source teamId, destination teamId)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== OnTrigger ===&lt;br /&gt;
Registers a script function callback for a given trigger string.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (trigger string, script function)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 global Map =&lt;br /&gt;
 {&lt;br /&gt;
  myfunc = function(trigger)&lt;br /&gt;
  {&lt;br /&gt;
    direction = ToVector(trigger.Action);&lt;br /&gt;
    entityName = GetEntName(trigger.Entity);&lt;br /&gt;
  }&lt;br /&gt;
 };&lt;br /&gt;
 global OnMapLoad = function()&lt;br /&gt;
 { &lt;br /&gt;
  OnTrigger( &amp;quot;cargo_lift_goto&amp;quot;, Map.myfunc);&lt;br /&gt;
 };&lt;br /&gt;
 &amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;See Also:&#039;&#039;&#039; &lt;br /&gt;
[[Triggers]]&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== OnTriggerRegion===&lt;br /&gt;
Creates one of several types of trigger regions. A trigger region is an area that watches for entities of certain types to touch them and calls script callback functions for enter and exit. Useful if you want an easy way to be notified when certain entities go to certain areas of the map.&lt;br /&gt;
&lt;br /&gt;
This function takes a table as the last parameter to define a number of flexible options for the trigger region. Here is a list of available key/value options for the table.&lt;br /&gt;
* Name - Optional name to give the region. Does not need to be unique.&lt;br /&gt;
* OnEnter - script function to call when an entity touches the region.&lt;br /&gt;
* OnExit - script function to call when an entity stops touching the region.&lt;br /&gt;
* TriggerOnClass - Define the class id you want the region to trigger on. This field may also be an indexed table with up to 8 class ids.&lt;br /&gt;
* TriggerOnCategory - Category of entities to watch for. This field may also be an indexed table with as many categories as you want to limit the trigger to.&lt;br /&gt;
* TriggerOnEntity - A specific entity to trigger on. This field may also be an indexed table with up to 8 entities you want to limit the trigger to.&lt;br /&gt;
&lt;br /&gt;
The following region types are supported. The type is dependent on which parameters of the function are used.&lt;br /&gt;
* AABB - Axis aligned bounding box.&lt;br /&gt;
* Sphere - A radius around a position.&lt;br /&gt;
&lt;br /&gt;
Triggers may be rendered for reference with &#039;&#039;/bot drawtriggers 1&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (AABB, table)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (position, radius, table)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; unique serial number of region&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 // creates a sphere trigger 256 units in radius around 0,0,0&lt;br /&gt;
 triggerInfo =&lt;br /&gt;
 {&lt;br /&gt;
 	Name=&amp;quot;TestTrigger&amp;quot;,&lt;br /&gt;
 	TriggerOnClass=CLASS.ANYPLAYER,&lt;br /&gt;
 	OnEnter = function(ent)&lt;br /&gt;
 	{&lt;br /&gt;
 		print(GetEntName(ent),&amp;quot;entered aabb trigger&amp;quot;);&lt;br /&gt;
 	},&lt;br /&gt;
 	OnExit = function(ent)&lt;br /&gt;
 	{&lt;br /&gt;
 		print(GetEntName(ent),&amp;quot;exited aabb trigger&amp;quot;);&lt;br /&gt;
 	},&lt;br /&gt;
 };&lt;br /&gt;
 serial = OnTriggerRegion(Vector3(0,0,0),256,triggerInfo);&lt;br /&gt;
 &amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;See Also:&#039;&#039;&#039; &lt;br /&gt;
[[Bot Library#DeleteTriggerRegion| DeleteTriggerRegion]]&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== RegisterDefaultProfile ===&lt;br /&gt;
Registers a default profile that will be loaded for any bot that joins a specified class.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (Class Id, script name)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 RegisterDefaultProfile(CLASS.SOLDIER, &amp;quot;def_bot.gm&amp;quot;);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== ReloadGoalScripts ===&lt;br /&gt;
Executes all goal scripts. You must also kick all bots because any changes will be applied to newly added bots.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== RunScript ===&lt;br /&gt;
&#039;&#039;&#039;See:&#039;&#039;&#039; &lt;br /&gt;
[[Bot Library#ExecScript| ExecScript]]&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== SendTrigger ===&lt;br /&gt;
It is used by goal scripts to call function in map script.&lt;br /&gt;
Parameter TagName is string which must be same as the first parameter of function [[Bot Library#OnTrigger|OnTrigger]].&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; ( { TagName, Entity, Activator, Action } )&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
SendTrigger({&lt;br /&gt;
 Entity = ent,&lt;br /&gt;
 Activator = null,&lt;br /&gt;
 TagName = GetEntName(ent) + &amp;quot; at location&amp;quot;,&lt;br /&gt;
 Action = &amp;quot;arrived&amp;quot;&lt;br /&gt;
});&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== ServerCommand ===&lt;br /&gt;
Executes a server command. Requires cheats to be enabled.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; true if cheats are enabled, false if not&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 ServerCommand(&amp;quot;map oasis&amp;quot;);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;See Also:&#039;&#039;&#039; &lt;br /&gt;
[[Bot Library#CheatsEnabled | CheatsEnabled ]]&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== ServerScriptFunction ===&lt;br /&gt;
Not implemented in ET.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (entity name, function name, parameters[optinal])&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== SetAvailableMapGoals ===&lt;br /&gt;
Enables/Disables the available status of one or more map goals that match a regular expression, for a specific team.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (Team Id, enable/disable, mapgoal expression string)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (Team Id, enable/disable, table of mapgoal expressions) (added in 0.84)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; number of goals that match regular expression&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 SetAvailableMapGoals( TEAM.ALLIES, false, &amp;quot;ATTACK.*&amp;quot; );&lt;br /&gt;
 SetAvailableMapGoals( TEAM.AXIS, true, { &amp;quot;DEFEND_gate.*&amp;quot;, &amp;quot;MOUNTMG42_bunker&amp;quot;, &amp;quot;SNIPE_tower.*&amp;quot; } );&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;See Also:&#039;&#039;&#039; &lt;br /&gt;
[[Availability]], [[Bot Library#GetGoal| GetGoal]], [[Bot Library#GetGoals| GetGoals]]&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== SetGoalGroup ===&lt;br /&gt;
Sets the goal or table of goals group name.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (goalname or table, groupname)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 SetGoalGroup( &amp;quot;SomeGoalName&amp;quot;, &amp;quot;SomeGroupName&amp;quot; );&lt;br /&gt;
 SetGoalGroup( { &amp;quot;ROUTE_route1&amp;quot;, &amp;quot;ROUTE_route2&amp;quot;, &amp;quot;someothergoal&amp;quot; }, &amp;quot;MyGroup&amp;quot; );&lt;br /&gt;
 &amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;See Also:&#039;&#039;&#039; &lt;br /&gt;
[[Utility Functions#Util.DisableGroup| Util.DisableGroup]],&lt;br /&gt;
[[Utility Functions#Util.EnableGroup| Util.EnableGroup]],&lt;br /&gt;
[[Utility Functions#Util.GetGroup| Util.GetGroup]],&lt;br /&gt;
[[Utility Functions#Util.SetGroup| Util.SetGroup]],&lt;br /&gt;
[[Utility Functions#Util.ShowGroup| Util.ShowGroup]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== SetGoalPriority===&lt;br /&gt;
Sets priority of one or more MapGoals for specified team and class. The last parameter must be true for dynamically created goals (FLAG_dropped, FLAGRETURN, DEFUSE ...).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (expression or table, priority, teamId[optional, default 0], classId[optional, default 0], persistent[optional])&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 example: SetGoalPriority( &amp;quot;FLAG_Gold&amp;quot;, 0.7 ); //all teams and all classes&lt;br /&gt;
 example: SetGoalPriority( &amp;quot;CHECKPOINT_City&amp;quot;, 0.8, TEAM.AXIS); //axis only all classes&lt;br /&gt;
 example: SetGoalPriority( &amp;quot;DEFUSE_somedyno.*&amp;quot;, 0.0, TEAM.AXIS, CLASS.ENGINEER, true ); //the persistent parameter is used for dynamic goals that may not have been created yet &amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;See Also:&#039;&#039;&#039; [[Priority]]&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== SetGoalRole ===&lt;br /&gt;
Sets one or more roles of one or more MapGoals. The last parameter must be true for dynamically created goals (FLAG_dropped, FLAGRETURN, DEFUSE ...).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (expression or table, role or table, persistent[optional])&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 example: SetGoalRole( &amp;quot;FLAG_Gold&amp;quot;, ROLE.ATTACKER ); //1 goal, 1 role&lt;br /&gt;
 example: SetGoalRole( &amp;quot;DEFEND_City[4567]&amp;quot;, { ROLE.DEFENDER2, ROLE.DEFENDER3}); //4 goals, 2 roles&lt;br /&gt;
 example: SetGoalRole( &amp;quot;DEFUSE_somedyno.*&amp;quot;, ROLE.DEFENDER2, true ); //the persistent parameter is used for dynamic goals that may not have been created yet &amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;See Also:&#039;&#039;&#039; [[Roles]]&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== SetMapGoalProperties===&lt;br /&gt;
Passes a table full of properties along to all matching map goals to attempt to set their properties.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (expression or table, table of properties)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 // Set the camp time for all attack and defend goals&lt;br /&gt;
 SetMapGoalProperties( &amp;quot;ATTACK_.*&amp;quot;, {mincamptime=15, maxcamptime=30});&lt;br /&gt;
 SetMapGoalProperties( &amp;quot;DEFEND_.*&amp;quot;, {mincamptime=15, maxcamptime=30});&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;See Also:&#039;&#039;&#039; &lt;br /&gt;
[[Goal specific instructions]] for a list of properties for each map goal type.&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== TraceLine ===&lt;br /&gt;
Performs a traceline collision test, and returns the results in a table. TraceLine calls are useful for testing visibility, line of sight, or for getting a collision point along a line.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (Vector3 start, Vector3 end, AABB, collision mask, ignore user GameId, use PVS)&lt;br /&gt;
&lt;br /&gt;
* Vector3 start - Start position of trace line.&lt;br /&gt;
* Vector3 end - End position of trace line.&lt;br /&gt;
* AABB - Pass an AABB if you with the line to have volume, otherwise pass null.&lt;br /&gt;
* Collision Mask - Mask of collision types to test. See global [[TRACE]] table.&lt;br /&gt;
* GameId - Ignore this GameId in the traceline. Usually the entity or bot it originates from.&lt;br /&gt;
* UsePVS - true to use PVS (Potentially visible set), false to ignore PVS&lt;br /&gt;
&lt;br /&gt;
Always pass false to not UsePVS if you need collision information from the call to TraceLine. UsePVS=true is useful when all you need to know is whether or not something is blocking the path from start to end, it will not give you the collision position. It is slightly faster in most cases to use PVS as an early out test, but doing so limits the amount of useful information you get back from the function. In many cases you don&#039;t need this information, so the extra speed is useful.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; table of results&lt;br /&gt;
&lt;br /&gt;
Results table contains the following information.&lt;br /&gt;
* fraction - 0.0 to 1.0 The ratio along the line the collision took place. Not always valid if UsePVS=true. Example: 0.5 means ray hit half way between the start and end.&lt;br /&gt;
* startsolid - true/false The traceline started inside a solid object. Not always valid if UsePVS=true&lt;br /&gt;
&lt;br /&gt;
Additional properties are available if UsePVS=false and there was a collision.&lt;br /&gt;
* entity - May be null, the GameEntity that was hit in the collision.&lt;br /&gt;
* normal - The Vector3 normal of the collision point.&lt;br /&gt;
* end - The Vector3 world position of the collision.&lt;br /&gt;
* contents - water etc., see global [[CONTENT]] table.&lt;br /&gt;
* surface - ice, ladder, see global [[SURFACE]] table.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 // Do a traceline along a bots facing 1024 units out&lt;br /&gt;
 start = b.GetEyePosition();&lt;br /&gt;
 end = start + b.GetFacing() * 1024;&lt;br /&gt;
 tr = TraceLine(start, end, null, TRACE.SHOT, b.GetGameId(), false);&lt;br /&gt;
&lt;br /&gt;
 // the fraction value tells us of a collision or not. If it&#039;s 1, there was no collision. If less than 1 there was a collision.&lt;br /&gt;
 if(tr.fraction &amp;lt; 1)&lt;br /&gt;
 {&lt;br /&gt;
     // tr.startsolid&lt;br /&gt;
     // tr.entity&lt;br /&gt;
     // tr.normal&lt;br /&gt;
     // tr.end&lt;br /&gt;
     // tr.contents&lt;br /&gt;
     // tr.surface&lt;br /&gt;
 }&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== Enemy Territory Addendum ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== GetCabinetData ===&lt;br /&gt;
Gets information about health or ammo cabinet. Properties CurrentAmount, MaxAmount, Rate are stored into table.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (entity, table)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; true if successful, null if not&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
cab = {};&lt;br /&gt;
if (GetCabinetData( GetGoal(&amp;quot;AMMOCAB_north&amp;quot;).GetEntity(), cab)){&lt;br /&gt;
	print( cab.CurrentAmount );&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== GetCvar ===&lt;br /&gt;
Gets a game cvar. Returns zero if the cvar does not exists or if its value cannot be converted to integer.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (name)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; integer&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
friendlyFire = GetCvar(&amp;quot;g_friendlyfire&amp;quot;);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== GetGameType ===&lt;br /&gt;
Gets the current game type:&lt;br /&gt;
&lt;br /&gt;
2 - single-map objective, 3 - stopwatch, 4 - campaign, 5 - last man standing&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; integer&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== IsWaitingForMedic ===&lt;br /&gt;
Deprecated.&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== SetCvar ===&lt;br /&gt;
Sets a game cvar.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (name, value)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; true if successful, false if not &lt;br /&gt;
----&lt;/div&gt;</summary>
		<author><name>Palota</name></author>
	</entry>
	<entry>
		<id>https://mygamingtalk.com/wiki/index.php?title=ScriptGoal&amp;diff=1765</id>
		<title>ScriptGoal</title>
		<link rel="alternate" type="text/html" href="https://mygamingtalk.com/wiki/index.php?title=ScriptGoal&amp;diff=1765"/>
		<updated>2025-05-25T16:31:46Z</updated>

		<summary type="html">&lt;p&gt;Palota: /* MarkInProgress */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{process header&lt;br /&gt;
 | title    = Script Goal&lt;br /&gt;
 | section  =&lt;br /&gt;
 | previous = [[Omni-bot_Script_Reference | Script Reference]]&lt;br /&gt;
 | next     = &lt;br /&gt;
 | shortcut =&lt;br /&gt;
 | notes    =&lt;br /&gt;
}}&lt;br /&gt;
{{TOCright}}&lt;br /&gt;
[[Category:ET|Script Goals]]&lt;br /&gt;
[[Category:Doom 3|Script Goals]]&lt;br /&gt;
[[Category:Quake 4|Script Goals]]&lt;br /&gt;
[[Category:RTCW|Script Goals]]&lt;br /&gt;
&lt;br /&gt;
==ScriptGoal Properties==&lt;br /&gt;
===Name===&lt;br /&gt;
The name of the script goal. Important for other scripts to refer to by name, and the name it is displayed under in the [[Debug Window]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;this.Name = &amp;quot;MyGoalName&amp;quot;;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Parent===&lt;br /&gt;
The name of the parent goal. This should be set up once in the script and left alone. It controls where in the behavior tree the goal is inserted. The location of the goal in the state tree effects how it is evaluated.&lt;br /&gt;
&lt;br /&gt;
Users should stick to one of the following 2 parents.&lt;br /&gt;
* HighLevel - Puts the goal under the HighLevel parent. Because the goal is under the HighLevel state, only one state at a time can run. This is useful for goals that take control of the bot, that shouldn&#039;t be interrupted by other script goals or built in goals.&lt;br /&gt;
* LowLevel - Puts the goal under the LowLevel parent. All states under the LowLevel state are run simultaneously, and so is a good location for scripts that control things that don&#039;t necessarily take total control over the bot, or don&#039;t wish to interrupt the execution of other goals. Some examples might be calling for medic, calling for ammo, most communication scripts.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;this.Parent = &amp;quot;HighLevel&amp;quot;;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===InsertBefore===&lt;br /&gt;
It controls where in the behavior tree the goal is inserted. InsertBefore property is ignored if Parent has been set. &lt;br /&gt;
&lt;br /&gt;
===InsertAfter===&lt;br /&gt;
It controls where in the behavior tree the goal is inserted. InsertAfter property is ignored if Parent or InsertBefore has been set. &lt;br /&gt;
&lt;br /&gt;
===Disable===&lt;br /&gt;
Enables/Disables the goal for consideration. The goal will no longer be considered for execution. Disabled goals have specific coloring in the [[Debug Window]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;this.Disable = true;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===AimVector===&lt;br /&gt;
This Vector3 is used by any active aim request the script goal has registered. You usually do not need to use this property directly, because function AddAimRequest sets this property.&lt;br /&gt;
&lt;br /&gt;
===AlwaysRecieveEvents===&lt;br /&gt;
Normally goals receive events only when active. Setting this to true will allow the goal to receive events even when it&#039;s not running. This is useful for when you want to have the goal sit idle and only activate when receiving a certain event, or you want to track and store information in the goal from events.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;this.AlwaysRecieveEvents = true;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Events===&lt;br /&gt;
Accesses the Events table of the goal, in order to set up script functions that will be called when the bot receives events. By default, goals only receive events when they are active. This can be overridden with [[ScriptGoal#AlwaysRecieveEvents| AlwaysRecieveEvents]], which will allow goals to receive events even when not active.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 this.Events[EVENT.FEEL_PAIN] = function(Inflictor, PreviousHealth, CurrentHealth)&lt;br /&gt;
 {&lt;br /&gt;
   whoDoneIt = GetEntName(Inflictor);&lt;br /&gt;
   print( format(&amp;quot;%s: %s Hurt me: Was %d, now %d&amp;quot;, &lt;br /&gt;
    this.Bot.GetName(), whoDoneIt, PreviousHealth, CurrentHealth) );&lt;br /&gt;
 };&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Bot===&lt;br /&gt;
This provides an accessor to the bot that is running the goal. The &#039;this&#039; within script goals is always the script goal itself, so in the frequent case of needing to access the bot, use this property.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;this.Bot.Say(&amp;quot;Wassup&amp;quot;);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Priority===&lt;br /&gt;
Priority is a property rather than a return value of [[ScriptGoal#GetPriority| GetPriority]] in order to support the useful threading nature of script goals. It is possible to completely leave out a [[ScriptGoal#GetPriority| GetPriority]] function, and set the priority through this property somewhere else, such as in an event callback. This property will automatically be reset internally when the state exits, to prevent a script goal from activating in a loop from the user forgetting to reset the Priority.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;this.Priority = 1;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SkipGetPriorityWhenActive===&lt;br /&gt;
Set SkipGetPriorityWhenActive to true if function GetPriority should not be called while the goal is active.&lt;br /&gt;
&lt;br /&gt;
===GetPriorityDelay===&lt;br /&gt;
Delay in seconds between GetPriority calls. Default is 0.&lt;br /&gt;
&lt;br /&gt;
===MapGoal===&lt;br /&gt;
Current MapGoal or null if the script goal is not active. This property is not set automatically. You must assign map goal to this property in GetPriority and clear it in Exit.&lt;br /&gt;
&lt;br /&gt;
===AutoReleaseAim===&lt;br /&gt;
Function ReleaseAimRequest is automatically called in Exit. Default is true.&lt;br /&gt;
&lt;br /&gt;
===AutoReleaseWeapon===&lt;br /&gt;
Function ReleaseWeaponRequest is automatically called in Exit. Default is true.&lt;br /&gt;
&lt;br /&gt;
===AutoReleaseTrackers===&lt;br /&gt;
Function Trackers::Reset is automatically called in Exit. Default is true.&lt;br /&gt;
&lt;br /&gt;
===AutoFinishOnUnAvailable===&lt;br /&gt;
The goal is automatically finished if current MapGoal is not available. Default is true.&lt;br /&gt;
&lt;br /&gt;
===AutoFinishOnNoProgressSlots===&lt;br /&gt;
The goal is automatically finished if MarkInProgress has not been called yet and MapGoal has no TRACK_INPROGRESS slots available. Default is true.&lt;br /&gt;
&lt;br /&gt;
===AutoFinishOnNoUseSlots===&lt;br /&gt;
The goal is automatically finished if MarkInUse has not been called yet and MapGoal has no TRACK_INUSE slots available. Default is true.&lt;br /&gt;
&lt;br /&gt;
===AutoAdd===&lt;br /&gt;
Set AutoAdd to false if the script should not be loaded for every map, because it&#039;s deprecated or used only for debugging (RideTram, TestEvents, ...).&lt;br /&gt;
&lt;br /&gt;
===DebugString===&lt;br /&gt;
Debug strings are displayed if you use command &amp;quot;/bot debugbot all fpinfo&amp;quot; and then spectate bots. If DebugString is null, MapGoal name is displayed.&lt;br /&gt;
&lt;br /&gt;
===Debug===&lt;br /&gt;
Set this property at the beginning of gm file so that all your debug messages or debug drawing can be easily enabled or disabled.&lt;br /&gt;
&lt;br /&gt;
===Commands===&lt;br /&gt;
Table of console commands which are executed on the script goal for every bot.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 this.Commands[&amp;quot;command_name&amp;quot;] = {&lt;br /&gt;
  Func = function( _params )&lt;br /&gt;
  { &lt;br /&gt;
  },&lt;br /&gt;
  Help = { &amp;quot;description&amp;quot; },&lt;br /&gt;
 };&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==ScriptGoal Callbacks==&lt;br /&gt;
These functions are available only in 0.7 and later.&lt;br /&gt;
&lt;br /&gt;
===Initialize===&lt;br /&gt;
This function is called exactly once per bot, when the bot is added and initialized. It is typically used to perform one time initialization code.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 this.Initialize() = function()&lt;br /&gt;
 {&lt;br /&gt;
 };&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===OnSpawn===&lt;br /&gt;
This function is called every time the bot spawns. Spawning in Omni-bot means any time the bot re-enters his Main active state. This could mean an actual respawn, a revival from an incapacitated state, or something similar.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 this.OnSpawn() = function()&lt;br /&gt;
 {&lt;br /&gt;
 };&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===GetPriority===&lt;br /&gt;
This function is most often the place to evaluate whether you want the script goal to run. Take care in the complexity of the code here, as it is called pretty often, and can be a source of considerable performance overhead.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 this.GetPriority() = function()&lt;br /&gt;
 {&lt;br /&gt;
 };&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===Enter===&lt;br /&gt;
This function is called when a state is chosen to run, right before it begins running. This function is only called once when the state enters, and will not be called again until the state is exited.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 this.Enter() = function()&lt;br /&gt;
 {&lt;br /&gt;
 };&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;See Also:&#039;&#039;&#039; &lt;br /&gt;
[[ScriptGoal#Exit| Exit]]&lt;br /&gt;
----&lt;br /&gt;
===Exit===&lt;br /&gt;
This function is called when a state finishes running, or is overridden by a higher priority state. It is often used to release aim or weapon requests that were used by the goal.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 this.Exit() = function()&lt;br /&gt;
 {&lt;br /&gt;
 };&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;See Also:&#039;&#039;&#039; &lt;br /&gt;
[[ScriptGoal#Enter| Enter]]&lt;br /&gt;
----&lt;br /&gt;
===Update===&lt;br /&gt;
This function is the meat of a script goal. Once a goal is chosen to run, and [[ScriptGoal#Enter| Enter]] is called, the Update function begins getting called at frequent regular intervals. The state stays active until another goal overrides it, or until [[ScriptGoal#Finished| Finished]] is called, after which the [[ScriptGoal#Exit| Exit]] function is called.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 this.Update() = function()&lt;br /&gt;
 {&lt;br /&gt;
   // do stuff&lt;br /&gt;
   this.Finished(); // when we&#039;re done running&lt;br /&gt;
 };&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;See Also:&#039;&#039;&#039; &lt;br /&gt;
[[ScriptGoal#Enter| Enter]], [[ScriptGoal#Exit| Exit]]&lt;br /&gt;
----&lt;br /&gt;
===OnPathThrough===&lt;br /&gt;
This function is called if bot comes to waypoint which has paththrough property set and its value is goalName:data.&lt;br /&gt;
Paththrough is activated if OnPathThrough function returns true.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 this.OnPathThrough = function(data)&lt;br /&gt;
 {&lt;br /&gt;
  navigation = Map.Navigation[data];&lt;br /&gt;
  if(navigation)&lt;br /&gt;
  {&lt;br /&gt;
   this.CurrentNavigation = data;&lt;br /&gt;
   return true;&lt;br /&gt;
  }&lt;br /&gt;
  this.CurrentNavigation = null;&lt;br /&gt;
  return false;&lt;br /&gt;
 };&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==ScriptGoal Functions==&lt;br /&gt;
These functions are available only in 0.7 and later.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===AddFinishCriteria===&lt;br /&gt;
Finish Criteria are expressions set up from script that will be evaluated constantly in the code and when they are satisfied will cause the script goal to abort. These are useful when your script does alot of asynchronous operations(like Goto), but you want a way to abort the script goal, even if the main update script happens to be in an asynchronous or blocked call, sleep or yield.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (subject, expression, value[optional])&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (expression, value[optional])&lt;br /&gt;
&lt;br /&gt;
====Subject====&lt;br /&gt;
Subject must be an entity, if no entity is provided as the first parameter, it is assumed that the 2nd version of the function is called, which takes only and expression and an optional value. The need for a value is determined by what the expression actually is.&lt;br /&gt;
&lt;br /&gt;
====Expression====&lt;br /&gt;
Expression is a string containing 1 or more keywords that use a natural syntax for defining the conditions of the criteria. Additionally, some keywords expect an operator to be defined&lt;br /&gt;
{| align=&amp;quot;center&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!Keyword&lt;br /&gt;
!Operator Required&lt;br /&gt;
!Value&lt;br /&gt;
|-&lt;br /&gt;
|deleted&lt;br /&gt;
|No&lt;br /&gt;
|entity&lt;br /&gt;
|-&lt;br /&gt;
|health&lt;br /&gt;
|Yes&lt;br /&gt;
|health value to compare against(float or int)&lt;br /&gt;
|-&lt;br /&gt;
|hasentflag&lt;br /&gt;
|No&lt;br /&gt;
|entity flag to compare against. use not to negate test&lt;br /&gt;
|-&lt;br /&gt;
|weaponcharged&lt;br /&gt;
|No&lt;br /&gt;
|weapon Id(integer)&lt;br /&gt;
|-&lt;br /&gt;
|weaponequipped&lt;br /&gt;
|No&lt;br /&gt;
|weapon Id(integer)&lt;br /&gt;
|-&lt;br /&gt;
|weaponhasammo&lt;br /&gt;
|No&lt;br /&gt;
|weapon Id(integer)&lt;br /&gt;
|-&lt;br /&gt;
|velocity&lt;br /&gt;
|Yes&lt;br /&gt;
|vector3 velocity to compare against, OR float magnitude of velocity to compare against(speed)&lt;br /&gt;
|-&lt;br /&gt;
|mapgoalavailable&lt;br /&gt;
|No&lt;br /&gt;
|MapGoal object or name&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Valid Operators=====&lt;br /&gt;
* lessthan&lt;br /&gt;
* &amp;lt;&lt;br /&gt;
* greaterthan&lt;br /&gt;
* &amp;gt;&lt;br /&gt;
* equals&lt;br /&gt;
* ==&lt;br /&gt;
&lt;br /&gt;
In addition, some expressions can contain negation keywords in order to check for the negative of an expression, such as&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 this.AddFinishCriteria(this.TargetEntity,&amp;quot;not hasentflag&amp;quot;,ENTFLAG.DEAD); // as soon as the entity does not have the dead flag&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; true if criteria was created, false if not&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 this.AddFinishCriteria(this.TargetEntity,&amp;quot;deleted&amp;quot;); // finish the goal of the target is deleted&lt;br /&gt;
 this.AddFinishCriteria(this.TargetEntity,&amp;quot;health lessthan&amp;quot;,1); // or if they are dead(health &amp;lt;= 1)&lt;br /&gt;
 this.AddFinishCriteria(this.TargetEntity,&amp;quot;hasentflag&amp;quot;,ENTFLAG.LIMBO); // or if they tap out&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===ClearFinishCriteria===&lt;br /&gt;
Deletes finish criteria.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (clearpersistent[optional, default false])&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===Finished===&lt;br /&gt;
Notifies the goal that it is finished running. This function is normally called from the Update function when the goal is desired to finish.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (none)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 this.Finished();&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===LimitTo===&lt;br /&gt;
This function limits script execution based on a true value being returned from a user defined function. This function is useful if scripts should only be run based on some external logic; like a Map variable setting.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (function, delay, onlyactive[optional - default false])&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
LimitTo functions are script functions that are called at user defined intervals that can be used to update from script whether or not the script goal should be able to run or not. Returning false from this function effectively blocks the script goals ability to activate. It will remain in this state as long as the LimitTo function is defined. The 2nd parameter controls how often the callback is performed. Calling script functions too often can adversely effect performance, so it is recommended to choose a delay that is as infrequently as you can get away with. The &#039;onlyactive&#039; parameter is optional and defaults to false. If this parameter is set to true, the LimitTo function callback will ONLY be performed when the script goal is active. By default the LimitTo function will be called whether the goal is active or not, and returning false will prevent the goal from being able to activate. Passing true as the &#039;onlyactive&#039; flag means the goal can activate, and only then is the LimitTo function called. This is useful when you need to check more information regarding specific targets of the goal to validate whether the goal should continue running. This callback is effectively a way to define your own finish criteria. It is recommended that you only use LimitTo callbacks when FinishCriteria can&#039;t be used, since FinishCriteria are much faster and don&#039;t involve frequent calls into script. LimitTo functions might commonly be used to check the status of a map goal or some other world state that the goal relies on.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 //This function is typically set up in this.Initialize()&lt;br /&gt;
 this.LimitTo(Map.SomeFunction, 1.0); //Call Map.SomeFunction every second&lt;br /&gt;
 this.LimitTo(NULL); //clear the function&lt;br /&gt;
  &lt;br /&gt;
 //The script goal object is referenced in the passed function as &#039;this&#039;&lt;br /&gt;
 Map.SomeFunction = function()&lt;br /&gt;
 {&lt;br /&gt;
      if ( Map.SomeVariable == false )&lt;br /&gt;
          { this.Disable; } //disable the script&lt;br /&gt;
      else&lt;br /&gt;
          { return true; } //allow the script to run&lt;br /&gt;
 };&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===LimitToClass===&lt;br /&gt;
This function will only allow the script goal to be created if the owning bot is one of the classes provided. This is much more efficient than checking class in script in common cases where a goal only applies to a certain class of bot.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (classId, ...) Any number of class Ids&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 // This function can take any number of parameters.&lt;br /&gt;
 this.LimitToClass(CLASS.MEDIC);&lt;br /&gt;
 this.LimitToClass(CLASS.MEDIC, CLASS.ENGINEER);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===LimitToNoClass===&lt;br /&gt;
This function will only allow the script goal to be created if the owning bot is NOT one of the classes provided. This is much more efficient than checking class in script in common cases where a goal only applies to a certain class of bot.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (classId, ...) Any number of class Ids&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 // This function can take any number of parameters.&lt;br /&gt;
 this.LimitToNoClass(CLASS.MEDIC);&lt;br /&gt;
 this.LimitToNoClass(CLASS.MEDIC, CLASS.ENGINEER);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
===LimitToTeam===&lt;br /&gt;
This function will only allow the script goal to be created if the owning bot is one of the teams provided. This is much more efficient than checking team in script in common cases where a goal only applies to a certain team of bots.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (teamId, ...) Any number of class Ids&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 // This function can take any number of parameters.&lt;br /&gt;
 this.LimitToTeam(TEAM.BLUE);&lt;br /&gt;
 this.LimitToTeam(TEAM.BLUE, TEAM.RED);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===LimitToEntityFlag===&lt;br /&gt;
This function will only allow the script goal to be created if the owning bot has one or more entity flags set. This is much more efficient than checking entity flags in script in common cases where a goal only applies to specific cases where the bot has certain entity flags.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (ent flag, ...) Any number of entity flags&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 // This function can take any number of parameters.&lt;br /&gt;
 this.LimitToEntityFlag(ENTFLAG.INWATER);&lt;br /&gt;
 this.LimitToEntityFlag(ENTFLAG.INWATER, ENTFLAG.UNDERWATER);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===LimitToNoEntityFlag===&lt;br /&gt;
This function will only allow the script goal to be created if the owning bot does not have one or more entity flags set. This is much more efficient than checking entity flags in script in common cases where a goal only applies to specific cases where the bot does not have certain entity flags.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (ent flag, ...) Any number of entity flags&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 // This function can take any number of parameters.&lt;br /&gt;
 this.LimitToNoEntityFlag(ENTFLAG.INWATER);&lt;br /&gt;
 this.LimitToNoEntityFlag(ENTFLAG.INWATER, ENTFLAG.UNDERWATER);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===LimitToNoPowerup===&lt;br /&gt;
This function will only allow the script goal to be considered if the owning bot does not have the given powerups.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (powerup flag, ...) Any number of power up flags&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 // This function can take any number of parameters.&lt;br /&gt;
 this.LimitToNoPowerUp(ENTFLAG.INVINCIBLE);&lt;br /&gt;
 this.LimitToNoPowerUp(ENTFLAG.INVINCIBLE, ENTFLAG.QUADDAMAGE); &amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===LimitToNoTarget===&lt;br /&gt;
This function will only allow the script goal to be considered if the owning bot does not have a target. This is much more efficient than checking for a target in the GetPriority function in script in cases where the bot should not have a target. The goal will not be evaluated unless the bot does not have a target.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 // This function takes no parameters.&lt;br /&gt;
 this.LimitToNoTarget(); &amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===LimitToPowerUp===&lt;br /&gt;
This function will only allow the script goal to be created if the owning bot has one or more power up flags set. This is much more efficient than checking power up flags in script in common cases where a goal only applies to specific cases where the bot has certain power up flags.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (powerup flag, ...) Any number of power up flags&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 // This function can take any number of parameters.&lt;br /&gt;
 this.LimitToPowerUp(ENTFLAG.INVINCIBLE);&lt;br /&gt;
 this.LimitToPowerUp(ENTFLAG.INVINCIBLE, ENTFLAG.QUADDAMAGE);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===LimitToWeapon===&lt;br /&gt;
This function will only allow the script goal to be created if the owning bot has one or more weapons set by this function. This is much more efficient than checking the bots weapons in script in common cases where a goal only applies to specific cases where the bot has a certain weapon.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (weapon Id, ...) Any number of weapon Ids&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 // This function can take any number of parameters.&lt;br /&gt;
 this.LimitToWeapon(WEAPON.MOBILE_MG42);&lt;br /&gt;
 this.LimitToWeapon(WEAPON.MOBILE_MG42, WEAPON.MORTAR);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===LimitToTargetClass===&lt;br /&gt;
This function will only allow the script goal to be considered if the owning bot has a target of a specified class. This is much more efficient than checking class in the GetPriority function in script in cases where a goal only applies to specific cases where the bots target is a specific class. The goal will not be evaluated unless the bot has a target and the target is on one of the provided classes.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (classId, ...) Any number of target classes&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 // This function can take any number of parameters.&lt;br /&gt;
 this.LimitToTargetClass(CLASS.ANYPLAYER); // don&#039;t run unless we have any player class&lt;br /&gt;
 this.LimitToTargetClass(CLASS.ENGINEER, CLASS.MEDIC); // look for specific classes&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===LimitToTargetTeam===&lt;br /&gt;
This function will only allow the script goal to be considered if the owning bot has a target on a specified team. This is much more efficient than checking team in the GetPriority function in script in cases where a goal only applies to specific cases where the bots target is on a specific team. The goal will not be evaluated unless the bot has a target and the target is on one of the provided teams.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (teamId, ...) Any number of teams&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 // This function can take any number of parameters.&lt;br /&gt;
 this.LimitToTargetTeam(TEAM.RED); // don&#039;t run unless our target is on red team&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===LimitToTargetPowerUp===&lt;br /&gt;
This function will only allow the script goal to be considered if the owning bot has a target with one or more powerups. This is much more efficient than checking powerups in the GetPriority function in script in cases where a goal only applies to specific cases where the bots target has a powerup. The goal will not be evaluated unless the bot has a target and the target is on one of the provided powerups.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (powerup id, ...) Any number of power up flags&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 // This function can take any number of parameters.&lt;br /&gt;
 this.LimitToTargetPowerUp(POWERUP.QUADDAMAGE); // don&#039;t run unless our target has quad damage&lt;br /&gt;
 this.LimitToTargetPowerUp(ENTFLAG.INVINCIBLE, ENTFLAG.QUADDAMAGE);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===LimitToTargetNoPowerUp===&lt;br /&gt;
This function will only allow the script goal to be considered if the owning bot has a target without one or more powerups. This is much more efficient than checking powerups in the GetPriority function in script in cases where a goal only applies to specific cases where the bot&#039;s target hasn&#039;t a powerup. The goal will not be evaluated unless the bot has a target and the target doesn&#039;t have one of the provided powerups.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (powerup id, ...) Any number of power up flags&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 // This function can take any number of parameters.&lt;br /&gt;
 this.LimitToTargetNoPowerUp(POWERUP.QUADDAMAGE); // don&#039;t run if our target has quad damage&lt;br /&gt;
 this.LimitToTargetNoPowerUp(ENTFLAG.INVINCIBLE, ENTFLAG.QUADDAMAGE);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===LimitToTargetEntityFlag===&lt;br /&gt;
This function will only allow the script goal to be created if the target bot has one or more of the entity flags set. This is much more efficient than checking entity flags in script in common cases where a goal only applies to specific cases where the bot has certain entity flags.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (ent flag, ...) Any number of entity flags&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 // This function can take any number of parameters.&lt;br /&gt;
 this.LimitToTargetEntityFlag(ENTFLAG.INWATER);&lt;br /&gt;
 this.LimitToTargetEntityFlag(ENTFLAG.INWATER, ENTFLAG.UNDERWATER);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===LimitToTargetNoEntityFlag===&lt;br /&gt;
This function will only allow the script goal to be created if the target bot does not have one or more of the entity flags set. This is much more efficient than checking entity flags in script in common cases where a goal only applies to specific cases where the bot does not have certain entity flags.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (ent flag, ...) Any number of entity flags&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 // This function can take any number of parameters.&lt;br /&gt;
 this.LimitToTargetNoEntityFlag(ENTFLAG.INWATER);&lt;br /&gt;
 this.LimitToTargetNoEntityFlag(ENTFLAG.INWATER, ENTFLAG.UNDERWATER);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===LimitToTargetWeapon===&lt;br /&gt;
This function will only allow the script goal to be created if the bots has one or more weapons set by this function. This is much more efficient than checking the bots weapons in script in common cases where a goal only applies to specific cases where the bot&#039;s target has a certain weapon.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (weapon Id, ...) Any number of weapon Ids&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 // This function can take any number of parameters.&lt;br /&gt;
 this.LimitToTargetWeapon(WEAPON.MOBILE_MG42);&lt;br /&gt;
 this.LimitToTargetWeapon(WEAPON.MOBILE_MG42, WEAPON.MORTAR);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===LimitToRole===&lt;br /&gt;
This function will only allow the script goal to be created if the owning bot has one of the roles provided.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (roleId, ...) Any number of role Ids&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 this.LimitToRole(ROLE.DEFENDER);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===IsActive===&lt;br /&gt;
Checks if the script goal is currently active. An active script goal means it is currently running. This check is useful mostly in cases where you want an active script goal to remain active and not necessarily keep performing complex checks in its GetPriority function.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (none)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; true if active, false if not&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 this.GetPriority = function()&lt;br /&gt;
 {&lt;br /&gt;
   if(this.IsActive())&lt;br /&gt;
   {&lt;br /&gt;
     return 1.0;&lt;br /&gt;
   }&lt;br /&gt;
   else&lt;br /&gt;
   {&lt;br /&gt;
     // do some other check&lt;br /&gt;
   }&lt;br /&gt;
 }; &amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===Goto===&lt;br /&gt;
Tells the bot to go to a specific location, planning and running a path if necessary. This function is synchronous.&lt;br /&gt;
&lt;br /&gt;
The first parameter can be a table of positions, bot will choose destination which has the shortest path.&lt;br /&gt;
&lt;br /&gt;
Bot will walk if the last parameter is {MoveMode = MoveMode.Walk}.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (Vector3 position, tolerance, options[optional])&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (table of Vector3 positions, tolerance, options[optional])&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; EVENT.PATH_SUCCESS or EVENT.PATH_FAILED&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 wpinfo = table();&lt;br /&gt;
 wp = Wp.GetWaypointByName(&amp;quot;somewaypoint&amp;quot;, wpinfo);&lt;br /&gt;
 if( this.Goto(wpinfo.position, wpinfo.radius) == EVENT.PATH_SUCCESS )&lt;br /&gt;
 {&lt;br /&gt;
     print(&amp;quot;Made it!&amp;quot;);&lt;br /&gt;
 }&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===GotoAsync===&lt;br /&gt;
Tells the bot to go to a specific location, planning and running a path if necessary. This function is asynchronous. Typically a script would block after calling this to wait for a success or failure message.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (Vector3 position, tolerance, options[optional])&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 wpinfo = table();&lt;br /&gt;
 wp = Wp.GetWaypointByName(&amp;quot;somewaypoint&amp;quot;, wpinfo);&lt;br /&gt;
 this.GotoAsync(wpinfo.position, wpinfo.radius);&lt;br /&gt;
 if( block(EVENT.PATH_SUCCESS, EVENT.PATH_FAILED) == EVENT.PATH_SUCCESS )&lt;br /&gt;
 {&lt;br /&gt;
     print(&amp;quot;Made it!&amp;quot;);&lt;br /&gt;
 }&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===GotoRandom===&lt;br /&gt;
Goto random destination.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (tolerance, options[optional])&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; EVENT.PATH_SUCCESS or EVENT.PATH_FAILED&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===GotoRandomAsync===&lt;br /&gt;
Goto random destination (asynchronous).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (tolerance, options[optional])&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===RouteTo===&lt;br /&gt;
RouteTo is similar to Goto, but bots use routes which are defined for map goal. Routes are used only if bot is within radius of any ROUTE goal.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (mapGoal, tolerance, options[optional])&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; EVENT.PATH_SUCCESS or EVENT.PATH_FAILED&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===Stop===&lt;br /&gt;
Interrupts any active Goto and signals PATH_FAILED.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===DidPathSucceed===&lt;br /&gt;
Checks if the last Goto command succeeded. Success means the bot has reached the end of the desired path. Typically a goal will block on EVENT.PATH_SUCCESS or EVENT.PATH_FAILED events. [[ScriptGoal#DidPathSucceed| DidPathSucceed]] and [[ScriptGoal#DidPathFail| DidPathFail]] are included for cases where the script wishes to remain active and doing something during the path traversal, and it can poll the path success/failure during. If neither function returns true, then the bot should be moving along the path normally.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; true if path succeeded, false if not&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 if(this.DidPathSucceed())&lt;br /&gt;
 {&lt;br /&gt;
 }&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;See Also:&#039;&#039;&#039; &lt;br /&gt;
[[ScriptGoal#Goto| Goto]], [[ScriptGoal#DidPathSucceed| DidPathSucceed]]&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===DidPathFail===&lt;br /&gt;
Checks if the last Goto command failed. Failure means the path was either blocked(no path exists), or the bot has gotten stuck on the way. Typically a goal will block on EVENT.PATH_SUCCESS or EVENT.PATH_FAILED events. [[ScriptGoal#DidPathSucceed| DidPathSucceed]] and [[ScriptGoal#DidPathFail| DidPathFail]] are included for cases where the script wishes to remain active and doing something during the path traversal, and it can poll the path success/failure during. If neither function returns true, then the bot should be moving along the path normally.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; true if path failed, false if not&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 if(this.DidPathFail())&lt;br /&gt;
 {&lt;br /&gt;
 }&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;See Also:&#039;&#039;&#039; &lt;br /&gt;
[[ScriptGoal#Goto| Goto]], [[ScriptGoal#DidPathSucceed| DidPathSucceed]]&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===AddAimRequest ===&lt;br /&gt;
Adds a priority based aim request into the bots aiming system. Aim requests are favored based on their priority, with the highest priority aim request chosen at any given point. It is a much simpler and easier to manage setup in the cases of many competing goals that wish to control the bots aim. Each goal can add an aim request and will recieve notifications when the bot chooses and executes their request. This functions works together with the AimVector property to allow setting the aim type at any point. The script can recieve notification of a successful aiming by blocking on the EVENT.AIM_SUCCESS event.&lt;br /&gt;
&lt;br /&gt;
Aim requests can be viewed in the [[Debug Window]] under the Aimer state. They will take on the name of the script goal they were added in.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (priority, aim type&amp;lt;optional, default position&amp;gt;, aim position&amp;lt;optional&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
====Priority====&lt;br /&gt;
Most normal goals use a Priority.High priority, which leaves 2 higher levels of priority usable by scripts or important goals. &lt;br /&gt;
&lt;br /&gt;
Priority determines how to select a request when there are multiple requests active. Higher priorities are selected over lower priorities.&lt;br /&gt;
&lt;br /&gt;
* Priority.Zero&lt;br /&gt;
* Priority.Min&lt;br /&gt;
* Priority.Idle - FollowPath&lt;br /&gt;
* Priority.VeryLow - LookAround&lt;br /&gt;
* Priority.Low - CAMP, ESCORT, RIDE, MOUNT, ...&lt;br /&gt;
* Priority.LowMed - AttackTarget&lt;br /&gt;
* Priority.Medium - CALLARTILLERY, MOBILEMORTAR, ...&lt;br /&gt;
* Priority.High - BUILD, DEFUSE, GRENADE, REVIVE, SWITCH, ...&lt;br /&gt;
* Priority.VeryHigh&lt;br /&gt;
* Priority.Override&lt;br /&gt;
&lt;br /&gt;
====Aim Types====&lt;br /&gt;
* movedirection - Face in the direction of movement. Useful if you want to override the bots normal combat aiming, as in for a disguise goal where you don&#039;t want them to engage the target.&lt;br /&gt;
* facing - Face a given facing (direction) vector. In this case AimVector represents a facing vector.&lt;br /&gt;
** (1,0,0) - east, (-1,0,0) - west&lt;br /&gt;
** (0,1,0) - north, (0,-1,0) - south&lt;br /&gt;
** (0,0,1) - up, (0,0,-1) - down&lt;br /&gt;
* position - Face a given position vector. In this case AimVector represents a point in the 3D map space.&lt;br /&gt;
&lt;br /&gt;
If one of the above is not specified, the aim request is a positional request, and the AimVector of the script goal will be used as a raw position to aim at.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 aimPos = someAimPosition;&lt;br /&gt;
 aimPos2 = someAimPosition2;&lt;br /&gt;
&lt;br /&gt;
 this.AddAimRequest(Priority.High, &amp;quot;movedirection&amp;quot;); // requests the bot to face along its move direction at a 0.8 priority&lt;br /&gt;
 // OR&lt;br /&gt;
 this.AddAimRequest(Priority.High); // leave off optional parameters, defaults to AimPosition, so set it&lt;br /&gt;
 this.AimVector = aimPos; // this can be called at any time in the script goal&lt;br /&gt;
&lt;br /&gt;
 if(block(EVENT.AIM_SUCCESS) == EVENT.AIM_SUCCESS)&lt;br /&gt;
 {&lt;br /&gt;
    // we&#039;re on target, do something cool&lt;br /&gt;
 }&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;See Also:&#039;&#039;&#039; &lt;br /&gt;
[[ScriptGoal#ReleaseAimRequest | ReleaseAimRequest]]&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===ReleaseAimRequest ===&lt;br /&gt;
This function will release the Aim Request within the script goal; allowing other potential aim requests to have control.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 this.ReleaseAimRequest();&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;See Also:&#039;&#039;&#039; &lt;br /&gt;
[[ScriptGoal#AddAimRequest| AddAimRequest]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===AddWeaponRequest ===&lt;br /&gt;
Adds a priority based weapon equip request into the bots weapon system. Weapon requests are favored based on their priority, with the highest priority request chosen as the desired weapon. It is a much simpler and easier to manage setup in the cases of many competing goals that wish to control the bots equipped weapon. Each goal can add an weapon request and will receive notifications when the bot chooses and executes their request. &lt;br /&gt;
&lt;br /&gt;
Weapon requests can be view in the [[Debug Window]] under the WeaponSystem state. They will take on the name of the script goal they were added in.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (priority, weapon Id)&lt;br /&gt;
&lt;br /&gt;
====Priority====&lt;br /&gt;
Most normal goals use a Priority.High priority, which leaves 2 higher levels of priority usable by scripts or important goals.&lt;br /&gt;
&lt;br /&gt;
Priority determines how to select a request when there are multiple requests active. Higher priorities are selected over lower priorities.&lt;br /&gt;
&lt;br /&gt;
* Priority.Min&lt;br /&gt;
* Priority.Idle&lt;br /&gt;
* Priority.VeryLow&lt;br /&gt;
* Priority.Low&lt;br /&gt;
* Priority.Medium&lt;br /&gt;
* Priority.High&lt;br /&gt;
* Priority.VeryHigh&lt;br /&gt;
* Priority.Override&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 this.AddWeaponRequest(Priority.High, WEAPON.MEDKIT); &amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;See Also:&#039;&#039;&#039; &lt;br /&gt;
[[ScriptGoal#ReleaseWeaponRequest | ReleaseWeaponRequest]]&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===ReleaseWeaponRequest ===&lt;br /&gt;
This function will release the weapon request within the script goal; allowing other potential weapon requests to have control.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 this.ReleaseWeaponRequest();&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;See Also:&#039;&#039;&#039; &lt;br /&gt;
[[ScriptGoal#AddWeaponRequest | AddWeaponRequest ]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===BlockForWeaponChange===&lt;br /&gt;
This function provides specialized script thread blocking functionality to wait for a weapon change to a certain weapon. This function takes the place of a call to block in the case you want to wait until the bot switches to a specific weapon.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (weaponId)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 this.BlockForWeaponChange(WEAPON.MEDKIT);&lt;br /&gt;
 this.Say(&amp;quot;Medkit Equipped!&amp;quot;);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===BlockForWeaponFire===&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===BlockForVoiceMacro===&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===QueryGoals===&lt;br /&gt;
&lt;br /&gt;
Finds goals available for this bot and stores them in the first table parameter. The previous table content is cleared since omni-bot 0.84. &lt;br /&gt;
&lt;br /&gt;
The last optional parameter is table of parameters to filter result (NoFilters, Group, Role, Team, SkipDelayed, SkipNoInProgress, SkipNoInUse, SkipInUse) or sort result (parameter Sort, values are &amp;quot;none&amp;quot;, &amp;quot;priority&amp;quot;, &amp;quot;name&amp;quot;, &amp;quot;random&amp;quot;, default is &amp;quot;priority&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (table, goal type hash, params[optional])&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (table, table of goal type hashes, params[optional])&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (table, expression, params[optional])&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; count of goals returned in table&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 count = this.QueryGoals(this.Bot.QueryGoalsTable, 0xc9326a43);&lt;br /&gt;
 count = this.QueryGoals(this.Bot.QueryGoalsTable, &amp;quot;BUILD_.*&amp;quot;);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===BlackboardDelay===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (time, mapGoal or serialNumber[optional])&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 this.BlackboardDelay(10);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===BlackboardIsDelayed===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (mapGoal or serialNumber)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; true if goal has been found on blackboard&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 if (this.BlackboardIsDelayed(serial))&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===MarkInProgress===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (mapGoal[optional])&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; true if empty slot has been found and marked&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 this.MarkInProgress(); //finish if no slot is available&lt;br /&gt;
&lt;br /&gt;
 if (!this.MarkInProgress(this.MapGoal)) {&lt;br /&gt;
   this.BlackboardDelay(5);&lt;br /&gt;
   this.Finished();&lt;br /&gt;
 }&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===MarkInUse===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (mapGoal[optional])&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; true if empty slot has been found and marked&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 this.MarkInUse(); //finish if no slot is available&lt;br /&gt;
&lt;br /&gt;
 if (!this.MarkInUse(this.MapGoal)) {&lt;br /&gt;
   this.BlackboardDelay(5);&lt;br /&gt;
   this.Finished();&lt;br /&gt;
 }&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===WatchForMapGoalsInRadius===&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===ClearWatchForMapGoalsInRadius===&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===WatchForEntityCategory===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; ( { Radius, Category, RequireLOS[optional, default 0] } )&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 this.WatchForEntityCategory({&lt;br /&gt;
   Radius = 350,&lt;br /&gt;
   Category = CAT.PROJECTILE,&lt;br /&gt;
   RequireLOS = TRACE.VISIBLE&lt;br /&gt;
 });&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===DelayGetPriority===&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===ForkThread===&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===KillThread===&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===Signal===&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== Script Goal Threading ==&lt;br /&gt;
&lt;br /&gt;
Script goals have been designed to be friendly to script threading, by providing some built in functionality to make it easier to manage multiple threads to be associated with the script goal.&lt;br /&gt;
&lt;br /&gt;
The script goal keeps track of the thread created when calling all the following functions.&lt;br /&gt;
* Initialize&lt;br /&gt;
* OnSpawn&lt;br /&gt;
* GetPriority&lt;br /&gt;
* Enter&lt;br /&gt;
* Exit&lt;br /&gt;
* Update&lt;br /&gt;
&lt;br /&gt;
You may use thread functions (block, yield, sleep), in any of the script goal functions, though you must understand that for efficiency, and to prevent runaway threads, the script goal will internally kill the threads associated with the function callbacks at certain times.&lt;br /&gt;
&lt;br /&gt;
Currently&lt;br /&gt;
* All threads will be killed when the state exits.&lt;br /&gt;
* All threads will be killed when the state is disabled. See [[ScriptGoal#Disable| Disable]]&lt;br /&gt;
* All threads will be killed when the state becomes unselectable. This is normally due to the limit functions.&lt;br /&gt;
&lt;br /&gt;
Note that this only applies to the thread that is created for the function calls themselves. If you really need a thread to run longer than these specifications allow, you can create your own thread normally with the thread() function. It is highly recommended that you script your goal within these functions, as it is easy to &#039;&#039;leak&#039;&#039; threads when creating them arbitrarily.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
== Script Goal Performance ==&lt;br /&gt;
&lt;br /&gt;
Executing script is much much slower than executing native code, so you should be aware that a script can have significant adverse effects on the performance of the bot as a whole. Here are some tips to keep performance as high as possible with script goals.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Only define what you need&#039;&#039;&#039; - None of the callback functions are required, so if you don&#039;t use them, don&#039;t define them. It is wasteful to have an empty function defined. If you don&#039;t need an Enter function, leave it out, if you don&#039;t need an Update function, leave it out. Same for Exit, GetPriority, Initialize.&lt;br /&gt;
* &#039;&#039;&#039;Use limit functions as much as possible&#039;&#039;&#039; - If the goal should only be considered for certain player classes, or for bots with certain powerups or entity flags, or for when the bot has a target that matches similar specific flags, use the Limit functions to set that up. They are much much faster than checking those properties in the GetPriority function. If the limit functions fail, the script will never be called, which is a huge optimization.&lt;br /&gt;
* &#039;&#039;&#039;Use thread functions&#039;&#039;&#039; - Normally, GetPriority is called often. You can control this behavior by using thread functions to keep a thread running, and delay priority evaluations with a loop and calls to sleep. GetPriority will not be called if there is still an active GetPriority thread.&lt;br /&gt;
* &#039;&#039;&#039;Keep your GetPriority function as lightweight as possible&#039;&#039;&#039; - The less work it does the better, because GetPriority is called frequently by the bot. This is especially important if the goal is placed under the &#039;&#039;LowLevel&#039;&#039; parent because all child states under &#039;&#039;LowLevel&#039;&#039; are evaluated and allowed to run simultaneously. &lt;br /&gt;
* &#039;&#039;&#039;Ditto for the Update function&#039;&#039;&#039; - The same applies to the Update function especially. Keep it as simple as possible to achieve the desired behavior, and use thread functions.&lt;br /&gt;
* &#039;&#039;&#039;Cache as much as possible&#039;&#039;&#039; - Take advantage of the fact that Initialize is called only once when the bot is added. Use this function to cache values the script goal might need. For example, if the script goal does things based on specific waypoints, it would be expensive to call functions like Wp.GetWaypointByName() in the priority or update functions. Instead collect all you might need up front in the Initialize function and store them in a table on the script goal so you have faster access to them later.&lt;br /&gt;
* &#039;&#039;&#039;Use events, and block() as much as possible&#039;&#039;&#039; - Most common operations that previously required expensive loops to perform have been converted to events. Choosing a weapon, aiming a weapon, going to some location, etc. Most can be followed by a call to block() which will suspend the execution of the script until the event is recieved. This is the single easiest to use and most useful for performance features available. See [[ScriptGoal#BlockForWeaponChange|BlockForWeaponChange]], [[ScriptGoal#Goto|Goto]], [[ScriptGoal#AddAimRequest|AddAimRequest]].&lt;br /&gt;
* &#039;&#039;&#039;Beware of loops&#039;&#039;&#039; - Be careful when looping, as they can silently cause large performance drains. Be wary of how much work is being done in a loop, and on how many elements. Expensive functionality can be updated less often, or split up over time. Use yield() or sleep(x) within loops to spread out the calculations over time.&lt;/div&gt;</summary>
		<author><name>Palota</name></author>
	</entry>
	<entry>
		<id>https://mygamingtalk.com/wiki/index.php?title=ScriptGoal&amp;diff=1764</id>
		<title>ScriptGoal</title>
		<link rel="alternate" type="text/html" href="https://mygamingtalk.com/wiki/index.php?title=ScriptGoal&amp;diff=1764"/>
		<updated>2025-05-25T16:30:54Z</updated>

		<summary type="html">&lt;p&gt;Palota: /* MarkInUse */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{process header&lt;br /&gt;
 | title    = Script Goal&lt;br /&gt;
 | section  =&lt;br /&gt;
 | previous = [[Omni-bot_Script_Reference | Script Reference]]&lt;br /&gt;
 | next     = &lt;br /&gt;
 | shortcut =&lt;br /&gt;
 | notes    =&lt;br /&gt;
}}&lt;br /&gt;
{{TOCright}}&lt;br /&gt;
[[Category:ET|Script Goals]]&lt;br /&gt;
[[Category:Doom 3|Script Goals]]&lt;br /&gt;
[[Category:Quake 4|Script Goals]]&lt;br /&gt;
[[Category:RTCW|Script Goals]]&lt;br /&gt;
&lt;br /&gt;
==ScriptGoal Properties==&lt;br /&gt;
===Name===&lt;br /&gt;
The name of the script goal. Important for other scripts to refer to by name, and the name it is displayed under in the [[Debug Window]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;this.Name = &amp;quot;MyGoalName&amp;quot;;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Parent===&lt;br /&gt;
The name of the parent goal. This should be set up once in the script and left alone. It controls where in the behavior tree the goal is inserted. The location of the goal in the state tree effects how it is evaluated.&lt;br /&gt;
&lt;br /&gt;
Users should stick to one of the following 2 parents.&lt;br /&gt;
* HighLevel - Puts the goal under the HighLevel parent. Because the goal is under the HighLevel state, only one state at a time can run. This is useful for goals that take control of the bot, that shouldn&#039;t be interrupted by other script goals or built in goals.&lt;br /&gt;
* LowLevel - Puts the goal under the LowLevel parent. All states under the LowLevel state are run simultaneously, and so is a good location for scripts that control things that don&#039;t necessarily take total control over the bot, or don&#039;t wish to interrupt the execution of other goals. Some examples might be calling for medic, calling for ammo, most communication scripts.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;this.Parent = &amp;quot;HighLevel&amp;quot;;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===InsertBefore===&lt;br /&gt;
It controls where in the behavior tree the goal is inserted. InsertBefore property is ignored if Parent has been set. &lt;br /&gt;
&lt;br /&gt;
===InsertAfter===&lt;br /&gt;
It controls where in the behavior tree the goal is inserted. InsertAfter property is ignored if Parent or InsertBefore has been set. &lt;br /&gt;
&lt;br /&gt;
===Disable===&lt;br /&gt;
Enables/Disables the goal for consideration. The goal will no longer be considered for execution. Disabled goals have specific coloring in the [[Debug Window]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;this.Disable = true;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===AimVector===&lt;br /&gt;
This Vector3 is used by any active aim request the script goal has registered. You usually do not need to use this property directly, because function AddAimRequest sets this property.&lt;br /&gt;
&lt;br /&gt;
===AlwaysRecieveEvents===&lt;br /&gt;
Normally goals receive events only when active. Setting this to true will allow the goal to receive events even when it&#039;s not running. This is useful for when you want to have the goal sit idle and only activate when receiving a certain event, or you want to track and store information in the goal from events.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;this.AlwaysRecieveEvents = true;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Events===&lt;br /&gt;
Accesses the Events table of the goal, in order to set up script functions that will be called when the bot receives events. By default, goals only receive events when they are active. This can be overridden with [[ScriptGoal#AlwaysRecieveEvents| AlwaysRecieveEvents]], which will allow goals to receive events even when not active.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 this.Events[EVENT.FEEL_PAIN] = function(Inflictor, PreviousHealth, CurrentHealth)&lt;br /&gt;
 {&lt;br /&gt;
   whoDoneIt = GetEntName(Inflictor);&lt;br /&gt;
   print( format(&amp;quot;%s: %s Hurt me: Was %d, now %d&amp;quot;, &lt;br /&gt;
    this.Bot.GetName(), whoDoneIt, PreviousHealth, CurrentHealth) );&lt;br /&gt;
 };&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Bot===&lt;br /&gt;
This provides an accessor to the bot that is running the goal. The &#039;this&#039; within script goals is always the script goal itself, so in the frequent case of needing to access the bot, use this property.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;this.Bot.Say(&amp;quot;Wassup&amp;quot;);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Priority===&lt;br /&gt;
Priority is a property rather than a return value of [[ScriptGoal#GetPriority| GetPriority]] in order to support the useful threading nature of script goals. It is possible to completely leave out a [[ScriptGoal#GetPriority| GetPriority]] function, and set the priority through this property somewhere else, such as in an event callback. This property will automatically be reset internally when the state exits, to prevent a script goal from activating in a loop from the user forgetting to reset the Priority.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;this.Priority = 1;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SkipGetPriorityWhenActive===&lt;br /&gt;
Set SkipGetPriorityWhenActive to true if function GetPriority should not be called while the goal is active.&lt;br /&gt;
&lt;br /&gt;
===GetPriorityDelay===&lt;br /&gt;
Delay in seconds between GetPriority calls. Default is 0.&lt;br /&gt;
&lt;br /&gt;
===MapGoal===&lt;br /&gt;
Current MapGoal or null if the script goal is not active. This property is not set automatically. You must assign map goal to this property in GetPriority and clear it in Exit.&lt;br /&gt;
&lt;br /&gt;
===AutoReleaseAim===&lt;br /&gt;
Function ReleaseAimRequest is automatically called in Exit. Default is true.&lt;br /&gt;
&lt;br /&gt;
===AutoReleaseWeapon===&lt;br /&gt;
Function ReleaseWeaponRequest is automatically called in Exit. Default is true.&lt;br /&gt;
&lt;br /&gt;
===AutoReleaseTrackers===&lt;br /&gt;
Function Trackers::Reset is automatically called in Exit. Default is true.&lt;br /&gt;
&lt;br /&gt;
===AutoFinishOnUnAvailable===&lt;br /&gt;
The goal is automatically finished if current MapGoal is not available. Default is true.&lt;br /&gt;
&lt;br /&gt;
===AutoFinishOnNoProgressSlots===&lt;br /&gt;
The goal is automatically finished if MarkInProgress has not been called yet and MapGoal has no TRACK_INPROGRESS slots available. Default is true.&lt;br /&gt;
&lt;br /&gt;
===AutoFinishOnNoUseSlots===&lt;br /&gt;
The goal is automatically finished if MarkInUse has not been called yet and MapGoal has no TRACK_INUSE slots available. Default is true.&lt;br /&gt;
&lt;br /&gt;
===AutoAdd===&lt;br /&gt;
Set AutoAdd to false if the script should not be loaded for every map, because it&#039;s deprecated or used only for debugging (RideTram, TestEvents, ...).&lt;br /&gt;
&lt;br /&gt;
===DebugString===&lt;br /&gt;
Debug strings are displayed if you use command &amp;quot;/bot debugbot all fpinfo&amp;quot; and then spectate bots. If DebugString is null, MapGoal name is displayed.&lt;br /&gt;
&lt;br /&gt;
===Debug===&lt;br /&gt;
Set this property at the beginning of gm file so that all your debug messages or debug drawing can be easily enabled or disabled.&lt;br /&gt;
&lt;br /&gt;
===Commands===&lt;br /&gt;
Table of console commands which are executed on the script goal for every bot.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 this.Commands[&amp;quot;command_name&amp;quot;] = {&lt;br /&gt;
  Func = function( _params )&lt;br /&gt;
  { &lt;br /&gt;
  },&lt;br /&gt;
  Help = { &amp;quot;description&amp;quot; },&lt;br /&gt;
 };&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==ScriptGoal Callbacks==&lt;br /&gt;
These functions are available only in 0.7 and later.&lt;br /&gt;
&lt;br /&gt;
===Initialize===&lt;br /&gt;
This function is called exactly once per bot, when the bot is added and initialized. It is typically used to perform one time initialization code.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 this.Initialize() = function()&lt;br /&gt;
 {&lt;br /&gt;
 };&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===OnSpawn===&lt;br /&gt;
This function is called every time the bot spawns. Spawning in Omni-bot means any time the bot re-enters his Main active state. This could mean an actual respawn, a revival from an incapacitated state, or something similar.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 this.OnSpawn() = function()&lt;br /&gt;
 {&lt;br /&gt;
 };&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===GetPriority===&lt;br /&gt;
This function is most often the place to evaluate whether you want the script goal to run. Take care in the complexity of the code here, as it is called pretty often, and can be a source of considerable performance overhead.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 this.GetPriority() = function()&lt;br /&gt;
 {&lt;br /&gt;
 };&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===Enter===&lt;br /&gt;
This function is called when a state is chosen to run, right before it begins running. This function is only called once when the state enters, and will not be called again until the state is exited.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 this.Enter() = function()&lt;br /&gt;
 {&lt;br /&gt;
 };&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;See Also:&#039;&#039;&#039; &lt;br /&gt;
[[ScriptGoal#Exit| Exit]]&lt;br /&gt;
----&lt;br /&gt;
===Exit===&lt;br /&gt;
This function is called when a state finishes running, or is overridden by a higher priority state. It is often used to release aim or weapon requests that were used by the goal.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 this.Exit() = function()&lt;br /&gt;
 {&lt;br /&gt;
 };&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;See Also:&#039;&#039;&#039; &lt;br /&gt;
[[ScriptGoal#Enter| Enter]]&lt;br /&gt;
----&lt;br /&gt;
===Update===&lt;br /&gt;
This function is the meat of a script goal. Once a goal is chosen to run, and [[ScriptGoal#Enter| Enter]] is called, the Update function begins getting called at frequent regular intervals. The state stays active until another goal overrides it, or until [[ScriptGoal#Finished| Finished]] is called, after which the [[ScriptGoal#Exit| Exit]] function is called.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 this.Update() = function()&lt;br /&gt;
 {&lt;br /&gt;
   // do stuff&lt;br /&gt;
   this.Finished(); // when we&#039;re done running&lt;br /&gt;
 };&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;See Also:&#039;&#039;&#039; &lt;br /&gt;
[[ScriptGoal#Enter| Enter]], [[ScriptGoal#Exit| Exit]]&lt;br /&gt;
----&lt;br /&gt;
===OnPathThrough===&lt;br /&gt;
This function is called if bot comes to waypoint which has paththrough property set and its value is goalName:data.&lt;br /&gt;
Paththrough is activated if OnPathThrough function returns true.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 this.OnPathThrough = function(data)&lt;br /&gt;
 {&lt;br /&gt;
  navigation = Map.Navigation[data];&lt;br /&gt;
  if(navigation)&lt;br /&gt;
  {&lt;br /&gt;
   this.CurrentNavigation = data;&lt;br /&gt;
   return true;&lt;br /&gt;
  }&lt;br /&gt;
  this.CurrentNavigation = null;&lt;br /&gt;
  return false;&lt;br /&gt;
 };&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==ScriptGoal Functions==&lt;br /&gt;
These functions are available only in 0.7 and later.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===AddFinishCriteria===&lt;br /&gt;
Finish Criteria are expressions set up from script that will be evaluated constantly in the code and when they are satisfied will cause the script goal to abort. These are useful when your script does alot of asynchronous operations(like Goto), but you want a way to abort the script goal, even if the main update script happens to be in an asynchronous or blocked call, sleep or yield.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (subject, expression, value[optional])&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (expression, value[optional])&lt;br /&gt;
&lt;br /&gt;
====Subject====&lt;br /&gt;
Subject must be an entity, if no entity is provided as the first parameter, it is assumed that the 2nd version of the function is called, which takes only and expression and an optional value. The need for a value is determined by what the expression actually is.&lt;br /&gt;
&lt;br /&gt;
====Expression====&lt;br /&gt;
Expression is a string containing 1 or more keywords that use a natural syntax for defining the conditions of the criteria. Additionally, some keywords expect an operator to be defined&lt;br /&gt;
{| align=&amp;quot;center&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!Keyword&lt;br /&gt;
!Operator Required&lt;br /&gt;
!Value&lt;br /&gt;
|-&lt;br /&gt;
|deleted&lt;br /&gt;
|No&lt;br /&gt;
|entity&lt;br /&gt;
|-&lt;br /&gt;
|health&lt;br /&gt;
|Yes&lt;br /&gt;
|health value to compare against(float or int)&lt;br /&gt;
|-&lt;br /&gt;
|hasentflag&lt;br /&gt;
|No&lt;br /&gt;
|entity flag to compare against. use not to negate test&lt;br /&gt;
|-&lt;br /&gt;
|weaponcharged&lt;br /&gt;
|No&lt;br /&gt;
|weapon Id(integer)&lt;br /&gt;
|-&lt;br /&gt;
|weaponequipped&lt;br /&gt;
|No&lt;br /&gt;
|weapon Id(integer)&lt;br /&gt;
|-&lt;br /&gt;
|weaponhasammo&lt;br /&gt;
|No&lt;br /&gt;
|weapon Id(integer)&lt;br /&gt;
|-&lt;br /&gt;
|velocity&lt;br /&gt;
|Yes&lt;br /&gt;
|vector3 velocity to compare against, OR float magnitude of velocity to compare against(speed)&lt;br /&gt;
|-&lt;br /&gt;
|mapgoalavailable&lt;br /&gt;
|No&lt;br /&gt;
|MapGoal object or name&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Valid Operators=====&lt;br /&gt;
* lessthan&lt;br /&gt;
* &amp;lt;&lt;br /&gt;
* greaterthan&lt;br /&gt;
* &amp;gt;&lt;br /&gt;
* equals&lt;br /&gt;
* ==&lt;br /&gt;
&lt;br /&gt;
In addition, some expressions can contain negation keywords in order to check for the negative of an expression, such as&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 this.AddFinishCriteria(this.TargetEntity,&amp;quot;not hasentflag&amp;quot;,ENTFLAG.DEAD); // as soon as the entity does not have the dead flag&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; true if criteria was created, false if not&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 this.AddFinishCriteria(this.TargetEntity,&amp;quot;deleted&amp;quot;); // finish the goal of the target is deleted&lt;br /&gt;
 this.AddFinishCriteria(this.TargetEntity,&amp;quot;health lessthan&amp;quot;,1); // or if they are dead(health &amp;lt;= 1)&lt;br /&gt;
 this.AddFinishCriteria(this.TargetEntity,&amp;quot;hasentflag&amp;quot;,ENTFLAG.LIMBO); // or if they tap out&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===ClearFinishCriteria===&lt;br /&gt;
Deletes finish criteria.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (clearpersistent[optional, default false])&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===Finished===&lt;br /&gt;
Notifies the goal that it is finished running. This function is normally called from the Update function when the goal is desired to finish.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (none)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 this.Finished();&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===LimitTo===&lt;br /&gt;
This function limits script execution based on a true value being returned from a user defined function. This function is useful if scripts should only be run based on some external logic; like a Map variable setting.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (function, delay, onlyactive[optional - default false])&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
LimitTo functions are script functions that are called at user defined intervals that can be used to update from script whether or not the script goal should be able to run or not. Returning false from this function effectively blocks the script goals ability to activate. It will remain in this state as long as the LimitTo function is defined. The 2nd parameter controls how often the callback is performed. Calling script functions too often can adversely effect performance, so it is recommended to choose a delay that is as infrequently as you can get away with. The &#039;onlyactive&#039; parameter is optional and defaults to false. If this parameter is set to true, the LimitTo function callback will ONLY be performed when the script goal is active. By default the LimitTo function will be called whether the goal is active or not, and returning false will prevent the goal from being able to activate. Passing true as the &#039;onlyactive&#039; flag means the goal can activate, and only then is the LimitTo function called. This is useful when you need to check more information regarding specific targets of the goal to validate whether the goal should continue running. This callback is effectively a way to define your own finish criteria. It is recommended that you only use LimitTo callbacks when FinishCriteria can&#039;t be used, since FinishCriteria are much faster and don&#039;t involve frequent calls into script. LimitTo functions might commonly be used to check the status of a map goal or some other world state that the goal relies on.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 //This function is typically set up in this.Initialize()&lt;br /&gt;
 this.LimitTo(Map.SomeFunction, 1.0); //Call Map.SomeFunction every second&lt;br /&gt;
 this.LimitTo(NULL); //clear the function&lt;br /&gt;
  &lt;br /&gt;
 //The script goal object is referenced in the passed function as &#039;this&#039;&lt;br /&gt;
 Map.SomeFunction = function()&lt;br /&gt;
 {&lt;br /&gt;
      if ( Map.SomeVariable == false )&lt;br /&gt;
          { this.Disable; } //disable the script&lt;br /&gt;
      else&lt;br /&gt;
          { return true; } //allow the script to run&lt;br /&gt;
 };&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===LimitToClass===&lt;br /&gt;
This function will only allow the script goal to be created if the owning bot is one of the classes provided. This is much more efficient than checking class in script in common cases where a goal only applies to a certain class of bot.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (classId, ...) Any number of class Ids&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 // This function can take any number of parameters.&lt;br /&gt;
 this.LimitToClass(CLASS.MEDIC);&lt;br /&gt;
 this.LimitToClass(CLASS.MEDIC, CLASS.ENGINEER);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===LimitToNoClass===&lt;br /&gt;
This function will only allow the script goal to be created if the owning bot is NOT one of the classes provided. This is much more efficient than checking class in script in common cases where a goal only applies to a certain class of bot.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (classId, ...) Any number of class Ids&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 // This function can take any number of parameters.&lt;br /&gt;
 this.LimitToNoClass(CLASS.MEDIC);&lt;br /&gt;
 this.LimitToNoClass(CLASS.MEDIC, CLASS.ENGINEER);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
===LimitToTeam===&lt;br /&gt;
This function will only allow the script goal to be created if the owning bot is one of the teams provided. This is much more efficient than checking team in script in common cases where a goal only applies to a certain team of bots.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (teamId, ...) Any number of class Ids&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 // This function can take any number of parameters.&lt;br /&gt;
 this.LimitToTeam(TEAM.BLUE);&lt;br /&gt;
 this.LimitToTeam(TEAM.BLUE, TEAM.RED);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===LimitToEntityFlag===&lt;br /&gt;
This function will only allow the script goal to be created if the owning bot has one or more entity flags set. This is much more efficient than checking entity flags in script in common cases where a goal only applies to specific cases where the bot has certain entity flags.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (ent flag, ...) Any number of entity flags&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 // This function can take any number of parameters.&lt;br /&gt;
 this.LimitToEntityFlag(ENTFLAG.INWATER);&lt;br /&gt;
 this.LimitToEntityFlag(ENTFLAG.INWATER, ENTFLAG.UNDERWATER);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===LimitToNoEntityFlag===&lt;br /&gt;
This function will only allow the script goal to be created if the owning bot does not have one or more entity flags set. This is much more efficient than checking entity flags in script in common cases where a goal only applies to specific cases where the bot does not have certain entity flags.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (ent flag, ...) Any number of entity flags&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 // This function can take any number of parameters.&lt;br /&gt;
 this.LimitToNoEntityFlag(ENTFLAG.INWATER);&lt;br /&gt;
 this.LimitToNoEntityFlag(ENTFLAG.INWATER, ENTFLAG.UNDERWATER);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===LimitToNoPowerup===&lt;br /&gt;
This function will only allow the script goal to be considered if the owning bot does not have the given powerups.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (powerup flag, ...) Any number of power up flags&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 // This function can take any number of parameters.&lt;br /&gt;
 this.LimitToNoPowerUp(ENTFLAG.INVINCIBLE);&lt;br /&gt;
 this.LimitToNoPowerUp(ENTFLAG.INVINCIBLE, ENTFLAG.QUADDAMAGE); &amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===LimitToNoTarget===&lt;br /&gt;
This function will only allow the script goal to be considered if the owning bot does not have a target. This is much more efficient than checking for a target in the GetPriority function in script in cases where the bot should not have a target. The goal will not be evaluated unless the bot does not have a target.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 // This function takes no parameters.&lt;br /&gt;
 this.LimitToNoTarget(); &amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===LimitToPowerUp===&lt;br /&gt;
This function will only allow the script goal to be created if the owning bot has one or more power up flags set. This is much more efficient than checking power up flags in script in common cases where a goal only applies to specific cases where the bot has certain power up flags.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (powerup flag, ...) Any number of power up flags&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 // This function can take any number of parameters.&lt;br /&gt;
 this.LimitToPowerUp(ENTFLAG.INVINCIBLE);&lt;br /&gt;
 this.LimitToPowerUp(ENTFLAG.INVINCIBLE, ENTFLAG.QUADDAMAGE);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===LimitToWeapon===&lt;br /&gt;
This function will only allow the script goal to be created if the owning bot has one or more weapons set by this function. This is much more efficient than checking the bots weapons in script in common cases where a goal only applies to specific cases where the bot has a certain weapon.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (weapon Id, ...) Any number of weapon Ids&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 // This function can take any number of parameters.&lt;br /&gt;
 this.LimitToWeapon(WEAPON.MOBILE_MG42);&lt;br /&gt;
 this.LimitToWeapon(WEAPON.MOBILE_MG42, WEAPON.MORTAR);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===LimitToTargetClass===&lt;br /&gt;
This function will only allow the script goal to be considered if the owning bot has a target of a specified class. This is much more efficient than checking class in the GetPriority function in script in cases where a goal only applies to specific cases where the bots target is a specific class. The goal will not be evaluated unless the bot has a target and the target is on one of the provided classes.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (classId, ...) Any number of target classes&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 // This function can take any number of parameters.&lt;br /&gt;
 this.LimitToTargetClass(CLASS.ANYPLAYER); // don&#039;t run unless we have any player class&lt;br /&gt;
 this.LimitToTargetClass(CLASS.ENGINEER, CLASS.MEDIC); // look for specific classes&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===LimitToTargetTeam===&lt;br /&gt;
This function will only allow the script goal to be considered if the owning bot has a target on a specified team. This is much more efficient than checking team in the GetPriority function in script in cases where a goal only applies to specific cases where the bots target is on a specific team. The goal will not be evaluated unless the bot has a target and the target is on one of the provided teams.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (teamId, ...) Any number of teams&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 // This function can take any number of parameters.&lt;br /&gt;
 this.LimitToTargetTeam(TEAM.RED); // don&#039;t run unless our target is on red team&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===LimitToTargetPowerUp===&lt;br /&gt;
This function will only allow the script goal to be considered if the owning bot has a target with one or more powerups. This is much more efficient than checking powerups in the GetPriority function in script in cases where a goal only applies to specific cases where the bots target has a powerup. The goal will not be evaluated unless the bot has a target and the target is on one of the provided powerups.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (powerup id, ...) Any number of power up flags&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 // This function can take any number of parameters.&lt;br /&gt;
 this.LimitToTargetPowerUp(POWERUP.QUADDAMAGE); // don&#039;t run unless our target has quad damage&lt;br /&gt;
 this.LimitToTargetPowerUp(ENTFLAG.INVINCIBLE, ENTFLAG.QUADDAMAGE);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===LimitToTargetNoPowerUp===&lt;br /&gt;
This function will only allow the script goal to be considered if the owning bot has a target without one or more powerups. This is much more efficient than checking powerups in the GetPriority function in script in cases where a goal only applies to specific cases where the bot&#039;s target hasn&#039;t a powerup. The goal will not be evaluated unless the bot has a target and the target doesn&#039;t have one of the provided powerups.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (powerup id, ...) Any number of power up flags&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 // This function can take any number of parameters.&lt;br /&gt;
 this.LimitToTargetNoPowerUp(POWERUP.QUADDAMAGE); // don&#039;t run if our target has quad damage&lt;br /&gt;
 this.LimitToTargetNoPowerUp(ENTFLAG.INVINCIBLE, ENTFLAG.QUADDAMAGE);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===LimitToTargetEntityFlag===&lt;br /&gt;
This function will only allow the script goal to be created if the target bot has one or more of the entity flags set. This is much more efficient than checking entity flags in script in common cases where a goal only applies to specific cases where the bot has certain entity flags.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (ent flag, ...) Any number of entity flags&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 // This function can take any number of parameters.&lt;br /&gt;
 this.LimitToTargetEntityFlag(ENTFLAG.INWATER);&lt;br /&gt;
 this.LimitToTargetEntityFlag(ENTFLAG.INWATER, ENTFLAG.UNDERWATER);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===LimitToTargetNoEntityFlag===&lt;br /&gt;
This function will only allow the script goal to be created if the target bot does not have one or more of the entity flags set. This is much more efficient than checking entity flags in script in common cases where a goal only applies to specific cases where the bot does not have certain entity flags.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (ent flag, ...) Any number of entity flags&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 // This function can take any number of parameters.&lt;br /&gt;
 this.LimitToTargetNoEntityFlag(ENTFLAG.INWATER);&lt;br /&gt;
 this.LimitToTargetNoEntityFlag(ENTFLAG.INWATER, ENTFLAG.UNDERWATER);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===LimitToTargetWeapon===&lt;br /&gt;
This function will only allow the script goal to be created if the bots has one or more weapons set by this function. This is much more efficient than checking the bots weapons in script in common cases where a goal only applies to specific cases where the bot&#039;s target has a certain weapon.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (weapon Id, ...) Any number of weapon Ids&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 // This function can take any number of parameters.&lt;br /&gt;
 this.LimitToTargetWeapon(WEAPON.MOBILE_MG42);&lt;br /&gt;
 this.LimitToTargetWeapon(WEAPON.MOBILE_MG42, WEAPON.MORTAR);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===LimitToRole===&lt;br /&gt;
This function will only allow the script goal to be created if the owning bot has one of the roles provided.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (roleId, ...) Any number of role Ids&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 this.LimitToRole(ROLE.DEFENDER);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===IsActive===&lt;br /&gt;
Checks if the script goal is currently active. An active script goal means it is currently running. This check is useful mostly in cases where you want an active script goal to remain active and not necessarily keep performing complex checks in its GetPriority function.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (none)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; true if active, false if not&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 this.GetPriority = function()&lt;br /&gt;
 {&lt;br /&gt;
   if(this.IsActive())&lt;br /&gt;
   {&lt;br /&gt;
     return 1.0;&lt;br /&gt;
   }&lt;br /&gt;
   else&lt;br /&gt;
   {&lt;br /&gt;
     // do some other check&lt;br /&gt;
   }&lt;br /&gt;
 }; &amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===Goto===&lt;br /&gt;
Tells the bot to go to a specific location, planning and running a path if necessary. This function is synchronous.&lt;br /&gt;
&lt;br /&gt;
The first parameter can be a table of positions, bot will choose destination which has the shortest path.&lt;br /&gt;
&lt;br /&gt;
Bot will walk if the last parameter is {MoveMode = MoveMode.Walk}.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (Vector3 position, tolerance, options[optional])&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (table of Vector3 positions, tolerance, options[optional])&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; EVENT.PATH_SUCCESS or EVENT.PATH_FAILED&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 wpinfo = table();&lt;br /&gt;
 wp = Wp.GetWaypointByName(&amp;quot;somewaypoint&amp;quot;, wpinfo);&lt;br /&gt;
 if( this.Goto(wpinfo.position, wpinfo.radius) == EVENT.PATH_SUCCESS )&lt;br /&gt;
 {&lt;br /&gt;
     print(&amp;quot;Made it!&amp;quot;);&lt;br /&gt;
 }&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===GotoAsync===&lt;br /&gt;
Tells the bot to go to a specific location, planning and running a path if necessary. This function is asynchronous. Typically a script would block after calling this to wait for a success or failure message.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (Vector3 position, tolerance, options[optional])&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 wpinfo = table();&lt;br /&gt;
 wp = Wp.GetWaypointByName(&amp;quot;somewaypoint&amp;quot;, wpinfo);&lt;br /&gt;
 this.GotoAsync(wpinfo.position, wpinfo.radius);&lt;br /&gt;
 if( block(EVENT.PATH_SUCCESS, EVENT.PATH_FAILED) == EVENT.PATH_SUCCESS )&lt;br /&gt;
 {&lt;br /&gt;
     print(&amp;quot;Made it!&amp;quot;);&lt;br /&gt;
 }&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===GotoRandom===&lt;br /&gt;
Goto random destination.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (tolerance, options[optional])&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; EVENT.PATH_SUCCESS or EVENT.PATH_FAILED&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===GotoRandomAsync===&lt;br /&gt;
Goto random destination (asynchronous).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (tolerance, options[optional])&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===RouteTo===&lt;br /&gt;
RouteTo is similar to Goto, but bots use routes which are defined for map goal. Routes are used only if bot is within radius of any ROUTE goal.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (mapGoal, tolerance, options[optional])&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; EVENT.PATH_SUCCESS or EVENT.PATH_FAILED&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===Stop===&lt;br /&gt;
Interrupts any active Goto and signals PATH_FAILED.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===DidPathSucceed===&lt;br /&gt;
Checks if the last Goto command succeeded. Success means the bot has reached the end of the desired path. Typically a goal will block on EVENT.PATH_SUCCESS or EVENT.PATH_FAILED events. [[ScriptGoal#DidPathSucceed| DidPathSucceed]] and [[ScriptGoal#DidPathFail| DidPathFail]] are included for cases where the script wishes to remain active and doing something during the path traversal, and it can poll the path success/failure during. If neither function returns true, then the bot should be moving along the path normally.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; true if path succeeded, false if not&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 if(this.DidPathSucceed())&lt;br /&gt;
 {&lt;br /&gt;
 }&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;See Also:&#039;&#039;&#039; &lt;br /&gt;
[[ScriptGoal#Goto| Goto]], [[ScriptGoal#DidPathSucceed| DidPathSucceed]]&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===DidPathFail===&lt;br /&gt;
Checks if the last Goto command failed. Failure means the path was either blocked(no path exists), or the bot has gotten stuck on the way. Typically a goal will block on EVENT.PATH_SUCCESS or EVENT.PATH_FAILED events. [[ScriptGoal#DidPathSucceed| DidPathSucceed]] and [[ScriptGoal#DidPathFail| DidPathFail]] are included for cases where the script wishes to remain active and doing something during the path traversal, and it can poll the path success/failure during. If neither function returns true, then the bot should be moving along the path normally.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; true if path failed, false if not&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 if(this.DidPathFail())&lt;br /&gt;
 {&lt;br /&gt;
 }&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;See Also:&#039;&#039;&#039; &lt;br /&gt;
[[ScriptGoal#Goto| Goto]], [[ScriptGoal#DidPathSucceed| DidPathSucceed]]&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===AddAimRequest ===&lt;br /&gt;
Adds a priority based aim request into the bots aiming system. Aim requests are favored based on their priority, with the highest priority aim request chosen at any given point. It is a much simpler and easier to manage setup in the cases of many competing goals that wish to control the bots aim. Each goal can add an aim request and will recieve notifications when the bot chooses and executes their request. This functions works together with the AimVector property to allow setting the aim type at any point. The script can recieve notification of a successful aiming by blocking on the EVENT.AIM_SUCCESS event.&lt;br /&gt;
&lt;br /&gt;
Aim requests can be viewed in the [[Debug Window]] under the Aimer state. They will take on the name of the script goal they were added in.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (priority, aim type&amp;lt;optional, default position&amp;gt;, aim position&amp;lt;optional&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
====Priority====&lt;br /&gt;
Most normal goals use a Priority.High priority, which leaves 2 higher levels of priority usable by scripts or important goals. &lt;br /&gt;
&lt;br /&gt;
Priority determines how to select a request when there are multiple requests active. Higher priorities are selected over lower priorities.&lt;br /&gt;
&lt;br /&gt;
* Priority.Zero&lt;br /&gt;
* Priority.Min&lt;br /&gt;
* Priority.Idle - FollowPath&lt;br /&gt;
* Priority.VeryLow - LookAround&lt;br /&gt;
* Priority.Low - CAMP, ESCORT, RIDE, MOUNT, ...&lt;br /&gt;
* Priority.LowMed - AttackTarget&lt;br /&gt;
* Priority.Medium - CALLARTILLERY, MOBILEMORTAR, ...&lt;br /&gt;
* Priority.High - BUILD, DEFUSE, GRENADE, REVIVE, SWITCH, ...&lt;br /&gt;
* Priority.VeryHigh&lt;br /&gt;
* Priority.Override&lt;br /&gt;
&lt;br /&gt;
====Aim Types====&lt;br /&gt;
* movedirection - Face in the direction of movement. Useful if you want to override the bots normal combat aiming, as in for a disguise goal where you don&#039;t want them to engage the target.&lt;br /&gt;
* facing - Face a given facing (direction) vector. In this case AimVector represents a facing vector.&lt;br /&gt;
** (1,0,0) - east, (-1,0,0) - west&lt;br /&gt;
** (0,1,0) - north, (0,-1,0) - south&lt;br /&gt;
** (0,0,1) - up, (0,0,-1) - down&lt;br /&gt;
* position - Face a given position vector. In this case AimVector represents a point in the 3D map space.&lt;br /&gt;
&lt;br /&gt;
If one of the above is not specified, the aim request is a positional request, and the AimVector of the script goal will be used as a raw position to aim at.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 aimPos = someAimPosition;&lt;br /&gt;
 aimPos2 = someAimPosition2;&lt;br /&gt;
&lt;br /&gt;
 this.AddAimRequest(Priority.High, &amp;quot;movedirection&amp;quot;); // requests the bot to face along its move direction at a 0.8 priority&lt;br /&gt;
 // OR&lt;br /&gt;
 this.AddAimRequest(Priority.High); // leave off optional parameters, defaults to AimPosition, so set it&lt;br /&gt;
 this.AimVector = aimPos; // this can be called at any time in the script goal&lt;br /&gt;
&lt;br /&gt;
 if(block(EVENT.AIM_SUCCESS) == EVENT.AIM_SUCCESS)&lt;br /&gt;
 {&lt;br /&gt;
    // we&#039;re on target, do something cool&lt;br /&gt;
 }&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;See Also:&#039;&#039;&#039; &lt;br /&gt;
[[ScriptGoal#ReleaseAimRequest | ReleaseAimRequest]]&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===ReleaseAimRequest ===&lt;br /&gt;
This function will release the Aim Request within the script goal; allowing other potential aim requests to have control.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 this.ReleaseAimRequest();&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;See Also:&#039;&#039;&#039; &lt;br /&gt;
[[ScriptGoal#AddAimRequest| AddAimRequest]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===AddWeaponRequest ===&lt;br /&gt;
Adds a priority based weapon equip request into the bots weapon system. Weapon requests are favored based on their priority, with the highest priority request chosen as the desired weapon. It is a much simpler and easier to manage setup in the cases of many competing goals that wish to control the bots equipped weapon. Each goal can add an weapon request and will receive notifications when the bot chooses and executes their request. &lt;br /&gt;
&lt;br /&gt;
Weapon requests can be view in the [[Debug Window]] under the WeaponSystem state. They will take on the name of the script goal they were added in.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (priority, weapon Id)&lt;br /&gt;
&lt;br /&gt;
====Priority====&lt;br /&gt;
Most normal goals use a Priority.High priority, which leaves 2 higher levels of priority usable by scripts or important goals.&lt;br /&gt;
&lt;br /&gt;
Priority determines how to select a request when there are multiple requests active. Higher priorities are selected over lower priorities.&lt;br /&gt;
&lt;br /&gt;
* Priority.Min&lt;br /&gt;
* Priority.Idle&lt;br /&gt;
* Priority.VeryLow&lt;br /&gt;
* Priority.Low&lt;br /&gt;
* Priority.Medium&lt;br /&gt;
* Priority.High&lt;br /&gt;
* Priority.VeryHigh&lt;br /&gt;
* Priority.Override&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 this.AddWeaponRequest(Priority.High, WEAPON.MEDKIT); &amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;See Also:&#039;&#039;&#039; &lt;br /&gt;
[[ScriptGoal#ReleaseWeaponRequest | ReleaseWeaponRequest]]&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===ReleaseWeaponRequest ===&lt;br /&gt;
This function will release the weapon request within the script goal; allowing other potential weapon requests to have control.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 this.ReleaseWeaponRequest();&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;See Also:&#039;&#039;&#039; &lt;br /&gt;
[[ScriptGoal#AddWeaponRequest | AddWeaponRequest ]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===BlockForWeaponChange===&lt;br /&gt;
This function provides specialized script thread blocking functionality to wait for a weapon change to a certain weapon. This function takes the place of a call to block in the case you want to wait until the bot switches to a specific weapon.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (weaponId)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 this.BlockForWeaponChange(WEAPON.MEDKIT);&lt;br /&gt;
 this.Say(&amp;quot;Medkit Equipped!&amp;quot;);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===BlockForWeaponFire===&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===BlockForVoiceMacro===&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===QueryGoals===&lt;br /&gt;
&lt;br /&gt;
Finds goals available for this bot and stores them in the first table parameter. The previous table content is cleared since omni-bot 0.84. &lt;br /&gt;
&lt;br /&gt;
The last optional parameter is table of parameters to filter result (NoFilters, Group, Role, Team, SkipDelayed, SkipNoInProgress, SkipNoInUse, SkipInUse) or sort result (parameter Sort, values are &amp;quot;none&amp;quot;, &amp;quot;priority&amp;quot;, &amp;quot;name&amp;quot;, &amp;quot;random&amp;quot;, default is &amp;quot;priority&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (table, goal type hash, params[optional])&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (table, table of goal type hashes, params[optional])&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (table, expression, params[optional])&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; count of goals returned in table&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 count = this.QueryGoals(this.Bot.QueryGoalsTable, 0xc9326a43);&lt;br /&gt;
 count = this.QueryGoals(this.Bot.QueryGoalsTable, &amp;quot;BUILD_.*&amp;quot;);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===BlackboardDelay===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (time, mapGoal or serialNumber[optional])&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 this.BlackboardDelay(10);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===BlackboardIsDelayed===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (mapGoal or serialNumber)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; true if goal has been found on blackboard&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 if (this.BlackboardIsDelayed(serial))&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===MarkInProgress===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (mapGoal[optional])&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; true if empty slot has been found and marked&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 if (!this.MarkInProgress()) {&lt;br /&gt;
   this.BlackboardDelay(5);&lt;br /&gt;
   this.Finished();&lt;br /&gt;
 }&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===MarkInUse===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (mapGoal[optional])&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; true if empty slot has been found and marked&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 this.MarkInUse(); //finish if no slot is available&lt;br /&gt;
&lt;br /&gt;
 if (!this.MarkInUse(this.MapGoal)) {&lt;br /&gt;
   this.BlackboardDelay(5);&lt;br /&gt;
   this.Finished();&lt;br /&gt;
 }&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===WatchForMapGoalsInRadius===&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===ClearWatchForMapGoalsInRadius===&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===WatchForEntityCategory===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; ( { Radius, Category, RequireLOS[optional, default 0] } )&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 this.WatchForEntityCategory({&lt;br /&gt;
   Radius = 350,&lt;br /&gt;
   Category = CAT.PROJECTILE,&lt;br /&gt;
   RequireLOS = TRACE.VISIBLE&lt;br /&gt;
 });&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===DelayGetPriority===&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===ForkThread===&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===KillThread===&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===Signal===&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== Script Goal Threading ==&lt;br /&gt;
&lt;br /&gt;
Script goals have been designed to be friendly to script threading, by providing some built in functionality to make it easier to manage multiple threads to be associated with the script goal.&lt;br /&gt;
&lt;br /&gt;
The script goal keeps track of the thread created when calling all the following functions.&lt;br /&gt;
* Initialize&lt;br /&gt;
* OnSpawn&lt;br /&gt;
* GetPriority&lt;br /&gt;
* Enter&lt;br /&gt;
* Exit&lt;br /&gt;
* Update&lt;br /&gt;
&lt;br /&gt;
You may use thread functions (block, yield, sleep), in any of the script goal functions, though you must understand that for efficiency, and to prevent runaway threads, the script goal will internally kill the threads associated with the function callbacks at certain times.&lt;br /&gt;
&lt;br /&gt;
Currently&lt;br /&gt;
* All threads will be killed when the state exits.&lt;br /&gt;
* All threads will be killed when the state is disabled. See [[ScriptGoal#Disable| Disable]]&lt;br /&gt;
* All threads will be killed when the state becomes unselectable. This is normally due to the limit functions.&lt;br /&gt;
&lt;br /&gt;
Note that this only applies to the thread that is created for the function calls themselves. If you really need a thread to run longer than these specifications allow, you can create your own thread normally with the thread() function. It is highly recommended that you script your goal within these functions, as it is easy to &#039;&#039;leak&#039;&#039; threads when creating them arbitrarily.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
== Script Goal Performance ==&lt;br /&gt;
&lt;br /&gt;
Executing script is much much slower than executing native code, so you should be aware that a script can have significant adverse effects on the performance of the bot as a whole. Here are some tips to keep performance as high as possible with script goals.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Only define what you need&#039;&#039;&#039; - None of the callback functions are required, so if you don&#039;t use them, don&#039;t define them. It is wasteful to have an empty function defined. If you don&#039;t need an Enter function, leave it out, if you don&#039;t need an Update function, leave it out. Same for Exit, GetPriority, Initialize.&lt;br /&gt;
* &#039;&#039;&#039;Use limit functions as much as possible&#039;&#039;&#039; - If the goal should only be considered for certain player classes, or for bots with certain powerups or entity flags, or for when the bot has a target that matches similar specific flags, use the Limit functions to set that up. They are much much faster than checking those properties in the GetPriority function. If the limit functions fail, the script will never be called, which is a huge optimization.&lt;br /&gt;
* &#039;&#039;&#039;Use thread functions&#039;&#039;&#039; - Normally, GetPriority is called often. You can control this behavior by using thread functions to keep a thread running, and delay priority evaluations with a loop and calls to sleep. GetPriority will not be called if there is still an active GetPriority thread.&lt;br /&gt;
* &#039;&#039;&#039;Keep your GetPriority function as lightweight as possible&#039;&#039;&#039; - The less work it does the better, because GetPriority is called frequently by the bot. This is especially important if the goal is placed under the &#039;&#039;LowLevel&#039;&#039; parent because all child states under &#039;&#039;LowLevel&#039;&#039; are evaluated and allowed to run simultaneously. &lt;br /&gt;
* &#039;&#039;&#039;Ditto for the Update function&#039;&#039;&#039; - The same applies to the Update function especially. Keep it as simple as possible to achieve the desired behavior, and use thread functions.&lt;br /&gt;
* &#039;&#039;&#039;Cache as much as possible&#039;&#039;&#039; - Take advantage of the fact that Initialize is called only once when the bot is added. Use this function to cache values the script goal might need. For example, if the script goal does things based on specific waypoints, it would be expensive to call functions like Wp.GetWaypointByName() in the priority or update functions. Instead collect all you might need up front in the Initialize function and store them in a table on the script goal so you have faster access to them later.&lt;br /&gt;
* &#039;&#039;&#039;Use events, and block() as much as possible&#039;&#039;&#039; - Most common operations that previously required expensive loops to perform have been converted to events. Choosing a weapon, aiming a weapon, going to some location, etc. Most can be followed by a call to block() which will suspend the execution of the script until the event is recieved. This is the single easiest to use and most useful for performance features available. See [[ScriptGoal#BlockForWeaponChange|BlockForWeaponChange]], [[ScriptGoal#Goto|Goto]], [[ScriptGoal#AddAimRequest|AddAimRequest]].&lt;br /&gt;
* &#039;&#039;&#039;Beware of loops&#039;&#039;&#039; - Be careful when looping, as they can silently cause large performance drains. Be wary of how much work is being done in a loop, and on how many elements. Expensive functionality can be updated less often, or split up over time. Use yield() or sleep(x) within loops to spread out the calculations over time.&lt;/div&gt;</summary>
		<author><name>Palota</name></author>
	</entry>
	<entry>
		<id>https://mygamingtalk.com/wiki/index.php?title=MapGoal&amp;diff=1763</id>
		<title>MapGoal</title>
		<link rel="alternate" type="text/html" href="https://mygamingtalk.com/wiki/index.php?title=MapGoal&amp;diff=1763"/>
		<updated>2025-05-25T16:22:06Z</updated>

		<summary type="html">&lt;p&gt;Palota: /* ClearRoles */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{process header&lt;br /&gt;
 | title    = MapGoal Functions&lt;br /&gt;
 | section  =&lt;br /&gt;
 | previous = [[Omni-bot_Script_Reference | Script Reference]]&lt;br /&gt;
 | next     = &lt;br /&gt;
 | shortcut =&lt;br /&gt;
 | notes    =&lt;br /&gt;
}}&lt;br /&gt;
{{TOCright}}&lt;br /&gt;
==Map Goal Properties==&lt;br /&gt;
----&lt;br /&gt;
===CreateOnLoad===&lt;br /&gt;
False to not create the goal at load time, but keep the data around for when created by the interface.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===DefaultPriority===&lt;br /&gt;
Default priority of the goal, if no class/team specific priorities.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===DefaultRenderHeight===&lt;br /&gt;
Goal height offset where rendering will take place.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===DefaultRenderRadius===&lt;br /&gt;
Maximal distance from player to display text (goal options).&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===DisableForControllingTeam===&lt;br /&gt;
Goal will be made unavailable for the team which controls it (GetOwner). It is used by CHECKPOINT goal.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===DontSave===&lt;br /&gt;
Don&#039;t save this goal into the map goal script.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===DynamicOrientation===&lt;br /&gt;
Goal should update its orientation from its entity. It is used by BUILD goal to repair vehicles.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===DynamicPosition===&lt;br /&gt;
Goal should update its position from its entity. It is used by BUILD goal to repair vehicles.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===ExtraDebugText===&lt;br /&gt;
Additional debug text to render in RenderDefault function.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===GoalState===&lt;br /&gt;
Gets the goal state.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===GoalStateFunction===&lt;br /&gt;
internal&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===GoalType===&lt;br /&gt;
Type of goal.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===InUse===&lt;br /&gt;
Goal is inuse and should not be chosen.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===MarkForRemoval===&lt;br /&gt;
Mark the goal for deletion.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===MinRadius===&lt;br /&gt;
Minimum allowed radius of the goal.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===Radius===&lt;br /&gt;
Radius of the goal.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===RemoveWithEntity===&lt;br /&gt;
Goal should be removed if its entity is removed. Default is true. It is used by FLAG, FLAGRETURN, DEFUSE goals.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===RenderDefaultCurrentAvailability===&lt;br /&gt;
Draw the current availability of the goal.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===RenderDefaultGroup===&lt;br /&gt;
Draw the group of the goal.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===RenderDefaultInitialAvailability===&lt;br /&gt;
Draw the initial availability of the goal.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===RenderDefaultName===&lt;br /&gt;
Draw the name of the goal.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===RenderDefaultRadius===&lt;br /&gt;
Draw the radius of the goal.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===RenderDefaultRole===&lt;br /&gt;
Draw the roles for the goal.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===RenderGoal===&lt;br /&gt;
Enable rendering for this goal. It is set by console command /bot draw_goals&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===RenderRandomUsePoint===&lt;br /&gt;
Draw whether or not the goal randomly selects a usepoint.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===RenderRangeLimit===&lt;br /&gt;
Draw whether or not the goal randomly selects a usepoint.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===RenderRoutes===&lt;br /&gt;
Enable rendering of the routes for this goal. It is set by console command /bot draw_goalroutes&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;See:&#039;&#039;&#039; &lt;br /&gt;
[[Template:Baserouting|Routing]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===RolePriorityBonus===&lt;br /&gt;
Role priority bonus of the goal, for users matching role.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;See:&#039;&#039;&#039; &lt;br /&gt;
[[Roles]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===Version===&lt;br /&gt;
Gets the goal version. Omni-bot 0.8 sets goal version to 1.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===SerialNum===&lt;br /&gt;
Auto generated unique serial number of the goal.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==Map Goal Callbacks==&lt;br /&gt;
----&lt;br /&gt;
===InitNewGoal===&lt;br /&gt;
Called on goal creation (command /bot goal_create) to initialize any internal variables and set properties to default values.&lt;br /&gt;
For example, camping goals can initialize aim vectors to the player facing.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===UpgradeVersion===&lt;br /&gt;
Called after the goal properties have been loaded from a goals file. This function should validate schema and upgrade the goal to the latest used version.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===Render===&lt;br /&gt;
Called when draw_goals is enabled for this goal. Used to render itself.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===Update===&lt;br /&gt;
Called every frame to update the state of the goal if needed. For example, GRENADE goal calls TraceLine function to check if the goal has been destroyed.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===SaveToTable===&lt;br /&gt;
Called when the goals are saved to a file. Allows the goal to serialize persistent information.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===SetProperty===&lt;br /&gt;
Called on command /bot goal_setproperty x y, where x is a property name and y is a value or keyword.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===Help===&lt;br /&gt;
Called on commands /bot goal_help or /bot goal_create to print requirements and available properties for the goal.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===HudDisplay===&lt;br /&gt;
Called when debug window is enabled and goal is highlighted to create gui elements for debug visualization.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==Map Goal Functions==&lt;br /&gt;
----&lt;br /&gt;
===AddRoute===&lt;br /&gt;
&#039;&#039;&#039;See:&#039;&#039;&#039; &lt;br /&gt;
[[Template:Baserouting|Routing]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (start, end, weight)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 mg.AddRoute(&amp;quot;ROUTE_spawn&amp;quot;, &amp;quot;ROUTE_gate&amp;quot;, 1.0);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Utility function:&#039;&#039;&#039; Util.Routes&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===AddUsePoint===&lt;br /&gt;
Adds a use point to the goal. Use points are used by RouteTo function. The goal can have multiple use points. Bots choose the nearest use point if goal property RandomUsePoint is false.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (Vector3, relative[optional, default false])&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 mg.AddUsePoint(Vector3(10,50,0), true);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Utility functions:&#039;&#039;&#039; Util.AddUsePoint, Util.AddUseWp&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===ClearRoles===&lt;br /&gt;
Removes the given roles from this goal.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (roleId, ...)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 mg.ClearRoles(ROLE.DEFENDER1, ROLE.DEFENDER2);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Utility functions:&#039;&#039;&#039; ClearGoalRole, Util.ClearRoleForGroup, Util.ClearRoleForTable&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;See:&#039;&#039;&#039; [[Roles]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===ClearUsePoints===&lt;br /&gt;
Deletes all use points of the map goal.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 mg.ClearUsePoints();&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===CreateGuiFromSchema===&lt;br /&gt;
Used in HudDisplay callback if debug window is enabled.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 this.CreateGuiFromSchema(this.Schema);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===DeleteIfEntityFlag===&lt;br /&gt;
Sets one or more entity flags that will cause the goal to be deleted.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (entFlagId, ...)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 mg.DeleteIfEntityFlag(ENTFLAG.DISABLED);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===DisableGoal===&lt;br /&gt;
Sets whether the goal is currently disabled.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (true/false)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 mg.DisableGoal(true);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===DisableIfEntityFlag===&lt;br /&gt;
Sets one or more entity flags that will cause the goal to be disabled.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (entFlagId, ...)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 mg.DisableIfEntityFlag(ENTFLAG.DISABLED);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===GetCenterBounds===&lt;br /&gt;
Gets the center of the bounding box.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; Vector3&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 center = mg.GetCenterBounds();&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===GetEntity===&lt;br /&gt;
Gets the entity of the map goal.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; GameEntity&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 ent = mg.GetEntity();&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===GetFacing===&lt;br /&gt;
Gets the facing of the map goal.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; Vector3 facing&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 face = mg.GetFacing();&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===GetGoalPriority===&lt;br /&gt;
Gets the priority for a given class/team. Default priority is returned if class or team is 0.&lt;br /&gt;
&lt;br /&gt;
If the parameter is bot, role priority bonus is added if the bot has any of the goals roles.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (bot)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (teamId, classId)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; float&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 priority = mg.GetGoalPriority(bot);&lt;br /&gt;
 // OR&lt;br /&gt;
 priority = mg.GetGoalPriority(TEAM.AXIS,CLASS.MEDIC);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===GetGoalState===&lt;br /&gt;
Gets the goal state of the map goal.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; goal state id&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 state = mg.GetGoalState();&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===GetGoalType===&lt;br /&gt;
Gets goal type. Examples: Attack, BUILD, CapPoint, PLANT.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; string&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 type = mg.GetGoalType();&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===GetGroupName===&lt;br /&gt;
Gets the current group this goal is assigned to.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; string&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 group = mg.GetGroupName();&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===GetName===&lt;br /&gt;
Gets the name of the map goal.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; name of mapgoal&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 name = mg.GetName();&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===GetNumUsePoint===&lt;br /&gt;
Gets the number of use points the goal has.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; # use points&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 n = mg.GetNumUsePoint();&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===GetOwner===&lt;br /&gt;
Gets the owner of the map goal. Typically someone that is carrying it.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; Owner GameId, or null if no owner&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 owner = mg.GetOwner();&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===GetPosition===&lt;br /&gt;
Gets the position of the map goal.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; Vector3 position&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 pos = mg.GetPosition();&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===GetRadius===&lt;br /&gt;
Gets the radius of the map goal.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; float radius&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 radius = mg.GetRadius();&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===GetRange===&lt;br /&gt;
Get current radius limit for the map goal or 0.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; int radius&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 range = mg.GetRange();&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===GetRangeAABB===&lt;br /&gt;
Get current AABB range limit for the map goal or null.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; AABB or null&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 range = mg.GetRangeAABB();&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===GetTagName===&lt;br /&gt;
Gets the tag name of the map goal. This is usually a mash of the entity name and goal type.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; tag name&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 tag = mg.GetTagName();&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===GetTypeName===&lt;br /&gt;
Gets the type name of the map goal.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; type name&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 type = mg.GetTypeName();&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===GetUsePoint===&lt;br /&gt;
Gets a use point, by index. If no index provided, returns a random one.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (index&amp;lt;optional&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; Vector3 use point&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 pt = mg.GetUsePoint();&lt;br /&gt;
 // OR&lt;br /&gt;
 pt = mg.GetUsePoint(2);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===HasRole===&lt;br /&gt;
Returns true if the goal has any of the roles provided as parameters.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (roleId, ...)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; true/false&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 if(mg.HasRole(ROLE.ATTACKER))&lt;br /&gt;
 {&lt;br /&gt;
 }&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;See:&#039;&#039;&#039; [[Roles]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===IsAvailable===&lt;br /&gt;
Checks if the map goal is currently available to a certain team.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (team id)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; true if goal is available for team, false if not&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 if(mg.IsAvailable(TEAM.RED))&lt;br /&gt;
 {&lt;br /&gt;
 }&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===IsAvailableInitial===&lt;br /&gt;
Is goal available for team initially (before OnMapLoad is executed).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (team id)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; true if goal is available for team, false if not&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 if (mg.IsAvailableInitial(TEAM.RED))&lt;br /&gt;
 {&lt;br /&gt;
 }&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===IsDisabled===&lt;br /&gt;
Gets whether the goal is currently disabled.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; true/false&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 if(mg.IsDisabled())&lt;br /&gt;
 {&lt;br /&gt;
 }&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===LimitToWeapon===&lt;br /&gt;
Adds a list of weapons that are required from any user of the goal. &lt;br /&gt;
&lt;br /&gt;
Warning: This function does not work for weapons that have ID greater than 63.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (weaponId, ...)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 mg.LimitToWeapon(WEAPON.FG42);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===MaxUsers_InProgress===&lt;br /&gt;
Get or set the max number of users that can go to the goal.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none or (integer)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; integer&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 num = mg.MaxUsers_InProgress();&lt;br /&gt;
 // OR&lt;br /&gt;
 mg.MaxUsers_InProgress(2);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Utility functions:&#039;&#039;&#039; Util.SetMaxUsers, Util.SetMaxUsersInProgress, Util.GetMaxUsersInProgress, Util.SetPercentInProgress&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===MaxUsers_InUse===&lt;br /&gt;
Get or set the max number of users that can use the goal after they come to the goal position.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none or (integer)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; integer&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 num = mg.MaxUsers_InUse();&lt;br /&gt;
 // OR&lt;br /&gt;
 mg.MaxUsers_InUse(1);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Utility functions:&#039;&#039;&#039; Util.SetMaxUsers, Util.SetMaxUsersInUse, Util.GetMaxUsersInUse&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===RenderDefault===&lt;br /&gt;
Draws goal name, radius, availability, use points, ExtraDebugText, ...&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 mg.RenderDefault();&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===ResetGoalPriorities===&lt;br /&gt;
Clears all the current priorities.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 mg.ResetGoalPriorities();&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===SetAvailable===&lt;br /&gt;
Sets the map goal available for a certain team.&lt;br /&gt;
&lt;br /&gt;
NOTE: Map scripts usually use global function SetAvailableMapGoals instead of calling SetAvailable directly on map goal object.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (team id, true/false)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 mg.SetAvailable(TEAM.RED, false);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===SetAvailableInitial===&lt;br /&gt;
Sets goal available for team initially.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (team id, true/false)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 mg.SetAvailableInitial(TEAM.AXIS, true);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===SetBaseGoalType===&lt;br /&gt;
Clones a base goal type. Should be done first thing in goal script.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (fileName)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 this.SetBaseGoalType(&amp;quot;mapgoal_camp.gm&amp;quot;);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===SetEntity===&lt;br /&gt;
Sets the entity for a map goal. It is usually not needed because most entities are detected automatically.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (entity)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 GetGoal(&amp;quot;MOUNTMG42_assault_tower_mg&amp;quot;).SetEntity(GetEntityByName(&amp;quot;assault_tower_mg&amp;quot;));;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===SetFacing===&lt;br /&gt;
Sets the facing for a map goal.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (Vector3)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 mg.SetFacing(Vector3(1,0,0));&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===SetGoalPriority===&lt;br /&gt;
Sets the priority for a given class/team. The first parameter can be 0 to set priority for all teams. The second parameter can be 0 to set priority for all classes.&lt;br /&gt;
&lt;br /&gt;
NOTE: Map scripts usually use global function SetGoalPriority instead of calling SetGoalPriority directly on map goal object.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (teamId, classId, priority)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 mg.SetGoalPriority(TEAM.ALLIES, CLASS.SOLDIER, 0.8);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===SetGroupName===&lt;br /&gt;
Sets the current group this goal is assigned to.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (groupName)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 mg.SetGroupName(&amp;quot;group1&amp;quot;);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===SetPosition===&lt;br /&gt;
Sets the position for a map goal.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (Vector3)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 mg.SetPosition(Vector3(10,10,10));&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===SetRadius===&lt;br /&gt;
Sets the radius for a map goal.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (radius)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 mg.SetRadius(65);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===SetRange===&lt;br /&gt;
Sets the range for a script based map goal. It can be int radius or AABB box or both. The QueryGoals functions does not return goals which are out of range. Default range for all goals is unlimited. Goals will not be interrupted if the range changes after the bot has already activated the goal.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (int or AABB)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 mg.SetRange(1000);&lt;br /&gt;
 mg.SetRange(AABB(1369,2165,30, 4100,3700,350));&lt;br /&gt;
&lt;br /&gt;
 //reset to unlimited&lt;br /&gt;
 mg.SetRange(0);&lt;br /&gt;
 mg.SetRange(AABB());&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Utility function:&#039;&#039;&#039; Util.SetGoalRange&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===SetRemoveFlag===&lt;br /&gt;
Marks the goal for removal.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (true/false)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 mg.SetRemoveFlag(true);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===SetRoles===&lt;br /&gt;
Sets the roles that are allowed to use this goal.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (roleId or table)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 mg.SetRoles(ROLE.DEFENDER);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Utility functions:&#039;&#039;&#039; SetGoalRole, Util.SetRoleForGroup&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;See:&#039;&#039;&#039; [[Roles]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==Obsolete Functions==&lt;br /&gt;
&lt;br /&gt;
===GetBounds===&lt;br /&gt;
Gets the AABB bounds of the map goal.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; AABB&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 bounds = mg.GetBounds();&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===GetLocalBounds===&lt;br /&gt;
Gets the local space bounds of the map goal.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; AABB bounds&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 localbounds = mg.GetLocalBounds();&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===GetMatrix===&lt;br /&gt;
Gets the Matrix3 transform of the map goal.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; Matrix3 transform&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 m = mg.GetMatrix();&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===SetEnableDraw===&lt;br /&gt;
Enables debug rendering for this map goal.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (true/false)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 mg.SetEnableDraw(true);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===SetMatrix===&lt;br /&gt;
Sets the matrix for a map goal.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (Matrix3)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 m = Matrix3();&lt;br /&gt;
 // initialize it somehow&lt;br /&gt;
 mg.SetMatrix(m);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;/div&gt;</summary>
		<author><name>Palota</name></author>
	</entry>
	<entry>
		<id>https://mygamingtalk.com/wiki/index.php?title=MapGoal&amp;diff=1762</id>
		<title>MapGoal</title>
		<link rel="alternate" type="text/html" href="https://mygamingtalk.com/wiki/index.php?title=MapGoal&amp;diff=1762"/>
		<updated>2025-05-25T16:19:26Z</updated>

		<summary type="html">&lt;p&gt;Palota: /* GetRange, GetRangeAABB */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{process header&lt;br /&gt;
 | title    = MapGoal Functions&lt;br /&gt;
 | section  =&lt;br /&gt;
 | previous = [[Omni-bot_Script_Reference | Script Reference]]&lt;br /&gt;
 | next     = &lt;br /&gt;
 | shortcut =&lt;br /&gt;
 | notes    =&lt;br /&gt;
}}&lt;br /&gt;
{{TOCright}}&lt;br /&gt;
==Map Goal Properties==&lt;br /&gt;
----&lt;br /&gt;
===CreateOnLoad===&lt;br /&gt;
False to not create the goal at load time, but keep the data around for when created by the interface.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===DefaultPriority===&lt;br /&gt;
Default priority of the goal, if no class/team specific priorities.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===DefaultRenderHeight===&lt;br /&gt;
Goal height offset where rendering will take place.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===DefaultRenderRadius===&lt;br /&gt;
Maximal distance from player to display text (goal options).&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===DisableForControllingTeam===&lt;br /&gt;
Goal will be made unavailable for the team which controls it (GetOwner). It is used by CHECKPOINT goal.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===DontSave===&lt;br /&gt;
Don&#039;t save this goal into the map goal script.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===DynamicOrientation===&lt;br /&gt;
Goal should update its orientation from its entity. It is used by BUILD goal to repair vehicles.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===DynamicPosition===&lt;br /&gt;
Goal should update its position from its entity. It is used by BUILD goal to repair vehicles.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===ExtraDebugText===&lt;br /&gt;
Additional debug text to render in RenderDefault function.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===GoalState===&lt;br /&gt;
Gets the goal state.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===GoalStateFunction===&lt;br /&gt;
internal&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===GoalType===&lt;br /&gt;
Type of goal.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===InUse===&lt;br /&gt;
Goal is inuse and should not be chosen.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===MarkForRemoval===&lt;br /&gt;
Mark the goal for deletion.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===MinRadius===&lt;br /&gt;
Minimum allowed radius of the goal.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===Radius===&lt;br /&gt;
Radius of the goal.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===RemoveWithEntity===&lt;br /&gt;
Goal should be removed if its entity is removed. Default is true. It is used by FLAG, FLAGRETURN, DEFUSE goals.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===RenderDefaultCurrentAvailability===&lt;br /&gt;
Draw the current availability of the goal.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===RenderDefaultGroup===&lt;br /&gt;
Draw the group of the goal.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===RenderDefaultInitialAvailability===&lt;br /&gt;
Draw the initial availability of the goal.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===RenderDefaultName===&lt;br /&gt;
Draw the name of the goal.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===RenderDefaultRadius===&lt;br /&gt;
Draw the radius of the goal.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===RenderDefaultRole===&lt;br /&gt;
Draw the roles for the goal.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===RenderGoal===&lt;br /&gt;
Enable rendering for this goal. It is set by console command /bot draw_goals&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===RenderRandomUsePoint===&lt;br /&gt;
Draw whether or not the goal randomly selects a usepoint.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===RenderRangeLimit===&lt;br /&gt;
Draw whether or not the goal randomly selects a usepoint.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===RenderRoutes===&lt;br /&gt;
Enable rendering of the routes for this goal. It is set by console command /bot draw_goalroutes&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;See:&#039;&#039;&#039; &lt;br /&gt;
[[Template:Baserouting|Routing]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===RolePriorityBonus===&lt;br /&gt;
Role priority bonus of the goal, for users matching role.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;See:&#039;&#039;&#039; &lt;br /&gt;
[[Roles]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===Version===&lt;br /&gt;
Gets the goal version. Omni-bot 0.8 sets goal version to 1.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===SerialNum===&lt;br /&gt;
Auto generated unique serial number of the goal.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==Map Goal Callbacks==&lt;br /&gt;
----&lt;br /&gt;
===InitNewGoal===&lt;br /&gt;
Called on goal creation (command /bot goal_create) to initialize any internal variables and set properties to default values.&lt;br /&gt;
For example, camping goals can initialize aim vectors to the player facing.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===UpgradeVersion===&lt;br /&gt;
Called after the goal properties have been loaded from a goals file. This function should validate schema and upgrade the goal to the latest used version.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===Render===&lt;br /&gt;
Called when draw_goals is enabled for this goal. Used to render itself.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===Update===&lt;br /&gt;
Called every frame to update the state of the goal if needed. For example, GRENADE goal calls TraceLine function to check if the goal has been destroyed.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===SaveToTable===&lt;br /&gt;
Called when the goals are saved to a file. Allows the goal to serialize persistent information.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===SetProperty===&lt;br /&gt;
Called on command /bot goal_setproperty x y, where x is a property name and y is a value or keyword.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===Help===&lt;br /&gt;
Called on commands /bot goal_help or /bot goal_create to print requirements and available properties for the goal.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===HudDisplay===&lt;br /&gt;
Called when debug window is enabled and goal is highlighted to create gui elements for debug visualization.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==Map Goal Functions==&lt;br /&gt;
----&lt;br /&gt;
===AddRoute===&lt;br /&gt;
&#039;&#039;&#039;See:&#039;&#039;&#039; &lt;br /&gt;
[[Template:Baserouting|Routing]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (start, end, weight)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 mg.AddRoute(&amp;quot;ROUTE_spawn&amp;quot;, &amp;quot;ROUTE_gate&amp;quot;, 1.0);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Utility function:&#039;&#039;&#039; Util.Routes&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===AddUsePoint===&lt;br /&gt;
Adds a use point to the goal. Use points are used by RouteTo function. The goal can have multiple use points. Bots choose the nearest use point if goal property RandomUsePoint is false.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (Vector3, relative[optional, default false])&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 mg.AddUsePoint(Vector3(10,50,0), true);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Utility functions:&#039;&#039;&#039; Util.AddUsePoint, Util.AddUseWp&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===ClearRoles===&lt;br /&gt;
Removes the given roles from this goal.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (roleId, ...)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 mg.ClearRoles(ROLE.DEFENDER1, ROLE.DEFENDER2);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Utility functions:&#039;&#039;&#039; ClearGoalRole, Util.ClearRoleForGroup, Util.ClearRoleForTable&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;See:&#039;&#039;&#039; [[Roles]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===CreateGuiFromSchema===&lt;br /&gt;
Used in HudDisplay callback if debug window is enabled.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 this.CreateGuiFromSchema(this.Schema);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===DeleteIfEntityFlag===&lt;br /&gt;
Sets one or more entity flags that will cause the goal to be deleted.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (entFlagId, ...)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 mg.DeleteIfEntityFlag(ENTFLAG.DISABLED);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===DisableGoal===&lt;br /&gt;
Sets whether the goal is currently disabled.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (true/false)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 mg.DisableGoal(true);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===DisableIfEntityFlag===&lt;br /&gt;
Sets one or more entity flags that will cause the goal to be disabled.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (entFlagId, ...)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 mg.DisableIfEntityFlag(ENTFLAG.DISABLED);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===GetCenterBounds===&lt;br /&gt;
Gets the center of the bounding box.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; Vector3&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 center = mg.GetCenterBounds();&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===GetEntity===&lt;br /&gt;
Gets the entity of the map goal.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; GameEntity&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 ent = mg.GetEntity();&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===GetFacing===&lt;br /&gt;
Gets the facing of the map goal.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; Vector3 facing&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 face = mg.GetFacing();&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===GetGoalPriority===&lt;br /&gt;
Gets the priority for a given class/team. Default priority is returned if class or team is 0.&lt;br /&gt;
&lt;br /&gt;
If the parameter is bot, role priority bonus is added if the bot has any of the goals roles.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (bot)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (teamId, classId)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; float&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 priority = mg.GetGoalPriority(bot);&lt;br /&gt;
 // OR&lt;br /&gt;
 priority = mg.GetGoalPriority(TEAM.AXIS,CLASS.MEDIC);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===GetGoalState===&lt;br /&gt;
Gets the goal state of the map goal.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; goal state id&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 state = mg.GetGoalState();&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===GetGoalType===&lt;br /&gt;
Gets goal type. Examples: Attack, BUILD, CapPoint, PLANT.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; string&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 type = mg.GetGoalType();&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===GetGroupName===&lt;br /&gt;
Gets the current group this goal is assigned to.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; string&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 group = mg.GetGroupName();&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===GetName===&lt;br /&gt;
Gets the name of the map goal.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; name of mapgoal&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 name = mg.GetName();&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===GetNumUsePoint===&lt;br /&gt;
Gets the number of use points the goal has.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; # use points&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 n = mg.GetNumUsePoint();&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===GetOwner===&lt;br /&gt;
Gets the owner of the map goal. Typically someone that is carrying it.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; Owner GameId, or null if no owner&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 owner = mg.GetOwner();&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===GetPosition===&lt;br /&gt;
Gets the position of the map goal.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; Vector3 position&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 pos = mg.GetPosition();&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===GetRadius===&lt;br /&gt;
Gets the radius of the map goal.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; float radius&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 radius = mg.GetRadius();&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===GetRange===&lt;br /&gt;
Get current radius limit for the map goal or 0.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; int radius&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 range = mg.GetRange();&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===GetRangeAABB===&lt;br /&gt;
Get current AABB range limit for the map goal or null.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; AABB or null&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 range = mg.GetRangeAABB();&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===GetTagName===&lt;br /&gt;
Gets the tag name of the map goal. This is usually a mash of the entity name and goal type.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; tag name&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 tag = mg.GetTagName();&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===GetTypeName===&lt;br /&gt;
Gets the type name of the map goal.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; type name&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 type = mg.GetTypeName();&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===GetUsePoint===&lt;br /&gt;
Gets a use point, by index. If no index provided, returns a random one.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (index&amp;lt;optional&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; Vector3 use point&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 pt = mg.GetUsePoint();&lt;br /&gt;
 // OR&lt;br /&gt;
 pt = mg.GetUsePoint(2);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===HasRole===&lt;br /&gt;
Returns true if the goal has any of the roles provided as parameters.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (roleId, ...)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; true/false&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 if(mg.HasRole(ROLE.ATTACKER))&lt;br /&gt;
 {&lt;br /&gt;
 }&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;See:&#039;&#039;&#039; [[Roles]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===IsAvailable===&lt;br /&gt;
Checks if the map goal is currently available to a certain team.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (team id)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; true if goal is available for team, false if not&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 if(mg.IsAvailable(TEAM.RED))&lt;br /&gt;
 {&lt;br /&gt;
 }&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===IsAvailableInitial===&lt;br /&gt;
Is goal available for team initially (before OnMapLoad is executed).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (team id)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; true if goal is available for team, false if not&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 if (mg.IsAvailableInitial(TEAM.RED))&lt;br /&gt;
 {&lt;br /&gt;
 }&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===IsDisabled===&lt;br /&gt;
Gets whether the goal is currently disabled.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; true/false&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 if(mg.IsDisabled())&lt;br /&gt;
 {&lt;br /&gt;
 }&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===LimitToWeapon===&lt;br /&gt;
Adds a list of weapons that are required from any user of the goal. &lt;br /&gt;
&lt;br /&gt;
Warning: This function does not work for weapons that have ID greater than 63.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (weaponId, ...)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 mg.LimitToWeapon(WEAPON.FG42);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===MaxUsers_InProgress===&lt;br /&gt;
Get or set the max number of users that can go to the goal.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none or (integer)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; integer&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 num = mg.MaxUsers_InProgress();&lt;br /&gt;
 // OR&lt;br /&gt;
 mg.MaxUsers_InProgress(2);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Utility functions:&#039;&#039;&#039; Util.SetMaxUsers, Util.SetMaxUsersInProgress, Util.GetMaxUsersInProgress, Util.SetPercentInProgress&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===MaxUsers_InUse===&lt;br /&gt;
Get or set the max number of users that can use the goal after they come to the goal position.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none or (integer)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; integer&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 num = mg.MaxUsers_InUse();&lt;br /&gt;
 // OR&lt;br /&gt;
 mg.MaxUsers_InUse(1);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Utility functions:&#039;&#039;&#039; Util.SetMaxUsers, Util.SetMaxUsersInUse, Util.GetMaxUsersInUse&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===RenderDefault===&lt;br /&gt;
Draws goal name, radius, availability, use points, ExtraDebugText, ...&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 mg.RenderDefault();&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===ResetGoalPriorities===&lt;br /&gt;
Clears all the current priorities.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 mg.ResetGoalPriorities();&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===SetAvailable===&lt;br /&gt;
Sets the map goal available for a certain team.&lt;br /&gt;
&lt;br /&gt;
NOTE: Map scripts usually use global function SetAvailableMapGoals instead of calling SetAvailable directly on map goal object.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (team id, true/false)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 mg.SetAvailable(TEAM.RED, false);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===SetAvailableInitial===&lt;br /&gt;
Sets goal available for team initially.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (team id, true/false)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 mg.SetAvailableInitial(TEAM.AXIS, true);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===SetBaseGoalType===&lt;br /&gt;
Clones a base goal type. Should be done first thing in goal script.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (fileName)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 this.SetBaseGoalType(&amp;quot;mapgoal_camp.gm&amp;quot;);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===SetEntity===&lt;br /&gt;
Sets the entity for a map goal. It is usually not needed because most entities are detected automatically.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (entity)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 GetGoal(&amp;quot;MOUNTMG42_assault_tower_mg&amp;quot;).SetEntity(GetEntityByName(&amp;quot;assault_tower_mg&amp;quot;));;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===SetFacing===&lt;br /&gt;
Sets the facing for a map goal.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (Vector3)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 mg.SetFacing(Vector3(1,0,0));&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===SetGoalPriority===&lt;br /&gt;
Sets the priority for a given class/team. The first parameter can be 0 to set priority for all teams. The second parameter can be 0 to set priority for all classes.&lt;br /&gt;
&lt;br /&gt;
NOTE: Map scripts usually use global function SetGoalPriority instead of calling SetGoalPriority directly on map goal object.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (teamId, classId, priority)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 mg.SetGoalPriority(TEAM.ALLIES, CLASS.SOLDIER, 0.8);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===SetGroupName===&lt;br /&gt;
Sets the current group this goal is assigned to.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (groupName)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 mg.SetGroupName(&amp;quot;group1&amp;quot;);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===SetPosition===&lt;br /&gt;
Sets the position for a map goal.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (Vector3)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 mg.SetPosition(Vector3(10,10,10));&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===SetRadius===&lt;br /&gt;
Sets the radius for a map goal.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (radius)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 mg.SetRadius(65);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===SetRange===&lt;br /&gt;
Sets the range for a script based map goal. It can be int radius or AABB box or both. The QueryGoals functions does not return goals which are out of range. Default range for all goals is unlimited. Goals will not be interrupted if the range changes after the bot has already activated the goal.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (int or AABB)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 mg.SetRange(1000);&lt;br /&gt;
 mg.SetRange(AABB(1369,2165,30, 4100,3700,350));&lt;br /&gt;
&lt;br /&gt;
 //reset to unlimited&lt;br /&gt;
 mg.SetRange(0);&lt;br /&gt;
 mg.SetRange(AABB());&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Utility function:&#039;&#039;&#039; Util.SetGoalRange&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===SetRemoveFlag===&lt;br /&gt;
Marks the goal for removal.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (true/false)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 mg.SetRemoveFlag(true);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===SetRoles===&lt;br /&gt;
Sets the roles that are allowed to use this goal.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (roleId or table)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 mg.SetRoles(ROLE.DEFENDER);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Utility functions:&#039;&#039;&#039; SetGoalRole, Util.SetRoleForGroup&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;See:&#039;&#039;&#039; [[Roles]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==Obsolete Functions==&lt;br /&gt;
&lt;br /&gt;
===GetBounds===&lt;br /&gt;
Gets the AABB bounds of the map goal.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; AABB&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 bounds = mg.GetBounds();&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===GetLocalBounds===&lt;br /&gt;
Gets the local space bounds of the map goal.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; AABB bounds&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 localbounds = mg.GetLocalBounds();&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===GetMatrix===&lt;br /&gt;
Gets the Matrix3 transform of the map goal.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; Matrix3 transform&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 m = mg.GetMatrix();&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===SetEnableDraw===&lt;br /&gt;
Enables debug rendering for this map goal.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (true/false)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 mg.SetEnableDraw(true);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===SetMatrix===&lt;br /&gt;
Sets the matrix for a map goal.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (Matrix3)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 m = Matrix3();&lt;br /&gt;
 // initialize it somehow&lt;br /&gt;
 mg.SetMatrix(m);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;/div&gt;</summary>
		<author><name>Palota</name></author>
	</entry>
	<entry>
		<id>https://mygamingtalk.com/wiki/index.php?title=MapGoal&amp;diff=1761</id>
		<title>MapGoal</title>
		<link rel="alternate" type="text/html" href="https://mygamingtalk.com/wiki/index.php?title=MapGoal&amp;diff=1761"/>
		<updated>2025-05-25T16:14:44Z</updated>

		<summary type="html">&lt;p&gt;Palota: /* SetRange */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{process header&lt;br /&gt;
 | title    = MapGoal Functions&lt;br /&gt;
 | section  =&lt;br /&gt;
 | previous = [[Omni-bot_Script_Reference | Script Reference]]&lt;br /&gt;
 | next     = &lt;br /&gt;
 | shortcut =&lt;br /&gt;
 | notes    =&lt;br /&gt;
}}&lt;br /&gt;
{{TOCright}}&lt;br /&gt;
==Map Goal Properties==&lt;br /&gt;
----&lt;br /&gt;
===CreateOnLoad===&lt;br /&gt;
False to not create the goal at load time, but keep the data around for when created by the interface.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===DefaultPriority===&lt;br /&gt;
Default priority of the goal, if no class/team specific priorities.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===DefaultRenderHeight===&lt;br /&gt;
Goal height offset where rendering will take place.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===DefaultRenderRadius===&lt;br /&gt;
Maximal distance from player to display text (goal options).&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===DisableForControllingTeam===&lt;br /&gt;
Goal will be made unavailable for the team which controls it (GetOwner). It is used by CHECKPOINT goal.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===DontSave===&lt;br /&gt;
Don&#039;t save this goal into the map goal script.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===DynamicOrientation===&lt;br /&gt;
Goal should update its orientation from its entity. It is used by BUILD goal to repair vehicles.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===DynamicPosition===&lt;br /&gt;
Goal should update its position from its entity. It is used by BUILD goal to repair vehicles.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===ExtraDebugText===&lt;br /&gt;
Additional debug text to render in RenderDefault function.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===GoalState===&lt;br /&gt;
Gets the goal state.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===GoalStateFunction===&lt;br /&gt;
internal&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===GoalType===&lt;br /&gt;
Type of goal.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===InUse===&lt;br /&gt;
Goal is inuse and should not be chosen.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===MarkForRemoval===&lt;br /&gt;
Mark the goal for deletion.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===MinRadius===&lt;br /&gt;
Minimum allowed radius of the goal.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===Radius===&lt;br /&gt;
Radius of the goal.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===RemoveWithEntity===&lt;br /&gt;
Goal should be removed if its entity is removed. Default is true. It is used by FLAG, FLAGRETURN, DEFUSE goals.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===RenderDefaultCurrentAvailability===&lt;br /&gt;
Draw the current availability of the goal.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===RenderDefaultGroup===&lt;br /&gt;
Draw the group of the goal.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===RenderDefaultInitialAvailability===&lt;br /&gt;
Draw the initial availability of the goal.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===RenderDefaultName===&lt;br /&gt;
Draw the name of the goal.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===RenderDefaultRadius===&lt;br /&gt;
Draw the radius of the goal.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===RenderDefaultRole===&lt;br /&gt;
Draw the roles for the goal.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===RenderGoal===&lt;br /&gt;
Enable rendering for this goal. It is set by console command /bot draw_goals&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===RenderRandomUsePoint===&lt;br /&gt;
Draw whether or not the goal randomly selects a usepoint.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===RenderRangeLimit===&lt;br /&gt;
Draw whether or not the goal randomly selects a usepoint.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===RenderRoutes===&lt;br /&gt;
Enable rendering of the routes for this goal. It is set by console command /bot draw_goalroutes&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;See:&#039;&#039;&#039; &lt;br /&gt;
[[Template:Baserouting|Routing]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===RolePriorityBonus===&lt;br /&gt;
Role priority bonus of the goal, for users matching role.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;See:&#039;&#039;&#039; &lt;br /&gt;
[[Roles]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===Version===&lt;br /&gt;
Gets the goal version. Omni-bot 0.8 sets goal version to 1.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===SerialNum===&lt;br /&gt;
Auto generated unique serial number of the goal.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==Map Goal Callbacks==&lt;br /&gt;
----&lt;br /&gt;
===InitNewGoal===&lt;br /&gt;
Called on goal creation (command /bot goal_create) to initialize any internal variables and set properties to default values.&lt;br /&gt;
For example, camping goals can initialize aim vectors to the player facing.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===UpgradeVersion===&lt;br /&gt;
Called after the goal properties have been loaded from a goals file. This function should validate schema and upgrade the goal to the latest used version.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===Render===&lt;br /&gt;
Called when draw_goals is enabled for this goal. Used to render itself.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===Update===&lt;br /&gt;
Called every frame to update the state of the goal if needed. For example, GRENADE goal calls TraceLine function to check if the goal has been destroyed.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===SaveToTable===&lt;br /&gt;
Called when the goals are saved to a file. Allows the goal to serialize persistent information.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===SetProperty===&lt;br /&gt;
Called on command /bot goal_setproperty x y, where x is a property name and y is a value or keyword.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===Help===&lt;br /&gt;
Called on commands /bot goal_help or /bot goal_create to print requirements and available properties for the goal.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===HudDisplay===&lt;br /&gt;
Called when debug window is enabled and goal is highlighted to create gui elements for debug visualization.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==Map Goal Functions==&lt;br /&gt;
----&lt;br /&gt;
===AddRoute===&lt;br /&gt;
&#039;&#039;&#039;See:&#039;&#039;&#039; &lt;br /&gt;
[[Template:Baserouting|Routing]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (start, end, weight)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 mg.AddRoute(&amp;quot;ROUTE_spawn&amp;quot;, &amp;quot;ROUTE_gate&amp;quot;, 1.0);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Utility function:&#039;&#039;&#039; Util.Routes&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===AddUsePoint===&lt;br /&gt;
Adds a use point to the goal. Use points are used by RouteTo function. The goal can have multiple use points. Bots choose the nearest use point if goal property RandomUsePoint is false.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (Vector3, relative[optional, default false])&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 mg.AddUsePoint(Vector3(10,50,0), true);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Utility functions:&#039;&#039;&#039; Util.AddUsePoint, Util.AddUseWp&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===ClearRoles===&lt;br /&gt;
Removes the given roles from this goal.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (roleId, ...)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 mg.ClearRoles(ROLE.DEFENDER1, ROLE.DEFENDER2);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Utility functions:&#039;&#039;&#039; ClearGoalRole, Util.ClearRoleForGroup, Util.ClearRoleForTable&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;See:&#039;&#039;&#039; [[Roles]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===CreateGuiFromSchema===&lt;br /&gt;
Used in HudDisplay callback if debug window is enabled.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 this.CreateGuiFromSchema(this.Schema);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===DeleteIfEntityFlag===&lt;br /&gt;
Sets one or more entity flags that will cause the goal to be deleted.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (entFlagId, ...)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 mg.DeleteIfEntityFlag(ENTFLAG.DISABLED);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===DisableGoal===&lt;br /&gt;
Sets whether the goal is currently disabled.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (true/false)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 mg.DisableGoal(true);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===DisableIfEntityFlag===&lt;br /&gt;
Sets one or more entity flags that will cause the goal to be disabled.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (entFlagId, ...)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 mg.DisableIfEntityFlag(ENTFLAG.DISABLED);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===GetCenterBounds===&lt;br /&gt;
Gets the center of the bounding box.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; Vector3&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 center = mg.GetCenterBounds();&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===GetEntity===&lt;br /&gt;
Gets the entity of the map goal.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; GameEntity&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 ent = mg.GetEntity();&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===GetFacing===&lt;br /&gt;
Gets the facing of the map goal.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; Vector3 facing&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 face = mg.GetFacing();&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===GetGoalPriority===&lt;br /&gt;
Gets the priority for a given class/team. Default priority is returned if class or team is 0.&lt;br /&gt;
&lt;br /&gt;
If the parameter is bot, role priority bonus is added if the bot has any of the goals roles.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (bot)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (teamId, classId)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; float&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 priority = mg.GetGoalPriority(bot);&lt;br /&gt;
 // OR&lt;br /&gt;
 priority = mg.GetGoalPriority(TEAM.AXIS,CLASS.MEDIC);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===GetGoalState===&lt;br /&gt;
Gets the goal state of the map goal.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; goal state id&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 state = mg.GetGoalState();&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===GetGoalType===&lt;br /&gt;
Gets goal type. Examples: Attack, BUILD, CapPoint, PLANT.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; string&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 type = mg.GetGoalType();&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===GetGroupName===&lt;br /&gt;
Gets the current group this goal is assigned to.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; string&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 group = mg.GetGroupName();&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===GetName===&lt;br /&gt;
Gets the name of the map goal.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; name of mapgoal&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 name = mg.GetName();&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===GetNumUsePoint===&lt;br /&gt;
Gets the number of use points the goal has.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; # use points&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 n = mg.GetNumUsePoint();&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===GetOwner===&lt;br /&gt;
Gets the owner of the map goal. Typically someone that is carrying it.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; Owner GameId, or null if no owner&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 owner = mg.GetOwner();&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===GetPosition===&lt;br /&gt;
Gets the position of the map goal.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; Vector3 position&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 pos = mg.GetPosition();&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===GetRadius===&lt;br /&gt;
Gets the radius of the map goal.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; float radius&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 radius = mg.GetRadius();&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===GetTagName===&lt;br /&gt;
Gets the tag name of the map goal. This is usually a mash of the entity name and goal type.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; tag name&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 tag = mg.GetTagName();&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===GetTypeName===&lt;br /&gt;
Gets the type name of the map goal.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; type name&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 type = mg.GetTypeName();&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===GetUsePoint===&lt;br /&gt;
Gets a use point, by index. If no index provided, returns a random one.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (index&amp;lt;optional&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; Vector3 use point&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 pt = mg.GetUsePoint();&lt;br /&gt;
 // OR&lt;br /&gt;
 pt = mg.GetUsePoint(2);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===HasRole===&lt;br /&gt;
Returns true if the goal has any of the roles provided as parameters.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (roleId, ...)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; true/false&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 if(mg.HasRole(ROLE.ATTACKER))&lt;br /&gt;
 {&lt;br /&gt;
 }&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;See:&#039;&#039;&#039; [[Roles]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===IsAvailable===&lt;br /&gt;
Checks if the map goal is currently available to a certain team.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (team id)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; true if goal is available for team, false if not&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 if(mg.IsAvailable(TEAM.RED))&lt;br /&gt;
 {&lt;br /&gt;
 }&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===IsAvailableInitial===&lt;br /&gt;
Is goal available for team initially (before OnMapLoad is executed).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (team id)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; true if goal is available for team, false if not&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 if (mg.IsAvailableInitial(TEAM.RED))&lt;br /&gt;
 {&lt;br /&gt;
 }&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===IsDisabled===&lt;br /&gt;
Gets whether the goal is currently disabled.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; true/false&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 if(mg.IsDisabled())&lt;br /&gt;
 {&lt;br /&gt;
 }&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===LimitToWeapon===&lt;br /&gt;
Adds a list of weapons that are required from any user of the goal. &lt;br /&gt;
&lt;br /&gt;
Warning: This function does not work for weapons that have ID greater than 63.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (weaponId, ...)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 mg.LimitToWeapon(WEAPON.FG42);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===MaxUsers_InProgress===&lt;br /&gt;
Get or set the max number of users that can go to the goal.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none or (integer)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; integer&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 num = mg.MaxUsers_InProgress();&lt;br /&gt;
 // OR&lt;br /&gt;
 mg.MaxUsers_InProgress(2);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Utility functions:&#039;&#039;&#039; Util.SetMaxUsers, Util.SetMaxUsersInProgress, Util.GetMaxUsersInProgress, Util.SetPercentInProgress&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===MaxUsers_InUse===&lt;br /&gt;
Get or set the max number of users that can use the goal after they come to the goal position.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none or (integer)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; integer&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 num = mg.MaxUsers_InUse();&lt;br /&gt;
 // OR&lt;br /&gt;
 mg.MaxUsers_InUse(1);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Utility functions:&#039;&#039;&#039; Util.SetMaxUsers, Util.SetMaxUsersInUse, Util.GetMaxUsersInUse&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===RenderDefault===&lt;br /&gt;
Draws goal name, radius, availability, use points, ExtraDebugText, ...&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 mg.RenderDefault();&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===ResetGoalPriorities===&lt;br /&gt;
Clears all the current priorities.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 mg.ResetGoalPriorities();&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===SetAvailable===&lt;br /&gt;
Sets the map goal available for a certain team.&lt;br /&gt;
&lt;br /&gt;
NOTE: Map scripts usually use global function SetAvailableMapGoals instead of calling SetAvailable directly on map goal object.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (team id, true/false)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 mg.SetAvailable(TEAM.RED, false);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===SetAvailableInitial===&lt;br /&gt;
Sets goal available for team initially.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (team id, true/false)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 mg.SetAvailableInitial(TEAM.AXIS, true);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===SetBaseGoalType===&lt;br /&gt;
Clones a base goal type. Should be done first thing in goal script.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (fileName)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 this.SetBaseGoalType(&amp;quot;mapgoal_camp.gm&amp;quot;);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===SetEntity===&lt;br /&gt;
Sets the entity for a map goal. It is usually not needed because most entities are detected automatically.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (entity)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 GetGoal(&amp;quot;MOUNTMG42_assault_tower_mg&amp;quot;).SetEntity(GetEntityByName(&amp;quot;assault_tower_mg&amp;quot;));;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===SetFacing===&lt;br /&gt;
Sets the facing for a map goal.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (Vector3)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 mg.SetFacing(Vector3(1,0,0));&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===SetGoalPriority===&lt;br /&gt;
Sets the priority for a given class/team. The first parameter can be 0 to set priority for all teams. The second parameter can be 0 to set priority for all classes.&lt;br /&gt;
&lt;br /&gt;
NOTE: Map scripts usually use global function SetGoalPriority instead of calling SetGoalPriority directly on map goal object.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (teamId, classId, priority)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 mg.SetGoalPriority(TEAM.ALLIES, CLASS.SOLDIER, 0.8);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===SetGroupName===&lt;br /&gt;
Sets the current group this goal is assigned to.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (groupName)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 mg.SetGroupName(&amp;quot;group1&amp;quot;);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===SetPosition===&lt;br /&gt;
Sets the position for a map goal.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (Vector3)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 mg.SetPosition(Vector3(10,10,10));&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===SetRadius===&lt;br /&gt;
Sets the radius for a map goal.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (radius)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 mg.SetRadius(65);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===SetRange===&lt;br /&gt;
Sets the range for a script based map goal. It can be int radius or AABB box or both. The QueryGoals functions does not return goals which are out of range. Default range for all goals is unlimited. Goals will not be interrupted if the range changes after the bot has already activated the goal.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (int or AABB)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 mg.SetRange(1000);&lt;br /&gt;
 mg.SetRange(AABB(1369,2165,30, 4100,3700,350));&lt;br /&gt;
&lt;br /&gt;
 //reset to unlimited&lt;br /&gt;
 mg.SetRange(0);&lt;br /&gt;
 mg.SetRange(AABB());&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Utility function:&#039;&#039;&#039; Util.SetGoalRange&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===SetRemoveFlag===&lt;br /&gt;
Marks the goal for removal.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (true/false)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 mg.SetRemoveFlag(true);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===SetRoles===&lt;br /&gt;
Sets the roles that are allowed to use this goal.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (roleId or table)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 mg.SetRoles(ROLE.DEFENDER);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Utility functions:&#039;&#039;&#039; SetGoalRole, Util.SetRoleForGroup&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;See:&#039;&#039;&#039; [[Roles]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==Obsolete Functions==&lt;br /&gt;
&lt;br /&gt;
===GetBounds===&lt;br /&gt;
Gets the AABB bounds of the map goal.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; AABB&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 bounds = mg.GetBounds();&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===GetLocalBounds===&lt;br /&gt;
Gets the local space bounds of the map goal.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; AABB bounds&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 localbounds = mg.GetLocalBounds();&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===GetMatrix===&lt;br /&gt;
Gets the Matrix3 transform of the map goal.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; Matrix3 transform&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 m = mg.GetMatrix();&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===SetEnableDraw===&lt;br /&gt;
Enables debug rendering for this map goal.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (true/false)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 mg.SetEnableDraw(true);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===SetMatrix===&lt;br /&gt;
Sets the matrix for a map goal.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (Matrix3)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 m = Matrix3();&lt;br /&gt;
 // initialize it somehow&lt;br /&gt;
 mg.SetMatrix(m);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;/div&gt;</summary>
		<author><name>Palota</name></author>
	</entry>
	<entry>
		<id>https://mygamingtalk.com/wiki/index.php?title=MapGoal&amp;diff=1760</id>
		<title>MapGoal</title>
		<link rel="alternate" type="text/html" href="https://mygamingtalk.com/wiki/index.php?title=MapGoal&amp;diff=1760"/>
		<updated>2025-05-25T15:55:39Z</updated>

		<summary type="html">&lt;p&gt;Palota: /* SetBounds */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{process header&lt;br /&gt;
 | title    = MapGoal Functions&lt;br /&gt;
 | section  =&lt;br /&gt;
 | previous = [[Omni-bot_Script_Reference | Script Reference]]&lt;br /&gt;
 | next     = &lt;br /&gt;
 | shortcut =&lt;br /&gt;
 | notes    =&lt;br /&gt;
}}&lt;br /&gt;
{{TOCright}}&lt;br /&gt;
==Map Goal Properties==&lt;br /&gt;
----&lt;br /&gt;
===CreateOnLoad===&lt;br /&gt;
False to not create the goal at load time, but keep the data around for when created by the interface.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===DefaultPriority===&lt;br /&gt;
Default priority of the goal, if no class/team specific priorities.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===DefaultRenderHeight===&lt;br /&gt;
Goal height offset where rendering will take place.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===DefaultRenderRadius===&lt;br /&gt;
Maximal distance from player to display text (goal options).&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===DisableForControllingTeam===&lt;br /&gt;
Goal will be made unavailable for the team which controls it (GetOwner). It is used by CHECKPOINT goal.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===DontSave===&lt;br /&gt;
Don&#039;t save this goal into the map goal script.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===DynamicOrientation===&lt;br /&gt;
Goal should update its orientation from its entity. It is used by BUILD goal to repair vehicles.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===DynamicPosition===&lt;br /&gt;
Goal should update its position from its entity. It is used by BUILD goal to repair vehicles.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===ExtraDebugText===&lt;br /&gt;
Additional debug text to render in RenderDefault function.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===GoalState===&lt;br /&gt;
Gets the goal state.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===GoalStateFunction===&lt;br /&gt;
internal&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===GoalType===&lt;br /&gt;
Type of goal.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===InUse===&lt;br /&gt;
Goal is inuse and should not be chosen.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===MarkForRemoval===&lt;br /&gt;
Mark the goal for deletion.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===MinRadius===&lt;br /&gt;
Minimum allowed radius of the goal.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===Radius===&lt;br /&gt;
Radius of the goal.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===RemoveWithEntity===&lt;br /&gt;
Goal should be removed if its entity is removed. Default is true. It is used by FLAG, FLAGRETURN, DEFUSE goals.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===RenderDefaultCurrentAvailability===&lt;br /&gt;
Draw the current availability of the goal.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===RenderDefaultGroup===&lt;br /&gt;
Draw the group of the goal.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===RenderDefaultInitialAvailability===&lt;br /&gt;
Draw the initial availability of the goal.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===RenderDefaultName===&lt;br /&gt;
Draw the name of the goal.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===RenderDefaultRadius===&lt;br /&gt;
Draw the radius of the goal.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===RenderDefaultRole===&lt;br /&gt;
Draw the roles for the goal.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===RenderGoal===&lt;br /&gt;
Enable rendering for this goal. It is set by console command /bot draw_goals&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===RenderRandomUsePoint===&lt;br /&gt;
Draw whether or not the goal randomly selects a usepoint.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===RenderRangeLimit===&lt;br /&gt;
Draw whether or not the goal randomly selects a usepoint.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===RenderRoutes===&lt;br /&gt;
Enable rendering of the routes for this goal. It is set by console command /bot draw_goalroutes&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;See:&#039;&#039;&#039; &lt;br /&gt;
[[Template:Baserouting|Routing]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===RolePriorityBonus===&lt;br /&gt;
Role priority bonus of the goal, for users matching role.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;See:&#039;&#039;&#039; &lt;br /&gt;
[[Roles]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===Version===&lt;br /&gt;
Gets the goal version. Omni-bot 0.8 sets goal version to 1.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===SerialNum===&lt;br /&gt;
Auto generated unique serial number of the goal.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==Map Goal Callbacks==&lt;br /&gt;
----&lt;br /&gt;
===InitNewGoal===&lt;br /&gt;
Called on goal creation (command /bot goal_create) to initialize any internal variables and set properties to default values.&lt;br /&gt;
For example, camping goals can initialize aim vectors to the player facing.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===UpgradeVersion===&lt;br /&gt;
Called after the goal properties have been loaded from a goals file. This function should validate schema and upgrade the goal to the latest used version.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===Render===&lt;br /&gt;
Called when draw_goals is enabled for this goal. Used to render itself.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===Update===&lt;br /&gt;
Called every frame to update the state of the goal if needed. For example, GRENADE goal calls TraceLine function to check if the goal has been destroyed.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===SaveToTable===&lt;br /&gt;
Called when the goals are saved to a file. Allows the goal to serialize persistent information.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===SetProperty===&lt;br /&gt;
Called on command /bot goal_setproperty x y, where x is a property name and y is a value or keyword.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===Help===&lt;br /&gt;
Called on commands /bot goal_help or /bot goal_create to print requirements and available properties for the goal.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===HudDisplay===&lt;br /&gt;
Called when debug window is enabled and goal is highlighted to create gui elements for debug visualization.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==Map Goal Functions==&lt;br /&gt;
----&lt;br /&gt;
===AddRoute===&lt;br /&gt;
&#039;&#039;&#039;See:&#039;&#039;&#039; &lt;br /&gt;
[[Template:Baserouting|Routing]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (start, end, weight)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 mg.AddRoute(&amp;quot;ROUTE_spawn&amp;quot;, &amp;quot;ROUTE_gate&amp;quot;, 1.0);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Utility function:&#039;&#039;&#039; Util.Routes&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===AddUsePoint===&lt;br /&gt;
Adds a use point to the goal. Use points are used by RouteTo function. The goal can have multiple use points. Bots choose the nearest use point if goal property RandomUsePoint is false.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (Vector3, relative[optional, default false])&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 mg.AddUsePoint(Vector3(10,50,0), true);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Utility functions:&#039;&#039;&#039; Util.AddUsePoint, Util.AddUseWp&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===ClearRoles===&lt;br /&gt;
Removes the given roles from this goal.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (roleId, ...)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 mg.ClearRoles(ROLE.DEFENDER1, ROLE.DEFENDER2);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Utility functions:&#039;&#039;&#039; ClearGoalRole, Util.ClearRoleForGroup, Util.ClearRoleForTable&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;See:&#039;&#039;&#039; [[Roles]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===CreateGuiFromSchema===&lt;br /&gt;
Used in HudDisplay callback if debug window is enabled.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 this.CreateGuiFromSchema(this.Schema);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===DeleteIfEntityFlag===&lt;br /&gt;
Sets one or more entity flags that will cause the goal to be deleted.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (entFlagId, ...)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 mg.DeleteIfEntityFlag(ENTFLAG.DISABLED);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===DisableGoal===&lt;br /&gt;
Sets whether the goal is currently disabled.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (true/false)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 mg.DisableGoal(true);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===DisableIfEntityFlag===&lt;br /&gt;
Sets one or more entity flags that will cause the goal to be disabled.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (entFlagId, ...)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 mg.DisableIfEntityFlag(ENTFLAG.DISABLED);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===GetCenterBounds===&lt;br /&gt;
Gets the center of the bounding box.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; Vector3&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 center = mg.GetCenterBounds();&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===GetEntity===&lt;br /&gt;
Gets the entity of the map goal.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; GameEntity&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 ent = mg.GetEntity();&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===GetFacing===&lt;br /&gt;
Gets the facing of the map goal.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; Vector3 facing&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 face = mg.GetFacing();&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===GetGoalPriority===&lt;br /&gt;
Gets the priority for a given class/team. Default priority is returned if class or team is 0.&lt;br /&gt;
&lt;br /&gt;
If the parameter is bot, role priority bonus is added if the bot has any of the goals roles.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (bot)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (teamId, classId)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; float&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 priority = mg.GetGoalPriority(bot);&lt;br /&gt;
 // OR&lt;br /&gt;
 priority = mg.GetGoalPriority(TEAM.AXIS,CLASS.MEDIC);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===GetGoalState===&lt;br /&gt;
Gets the goal state of the map goal.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; goal state id&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 state = mg.GetGoalState();&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===GetGoalType===&lt;br /&gt;
Gets goal type. Examples: Attack, BUILD, CapPoint, PLANT.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; string&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 type = mg.GetGoalType();&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===GetGroupName===&lt;br /&gt;
Gets the current group this goal is assigned to.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; string&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 group = mg.GetGroupName();&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===GetName===&lt;br /&gt;
Gets the name of the map goal.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; name of mapgoal&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 name = mg.GetName();&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===GetNumUsePoint===&lt;br /&gt;
Gets the number of use points the goal has.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; # use points&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 n = mg.GetNumUsePoint();&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===GetOwner===&lt;br /&gt;
Gets the owner of the map goal. Typically someone that is carrying it.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; Owner GameId, or null if no owner&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 owner = mg.GetOwner();&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===GetPosition===&lt;br /&gt;
Gets the position of the map goal.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; Vector3 position&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 pos = mg.GetPosition();&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===GetRadius===&lt;br /&gt;
Gets the radius of the map goal.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; float radius&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 radius = mg.GetRadius();&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===GetTagName===&lt;br /&gt;
Gets the tag name of the map goal. This is usually a mash of the entity name and goal type.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; tag name&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 tag = mg.GetTagName();&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===GetTypeName===&lt;br /&gt;
Gets the type name of the map goal.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; type name&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 type = mg.GetTypeName();&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===GetUsePoint===&lt;br /&gt;
Gets a use point, by index. If no index provided, returns a random one.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (index&amp;lt;optional&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; Vector3 use point&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 pt = mg.GetUsePoint();&lt;br /&gt;
 // OR&lt;br /&gt;
 pt = mg.GetUsePoint(2);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===HasRole===&lt;br /&gt;
Returns true if the goal has any of the roles provided as parameters.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (roleId, ...)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; true/false&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 if(mg.HasRole(ROLE.ATTACKER))&lt;br /&gt;
 {&lt;br /&gt;
 }&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;See:&#039;&#039;&#039; [[Roles]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===IsAvailable===&lt;br /&gt;
Checks if the map goal is currently available to a certain team.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (team id)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; true if goal is available for team, false if not&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 if(mg.IsAvailable(TEAM.RED))&lt;br /&gt;
 {&lt;br /&gt;
 }&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===IsAvailableInitial===&lt;br /&gt;
Is goal available for team initially (before OnMapLoad is executed).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (team id)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; true if goal is available for team, false if not&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 if (mg.IsAvailableInitial(TEAM.RED))&lt;br /&gt;
 {&lt;br /&gt;
 }&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===IsDisabled===&lt;br /&gt;
Gets whether the goal is currently disabled.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; true/false&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 if(mg.IsDisabled())&lt;br /&gt;
 {&lt;br /&gt;
 }&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===LimitToWeapon===&lt;br /&gt;
Adds a list of weapons that are required from any user of the goal. &lt;br /&gt;
&lt;br /&gt;
Warning: This function does not work for weapons that have ID greater than 63.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (weaponId, ...)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 mg.LimitToWeapon(WEAPON.FG42);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===MaxUsers_InProgress===&lt;br /&gt;
Get or set the max number of users that can go to the goal.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none or (integer)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; integer&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 num = mg.MaxUsers_InProgress();&lt;br /&gt;
 // OR&lt;br /&gt;
 mg.MaxUsers_InProgress(2);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Utility functions:&#039;&#039;&#039; Util.SetMaxUsers, Util.SetMaxUsersInProgress, Util.GetMaxUsersInProgress, Util.SetPercentInProgress&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===MaxUsers_InUse===&lt;br /&gt;
Get or set the max number of users that can use the goal after they come to the goal position.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none or (integer)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; integer&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 num = mg.MaxUsers_InUse();&lt;br /&gt;
 // OR&lt;br /&gt;
 mg.MaxUsers_InUse(1);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Utility functions:&#039;&#039;&#039; Util.SetMaxUsers, Util.SetMaxUsersInUse, Util.GetMaxUsersInUse&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===RenderDefault===&lt;br /&gt;
Draws goal name, radius, availability, use points, ExtraDebugText, ...&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 mg.RenderDefault();&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===ResetGoalPriorities===&lt;br /&gt;
Clears all the current priorities.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 mg.ResetGoalPriorities();&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===SetAvailable===&lt;br /&gt;
Sets the map goal available for a certain team.&lt;br /&gt;
&lt;br /&gt;
NOTE: Map scripts usually use global function SetAvailableMapGoals instead of calling SetAvailable directly on map goal object.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (team id, true/false)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 mg.SetAvailable(TEAM.RED, false);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===SetAvailableInitial===&lt;br /&gt;
Sets goal available for team initially.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (team id, true/false)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 mg.SetAvailableInitial(TEAM.AXIS, true);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===SetBaseGoalType===&lt;br /&gt;
Clones a base goal type. Should be done first thing in goal script.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (fileName)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 this.SetBaseGoalType(&amp;quot;mapgoal_camp.gm&amp;quot;);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===SetEntity===&lt;br /&gt;
Sets the entity for a map goal. It is usually not needed because most entities are detected automatically.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (entity)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 GetGoal(&amp;quot;MOUNTMG42_assault_tower_mg&amp;quot;).SetEntity(GetEntityByName(&amp;quot;assault_tower_mg&amp;quot;));;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===SetFacing===&lt;br /&gt;
Sets the facing for a map goal.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (Vector3)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 mg.SetFacing(Vector3(1,0,0));&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===SetGoalPriority===&lt;br /&gt;
Sets the priority for a given class/team. The first parameter can be 0 to set priority for all teams. The second parameter can be 0 to set priority for all classes.&lt;br /&gt;
&lt;br /&gt;
NOTE: Map scripts usually use global function SetGoalPriority instead of calling SetGoalPriority directly on map goal object.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (teamId, classId, priority)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 mg.SetGoalPriority(TEAM.ALLIES, CLASS.SOLDIER, 0.8);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===SetGroupName===&lt;br /&gt;
Sets the current group this goal is assigned to.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (groupName)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 mg.SetGroupName(&amp;quot;group1&amp;quot;);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===SetPosition===&lt;br /&gt;
Sets the position for a map goal.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (Vector3)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 mg.SetPosition(Vector3(10,10,10));&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===SetRadius===&lt;br /&gt;
Sets the radius for a map goal.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (radius)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 mg.SetRadius(65);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===SetRange===&lt;br /&gt;
Sets the range for a script based map goal. The QueryGoals functions does not return goals which are out of range. Default range for all goals is 0 which means unlimited. Goals will not be interrupted if the range changes after the bot has activated the goal.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (range)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 mg.SetRange(1000);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Utility function:&#039;&#039;&#039; Util.SetGoalRange&lt;br /&gt;
----&lt;br /&gt;
===SetRemoveFlag===&lt;br /&gt;
Marks the goal for removal.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (true/false)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 mg.SetRemoveFlag(true);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===SetRoles===&lt;br /&gt;
Sets the roles that are allowed to use this goal.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (roleId or table)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 mg.SetRoles(ROLE.DEFENDER);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Utility functions:&#039;&#039;&#039; SetGoalRole, Util.SetRoleForGroup&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;See:&#039;&#039;&#039; [[Roles]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==Obsolete Functions==&lt;br /&gt;
&lt;br /&gt;
===GetBounds===&lt;br /&gt;
Gets the AABB bounds of the map goal.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; AABB&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 bounds = mg.GetBounds();&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===GetLocalBounds===&lt;br /&gt;
Gets the local space bounds of the map goal.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; AABB bounds&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 localbounds = mg.GetLocalBounds();&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===GetMatrix===&lt;br /&gt;
Gets the Matrix3 transform of the map goal.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; Matrix3 transform&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 m = mg.GetMatrix();&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===SetEnableDraw===&lt;br /&gt;
Enables debug rendering for this map goal.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (true/false)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 mg.SetEnableDraw(true);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===SetMatrix===&lt;br /&gt;
Sets the matrix for a map goal.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (Matrix3)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 m = Matrix3();&lt;br /&gt;
 // initialize it somehow&lt;br /&gt;
 mg.SetMatrix(m);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;/div&gt;</summary>
		<author><name>Palota</name></author>
	</entry>
	<entry>
		<id>https://mygamingtalk.com/wiki/index.php?title=Template:Configuration&amp;diff=1759</id>
		<title>Template:Configuration</title>
		<link rel="alternate" type="text/html" href="https://mygamingtalk.com/wiki/index.php?title=Template:Configuration&amp;diff=1759"/>
		<updated>2025-05-25T13:48:34Z</updated>

		<summary type="html">&lt;p&gt;Palota: /* Waypoints folder */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Number of bots ==&lt;br /&gt;
&lt;br /&gt;
 /bot maxbots 15&lt;br /&gt;
&lt;br /&gt;
Sets maximum number of bots. It must be less than number of slots (sv_maxclients). The server manager script will automatically kick one bot when a human player connects to server and joins axis or allied team. Similarly, it will add a new bot if some player disconnects.&lt;br /&gt;
&lt;br /&gt;
 /bot minbots 2&lt;br /&gt;
&lt;br /&gt;
Sets minimum number of bots. Default value is -1. You should set minbots only if you want some bots to be always playing even if your server is full.&lt;br /&gt;
&lt;br /&gt;
If you want to add bots manually, you must set maxbots and minbots to -1. Then you can add bots by commands [[Omni-bot_Command_Reference#ab|/bot ab]] or [[Omni-bot_Command_Reference#addbot|/bot addbot]].&lt;br /&gt;
&lt;br /&gt;
== Difficulty levels ==&lt;br /&gt;
&lt;br /&gt;
 /bot difficulty 4&lt;br /&gt;
&lt;br /&gt;
Difficulty ranges from 0 to 6 (0 is easy, 6 is hard).&lt;br /&gt;
&lt;br /&gt;
If you change difficulty, bots&#039; properties will be adjusted (reaction time, field of view, aim error, view distance, ...). Advanced users can adjust bot properties for each difficulty level in the file omni-bot/et/scripts/goals/goal_difficulty.gm.&lt;br /&gt;
&lt;br /&gt;
== Combat movement skill ==&lt;br /&gt;
&lt;br /&gt;
 /bot moveskill 4&lt;br /&gt;
&lt;br /&gt;
Moveskill ranges from 0 to 3. Specifying 4 for moveskill will have each bot choose a random moveskill.&lt;br /&gt;
&lt;br /&gt;
It affects bot&#039;s behaviour during combat (crouch, strafe left or right, ...).&lt;br /&gt;
&lt;br /&gt;
== Balance teams ==&lt;br /&gt;
&lt;br /&gt;
 /bot balanceteams 1 &lt;br /&gt;
&lt;br /&gt;
If you enable balanceteams, bots will move between teams in order to keep same number of players in both teams.&lt;br /&gt;
&lt;br /&gt;
== Log files ==&lt;br /&gt;
&lt;br /&gt;
Log files are written to folder omni-bot/et/logs. If the folder does not exists, log files are written to Enemy Territory game folder. File name is omnibot_&amp;lt;mapname&amp;gt;.log.&lt;br /&gt;
&lt;br /&gt;
 /seta omnibot_logsize 0&lt;br /&gt;
&lt;br /&gt;
* Value -1 disables logging. &lt;br /&gt;
* Default value 0 enables logging, but files will be overwritten every match. &lt;br /&gt;
* Value greater than 0 means maximal file size in KB and also allows appending more matches to a single file.&lt;br /&gt;
&lt;br /&gt;
== Configuration file ==&lt;br /&gt;
&lt;br /&gt;
You can find the file &#039;&#039;&#039;omni-bot.cfg&#039;&#039;&#039; in the folder omni-bot/et/user. You usually don&#039;t need to modify this file because most settings can be changed from the console. Nevertheless, some advanced settings are not accessible from the console: CountSpectators, SleepBots, SaveConfigChanges, AdjustAim, DumpFileEnable, DumpFileDialog, LiveUpdate, Debug,  EnableInterProcess, LogInfo, LogWarnings, LogErrors, LogCriticalErrors.&lt;br /&gt;
&lt;br /&gt;
Documentation can be found in file omni-bot.txt.&lt;br /&gt;
&lt;br /&gt;
== Changing bot names ==&lt;br /&gt;
&lt;br /&gt;
You need to go into the omni-bot/et/scripts folder. In Omni-bot 0.82 or later open file &amp;quot;&#039;&#039;&#039;et_botnames_ext.gm&#039;&#039;&#039;&amp;quot;. In Omni-bot 0.81 or 0.8 open file &amp;quot;et_botnames.gm&amp;quot;. In Omni-bot 0.71 or older open file &amp;quot;et_autoexec.gm&amp;quot;. Bots&#039; names are in quotes. Do not change other commands in that scripts.&lt;br /&gt;
&lt;br /&gt;
== Waypoints folder ==&lt;br /&gt;
&lt;br /&gt;
Waypoints and map scripts can be found in the &#039;&#039;&#039;omni-bot/et/nav&#039;&#039;&#039; and &#039;&#039;&#039;omni-bot/et/incomplete_navs&#039;&#039;&#039; folders. New waypoints should be added into this folder. You can add new waypoints in a zip or 7z file (they must be at the root level of the zip file, not in a folder) or you can just add the files directly.&lt;/div&gt;</summary>
		<author><name>Palota</name></author>
	</entry>
	<entry>
		<id>https://mygamingtalk.com/wiki/index.php?title=ScriptGoal&amp;diff=1758</id>
		<title>ScriptGoal</title>
		<link rel="alternate" type="text/html" href="https://mygamingtalk.com/wiki/index.php?title=ScriptGoal&amp;diff=1758"/>
		<updated>2025-05-25T13:46:17Z</updated>

		<summary type="html">&lt;p&gt;Palota: /* Expression */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{process header&lt;br /&gt;
 | title    = Script Goal&lt;br /&gt;
 | section  =&lt;br /&gt;
 | previous = [[Omni-bot_Script_Reference | Script Reference]]&lt;br /&gt;
 | next     = &lt;br /&gt;
 | shortcut =&lt;br /&gt;
 | notes    =&lt;br /&gt;
}}&lt;br /&gt;
{{TOCright}}&lt;br /&gt;
[[Category:ET|Script Goals]]&lt;br /&gt;
[[Category:Doom 3|Script Goals]]&lt;br /&gt;
[[Category:Quake 4|Script Goals]]&lt;br /&gt;
[[Category:RTCW|Script Goals]]&lt;br /&gt;
&lt;br /&gt;
==ScriptGoal Properties==&lt;br /&gt;
===Name===&lt;br /&gt;
The name of the script goal. Important for other scripts to refer to by name, and the name it is displayed under in the [[Debug Window]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;this.Name = &amp;quot;MyGoalName&amp;quot;;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Parent===&lt;br /&gt;
The name of the parent goal. This should be set up once in the script and left alone. It controls where in the behavior tree the goal is inserted. The location of the goal in the state tree effects how it is evaluated.&lt;br /&gt;
&lt;br /&gt;
Users should stick to one of the following 2 parents.&lt;br /&gt;
* HighLevel - Puts the goal under the HighLevel parent. Because the goal is under the HighLevel state, only one state at a time can run. This is useful for goals that take control of the bot, that shouldn&#039;t be interrupted by other script goals or built in goals.&lt;br /&gt;
* LowLevel - Puts the goal under the LowLevel parent. All states under the LowLevel state are run simultaneously, and so is a good location for scripts that control things that don&#039;t necessarily take total control over the bot, or don&#039;t wish to interrupt the execution of other goals. Some examples might be calling for medic, calling for ammo, most communication scripts.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;this.Parent = &amp;quot;HighLevel&amp;quot;;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===InsertBefore===&lt;br /&gt;
It controls where in the behavior tree the goal is inserted. InsertBefore property is ignored if Parent has been set. &lt;br /&gt;
&lt;br /&gt;
===InsertAfter===&lt;br /&gt;
It controls where in the behavior tree the goal is inserted. InsertAfter property is ignored if Parent or InsertBefore has been set. &lt;br /&gt;
&lt;br /&gt;
===Disable===&lt;br /&gt;
Enables/Disables the goal for consideration. The goal will no longer be considered for execution. Disabled goals have specific coloring in the [[Debug Window]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;this.Disable = true;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===AimVector===&lt;br /&gt;
This Vector3 is used by any active aim request the script goal has registered. You usually do not need to use this property directly, because function AddAimRequest sets this property.&lt;br /&gt;
&lt;br /&gt;
===AlwaysRecieveEvents===&lt;br /&gt;
Normally goals receive events only when active. Setting this to true will allow the goal to receive events even when it&#039;s not running. This is useful for when you want to have the goal sit idle and only activate when receiving a certain event, or you want to track and store information in the goal from events.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;this.AlwaysRecieveEvents = true;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Events===&lt;br /&gt;
Accesses the Events table of the goal, in order to set up script functions that will be called when the bot receives events. By default, goals only receive events when they are active. This can be overridden with [[ScriptGoal#AlwaysRecieveEvents| AlwaysRecieveEvents]], which will allow goals to receive events even when not active.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 this.Events[EVENT.FEEL_PAIN] = function(Inflictor, PreviousHealth, CurrentHealth)&lt;br /&gt;
 {&lt;br /&gt;
   whoDoneIt = GetEntName(Inflictor);&lt;br /&gt;
   print( format(&amp;quot;%s: %s Hurt me: Was %d, now %d&amp;quot;, &lt;br /&gt;
    this.Bot.GetName(), whoDoneIt, PreviousHealth, CurrentHealth) );&lt;br /&gt;
 };&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Bot===&lt;br /&gt;
This provides an accessor to the bot that is running the goal. The &#039;this&#039; within script goals is always the script goal itself, so in the frequent case of needing to access the bot, use this property.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;this.Bot.Say(&amp;quot;Wassup&amp;quot;);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Priority===&lt;br /&gt;
Priority is a property rather than a return value of [[ScriptGoal#GetPriority| GetPriority]] in order to support the useful threading nature of script goals. It is possible to completely leave out a [[ScriptGoal#GetPriority| GetPriority]] function, and set the priority through this property somewhere else, such as in an event callback. This property will automatically be reset internally when the state exits, to prevent a script goal from activating in a loop from the user forgetting to reset the Priority.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;this.Priority = 1;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SkipGetPriorityWhenActive===&lt;br /&gt;
Set SkipGetPriorityWhenActive to true if function GetPriority should not be called while the goal is active.&lt;br /&gt;
&lt;br /&gt;
===GetPriorityDelay===&lt;br /&gt;
Delay in seconds between GetPriority calls. Default is 0.&lt;br /&gt;
&lt;br /&gt;
===MapGoal===&lt;br /&gt;
Current MapGoal or null if the script goal is not active. This property is not set automatically. You must assign map goal to this property in GetPriority and clear it in Exit.&lt;br /&gt;
&lt;br /&gt;
===AutoReleaseAim===&lt;br /&gt;
Function ReleaseAimRequest is automatically called in Exit. Default is true.&lt;br /&gt;
&lt;br /&gt;
===AutoReleaseWeapon===&lt;br /&gt;
Function ReleaseWeaponRequest is automatically called in Exit. Default is true.&lt;br /&gt;
&lt;br /&gt;
===AutoReleaseTrackers===&lt;br /&gt;
Function Trackers::Reset is automatically called in Exit. Default is true.&lt;br /&gt;
&lt;br /&gt;
===AutoFinishOnUnAvailable===&lt;br /&gt;
The goal is automatically finished if current MapGoal is not available. Default is true.&lt;br /&gt;
&lt;br /&gt;
===AutoFinishOnNoProgressSlots===&lt;br /&gt;
The goal is automatically finished if MarkInProgress has not been called yet and MapGoal has no TRACK_INPROGRESS slots available. Default is true.&lt;br /&gt;
&lt;br /&gt;
===AutoFinishOnNoUseSlots===&lt;br /&gt;
The goal is automatically finished if MarkInUse has not been called yet and MapGoal has no TRACK_INUSE slots available. Default is true.&lt;br /&gt;
&lt;br /&gt;
===AutoAdd===&lt;br /&gt;
Set AutoAdd to false if the script should not be loaded for every map, because it&#039;s deprecated or used only for debugging (RideTram, TestEvents, ...).&lt;br /&gt;
&lt;br /&gt;
===DebugString===&lt;br /&gt;
Debug strings are displayed if you use command &amp;quot;/bot debugbot all fpinfo&amp;quot; and then spectate bots. If DebugString is null, MapGoal name is displayed.&lt;br /&gt;
&lt;br /&gt;
===Debug===&lt;br /&gt;
Set this property at the beginning of gm file so that all your debug messages or debug drawing can be easily enabled or disabled.&lt;br /&gt;
&lt;br /&gt;
===Commands===&lt;br /&gt;
Table of console commands which are executed on the script goal for every bot.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 this.Commands[&amp;quot;command_name&amp;quot;] = {&lt;br /&gt;
  Func = function( _params )&lt;br /&gt;
  { &lt;br /&gt;
  },&lt;br /&gt;
  Help = { &amp;quot;description&amp;quot; },&lt;br /&gt;
 };&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==ScriptGoal Callbacks==&lt;br /&gt;
These functions are available only in 0.7 and later.&lt;br /&gt;
&lt;br /&gt;
===Initialize===&lt;br /&gt;
This function is called exactly once per bot, when the bot is added and initialized. It is typically used to perform one time initialization code.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 this.Initialize() = function()&lt;br /&gt;
 {&lt;br /&gt;
 };&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===OnSpawn===&lt;br /&gt;
This function is called every time the bot spawns. Spawning in Omni-bot means any time the bot re-enters his Main active state. This could mean an actual respawn, a revival from an incapacitated state, or something similar.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 this.OnSpawn() = function()&lt;br /&gt;
 {&lt;br /&gt;
 };&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===GetPriority===&lt;br /&gt;
This function is most often the place to evaluate whether you want the script goal to run. Take care in the complexity of the code here, as it is called pretty often, and can be a source of considerable performance overhead.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 this.GetPriority() = function()&lt;br /&gt;
 {&lt;br /&gt;
 };&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===Enter===&lt;br /&gt;
This function is called when a state is chosen to run, right before it begins running. This function is only called once when the state enters, and will not be called again until the state is exited.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 this.Enter() = function()&lt;br /&gt;
 {&lt;br /&gt;
 };&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;See Also:&#039;&#039;&#039; &lt;br /&gt;
[[ScriptGoal#Exit| Exit]]&lt;br /&gt;
----&lt;br /&gt;
===Exit===&lt;br /&gt;
This function is called when a state finishes running, or is overridden by a higher priority state. It is often used to release aim or weapon requests that were used by the goal.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 this.Exit() = function()&lt;br /&gt;
 {&lt;br /&gt;
 };&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;See Also:&#039;&#039;&#039; &lt;br /&gt;
[[ScriptGoal#Enter| Enter]]&lt;br /&gt;
----&lt;br /&gt;
===Update===&lt;br /&gt;
This function is the meat of a script goal. Once a goal is chosen to run, and [[ScriptGoal#Enter| Enter]] is called, the Update function begins getting called at frequent regular intervals. The state stays active until another goal overrides it, or until [[ScriptGoal#Finished| Finished]] is called, after which the [[ScriptGoal#Exit| Exit]] function is called.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 this.Update() = function()&lt;br /&gt;
 {&lt;br /&gt;
   // do stuff&lt;br /&gt;
   this.Finished(); // when we&#039;re done running&lt;br /&gt;
 };&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;See Also:&#039;&#039;&#039; &lt;br /&gt;
[[ScriptGoal#Enter| Enter]], [[ScriptGoal#Exit| Exit]]&lt;br /&gt;
----&lt;br /&gt;
===OnPathThrough===&lt;br /&gt;
This function is called if bot comes to waypoint which has paththrough property set and its value is goalName:data.&lt;br /&gt;
Paththrough is activated if OnPathThrough function returns true.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 this.OnPathThrough = function(data)&lt;br /&gt;
 {&lt;br /&gt;
  navigation = Map.Navigation[data];&lt;br /&gt;
  if(navigation)&lt;br /&gt;
  {&lt;br /&gt;
   this.CurrentNavigation = data;&lt;br /&gt;
   return true;&lt;br /&gt;
  }&lt;br /&gt;
  this.CurrentNavigation = null;&lt;br /&gt;
  return false;&lt;br /&gt;
 };&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==ScriptGoal Functions==&lt;br /&gt;
These functions are available only in 0.7 and later.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===AddFinishCriteria===&lt;br /&gt;
Finish Criteria are expressions set up from script that will be evaluated constantly in the code and when they are satisfied will cause the script goal to abort. These are useful when your script does alot of asynchronous operations(like Goto), but you want a way to abort the script goal, even if the main update script happens to be in an asynchronous or blocked call, sleep or yield.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (subject, expression, value[optional])&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (expression, value[optional])&lt;br /&gt;
&lt;br /&gt;
====Subject====&lt;br /&gt;
Subject must be an entity, if no entity is provided as the first parameter, it is assumed that the 2nd version of the function is called, which takes only and expression and an optional value. The need for a value is determined by what the expression actually is.&lt;br /&gt;
&lt;br /&gt;
====Expression====&lt;br /&gt;
Expression is a string containing 1 or more keywords that use a natural syntax for defining the conditions of the criteria. Additionally, some keywords expect an operator to be defined&lt;br /&gt;
{| align=&amp;quot;center&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!Keyword&lt;br /&gt;
!Operator Required&lt;br /&gt;
!Value&lt;br /&gt;
|-&lt;br /&gt;
|deleted&lt;br /&gt;
|No&lt;br /&gt;
|entity&lt;br /&gt;
|-&lt;br /&gt;
|health&lt;br /&gt;
|Yes&lt;br /&gt;
|health value to compare against(float or int)&lt;br /&gt;
|-&lt;br /&gt;
|hasentflag&lt;br /&gt;
|No&lt;br /&gt;
|entity flag to compare against. use not to negate test&lt;br /&gt;
|-&lt;br /&gt;
|weaponcharged&lt;br /&gt;
|No&lt;br /&gt;
|weapon Id(integer)&lt;br /&gt;
|-&lt;br /&gt;
|weaponequipped&lt;br /&gt;
|No&lt;br /&gt;
|weapon Id(integer)&lt;br /&gt;
|-&lt;br /&gt;
|weaponhasammo&lt;br /&gt;
|No&lt;br /&gt;
|weapon Id(integer)&lt;br /&gt;
|-&lt;br /&gt;
|velocity&lt;br /&gt;
|Yes&lt;br /&gt;
|vector3 velocity to compare against, OR float magnitude of velocity to compare against(speed)&lt;br /&gt;
|-&lt;br /&gt;
|mapgoalavailable&lt;br /&gt;
|No&lt;br /&gt;
|MapGoal object or name&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Valid Operators=====&lt;br /&gt;
* lessthan&lt;br /&gt;
* &amp;lt;&lt;br /&gt;
* greaterthan&lt;br /&gt;
* &amp;gt;&lt;br /&gt;
* equals&lt;br /&gt;
* ==&lt;br /&gt;
&lt;br /&gt;
In addition, some expressions can contain negation keywords in order to check for the negative of an expression, such as&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 this.AddFinishCriteria(this.TargetEntity,&amp;quot;not hasentflag&amp;quot;,ENTFLAG.DEAD); // as soon as the entity does not have the dead flag&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; true if criteria was created, false if not&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 this.AddFinishCriteria(this.TargetEntity,&amp;quot;deleted&amp;quot;); // finish the goal of the target is deleted&lt;br /&gt;
 this.AddFinishCriteria(this.TargetEntity,&amp;quot;health lessthan&amp;quot;,1); // or if they are dead(health &amp;lt;= 1)&lt;br /&gt;
 this.AddFinishCriteria(this.TargetEntity,&amp;quot;hasentflag&amp;quot;,ENTFLAG.LIMBO); // or if they tap out&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===ClearFinishCriteria===&lt;br /&gt;
Deletes finish criteria.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (clearpersistent[optional, default false])&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===Finished===&lt;br /&gt;
Notifies the goal that it is finished running. This function is normally called from the Update function when the goal is desired to finish.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (none)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 this.Finished();&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===LimitTo===&lt;br /&gt;
This function limits script execution based on a true value being returned from a user defined function. This function is useful if scripts should only be run based on some external logic; like a Map variable setting.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (function, delay, onlyactive[optional - default false])&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
LimitTo functions are script functions that are called at user defined intervals that can be used to update from script whether or not the script goal should be able to run or not. Returning false from this function effectively blocks the script goals ability to activate. It will remain in this state as long as the LimitTo function is defined. The 2nd parameter controls how often the callback is performed. Calling script functions too often can adversely effect performance, so it is recommended to choose a delay that is as infrequently as you can get away with. The &#039;onlyactive&#039; parameter is optional and defaults to false. If this parameter is set to true, the LimitTo function callback will ONLY be performed when the script goal is active. By default the LimitTo function will be called whether the goal is active or not, and returning false will prevent the goal from being able to activate. Passing true as the &#039;onlyactive&#039; flag means the goal can activate, and only then is the LimitTo function called. This is useful when you need to check more information regarding specific targets of the goal to validate whether the goal should continue running. This callback is effectively a way to define your own finish criteria. It is recommended that you only use LimitTo callbacks when FinishCriteria can&#039;t be used, since FinishCriteria are much faster and don&#039;t involve frequent calls into script. LimitTo functions might commonly be used to check the status of a map goal or some other world state that the goal relies on.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 //This function is typically set up in this.Initialize()&lt;br /&gt;
 this.LimitTo(Map.SomeFunction, 1.0); //Call Map.SomeFunction every second&lt;br /&gt;
 this.LimitTo(NULL); //clear the function&lt;br /&gt;
  &lt;br /&gt;
 //The script goal object is referenced in the passed function as &#039;this&#039;&lt;br /&gt;
 Map.SomeFunction = function()&lt;br /&gt;
 {&lt;br /&gt;
      if ( Map.SomeVariable == false )&lt;br /&gt;
          { this.Disable; } //disable the script&lt;br /&gt;
      else&lt;br /&gt;
          { return true; } //allow the script to run&lt;br /&gt;
 };&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===LimitToClass===&lt;br /&gt;
This function will only allow the script goal to be created if the owning bot is one of the classes provided. This is much more efficient than checking class in script in common cases where a goal only applies to a certain class of bot.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (classId, ...) Any number of class Ids&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 // This function can take any number of parameters.&lt;br /&gt;
 this.LimitToClass(CLASS.MEDIC);&lt;br /&gt;
 this.LimitToClass(CLASS.MEDIC, CLASS.ENGINEER);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===LimitToNoClass===&lt;br /&gt;
This function will only allow the script goal to be created if the owning bot is NOT one of the classes provided. This is much more efficient than checking class in script in common cases where a goal only applies to a certain class of bot.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (classId, ...) Any number of class Ids&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 // This function can take any number of parameters.&lt;br /&gt;
 this.LimitToNoClass(CLASS.MEDIC);&lt;br /&gt;
 this.LimitToNoClass(CLASS.MEDIC, CLASS.ENGINEER);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
===LimitToTeam===&lt;br /&gt;
This function will only allow the script goal to be created if the owning bot is one of the teams provided. This is much more efficient than checking team in script in common cases where a goal only applies to a certain team of bots.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (teamId, ...) Any number of class Ids&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 // This function can take any number of parameters.&lt;br /&gt;
 this.LimitToTeam(TEAM.BLUE);&lt;br /&gt;
 this.LimitToTeam(TEAM.BLUE, TEAM.RED);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===LimitToEntityFlag===&lt;br /&gt;
This function will only allow the script goal to be created if the owning bot has one or more entity flags set. This is much more efficient than checking entity flags in script in common cases where a goal only applies to specific cases where the bot has certain entity flags.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (ent flag, ...) Any number of entity flags&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 // This function can take any number of parameters.&lt;br /&gt;
 this.LimitToEntityFlag(ENTFLAG.INWATER);&lt;br /&gt;
 this.LimitToEntityFlag(ENTFLAG.INWATER, ENTFLAG.UNDERWATER);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===LimitToNoEntityFlag===&lt;br /&gt;
This function will only allow the script goal to be created if the owning bot does not have one or more entity flags set. This is much more efficient than checking entity flags in script in common cases where a goal only applies to specific cases where the bot does not have certain entity flags.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (ent flag, ...) Any number of entity flags&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 // This function can take any number of parameters.&lt;br /&gt;
 this.LimitToNoEntityFlag(ENTFLAG.INWATER);&lt;br /&gt;
 this.LimitToNoEntityFlag(ENTFLAG.INWATER, ENTFLAG.UNDERWATER);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===LimitToNoPowerup===&lt;br /&gt;
This function will only allow the script goal to be considered if the owning bot does not have the given powerups.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (powerup flag, ...) Any number of power up flags&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 // This function can take any number of parameters.&lt;br /&gt;
 this.LimitToNoPowerUp(ENTFLAG.INVINCIBLE);&lt;br /&gt;
 this.LimitToNoPowerUp(ENTFLAG.INVINCIBLE, ENTFLAG.QUADDAMAGE); &amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===LimitToNoTarget===&lt;br /&gt;
This function will only allow the script goal to be considered if the owning bot does not have a target. This is much more efficient than checking for a target in the GetPriority function in script in cases where the bot should not have a target. The goal will not be evaluated unless the bot does not have a target.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 // This function takes no parameters.&lt;br /&gt;
 this.LimitToNoTarget(); &amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===LimitToPowerUp===&lt;br /&gt;
This function will only allow the script goal to be created if the owning bot has one or more power up flags set. This is much more efficient than checking power up flags in script in common cases where a goal only applies to specific cases where the bot has certain power up flags.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (powerup flag, ...) Any number of power up flags&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 // This function can take any number of parameters.&lt;br /&gt;
 this.LimitToPowerUp(ENTFLAG.INVINCIBLE);&lt;br /&gt;
 this.LimitToPowerUp(ENTFLAG.INVINCIBLE, ENTFLAG.QUADDAMAGE);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===LimitToWeapon===&lt;br /&gt;
This function will only allow the script goal to be created if the owning bot has one or more weapons set by this function. This is much more efficient than checking the bots weapons in script in common cases where a goal only applies to specific cases where the bot has a certain weapon.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (weapon Id, ...) Any number of weapon Ids&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 // This function can take any number of parameters.&lt;br /&gt;
 this.LimitToWeapon(WEAPON.MOBILE_MG42);&lt;br /&gt;
 this.LimitToWeapon(WEAPON.MOBILE_MG42, WEAPON.MORTAR);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===LimitToTargetClass===&lt;br /&gt;
This function will only allow the script goal to be considered if the owning bot has a target of a specified class. This is much more efficient than checking class in the GetPriority function in script in cases where a goal only applies to specific cases where the bots target is a specific class. The goal will not be evaluated unless the bot has a target and the target is on one of the provided classes.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (classId, ...) Any number of target classes&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 // This function can take any number of parameters.&lt;br /&gt;
 this.LimitToTargetClass(CLASS.ANYPLAYER); // don&#039;t run unless we have any player class&lt;br /&gt;
 this.LimitToTargetClass(CLASS.ENGINEER, CLASS.MEDIC); // look for specific classes&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===LimitToTargetTeam===&lt;br /&gt;
This function will only allow the script goal to be considered if the owning bot has a target on a specified team. This is much more efficient than checking team in the GetPriority function in script in cases where a goal only applies to specific cases where the bots target is on a specific team. The goal will not be evaluated unless the bot has a target and the target is on one of the provided teams.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (teamId, ...) Any number of teams&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 // This function can take any number of parameters.&lt;br /&gt;
 this.LimitToTargetTeam(TEAM.RED); // don&#039;t run unless our target is on red team&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===LimitToTargetPowerUp===&lt;br /&gt;
This function will only allow the script goal to be considered if the owning bot has a target with one or more powerups. This is much more efficient than checking powerups in the GetPriority function in script in cases where a goal only applies to specific cases where the bots target has a powerup. The goal will not be evaluated unless the bot has a target and the target is on one of the provided powerups.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (powerup id, ...) Any number of power up flags&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 // This function can take any number of parameters.&lt;br /&gt;
 this.LimitToTargetPowerUp(POWERUP.QUADDAMAGE); // don&#039;t run unless our target has quad damage&lt;br /&gt;
 this.LimitToTargetPowerUp(ENTFLAG.INVINCIBLE, ENTFLAG.QUADDAMAGE);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===LimitToTargetNoPowerUp===&lt;br /&gt;
This function will only allow the script goal to be considered if the owning bot has a target without one or more powerups. This is much more efficient than checking powerups in the GetPriority function in script in cases where a goal only applies to specific cases where the bot&#039;s target hasn&#039;t a powerup. The goal will not be evaluated unless the bot has a target and the target doesn&#039;t have one of the provided powerups.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (powerup id, ...) Any number of power up flags&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 // This function can take any number of parameters.&lt;br /&gt;
 this.LimitToTargetNoPowerUp(POWERUP.QUADDAMAGE); // don&#039;t run if our target has quad damage&lt;br /&gt;
 this.LimitToTargetNoPowerUp(ENTFLAG.INVINCIBLE, ENTFLAG.QUADDAMAGE);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===LimitToTargetEntityFlag===&lt;br /&gt;
This function will only allow the script goal to be created if the target bot has one or more of the entity flags set. This is much more efficient than checking entity flags in script in common cases where a goal only applies to specific cases where the bot has certain entity flags.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (ent flag, ...) Any number of entity flags&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 // This function can take any number of parameters.&lt;br /&gt;
 this.LimitToTargetEntityFlag(ENTFLAG.INWATER);&lt;br /&gt;
 this.LimitToTargetEntityFlag(ENTFLAG.INWATER, ENTFLAG.UNDERWATER);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===LimitToTargetNoEntityFlag===&lt;br /&gt;
This function will only allow the script goal to be created if the target bot does not have one or more of the entity flags set. This is much more efficient than checking entity flags in script in common cases where a goal only applies to specific cases where the bot does not have certain entity flags.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (ent flag, ...) Any number of entity flags&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 // This function can take any number of parameters.&lt;br /&gt;
 this.LimitToTargetNoEntityFlag(ENTFLAG.INWATER);&lt;br /&gt;
 this.LimitToTargetNoEntityFlag(ENTFLAG.INWATER, ENTFLAG.UNDERWATER);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===LimitToTargetWeapon===&lt;br /&gt;
This function will only allow the script goal to be created if the bots has one or more weapons set by this function. This is much more efficient than checking the bots weapons in script in common cases where a goal only applies to specific cases where the bot&#039;s target has a certain weapon.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (weapon Id, ...) Any number of weapon Ids&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 // This function can take any number of parameters.&lt;br /&gt;
 this.LimitToTargetWeapon(WEAPON.MOBILE_MG42);&lt;br /&gt;
 this.LimitToTargetWeapon(WEAPON.MOBILE_MG42, WEAPON.MORTAR);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===LimitToRole===&lt;br /&gt;
This function will only allow the script goal to be created if the owning bot has one of the roles provided.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (roleId, ...) Any number of role Ids&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 this.LimitToRole(ROLE.DEFENDER);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===IsActive===&lt;br /&gt;
Checks if the script goal is currently active. An active script goal means it is currently running. This check is useful mostly in cases where you want an active script goal to remain active and not necessarily keep performing complex checks in its GetPriority function.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (none)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; true if active, false if not&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 this.GetPriority = function()&lt;br /&gt;
 {&lt;br /&gt;
   if(this.IsActive())&lt;br /&gt;
   {&lt;br /&gt;
     return 1.0;&lt;br /&gt;
   }&lt;br /&gt;
   else&lt;br /&gt;
   {&lt;br /&gt;
     // do some other check&lt;br /&gt;
   }&lt;br /&gt;
 }; &amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===Goto===&lt;br /&gt;
Tells the bot to go to a specific location, planning and running a path if necessary. This function is synchronous.&lt;br /&gt;
&lt;br /&gt;
The first parameter can be a table of positions, bot will choose destination which has the shortest path.&lt;br /&gt;
&lt;br /&gt;
Bot will walk if the last parameter is {MoveMode = MoveMode.Walk}.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (Vector3 position, tolerance, options[optional])&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (table of Vector3 positions, tolerance, options[optional])&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; EVENT.PATH_SUCCESS or EVENT.PATH_FAILED&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 wpinfo = table();&lt;br /&gt;
 wp = Wp.GetWaypointByName(&amp;quot;somewaypoint&amp;quot;, wpinfo);&lt;br /&gt;
 if( this.Goto(wpinfo.position, wpinfo.radius) == EVENT.PATH_SUCCESS )&lt;br /&gt;
 {&lt;br /&gt;
     print(&amp;quot;Made it!&amp;quot;);&lt;br /&gt;
 }&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===GotoAsync===&lt;br /&gt;
Tells the bot to go to a specific location, planning and running a path if necessary. This function is asynchronous. Typically a script would block after calling this to wait for a success or failure message.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (Vector3 position, tolerance, options[optional])&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 wpinfo = table();&lt;br /&gt;
 wp = Wp.GetWaypointByName(&amp;quot;somewaypoint&amp;quot;, wpinfo);&lt;br /&gt;
 this.GotoAsync(wpinfo.position, wpinfo.radius);&lt;br /&gt;
 if( block(EVENT.PATH_SUCCESS, EVENT.PATH_FAILED) == EVENT.PATH_SUCCESS )&lt;br /&gt;
 {&lt;br /&gt;
     print(&amp;quot;Made it!&amp;quot;);&lt;br /&gt;
 }&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===GotoRandom===&lt;br /&gt;
Goto random destination.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (tolerance, options[optional])&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; EVENT.PATH_SUCCESS or EVENT.PATH_FAILED&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===GotoRandomAsync===&lt;br /&gt;
Goto random destination (asynchronous).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (tolerance, options[optional])&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===RouteTo===&lt;br /&gt;
RouteTo is similar to Goto, but bots use routes which are defined for map goal. Routes are used only if bot is within radius of any ROUTE goal.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (mapGoal, tolerance, options[optional])&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; EVENT.PATH_SUCCESS or EVENT.PATH_FAILED&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===Stop===&lt;br /&gt;
Interrupts any active Goto and signals PATH_FAILED.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===DidPathSucceed===&lt;br /&gt;
Checks if the last Goto command succeeded. Success means the bot has reached the end of the desired path. Typically a goal will block on EVENT.PATH_SUCCESS or EVENT.PATH_FAILED events. [[ScriptGoal#DidPathSucceed| DidPathSucceed]] and [[ScriptGoal#DidPathFail| DidPathFail]] are included for cases where the script wishes to remain active and doing something during the path traversal, and it can poll the path success/failure during. If neither function returns true, then the bot should be moving along the path normally.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; true if path succeeded, false if not&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 if(this.DidPathSucceed())&lt;br /&gt;
 {&lt;br /&gt;
 }&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;See Also:&#039;&#039;&#039; &lt;br /&gt;
[[ScriptGoal#Goto| Goto]], [[ScriptGoal#DidPathSucceed| DidPathSucceed]]&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===DidPathFail===&lt;br /&gt;
Checks if the last Goto command failed. Failure means the path was either blocked(no path exists), or the bot has gotten stuck on the way. Typically a goal will block on EVENT.PATH_SUCCESS or EVENT.PATH_FAILED events. [[ScriptGoal#DidPathSucceed| DidPathSucceed]] and [[ScriptGoal#DidPathFail| DidPathFail]] are included for cases where the script wishes to remain active and doing something during the path traversal, and it can poll the path success/failure during. If neither function returns true, then the bot should be moving along the path normally.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; true if path failed, false if not&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 if(this.DidPathFail())&lt;br /&gt;
 {&lt;br /&gt;
 }&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;See Also:&#039;&#039;&#039; &lt;br /&gt;
[[ScriptGoal#Goto| Goto]], [[ScriptGoal#DidPathSucceed| DidPathSucceed]]&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===AddAimRequest ===&lt;br /&gt;
Adds a priority based aim request into the bots aiming system. Aim requests are favored based on their priority, with the highest priority aim request chosen at any given point. It is a much simpler and easier to manage setup in the cases of many competing goals that wish to control the bots aim. Each goal can add an aim request and will recieve notifications when the bot chooses and executes their request. This functions works together with the AimVector property to allow setting the aim type at any point. The script can recieve notification of a successful aiming by blocking on the EVENT.AIM_SUCCESS event.&lt;br /&gt;
&lt;br /&gt;
Aim requests can be viewed in the [[Debug Window]] under the Aimer state. They will take on the name of the script goal they were added in.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (priority, aim type&amp;lt;optional, default position&amp;gt;, aim position&amp;lt;optional&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
====Priority====&lt;br /&gt;
Most normal goals use a Priority.High priority, which leaves 2 higher levels of priority usable by scripts or important goals. &lt;br /&gt;
&lt;br /&gt;
Priority determines how to select a request when there are multiple requests active. Higher priorities are selected over lower priorities.&lt;br /&gt;
&lt;br /&gt;
* Priority.Zero&lt;br /&gt;
* Priority.Min&lt;br /&gt;
* Priority.Idle - FollowPath&lt;br /&gt;
* Priority.VeryLow - LookAround&lt;br /&gt;
* Priority.Low - CAMP, ESCORT, RIDE, MOUNT, ...&lt;br /&gt;
* Priority.LowMed - AttackTarget&lt;br /&gt;
* Priority.Medium - CALLARTILLERY, MOBILEMORTAR, ...&lt;br /&gt;
* Priority.High - BUILD, DEFUSE, GRENADE, REVIVE, SWITCH, ...&lt;br /&gt;
* Priority.VeryHigh&lt;br /&gt;
* Priority.Override&lt;br /&gt;
&lt;br /&gt;
====Aim Types====&lt;br /&gt;
* movedirection - Face in the direction of movement. Useful if you want to override the bots normal combat aiming, as in for a disguise goal where you don&#039;t want them to engage the target.&lt;br /&gt;
* facing - Face a given facing (direction) vector. In this case AimVector represents a facing vector.&lt;br /&gt;
** (1,0,0) - east, (-1,0,0) - west&lt;br /&gt;
** (0,1,0) - north, (0,-1,0) - south&lt;br /&gt;
** (0,0,1) - up, (0,0,-1) - down&lt;br /&gt;
* position - Face a given position vector. In this case AimVector represents a point in the 3D map space.&lt;br /&gt;
&lt;br /&gt;
If one of the above is not specified, the aim request is a positional request, and the AimVector of the script goal will be used as a raw position to aim at.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 aimPos = someAimPosition;&lt;br /&gt;
 aimPos2 = someAimPosition2;&lt;br /&gt;
&lt;br /&gt;
 this.AddAimRequest(Priority.High, &amp;quot;movedirection&amp;quot;); // requests the bot to face along its move direction at a 0.8 priority&lt;br /&gt;
 // OR&lt;br /&gt;
 this.AddAimRequest(Priority.High); // leave off optional parameters, defaults to AimPosition, so set it&lt;br /&gt;
 this.AimVector = aimPos; // this can be called at any time in the script goal&lt;br /&gt;
&lt;br /&gt;
 if(block(EVENT.AIM_SUCCESS) == EVENT.AIM_SUCCESS)&lt;br /&gt;
 {&lt;br /&gt;
    // we&#039;re on target, do something cool&lt;br /&gt;
 }&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;See Also:&#039;&#039;&#039; &lt;br /&gt;
[[ScriptGoal#ReleaseAimRequest | ReleaseAimRequest]]&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===ReleaseAimRequest ===&lt;br /&gt;
This function will release the Aim Request within the script goal; allowing other potential aim requests to have control.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 this.ReleaseAimRequest();&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;See Also:&#039;&#039;&#039; &lt;br /&gt;
[[ScriptGoal#AddAimRequest| AddAimRequest]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===AddWeaponRequest ===&lt;br /&gt;
Adds a priority based weapon equip request into the bots weapon system. Weapon requests are favored based on their priority, with the highest priority request chosen as the desired weapon. It is a much simpler and easier to manage setup in the cases of many competing goals that wish to control the bots equipped weapon. Each goal can add an weapon request and will receive notifications when the bot chooses and executes their request. &lt;br /&gt;
&lt;br /&gt;
Weapon requests can be view in the [[Debug Window]] under the WeaponSystem state. They will take on the name of the script goal they were added in.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (priority, weapon Id)&lt;br /&gt;
&lt;br /&gt;
====Priority====&lt;br /&gt;
Most normal goals use a Priority.High priority, which leaves 2 higher levels of priority usable by scripts or important goals.&lt;br /&gt;
&lt;br /&gt;
Priority determines how to select a request when there are multiple requests active. Higher priorities are selected over lower priorities.&lt;br /&gt;
&lt;br /&gt;
* Priority.Min&lt;br /&gt;
* Priority.Idle&lt;br /&gt;
* Priority.VeryLow&lt;br /&gt;
* Priority.Low&lt;br /&gt;
* Priority.Medium&lt;br /&gt;
* Priority.High&lt;br /&gt;
* Priority.VeryHigh&lt;br /&gt;
* Priority.Override&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 this.AddWeaponRequest(Priority.High, WEAPON.MEDKIT); &amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;See Also:&#039;&#039;&#039; &lt;br /&gt;
[[ScriptGoal#ReleaseWeaponRequest | ReleaseWeaponRequest]]&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===ReleaseWeaponRequest ===&lt;br /&gt;
This function will release the weapon request within the script goal; allowing other potential weapon requests to have control.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 this.ReleaseWeaponRequest();&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;See Also:&#039;&#039;&#039; &lt;br /&gt;
[[ScriptGoal#AddWeaponRequest | AddWeaponRequest ]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===BlockForWeaponChange===&lt;br /&gt;
This function provides specialized script thread blocking functionality to wait for a weapon change to a certain weapon. This function takes the place of a call to block in the case you want to wait until the bot switches to a specific weapon.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (weaponId)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 this.BlockForWeaponChange(WEAPON.MEDKIT);&lt;br /&gt;
 this.Say(&amp;quot;Medkit Equipped!&amp;quot;);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===BlockForWeaponFire===&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===BlockForVoiceMacro===&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===QueryGoals===&lt;br /&gt;
&lt;br /&gt;
Finds goals available for this bot and stores them in the first table parameter. The previous table content is cleared since omni-bot 0.84. &lt;br /&gt;
&lt;br /&gt;
The last optional parameter is table of parameters to filter result (NoFilters, Group, Role, Team, SkipDelayed, SkipNoInProgress, SkipNoInUse, SkipInUse) or sort result (parameter Sort, values are &amp;quot;none&amp;quot;, &amp;quot;priority&amp;quot;, &amp;quot;name&amp;quot;, &amp;quot;random&amp;quot;, default is &amp;quot;priority&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (table, goal type hash, params[optional])&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (table, table of goal type hashes, params[optional])&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (table, expression, params[optional])&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; count of goals returned in table&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 count = this.QueryGoals(this.Bot.QueryGoalsTable, 0xc9326a43);&lt;br /&gt;
 count = this.QueryGoals(this.Bot.QueryGoalsTable, &amp;quot;BUILD_.*&amp;quot;);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===BlackboardDelay===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (time, mapGoal or serialNumber[optional])&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 this.BlackboardDelay(10);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===BlackboardIsDelayed===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (mapGoal or serialNumber)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; true if goal has been found on blackboard&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 if (this.BlackboardIsDelayed(serial))&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===MarkInProgress===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (mapGoal[optional])&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; true if empty slot has been found and marked&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 if (!this.MarkInProgress()) {&lt;br /&gt;
   this.BlackboardDelay(5);&lt;br /&gt;
   this.Finished();&lt;br /&gt;
 }&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===MarkInUse===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (mapGoal[optional])&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; true if empty slot has been found and marked&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 if (!this.MarkInUse()) {&lt;br /&gt;
   this.BlackboardDelay(5);&lt;br /&gt;
   this.Finished();&lt;br /&gt;
 }&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===WatchForMapGoalsInRadius===&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===ClearWatchForMapGoalsInRadius===&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===WatchForEntityCategory===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; ( { Radius, Category, RequireLOS[optional, default 0] } )&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 this.WatchForEntityCategory({&lt;br /&gt;
   Radius = 350,&lt;br /&gt;
   Category = CAT.PROJECTILE,&lt;br /&gt;
   RequireLOS = TRACE.VISIBLE&lt;br /&gt;
 });&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===DelayGetPriority===&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===ForkThread===&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===KillThread===&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===Signal===&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== Script Goal Threading ==&lt;br /&gt;
&lt;br /&gt;
Script goals have been designed to be friendly to script threading, by providing some built in functionality to make it easier to manage multiple threads to be associated with the script goal.&lt;br /&gt;
&lt;br /&gt;
The script goal keeps track of the thread created when calling all the following functions.&lt;br /&gt;
* Initialize&lt;br /&gt;
* OnSpawn&lt;br /&gt;
* GetPriority&lt;br /&gt;
* Enter&lt;br /&gt;
* Exit&lt;br /&gt;
* Update&lt;br /&gt;
&lt;br /&gt;
You may use thread functions (block, yield, sleep), in any of the script goal functions, though you must understand that for efficiency, and to prevent runaway threads, the script goal will internally kill the threads associated with the function callbacks at certain times.&lt;br /&gt;
&lt;br /&gt;
Currently&lt;br /&gt;
* All threads will be killed when the state exits.&lt;br /&gt;
* All threads will be killed when the state is disabled. See [[ScriptGoal#Disable| Disable]]&lt;br /&gt;
* All threads will be killed when the state becomes unselectable. This is normally due to the limit functions.&lt;br /&gt;
&lt;br /&gt;
Note that this only applies to the thread that is created for the function calls themselves. If you really need a thread to run longer than these specifications allow, you can create your own thread normally with the thread() function. It is highly recommended that you script your goal within these functions, as it is easy to &#039;&#039;leak&#039;&#039; threads when creating them arbitrarily.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
== Script Goal Performance ==&lt;br /&gt;
&lt;br /&gt;
Executing script is much much slower than executing native code, so you should be aware that a script can have significant adverse effects on the performance of the bot as a whole. Here are some tips to keep performance as high as possible with script goals.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Only define what you need&#039;&#039;&#039; - None of the callback functions are required, so if you don&#039;t use them, don&#039;t define them. It is wasteful to have an empty function defined. If you don&#039;t need an Enter function, leave it out, if you don&#039;t need an Update function, leave it out. Same for Exit, GetPriority, Initialize.&lt;br /&gt;
* &#039;&#039;&#039;Use limit functions as much as possible&#039;&#039;&#039; - If the goal should only be considered for certain player classes, or for bots with certain powerups or entity flags, or for when the bot has a target that matches similar specific flags, use the Limit functions to set that up. They are much much faster than checking those properties in the GetPriority function. If the limit functions fail, the script will never be called, which is a huge optimization.&lt;br /&gt;
* &#039;&#039;&#039;Use thread functions&#039;&#039;&#039; - Normally, GetPriority is called often. You can control this behavior by using thread functions to keep a thread running, and delay priority evaluations with a loop and calls to sleep. GetPriority will not be called if there is still an active GetPriority thread.&lt;br /&gt;
* &#039;&#039;&#039;Keep your GetPriority function as lightweight as possible&#039;&#039;&#039; - The less work it does the better, because GetPriority is called frequently by the bot. This is especially important if the goal is placed under the &#039;&#039;LowLevel&#039;&#039; parent because all child states under &#039;&#039;LowLevel&#039;&#039; are evaluated and allowed to run simultaneously. &lt;br /&gt;
* &#039;&#039;&#039;Ditto for the Update function&#039;&#039;&#039; - The same applies to the Update function especially. Keep it as simple as possible to achieve the desired behavior, and use thread functions.&lt;br /&gt;
* &#039;&#039;&#039;Cache as much as possible&#039;&#039;&#039; - Take advantage of the fact that Initialize is called only once when the bot is added. Use this function to cache values the script goal might need. For example, if the script goal does things based on specific waypoints, it would be expensive to call functions like Wp.GetWaypointByName() in the priority or update functions. Instead collect all you might need up front in the Initialize function and store them in a table on the script goal so you have faster access to them later.&lt;br /&gt;
* &#039;&#039;&#039;Use events, and block() as much as possible&#039;&#039;&#039; - Most common operations that previously required expensive loops to perform have been converted to events. Choosing a weapon, aiming a weapon, going to some location, etc. Most can be followed by a call to block() which will suspend the execution of the script until the event is recieved. This is the single easiest to use and most useful for performance features available. See [[ScriptGoal#BlockForWeaponChange|BlockForWeaponChange]], [[ScriptGoal#Goto|Goto]], [[ScriptGoal#AddAimRequest|AddAimRequest]].&lt;br /&gt;
* &#039;&#039;&#039;Beware of loops&#039;&#039;&#039; - Be careful when looping, as they can silently cause large performance drains. Be wary of how much work is being done in a loop, and on how many elements. Expensive functionality can be updated less often, or split up over time. Use yield() or sleep(x) within loops to spread out the calculations over time.&lt;/div&gt;</summary>
		<author><name>Palota</name></author>
	</entry>
	<entry>
		<id>https://mygamingtalk.com/wiki/index.php?title=Roles&amp;diff=1757</id>
		<title>Roles</title>
		<link rel="alternate" type="text/html" href="https://mygamingtalk.com/wiki/index.php?title=Roles&amp;diff=1757"/>
		<updated>2025-05-25T13:35:53Z</updated>

		<summary type="html">&lt;p&gt;Palota: /* Bots */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{process header&lt;br /&gt;
 | title    = Roles&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;
== Intro ==&lt;br /&gt;
&lt;br /&gt;
Bot roles were added in version 0.8 as a method to focus specific bots on specific goals. Any goal that has a role defined will be ignored by bots that do not have the same role defined. This is particularly useful when there are multiple defense points in a map that are simultaneously active or in large dual objective maps.&lt;br /&gt;
&lt;br /&gt;
The Enemy Territory map Radar is one such example as the last stage of the map has two separate objectives for the Allied team to steal; the East and West Radar Parts. The defense has been setup so that one group of defenders will focus on the West Parts and another will focus on the East Parts. Since the defend goals have an equal priority, setting roles ensures that the bots won&#039;t be wandering between locations; which results in a much weaker defense.&lt;br /&gt;
&lt;br /&gt;
Another very specific usage of roles is for Covert Ops bots in Enemy Territory that have the ability to steal an enemies uniform. Once in uniform, the bot is automatically assigned an Infiltrator role; which makes certain goals available that normally would not be reachable.&lt;br /&gt;
&lt;br /&gt;
A more common use of roles would be for the Capture the Flag type maps seen in Doom 3 and Quake 4 as there is a need for dedicated base defenders.&lt;br /&gt;
&lt;br /&gt;
Roles however are not limited to the scenarios given. Any time there is a need for specific goals to be limited in usage to one or more bots, setting roles is a simple way to solve the problem.  &lt;br /&gt;
&lt;br /&gt;
== Setup ==&lt;br /&gt;
&lt;br /&gt;
Setup requires that both bots and goals are given the desired roles with one of the predefined roles. Valid roles are as follows:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
ROLE.ATTACKER&lt;br /&gt;
ROLE.ATTACKER1&lt;br /&gt;
ROLE.ATTACKER2&lt;br /&gt;
ROLE.ATTACKER3&lt;br /&gt;
ROLE.OFFENSECAPTAIN&lt;br /&gt;
ROLE.DEFENDER&lt;br /&gt;
ROLE.DEFENDER1&lt;br /&gt;
ROLE.DEFENDER2&lt;br /&gt;
ROLE.DEFENDER3&lt;br /&gt;
ROLE.DEFENSECAPTAIN&lt;br /&gt;
ROLE.TEAMCAPTAIN&lt;br /&gt;
ROLE.FIRETEAMCAPTAIN&lt;br /&gt;
ROLE.AMBUSHER&lt;br /&gt;
ROLE.INFILTRATOR&lt;br /&gt;
ROLE.ROAMER&lt;br /&gt;
ROLE.SNIPER&lt;br /&gt;
ROLE.ESCORT&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Goals ===&lt;br /&gt;
&lt;br /&gt;
Roles can be added to goals either in the editor or in a map script. To add a role in the editor, simply use the following commands:&lt;br /&gt;
 /bot goal_edit&lt;br /&gt;
 /bot goal_setproperty roles DEFENDER&lt;br /&gt;
 /bot goal_finish&lt;br /&gt;
&lt;br /&gt;
You can set multiple roles on a goal by using the | operator:&lt;br /&gt;
 /bot goal_setproperty roles DEFENDER|DEFENDER1&lt;br /&gt;
&lt;br /&gt;
Once completed, /bot goal_save will commit the changes to the goals file.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Setting roles in the editor is preferred since it reduces script size, but users wishing to set them in the map script can use the following helper functions:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
SetGoalRole( &amp;lt;goal expression or table&amp;gt;, &amp;lt;roles&amp;gt;, &amp;lt;persistent&amp;gt; );&lt;br /&gt;
Util.SetRoleForGroup( &amp;lt;goal group&amp;gt;, &amp;lt;roles&amp;gt; );&lt;br /&gt;
ClearGoalRole( &amp;lt;goal expression or table&amp;gt;, &amp;lt;roles&amp;gt; );&lt;br /&gt;
Util.ClearRoleForGroup( &amp;lt;goal group&amp;gt;, &amp;lt;roles&amp;gt; );&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
SetGoalRole(&amp;quot;DEFEND_East.*&amp;quot;, ROLE.DEFENDER); //set the defender role on goals that have a name starting with DEFEND_East&lt;br /&gt;
SetGoalRole(&amp;quot;DEFUSE_wall.*&amp;quot;, ROLE.DEFENDER2, true); //set role for dynamically created goal&lt;br /&gt;
SetGoalRole(&amp;quot;MOUNTMG42_bank&amp;quot;, { ROLE.DEFENDER2, ROLE.DEFENDER3 }); //set multiple roles to one goal&lt;br /&gt;
SetGoalRole({ &amp;quot;DEFEND_docs.*&amp;quot;, &amp;quot;MOUNTMG42_docs&amp;quot; }, ROLE.DEFENDER1); //set role on multiple goals&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Priority ===&lt;br /&gt;
&lt;br /&gt;
Almost every map goal has property RolePriorityBonus which is added to priority if the goal has any role. That&#039;s why bots prefer goals which have role. Camp goals (attack/defend/camp/snipe) have RolePriorityBonus only 0.01. Other goals have RolePriorityBonus 0.1.&lt;br /&gt;
&lt;br /&gt;
Sometimes the default RolePriorityBonus is not enough and it&#039;s necessary to use function SetGoalPriority to change priorities. For example, if some CHECKPOINT goal without role is active, all DEFEND goals are ignored and all bots go to capture checkpoint. Even if the DEFEND goals have DEFENDER role and some bots have DEFENDER role, nobody will use DEFEND goals if they have default priority.&lt;br /&gt;
&lt;br /&gt;
=== Bots ===&lt;br /&gt;
&lt;br /&gt;
The simplest way to assign bot roles is to set up the map script to use the Role Manager. The Role Manager will automatically assign the bots&#039; roles based on a Map.Roles table in the map script.&lt;br /&gt;
&lt;br /&gt;
A commented example of the Role Manager setup:&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;
	Roles =&lt;br /&gt;
	{&lt;br /&gt;
		AXIS = // Team&lt;br /&gt;
		{&lt;br /&gt;
			AllBots = true, // each bot is considered for a role&lt;br /&gt;
			DEFENDER = // the DEFENDER role&lt;br /&gt;
			{&lt;br /&gt;
				voice = &amp;quot;defend&amp;quot;, 		// signals voice chat to randomly announce&lt;br /&gt;
				spawnpt = 2,			// users of this role will choose spawnpt 2&lt;br /&gt;
				numbots = 4,			// maximum of 4 bots&lt;br /&gt;
				crucialClass = CLASS.ENGINEER,	// class for the first bot&lt;br /&gt;
				MinBotsForRole = 4,             // only assign this role if there are already 4 bots in game&lt;br /&gt;
			},&lt;br /&gt;
			ATTACKER =&lt;br /&gt;
			{&lt;br /&gt;
				voice = &amp;quot;attack&amp;quot;,&lt;br /&gt;
				numbots = 4,&lt;br /&gt;
				crucialClass = {CLASS.ENGINEER, CLASS.COVERTOPS}, //the first is engineer, the second is covertops&lt;br /&gt;
			},&lt;br /&gt;
		},&lt;br /&gt;
&lt;br /&gt;
		ALLIES =&lt;br /&gt;
		{&lt;br /&gt;
			AllBots = false, // default: every other bot&lt;br /&gt;
			DEFENDER =&lt;br /&gt;
			{&lt;br /&gt;
				AllBots = true, //allow more than 3&lt;br /&gt;
				numbots = 3,&lt;br /&gt;
			},&lt;br /&gt;
			ATTACKER =&lt;br /&gt;
			{&lt;br /&gt;
				numbots = 4,&lt;br /&gt;
			},&lt;br /&gt;
		},&lt;br /&gt;
	},&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this example, each team will have bots assigned to two different roles. For each role there can be a maximum number of bots set, a spawn point defined, a crucial class given, and even a voice chat for the bot to randomly use when assigned the role. All of the role flags are optional except for numbots:&lt;br /&gt;
&lt;br /&gt;
 numbots - the number of bots the role manager will attempt to keep assigned the role&lt;br /&gt;
 AllBots - allow more than numbots for the role&lt;br /&gt;
 crucialClass - the first bot assigned the role will switch to this class, can be a table of classes for more bots&lt;br /&gt;
 spawnpt - bots with this role will choose this spawn point&lt;br /&gt;
 voice - &amp;quot;attack&amp;quot; and &amp;quot;defend&amp;quot; are the two valid values&lt;br /&gt;
 MinBotsForRole - the number of bots required to be in game before assigning the role.&lt;br /&gt;
&lt;br /&gt;
=== Region triggers ===&lt;br /&gt;
&lt;br /&gt;
If some goals are behind a door or gate which can be opened or destroyed by one team, and closed or rebuilt by the other team, then it is recommended to use region triggers. It will prevent path failed errors. It is usually possible to create one large region which covers entire area behind door (see maps mml_minastirith_fp3, nod_temple). Bots inside the region will have a role, but bots outside the region will not have the role. Goals behind door or gate will have the role only if the door is closed or gate is built.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
Rocket_room =&lt;br /&gt;
{&lt;br /&gt;
	Name = &amp;quot;Rocket_room&amp;quot;,&lt;br /&gt;
	TriggerOnClass = CLASS.ANYPLAYER,&lt;br /&gt;
	OnEnter = function(ent)&lt;br /&gt;
	{&lt;br /&gt;
		bot = Util.IsBot(ent);&lt;br /&gt;
		if(bot){ bot.SetRoles(ROLE.ATTACKER); }&lt;br /&gt;
	},&lt;br /&gt;
	OnExit = function(ent)&lt;br /&gt;
	{&lt;br /&gt;
		bot = Util.IsBot(ent);&lt;br /&gt;
		if(bot){ bot.ClearRoles(ROLE.ATTACKER); }&lt;br /&gt;
	},&lt;br /&gt;
},&lt;br /&gt;
&lt;br /&gt;
Door_Open = function()&lt;br /&gt;
{&lt;br /&gt;
	ClearGoalRole({ &amp;quot;PLANT_rocket&amp;quot;, &amp;quot;ATTACK_rocket.*&amp;quot; }, ROLE.ATTACKER);&lt;br /&gt;
},&lt;br /&gt;
&lt;br /&gt;
Door_Close = function()&lt;br /&gt;
{&lt;br /&gt;
	SetGoalRole({ &amp;quot;PLANT_rocket&amp;quot;, &amp;quot;ATTACK_rocket.*&amp;quot; }, ROLE.ATTACKER);&lt;br /&gt;
},&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sometimes it&#039;s not possible to create one large region (see map sfx_endor). Then it is necessary to create the first region just behind the gate (OnEnter function sets bot&#039;s role) and other regions in front of the gate and at every spawn (OnEnter function clears bot&#039;s role).&lt;/div&gt;</summary>
		<author><name>Palota</name></author>
	</entry>
	<entry>
		<id>https://mygamingtalk.com/wiki/index.php?title=ScriptGoal&amp;diff=1756</id>
		<title>ScriptGoal</title>
		<link rel="alternate" type="text/html" href="https://mygamingtalk.com/wiki/index.php?title=ScriptGoal&amp;diff=1756"/>
		<updated>2025-05-24T18:18:33Z</updated>

		<summary type="html">&lt;p&gt;Palota: /* Priority */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{process header&lt;br /&gt;
 | title    = Script Goal&lt;br /&gt;
 | section  =&lt;br /&gt;
 | previous = [[Omni-bot_Script_Reference | Script Reference]]&lt;br /&gt;
 | next     = &lt;br /&gt;
 | shortcut =&lt;br /&gt;
 | notes    =&lt;br /&gt;
}}&lt;br /&gt;
{{TOCright}}&lt;br /&gt;
[[Category:ET|Script Goals]]&lt;br /&gt;
[[Category:Doom 3|Script Goals]]&lt;br /&gt;
[[Category:Quake 4|Script Goals]]&lt;br /&gt;
[[Category:RTCW|Script Goals]]&lt;br /&gt;
&lt;br /&gt;
==ScriptGoal Properties==&lt;br /&gt;
===Name===&lt;br /&gt;
The name of the script goal. Important for other scripts to refer to by name, and the name it is displayed under in the [[Debug Window]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;this.Name = &amp;quot;MyGoalName&amp;quot;;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Parent===&lt;br /&gt;
The name of the parent goal. This should be set up once in the script and left alone. It controls where in the behavior tree the goal is inserted. The location of the goal in the state tree effects how it is evaluated.&lt;br /&gt;
&lt;br /&gt;
Users should stick to one of the following 2 parents.&lt;br /&gt;
* HighLevel - Puts the goal under the HighLevel parent. Because the goal is under the HighLevel state, only one state at a time can run. This is useful for goals that take control of the bot, that shouldn&#039;t be interrupted by other script goals or built in goals.&lt;br /&gt;
* LowLevel - Puts the goal under the LowLevel parent. All states under the LowLevel state are run simultaneously, and so is a good location for scripts that control things that don&#039;t necessarily take total control over the bot, or don&#039;t wish to interrupt the execution of other goals. Some examples might be calling for medic, calling for ammo, most communication scripts.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;this.Parent = &amp;quot;HighLevel&amp;quot;;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===InsertBefore===&lt;br /&gt;
It controls where in the behavior tree the goal is inserted. InsertBefore property is ignored if Parent has been set. &lt;br /&gt;
&lt;br /&gt;
===InsertAfter===&lt;br /&gt;
It controls where in the behavior tree the goal is inserted. InsertAfter property is ignored if Parent or InsertBefore has been set. &lt;br /&gt;
&lt;br /&gt;
===Disable===&lt;br /&gt;
Enables/Disables the goal for consideration. The goal will no longer be considered for execution. Disabled goals have specific coloring in the [[Debug Window]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;this.Disable = true;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===AimVector===&lt;br /&gt;
This Vector3 is used by any active aim request the script goal has registered. You usually do not need to use this property directly, because function AddAimRequest sets this property.&lt;br /&gt;
&lt;br /&gt;
===AlwaysRecieveEvents===&lt;br /&gt;
Normally goals receive events only when active. Setting this to true will allow the goal to receive events even when it&#039;s not running. This is useful for when you want to have the goal sit idle and only activate when receiving a certain event, or you want to track and store information in the goal from events.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;this.AlwaysRecieveEvents = true;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Events===&lt;br /&gt;
Accesses the Events table of the goal, in order to set up script functions that will be called when the bot receives events. By default, goals only receive events when they are active. This can be overridden with [[ScriptGoal#AlwaysRecieveEvents| AlwaysRecieveEvents]], which will allow goals to receive events even when not active.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 this.Events[EVENT.FEEL_PAIN] = function(Inflictor, PreviousHealth, CurrentHealth)&lt;br /&gt;
 {&lt;br /&gt;
   whoDoneIt = GetEntName(Inflictor);&lt;br /&gt;
   print( format(&amp;quot;%s: %s Hurt me: Was %d, now %d&amp;quot;, &lt;br /&gt;
    this.Bot.GetName(), whoDoneIt, PreviousHealth, CurrentHealth) );&lt;br /&gt;
 };&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Bot===&lt;br /&gt;
This provides an accessor to the bot that is running the goal. The &#039;this&#039; within script goals is always the script goal itself, so in the frequent case of needing to access the bot, use this property.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;this.Bot.Say(&amp;quot;Wassup&amp;quot;);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Priority===&lt;br /&gt;
Priority is a property rather than a return value of [[ScriptGoal#GetPriority| GetPriority]] in order to support the useful threading nature of script goals. It is possible to completely leave out a [[ScriptGoal#GetPriority| GetPriority]] function, and set the priority through this property somewhere else, such as in an event callback. This property will automatically be reset internally when the state exits, to prevent a script goal from activating in a loop from the user forgetting to reset the Priority.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;this.Priority = 1;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SkipGetPriorityWhenActive===&lt;br /&gt;
Set SkipGetPriorityWhenActive to true if function GetPriority should not be called while the goal is active.&lt;br /&gt;
&lt;br /&gt;
===GetPriorityDelay===&lt;br /&gt;
Delay in seconds between GetPriority calls. Default is 0.&lt;br /&gt;
&lt;br /&gt;
===MapGoal===&lt;br /&gt;
Current MapGoal or null if the script goal is not active. This property is not set automatically. You must assign map goal to this property in GetPriority and clear it in Exit.&lt;br /&gt;
&lt;br /&gt;
===AutoReleaseAim===&lt;br /&gt;
Function ReleaseAimRequest is automatically called in Exit. Default is true.&lt;br /&gt;
&lt;br /&gt;
===AutoReleaseWeapon===&lt;br /&gt;
Function ReleaseWeaponRequest is automatically called in Exit. Default is true.&lt;br /&gt;
&lt;br /&gt;
===AutoReleaseTrackers===&lt;br /&gt;
Function Trackers::Reset is automatically called in Exit. Default is true.&lt;br /&gt;
&lt;br /&gt;
===AutoFinishOnUnAvailable===&lt;br /&gt;
The goal is automatically finished if current MapGoal is not available. Default is true.&lt;br /&gt;
&lt;br /&gt;
===AutoFinishOnNoProgressSlots===&lt;br /&gt;
The goal is automatically finished if MarkInProgress has not been called yet and MapGoal has no TRACK_INPROGRESS slots available. Default is true.&lt;br /&gt;
&lt;br /&gt;
===AutoFinishOnNoUseSlots===&lt;br /&gt;
The goal is automatically finished if MarkInUse has not been called yet and MapGoal has no TRACK_INUSE slots available. Default is true.&lt;br /&gt;
&lt;br /&gt;
===AutoAdd===&lt;br /&gt;
Set AutoAdd to false if the script should not be loaded for every map, because it&#039;s deprecated or used only for debugging (RideTram, TestEvents, ...).&lt;br /&gt;
&lt;br /&gt;
===DebugString===&lt;br /&gt;
Debug strings are displayed if you use command &amp;quot;/bot debugbot all fpinfo&amp;quot; and then spectate bots. If DebugString is null, MapGoal name is displayed.&lt;br /&gt;
&lt;br /&gt;
===Debug===&lt;br /&gt;
Set this property at the beginning of gm file so that all your debug messages or debug drawing can be easily enabled or disabled.&lt;br /&gt;
&lt;br /&gt;
===Commands===&lt;br /&gt;
Table of console commands which are executed on the script goal for every bot.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 this.Commands[&amp;quot;command_name&amp;quot;] = {&lt;br /&gt;
  Func = function( _params )&lt;br /&gt;
  { &lt;br /&gt;
  },&lt;br /&gt;
  Help = { &amp;quot;description&amp;quot; },&lt;br /&gt;
 };&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==ScriptGoal Callbacks==&lt;br /&gt;
These functions are available only in 0.7 and later.&lt;br /&gt;
&lt;br /&gt;
===Initialize===&lt;br /&gt;
This function is called exactly once per bot, when the bot is added and initialized. It is typically used to perform one time initialization code.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 this.Initialize() = function()&lt;br /&gt;
 {&lt;br /&gt;
 };&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===OnSpawn===&lt;br /&gt;
This function is called every time the bot spawns. Spawning in Omni-bot means any time the bot re-enters his Main active state. This could mean an actual respawn, a revival from an incapacitated state, or something similar.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 this.OnSpawn() = function()&lt;br /&gt;
 {&lt;br /&gt;
 };&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===GetPriority===&lt;br /&gt;
This function is most often the place to evaluate whether you want the script goal to run. Take care in the complexity of the code here, as it is called pretty often, and can be a source of considerable performance overhead.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 this.GetPriority() = function()&lt;br /&gt;
 {&lt;br /&gt;
 };&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===Enter===&lt;br /&gt;
This function is called when a state is chosen to run, right before it begins running. This function is only called once when the state enters, and will not be called again until the state is exited.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 this.Enter() = function()&lt;br /&gt;
 {&lt;br /&gt;
 };&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;See Also:&#039;&#039;&#039; &lt;br /&gt;
[[ScriptGoal#Exit| Exit]]&lt;br /&gt;
----&lt;br /&gt;
===Exit===&lt;br /&gt;
This function is called when a state finishes running, or is overridden by a higher priority state. It is often used to release aim or weapon requests that were used by the goal.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 this.Exit() = function()&lt;br /&gt;
 {&lt;br /&gt;
 };&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;See Also:&#039;&#039;&#039; &lt;br /&gt;
[[ScriptGoal#Enter| Enter]]&lt;br /&gt;
----&lt;br /&gt;
===Update===&lt;br /&gt;
This function is the meat of a script goal. Once a goal is chosen to run, and [[ScriptGoal#Enter| Enter]] is called, the Update function begins getting called at frequent regular intervals. The state stays active until another goal overrides it, or until [[ScriptGoal#Finished| Finished]] is called, after which the [[ScriptGoal#Exit| Exit]] function is called.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 this.Update() = function()&lt;br /&gt;
 {&lt;br /&gt;
   // do stuff&lt;br /&gt;
   this.Finished(); // when we&#039;re done running&lt;br /&gt;
 };&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;See Also:&#039;&#039;&#039; &lt;br /&gt;
[[ScriptGoal#Enter| Enter]], [[ScriptGoal#Exit| Exit]]&lt;br /&gt;
----&lt;br /&gt;
===OnPathThrough===&lt;br /&gt;
This function is called if bot comes to waypoint which has paththrough property set and its value is goalName:data.&lt;br /&gt;
Paththrough is activated if OnPathThrough function returns true.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 this.OnPathThrough = function(data)&lt;br /&gt;
 {&lt;br /&gt;
  navigation = Map.Navigation[data];&lt;br /&gt;
  if(navigation)&lt;br /&gt;
  {&lt;br /&gt;
   this.CurrentNavigation = data;&lt;br /&gt;
   return true;&lt;br /&gt;
  }&lt;br /&gt;
  this.CurrentNavigation = null;&lt;br /&gt;
  return false;&lt;br /&gt;
 };&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==ScriptGoal Functions==&lt;br /&gt;
These functions are available only in 0.7 and later.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===AddFinishCriteria===&lt;br /&gt;
Finish Criteria are expressions set up from script that will be evaluated constantly in the code and when they are satisfied will cause the script goal to abort. These are useful when your script does alot of asynchronous operations(like Goto), but you want a way to abort the script goal, even if the main update script happens to be in an asynchronous or blocked call, sleep or yield.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (subject, expression, value[optional])&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (expression, value[optional])&lt;br /&gt;
&lt;br /&gt;
====Subject====&lt;br /&gt;
Subject must be an entity, if no entity is provided as the first parameter, it is assumed that the 2nd version of the function is called, which takes only and expression and an optional value. The need for a value is determined by what the expression actually is.&lt;br /&gt;
&lt;br /&gt;
====Expression====&lt;br /&gt;
Expression is a string containing 1 or more keywords that use a natural syntax for defining the conditions of the criteria. Additionally, some keywords expect an operator to be defined&lt;br /&gt;
{| align=&amp;quot;center&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!Keyword&lt;br /&gt;
!Operator Required&lt;br /&gt;
!Value&lt;br /&gt;
|-&lt;br /&gt;
|deleted&lt;br /&gt;
|No&lt;br /&gt;
|entity&lt;br /&gt;
|-&lt;br /&gt;
|health&lt;br /&gt;
|Yes&lt;br /&gt;
|health value to compare against(float or int)&lt;br /&gt;
|-&lt;br /&gt;
|hasentflag&lt;br /&gt;
|No&lt;br /&gt;
|entity flag to compare against. use not to negate test&lt;br /&gt;
|-&lt;br /&gt;
|weaponcharged&lt;br /&gt;
|No&lt;br /&gt;
|weapon Id(integer)&lt;br /&gt;
|-&lt;br /&gt;
|weaponequipped&lt;br /&gt;
|No&lt;br /&gt;
|weapon Id(integer)&lt;br /&gt;
|-&lt;br /&gt;
|weaponhasammo&lt;br /&gt;
|No&lt;br /&gt;
|weapon Id(integer)&lt;br /&gt;
|-&lt;br /&gt;
|velocity&lt;br /&gt;
|Yes&lt;br /&gt;
|vector3 velocity to compare against, OR float magnitude of velocity to compare against(speed)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Valid Operators=====&lt;br /&gt;
* lessthan&lt;br /&gt;
* &amp;lt;&lt;br /&gt;
* greaterthan&lt;br /&gt;
* &amp;gt;&lt;br /&gt;
* equals&lt;br /&gt;
* ==&lt;br /&gt;
&lt;br /&gt;
In addition, some expressions can contain negation keywords in order to check for the negative of an expression, such as&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 this.AddFinishCriteria(this.TargetEntity,&amp;quot;not hasentflag&amp;quot;,ENTFLAG.DEAD); // as soon as the entity does not have the dead flag&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; true if criteria was created, false if not&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 this.AddFinishCriteria(this.TargetEntity,&amp;quot;deleted&amp;quot;); // finish the goal of the target is deleted&lt;br /&gt;
 this.AddFinishCriteria(this.TargetEntity,&amp;quot;health lessthan&amp;quot;,1); // or if they are dead(health &amp;lt;= 1)&lt;br /&gt;
 this.AddFinishCriteria(this.TargetEntity,&amp;quot;hasentflag&amp;quot;,ENTFLAG.LIMBO); // or if they tap out&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===ClearFinishCriteria===&lt;br /&gt;
Deletes finish criteria.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (clearpersistent[optional, default false])&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===Finished===&lt;br /&gt;
Notifies the goal that it is finished running. This function is normally called from the Update function when the goal is desired to finish.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (none)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 this.Finished();&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===LimitTo===&lt;br /&gt;
This function limits script execution based on a true value being returned from a user defined function. This function is useful if scripts should only be run based on some external logic; like a Map variable setting.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (function, delay, onlyactive[optional - default false])&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
LimitTo functions are script functions that are called at user defined intervals that can be used to update from script whether or not the script goal should be able to run or not. Returning false from this function effectively blocks the script goals ability to activate. It will remain in this state as long as the LimitTo function is defined. The 2nd parameter controls how often the callback is performed. Calling script functions too often can adversely effect performance, so it is recommended to choose a delay that is as infrequently as you can get away with. The &#039;onlyactive&#039; parameter is optional and defaults to false. If this parameter is set to true, the LimitTo function callback will ONLY be performed when the script goal is active. By default the LimitTo function will be called whether the goal is active or not, and returning false will prevent the goal from being able to activate. Passing true as the &#039;onlyactive&#039; flag means the goal can activate, and only then is the LimitTo function called. This is useful when you need to check more information regarding specific targets of the goal to validate whether the goal should continue running. This callback is effectively a way to define your own finish criteria. It is recommended that you only use LimitTo callbacks when FinishCriteria can&#039;t be used, since FinishCriteria are much faster and don&#039;t involve frequent calls into script. LimitTo functions might commonly be used to check the status of a map goal or some other world state that the goal relies on.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 //This function is typically set up in this.Initialize()&lt;br /&gt;
 this.LimitTo(Map.SomeFunction, 1.0); //Call Map.SomeFunction every second&lt;br /&gt;
 this.LimitTo(NULL); //clear the function&lt;br /&gt;
  &lt;br /&gt;
 //The script goal object is referenced in the passed function as &#039;this&#039;&lt;br /&gt;
 Map.SomeFunction = function()&lt;br /&gt;
 {&lt;br /&gt;
      if ( Map.SomeVariable == false )&lt;br /&gt;
          { this.Disable; } //disable the script&lt;br /&gt;
      else&lt;br /&gt;
          { return true; } //allow the script to run&lt;br /&gt;
 };&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===LimitToClass===&lt;br /&gt;
This function will only allow the script goal to be created if the owning bot is one of the classes provided. This is much more efficient than checking class in script in common cases where a goal only applies to a certain class of bot.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (classId, ...) Any number of class Ids&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 // This function can take any number of parameters.&lt;br /&gt;
 this.LimitToClass(CLASS.MEDIC);&lt;br /&gt;
 this.LimitToClass(CLASS.MEDIC, CLASS.ENGINEER);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===LimitToNoClass===&lt;br /&gt;
This function will only allow the script goal to be created if the owning bot is NOT one of the classes provided. This is much more efficient than checking class in script in common cases where a goal only applies to a certain class of bot.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (classId, ...) Any number of class Ids&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 // This function can take any number of parameters.&lt;br /&gt;
 this.LimitToNoClass(CLASS.MEDIC);&lt;br /&gt;
 this.LimitToNoClass(CLASS.MEDIC, CLASS.ENGINEER);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
===LimitToTeam===&lt;br /&gt;
This function will only allow the script goal to be created if the owning bot is one of the teams provided. This is much more efficient than checking team in script in common cases where a goal only applies to a certain team of bots.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (teamId, ...) Any number of class Ids&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 // This function can take any number of parameters.&lt;br /&gt;
 this.LimitToTeam(TEAM.BLUE);&lt;br /&gt;
 this.LimitToTeam(TEAM.BLUE, TEAM.RED);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===LimitToEntityFlag===&lt;br /&gt;
This function will only allow the script goal to be created if the owning bot has one or more entity flags set. This is much more efficient than checking entity flags in script in common cases where a goal only applies to specific cases where the bot has certain entity flags.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (ent flag, ...) Any number of entity flags&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 // This function can take any number of parameters.&lt;br /&gt;
 this.LimitToEntityFlag(ENTFLAG.INWATER);&lt;br /&gt;
 this.LimitToEntityFlag(ENTFLAG.INWATER, ENTFLAG.UNDERWATER);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===LimitToNoEntityFlag===&lt;br /&gt;
This function will only allow the script goal to be created if the owning bot does not have one or more entity flags set. This is much more efficient than checking entity flags in script in common cases where a goal only applies to specific cases where the bot does not have certain entity flags.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (ent flag, ...) Any number of entity flags&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 // This function can take any number of parameters.&lt;br /&gt;
 this.LimitToNoEntityFlag(ENTFLAG.INWATER);&lt;br /&gt;
 this.LimitToNoEntityFlag(ENTFLAG.INWATER, ENTFLAG.UNDERWATER);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===LimitToNoPowerup===&lt;br /&gt;
This function will only allow the script goal to be considered if the owning bot does not have the given powerups.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (powerup flag, ...) Any number of power up flags&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 // This function can take any number of parameters.&lt;br /&gt;
 this.LimitToNoPowerUp(ENTFLAG.INVINCIBLE);&lt;br /&gt;
 this.LimitToNoPowerUp(ENTFLAG.INVINCIBLE, ENTFLAG.QUADDAMAGE); &amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===LimitToNoTarget===&lt;br /&gt;
This function will only allow the script goal to be considered if the owning bot does not have a target. This is much more efficient than checking for a target in the GetPriority function in script in cases where the bot should not have a target. The goal will not be evaluated unless the bot does not have a target.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 // This function takes no parameters.&lt;br /&gt;
 this.LimitToNoTarget(); &amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===LimitToPowerUp===&lt;br /&gt;
This function will only allow the script goal to be created if the owning bot has one or more power up flags set. This is much more efficient than checking power up flags in script in common cases where a goal only applies to specific cases where the bot has certain power up flags.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (powerup flag, ...) Any number of power up flags&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 // This function can take any number of parameters.&lt;br /&gt;
 this.LimitToPowerUp(ENTFLAG.INVINCIBLE);&lt;br /&gt;
 this.LimitToPowerUp(ENTFLAG.INVINCIBLE, ENTFLAG.QUADDAMAGE);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===LimitToWeapon===&lt;br /&gt;
This function will only allow the script goal to be created if the owning bot has one or more weapons set by this function. This is much more efficient than checking the bots weapons in script in common cases where a goal only applies to specific cases where the bot has a certain weapon.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (weapon Id, ...) Any number of weapon Ids&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 // This function can take any number of parameters.&lt;br /&gt;
 this.LimitToWeapon(WEAPON.MOBILE_MG42);&lt;br /&gt;
 this.LimitToWeapon(WEAPON.MOBILE_MG42, WEAPON.MORTAR);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===LimitToTargetClass===&lt;br /&gt;
This function will only allow the script goal to be considered if the owning bot has a target of a specified class. This is much more efficient than checking class in the GetPriority function in script in cases where a goal only applies to specific cases where the bots target is a specific class. The goal will not be evaluated unless the bot has a target and the target is on one of the provided classes.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (classId, ...) Any number of target classes&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 // This function can take any number of parameters.&lt;br /&gt;
 this.LimitToTargetClass(CLASS.ANYPLAYER); // don&#039;t run unless we have any player class&lt;br /&gt;
 this.LimitToTargetClass(CLASS.ENGINEER, CLASS.MEDIC); // look for specific classes&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===LimitToTargetTeam===&lt;br /&gt;
This function will only allow the script goal to be considered if the owning bot has a target on a specified team. This is much more efficient than checking team in the GetPriority function in script in cases where a goal only applies to specific cases where the bots target is on a specific team. The goal will not be evaluated unless the bot has a target and the target is on one of the provided teams.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (teamId, ...) Any number of teams&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 // This function can take any number of parameters.&lt;br /&gt;
 this.LimitToTargetTeam(TEAM.RED); // don&#039;t run unless our target is on red team&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===LimitToTargetPowerUp===&lt;br /&gt;
This function will only allow the script goal to be considered if the owning bot has a target with one or more powerups. This is much more efficient than checking powerups in the GetPriority function in script in cases where a goal only applies to specific cases where the bots target has a powerup. The goal will not be evaluated unless the bot has a target and the target is on one of the provided powerups.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (powerup id, ...) Any number of power up flags&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 // This function can take any number of parameters.&lt;br /&gt;
 this.LimitToTargetPowerUp(POWERUP.QUADDAMAGE); // don&#039;t run unless our target has quad damage&lt;br /&gt;
 this.LimitToTargetPowerUp(ENTFLAG.INVINCIBLE, ENTFLAG.QUADDAMAGE);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===LimitToTargetNoPowerUp===&lt;br /&gt;
This function will only allow the script goal to be considered if the owning bot has a target without one or more powerups. This is much more efficient than checking powerups in the GetPriority function in script in cases where a goal only applies to specific cases where the bot&#039;s target hasn&#039;t a powerup. The goal will not be evaluated unless the bot has a target and the target doesn&#039;t have one of the provided powerups.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (powerup id, ...) Any number of power up flags&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 // This function can take any number of parameters.&lt;br /&gt;
 this.LimitToTargetNoPowerUp(POWERUP.QUADDAMAGE); // don&#039;t run if our target has quad damage&lt;br /&gt;
 this.LimitToTargetNoPowerUp(ENTFLAG.INVINCIBLE, ENTFLAG.QUADDAMAGE);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===LimitToTargetEntityFlag===&lt;br /&gt;
This function will only allow the script goal to be created if the target bot has one or more of the entity flags set. This is much more efficient than checking entity flags in script in common cases where a goal only applies to specific cases where the bot has certain entity flags.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (ent flag, ...) Any number of entity flags&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 // This function can take any number of parameters.&lt;br /&gt;
 this.LimitToTargetEntityFlag(ENTFLAG.INWATER);&lt;br /&gt;
 this.LimitToTargetEntityFlag(ENTFLAG.INWATER, ENTFLAG.UNDERWATER);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===LimitToTargetNoEntityFlag===&lt;br /&gt;
This function will only allow the script goal to be created if the target bot does not have one or more of the entity flags set. This is much more efficient than checking entity flags in script in common cases where a goal only applies to specific cases where the bot does not have certain entity flags.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (ent flag, ...) Any number of entity flags&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 // This function can take any number of parameters.&lt;br /&gt;
 this.LimitToTargetNoEntityFlag(ENTFLAG.INWATER);&lt;br /&gt;
 this.LimitToTargetNoEntityFlag(ENTFLAG.INWATER, ENTFLAG.UNDERWATER);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===LimitToTargetWeapon===&lt;br /&gt;
This function will only allow the script goal to be created if the bots has one or more weapons set by this function. This is much more efficient than checking the bots weapons in script in common cases where a goal only applies to specific cases where the bot&#039;s target has a certain weapon.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (weapon Id, ...) Any number of weapon Ids&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 // This function can take any number of parameters.&lt;br /&gt;
 this.LimitToTargetWeapon(WEAPON.MOBILE_MG42);&lt;br /&gt;
 this.LimitToTargetWeapon(WEAPON.MOBILE_MG42, WEAPON.MORTAR);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===LimitToRole===&lt;br /&gt;
This function will only allow the script goal to be created if the owning bot has one of the roles provided.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (roleId, ...) Any number of role Ids&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 this.LimitToRole(ROLE.DEFENDER);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===IsActive===&lt;br /&gt;
Checks if the script goal is currently active. An active script goal means it is currently running. This check is useful mostly in cases where you want an active script goal to remain active and not necessarily keep performing complex checks in its GetPriority function.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (none)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; true if active, false if not&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 this.GetPriority = function()&lt;br /&gt;
 {&lt;br /&gt;
   if(this.IsActive())&lt;br /&gt;
   {&lt;br /&gt;
     return 1.0;&lt;br /&gt;
   }&lt;br /&gt;
   else&lt;br /&gt;
   {&lt;br /&gt;
     // do some other check&lt;br /&gt;
   }&lt;br /&gt;
 }; &amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===Goto===&lt;br /&gt;
Tells the bot to go to a specific location, planning and running a path if necessary. This function is synchronous.&lt;br /&gt;
&lt;br /&gt;
The first parameter can be a table of positions, bot will choose destination which has the shortest path.&lt;br /&gt;
&lt;br /&gt;
Bot will walk if the last parameter is {MoveMode = MoveMode.Walk}.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (Vector3 position, tolerance, options[optional])&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (table of Vector3 positions, tolerance, options[optional])&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; EVENT.PATH_SUCCESS or EVENT.PATH_FAILED&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 wpinfo = table();&lt;br /&gt;
 wp = Wp.GetWaypointByName(&amp;quot;somewaypoint&amp;quot;, wpinfo);&lt;br /&gt;
 if( this.Goto(wpinfo.position, wpinfo.radius) == EVENT.PATH_SUCCESS )&lt;br /&gt;
 {&lt;br /&gt;
     print(&amp;quot;Made it!&amp;quot;);&lt;br /&gt;
 }&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===GotoAsync===&lt;br /&gt;
Tells the bot to go to a specific location, planning and running a path if necessary. This function is asynchronous. Typically a script would block after calling this to wait for a success or failure message.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (Vector3 position, tolerance, options[optional])&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 wpinfo = table();&lt;br /&gt;
 wp = Wp.GetWaypointByName(&amp;quot;somewaypoint&amp;quot;, wpinfo);&lt;br /&gt;
 this.GotoAsync(wpinfo.position, wpinfo.radius);&lt;br /&gt;
 if( block(EVENT.PATH_SUCCESS, EVENT.PATH_FAILED) == EVENT.PATH_SUCCESS )&lt;br /&gt;
 {&lt;br /&gt;
     print(&amp;quot;Made it!&amp;quot;);&lt;br /&gt;
 }&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===GotoRandom===&lt;br /&gt;
Goto random destination.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (tolerance, options[optional])&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; EVENT.PATH_SUCCESS or EVENT.PATH_FAILED&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===GotoRandomAsync===&lt;br /&gt;
Goto random destination (asynchronous).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (tolerance, options[optional])&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===RouteTo===&lt;br /&gt;
RouteTo is similar to Goto, but bots use routes which are defined for map goal. Routes are used only if bot is within radius of any ROUTE goal.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (mapGoal, tolerance, options[optional])&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; EVENT.PATH_SUCCESS or EVENT.PATH_FAILED&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===Stop===&lt;br /&gt;
Interrupts any active Goto and signals PATH_FAILED.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===DidPathSucceed===&lt;br /&gt;
Checks if the last Goto command succeeded. Success means the bot has reached the end of the desired path. Typically a goal will block on EVENT.PATH_SUCCESS or EVENT.PATH_FAILED events. [[ScriptGoal#DidPathSucceed| DidPathSucceed]] and [[ScriptGoal#DidPathFail| DidPathFail]] are included for cases where the script wishes to remain active and doing something during the path traversal, and it can poll the path success/failure during. If neither function returns true, then the bot should be moving along the path normally.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; true if path succeeded, false if not&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 if(this.DidPathSucceed())&lt;br /&gt;
 {&lt;br /&gt;
 }&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;See Also:&#039;&#039;&#039; &lt;br /&gt;
[[ScriptGoal#Goto| Goto]], [[ScriptGoal#DidPathSucceed| DidPathSucceed]]&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===DidPathFail===&lt;br /&gt;
Checks if the last Goto command failed. Failure means the path was either blocked(no path exists), or the bot has gotten stuck on the way. Typically a goal will block on EVENT.PATH_SUCCESS or EVENT.PATH_FAILED events. [[ScriptGoal#DidPathSucceed| DidPathSucceed]] and [[ScriptGoal#DidPathFail| DidPathFail]] are included for cases where the script wishes to remain active and doing something during the path traversal, and it can poll the path success/failure during. If neither function returns true, then the bot should be moving along the path normally.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; true if path failed, false if not&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 if(this.DidPathFail())&lt;br /&gt;
 {&lt;br /&gt;
 }&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;See Also:&#039;&#039;&#039; &lt;br /&gt;
[[ScriptGoal#Goto| Goto]], [[ScriptGoal#DidPathSucceed| DidPathSucceed]]&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===AddAimRequest ===&lt;br /&gt;
Adds a priority based aim request into the bots aiming system. Aim requests are favored based on their priority, with the highest priority aim request chosen at any given point. It is a much simpler and easier to manage setup in the cases of many competing goals that wish to control the bots aim. Each goal can add an aim request and will recieve notifications when the bot chooses and executes their request. This functions works together with the AimVector property to allow setting the aim type at any point. The script can recieve notification of a successful aiming by blocking on the EVENT.AIM_SUCCESS event.&lt;br /&gt;
&lt;br /&gt;
Aim requests can be viewed in the [[Debug Window]] under the Aimer state. They will take on the name of the script goal they were added in.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (priority, aim type&amp;lt;optional, default position&amp;gt;, aim position&amp;lt;optional&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
====Priority====&lt;br /&gt;
Most normal goals use a Priority.High priority, which leaves 2 higher levels of priority usable by scripts or important goals. &lt;br /&gt;
&lt;br /&gt;
Priority determines how to select a request when there are multiple requests active. Higher priorities are selected over lower priorities.&lt;br /&gt;
&lt;br /&gt;
* Priority.Zero&lt;br /&gt;
* Priority.Min&lt;br /&gt;
* Priority.Idle - FollowPath&lt;br /&gt;
* Priority.VeryLow - LookAround&lt;br /&gt;
* Priority.Low - CAMP, ESCORT, RIDE, MOUNT, ...&lt;br /&gt;
* Priority.LowMed - AttackTarget&lt;br /&gt;
* Priority.Medium - CALLARTILLERY, MOBILEMORTAR, ...&lt;br /&gt;
* Priority.High - BUILD, DEFUSE, GRENADE, REVIVE, SWITCH, ...&lt;br /&gt;
* Priority.VeryHigh&lt;br /&gt;
* Priority.Override&lt;br /&gt;
&lt;br /&gt;
====Aim Types====&lt;br /&gt;
* movedirection - Face in the direction of movement. Useful if you want to override the bots normal combat aiming, as in for a disguise goal where you don&#039;t want them to engage the target.&lt;br /&gt;
* facing - Face a given facing (direction) vector. In this case AimVector represents a facing vector.&lt;br /&gt;
** (1,0,0) - east, (-1,0,0) - west&lt;br /&gt;
** (0,1,0) - north, (0,-1,0) - south&lt;br /&gt;
** (0,0,1) - up, (0,0,-1) - down&lt;br /&gt;
* position - Face a given position vector. In this case AimVector represents a point in the 3D map space.&lt;br /&gt;
&lt;br /&gt;
If one of the above is not specified, the aim request is a positional request, and the AimVector of the script goal will be used as a raw position to aim at.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 aimPos = someAimPosition;&lt;br /&gt;
 aimPos2 = someAimPosition2;&lt;br /&gt;
&lt;br /&gt;
 this.AddAimRequest(Priority.High, &amp;quot;movedirection&amp;quot;); // requests the bot to face along its move direction at a 0.8 priority&lt;br /&gt;
 // OR&lt;br /&gt;
 this.AddAimRequest(Priority.High); // leave off optional parameters, defaults to AimPosition, so set it&lt;br /&gt;
 this.AimVector = aimPos; // this can be called at any time in the script goal&lt;br /&gt;
&lt;br /&gt;
 if(block(EVENT.AIM_SUCCESS) == EVENT.AIM_SUCCESS)&lt;br /&gt;
 {&lt;br /&gt;
    // we&#039;re on target, do something cool&lt;br /&gt;
 }&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;See Also:&#039;&#039;&#039; &lt;br /&gt;
[[ScriptGoal#ReleaseAimRequest | ReleaseAimRequest]]&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===ReleaseAimRequest ===&lt;br /&gt;
This function will release the Aim Request within the script goal; allowing other potential aim requests to have control.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 this.ReleaseAimRequest();&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;See Also:&#039;&#039;&#039; &lt;br /&gt;
[[ScriptGoal#AddAimRequest| AddAimRequest]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===AddWeaponRequest ===&lt;br /&gt;
Adds a priority based weapon equip request into the bots weapon system. Weapon requests are favored based on their priority, with the highest priority request chosen as the desired weapon. It is a much simpler and easier to manage setup in the cases of many competing goals that wish to control the bots equipped weapon. Each goal can add an weapon request and will receive notifications when the bot chooses and executes their request. &lt;br /&gt;
&lt;br /&gt;
Weapon requests can be view in the [[Debug Window]] under the WeaponSystem state. They will take on the name of the script goal they were added in.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (priority, weapon Id)&lt;br /&gt;
&lt;br /&gt;
====Priority====&lt;br /&gt;
Most normal goals use a Priority.High priority, which leaves 2 higher levels of priority usable by scripts or important goals.&lt;br /&gt;
&lt;br /&gt;
Priority determines how to select a request when there are multiple requests active. Higher priorities are selected over lower priorities.&lt;br /&gt;
&lt;br /&gt;
* Priority.Min&lt;br /&gt;
* Priority.Idle&lt;br /&gt;
* Priority.VeryLow&lt;br /&gt;
* Priority.Low&lt;br /&gt;
* Priority.Medium&lt;br /&gt;
* Priority.High&lt;br /&gt;
* Priority.VeryHigh&lt;br /&gt;
* Priority.Override&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 this.AddWeaponRequest(Priority.High, WEAPON.MEDKIT); &amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;See Also:&#039;&#039;&#039; &lt;br /&gt;
[[ScriptGoal#ReleaseWeaponRequest | ReleaseWeaponRequest]]&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===ReleaseWeaponRequest ===&lt;br /&gt;
This function will release the weapon request within the script goal; allowing other potential weapon requests to have control.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 this.ReleaseWeaponRequest();&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;See Also:&#039;&#039;&#039; &lt;br /&gt;
[[ScriptGoal#AddWeaponRequest | AddWeaponRequest ]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===BlockForWeaponChange===&lt;br /&gt;
This function provides specialized script thread blocking functionality to wait for a weapon change to a certain weapon. This function takes the place of a call to block in the case you want to wait until the bot switches to a specific weapon.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (weaponId)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 this.BlockForWeaponChange(WEAPON.MEDKIT);&lt;br /&gt;
 this.Say(&amp;quot;Medkit Equipped!&amp;quot;);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===BlockForWeaponFire===&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===BlockForVoiceMacro===&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===QueryGoals===&lt;br /&gt;
&lt;br /&gt;
Finds goals available for this bot and stores them in the first table parameter. The previous table content is cleared since omni-bot 0.84. &lt;br /&gt;
&lt;br /&gt;
The last optional parameter is table of parameters to filter result (NoFilters, Group, Role, Team, SkipDelayed, SkipNoInProgress, SkipNoInUse, SkipInUse) or sort result (parameter Sort, values are &amp;quot;none&amp;quot;, &amp;quot;priority&amp;quot;, &amp;quot;name&amp;quot;, &amp;quot;random&amp;quot;, default is &amp;quot;priority&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (table, goal type hash, params[optional])&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (table, table of goal type hashes, params[optional])&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (table, expression, params[optional])&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; count of goals returned in table&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 count = this.QueryGoals(this.Bot.QueryGoalsTable, 0xc9326a43);&lt;br /&gt;
 count = this.QueryGoals(this.Bot.QueryGoalsTable, &amp;quot;BUILD_.*&amp;quot;);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===BlackboardDelay===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (time, mapGoal or serialNumber[optional])&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 this.BlackboardDelay(10);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===BlackboardIsDelayed===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (mapGoal or serialNumber)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; true if goal has been found on blackboard&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 if (this.BlackboardIsDelayed(serial))&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===MarkInProgress===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (mapGoal[optional])&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; true if empty slot has been found and marked&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 if (!this.MarkInProgress()) {&lt;br /&gt;
   this.BlackboardDelay(5);&lt;br /&gt;
   this.Finished();&lt;br /&gt;
 }&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===MarkInUse===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (mapGoal[optional])&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; true if empty slot has been found and marked&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 if (!this.MarkInUse()) {&lt;br /&gt;
   this.BlackboardDelay(5);&lt;br /&gt;
   this.Finished();&lt;br /&gt;
 }&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===WatchForMapGoalsInRadius===&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===ClearWatchForMapGoalsInRadius===&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===WatchForEntityCategory===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; ( { Radius, Category, RequireLOS[optional, default 0] } )&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 this.WatchForEntityCategory({&lt;br /&gt;
   Radius = 350,&lt;br /&gt;
   Category = CAT.PROJECTILE,&lt;br /&gt;
   RequireLOS = TRACE.VISIBLE&lt;br /&gt;
 });&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===DelayGetPriority===&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===ForkThread===&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===KillThread===&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===Signal===&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== Script Goal Threading ==&lt;br /&gt;
&lt;br /&gt;
Script goals have been designed to be friendly to script threading, by providing some built in functionality to make it easier to manage multiple threads to be associated with the script goal.&lt;br /&gt;
&lt;br /&gt;
The script goal keeps track of the thread created when calling all the following functions.&lt;br /&gt;
* Initialize&lt;br /&gt;
* OnSpawn&lt;br /&gt;
* GetPriority&lt;br /&gt;
* Enter&lt;br /&gt;
* Exit&lt;br /&gt;
* Update&lt;br /&gt;
&lt;br /&gt;
You may use thread functions (block, yield, sleep), in any of the script goal functions, though you must understand that for efficiency, and to prevent runaway threads, the script goal will internally kill the threads associated with the function callbacks at certain times.&lt;br /&gt;
&lt;br /&gt;
Currently&lt;br /&gt;
* All threads will be killed when the state exits.&lt;br /&gt;
* All threads will be killed when the state is disabled. See [[ScriptGoal#Disable| Disable]]&lt;br /&gt;
* All threads will be killed when the state becomes unselectable. This is normally due to the limit functions.&lt;br /&gt;
&lt;br /&gt;
Note that this only applies to the thread that is created for the function calls themselves. If you really need a thread to run longer than these specifications allow, you can create your own thread normally with the thread() function. It is highly recommended that you script your goal within these functions, as it is easy to &#039;&#039;leak&#039;&#039; threads when creating them arbitrarily.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
== Script Goal Performance ==&lt;br /&gt;
&lt;br /&gt;
Executing script is much much slower than executing native code, so you should be aware that a script can have significant adverse effects on the performance of the bot as a whole. Here are some tips to keep performance as high as possible with script goals.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Only define what you need&#039;&#039;&#039; - None of the callback functions are required, so if you don&#039;t use them, don&#039;t define them. It is wasteful to have an empty function defined. If you don&#039;t need an Enter function, leave it out, if you don&#039;t need an Update function, leave it out. Same for Exit, GetPriority, Initialize.&lt;br /&gt;
* &#039;&#039;&#039;Use limit functions as much as possible&#039;&#039;&#039; - If the goal should only be considered for certain player classes, or for bots with certain powerups or entity flags, or for when the bot has a target that matches similar specific flags, use the Limit functions to set that up. They are much much faster than checking those properties in the GetPriority function. If the limit functions fail, the script will never be called, which is a huge optimization.&lt;br /&gt;
* &#039;&#039;&#039;Use thread functions&#039;&#039;&#039; - Normally, GetPriority is called often. You can control this behavior by using thread functions to keep a thread running, and delay priority evaluations with a loop and calls to sleep. GetPriority will not be called if there is still an active GetPriority thread.&lt;br /&gt;
* &#039;&#039;&#039;Keep your GetPriority function as lightweight as possible&#039;&#039;&#039; - The less work it does the better, because GetPriority is called frequently by the bot. This is especially important if the goal is placed under the &#039;&#039;LowLevel&#039;&#039; parent because all child states under &#039;&#039;LowLevel&#039;&#039; are evaluated and allowed to run simultaneously. &lt;br /&gt;
* &#039;&#039;&#039;Ditto for the Update function&#039;&#039;&#039; - The same applies to the Update function especially. Keep it as simple as possible to achieve the desired behavior, and use thread functions.&lt;br /&gt;
* &#039;&#039;&#039;Cache as much as possible&#039;&#039;&#039; - Take advantage of the fact that Initialize is called only once when the bot is added. Use this function to cache values the script goal might need. For example, if the script goal does things based on specific waypoints, it would be expensive to call functions like Wp.GetWaypointByName() in the priority or update functions. Instead collect all you might need up front in the Initialize function and store them in a table on the script goal so you have faster access to them later.&lt;br /&gt;
* &#039;&#039;&#039;Use events, and block() as much as possible&#039;&#039;&#039; - Most common operations that previously required expensive loops to perform have been converted to events. Choosing a weapon, aiming a weapon, going to some location, etc. Most can be followed by a call to block() which will suspend the execution of the script until the event is recieved. This is the single easiest to use and most useful for performance features available. See [[ScriptGoal#BlockForWeaponChange|BlockForWeaponChange]], [[ScriptGoal#Goto|Goto]], [[ScriptGoal#AddAimRequest|AddAimRequest]].&lt;br /&gt;
* &#039;&#039;&#039;Beware of loops&#039;&#039;&#039; - Be careful when looping, as they can silently cause large performance drains. Be wary of how much work is being done in a loop, and on how many elements. Expensive functionality can be updated less often, or split up over time. Use yield() or sleep(x) within loops to spread out the calculations over time.&lt;/div&gt;</summary>
		<author><name>Palota</name></author>
	</entry>
	<entry>
		<id>https://mygamingtalk.com/wiki/index.php?title=Omni-bot_Command_Reference&amp;diff=1755</id>
		<title>Omni-bot Command Reference</title>
		<link rel="alternate" type="text/html" href="https://mygamingtalk.com/wiki/index.php?title=Omni-bot_Command_Reference&amp;diff=1755"/>
		<updated>2025-05-20T12:33:51Z</updated>

		<summary type="html">&lt;p&gt;Palota: /* navsystem */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{process header&lt;br /&gt;
 | title    = Omni-bot Command Reference&lt;br /&gt;
 | section  =&lt;br /&gt;
 | previous = [[Main_Page | Main Page]]&lt;br /&gt;
 | next     = &lt;br /&gt;
 | shortcut =&lt;br /&gt;
 | notes    =&lt;br /&gt;
}}&lt;br /&gt;
{{TOCright}}&lt;br /&gt;
[[Category:ET|Command Reference]]&lt;br /&gt;
[[Category:Doom 3|Command Reference]]&lt;br /&gt;
[[Category:Quake 4|Command Reference]]&lt;br /&gt;
{{TOCright}}&lt;br /&gt;
===Console Commands===&lt;br /&gt;
&lt;br /&gt;
Omni-bot comes with a wide range of utilities in the form of console commands for general purpose usage as well as debugging tools for waypointing. &lt;br /&gt;
You can also add/write your own commands into file et_autoexec_user.gm or rtcw_autoexec_user.gm in scripts folder.&lt;br /&gt;
&lt;br /&gt;
* [[Console|How to open console and execute command]]&lt;br /&gt;
* [[Goal Commands]]&lt;br /&gt;
* [[Waypoint Commands]]&lt;br /&gt;
&lt;br /&gt;
====addbot==== &lt;br /&gt;
Do NOT use this command on dedicated servers. Command [[Omni-bot_Command_Reference#maxbots | maxbots]] must be used on servers.&lt;br /&gt;
If you play game on your home computer and you want bots to be added automatically, you can use command [[Omni-bot_Command_Reference#maxbots | maxbots]] too. If you want to add bots manually every time you start the game, you should use command [[Omni-bot_Command_Reference#ab | ab]]. Command addbot is useful only if you need unbalanced teams.&lt;br /&gt;
&lt;br /&gt;
  syntax: bot addbot &amp;lt;optional team&amp;gt; &amp;lt;optional class&amp;gt; &amp;lt;optional name&amp;gt;&lt;br /&gt;
  example: /bot addbot 2 1 bob will add a soldier named bob to the allied team in ET&lt;br /&gt;
&lt;br /&gt;
team: 1 = Axis, 2 = Allies&lt;br /&gt;
&lt;br /&gt;
class: 1 = Soldier, 2 = Medic, 3 = Engineer, 4 = Field Ops, 5 = Covert Ops&lt;br /&gt;
&lt;br /&gt;
Note: Command addbot chooses bot&#039;s name randomly. Command [[Omni-bot_Command_Reference#ab | ab]] chooses names according to team and class as defined in file et_botnames_ext.gm. &lt;br /&gt;
&lt;br /&gt;
Note: Bots select their class every time they spawn. If you want to set classes manually, you must change DisableClassManager value to 1 in file et_autoexec.gm.&lt;br /&gt;
&lt;br /&gt;
====debugbot====&lt;br /&gt;
Enables debugging output on a specific bot or all bots.&lt;br /&gt;
&lt;br /&gt;
  syntax: bot debugbot botname debugtype&lt;br /&gt;
  example: bot debugbot all fpinfo&lt;br /&gt;
&lt;br /&gt;
debug types: log, move, script, fpinfo, planner, events, failedpaths, aim, sensory, steer, target&lt;br /&gt;
&lt;br /&gt;
Debug type can also be a ScriptGoal name to toggle Debug property.&lt;br /&gt;
&lt;br /&gt;
====debugtriggers====&lt;br /&gt;
Prints triggers to console.&lt;br /&gt;
&lt;br /&gt;
  syntax: bot debugtriggers &amp;lt;optional 1/0/on/off&amp;gt; &amp;lt;optional regular expression&amp;gt;&lt;br /&gt;
  usage: used for checking or identifying trigger names to be used with map scripting. when turned on, you will see &lt;br /&gt;
         messages about events as they occur in the map:&lt;br /&gt;
  &lt;br /&gt;
  &amp;lt;+++&amp;gt; Trigger: TagName: The Tank has been repaired! Action: announce Entity: 0x7016dd8c Activator: 0&lt;br /&gt;
  &lt;br /&gt;
  &amp;lt;+++&amp;gt; means that a callback (trigger) is set up and has been called, while &amp;lt;---&amp;gt; means no callback is associated&lt;br /&gt;
  TagName is the string to use for the OnTrigger function in the map script&lt;br /&gt;
  Action is the category in which the event is recognized&lt;br /&gt;
  &lt;br /&gt;
  notes: this is a toggle. issuing the command a second time will turn it off.&lt;br /&gt;
&lt;br /&gt;
====dontshoot====&lt;br /&gt;
Enables/disables all bot shooting ability.&lt;br /&gt;
&lt;br /&gt;
  syntax: bot dontshoot true/false/1/0/yes/no&lt;br /&gt;
  example: bot dontshoot 1 will stop all bots from shooting.&lt;br /&gt;
&lt;br /&gt;
====draw_goalrange====&lt;br /&gt;
Renders all goals range radius and prints it to the console.&lt;br /&gt;
&lt;br /&gt;
  syntax: bot draw_goalrange&lt;br /&gt;
&lt;br /&gt;
====draw_goalroutes====&lt;br /&gt;
Renders route paths.&lt;br /&gt;
&lt;br /&gt;
  syntax: bot draw_goalroutes on/off goalname&lt;br /&gt;
  example: bot draw_goalroutes on will draw route paths to all goals set up for routing&lt;br /&gt;
 &lt;br /&gt;
  notes: the goalname parameter is optional and supports expressions. i.e. bot draw_goalroutes on ATTACK.* will draw route to all of&lt;br /&gt;
         the attack goals in the map that are set up for routing&lt;br /&gt;
         this command was added in version 0.7&lt;br /&gt;
&lt;br /&gt;
====draw_goals====&lt;br /&gt;
Draws debug information for all mapgoals.&lt;br /&gt;
&lt;br /&gt;
  syntax: bot draw_goals on/off goalname&lt;br /&gt;
  example: bot draw_goals on will draw squares around all objective goals and highlight the radius of attack / defend goals&lt;br /&gt;
 &lt;br /&gt;
  notes: the goalname parameter is optional and supports expressions. i.e. bot draw_goals on ATTACK.* will highlight all of&lt;br /&gt;
         the attack goals in the map.&lt;br /&gt;
&lt;br /&gt;
====drawblocktests====&lt;br /&gt;
Enables drawing of blockable line tests.&lt;br /&gt;
&lt;br /&gt;
  syntax: bot drawblocktests 1/0&lt;br /&gt;
  example: bot drawblocktests 1 turns on drawing of block tests&lt;br /&gt;
  &lt;br /&gt;
  useage: will draw block test lines in addition to the ones drawn in waypoint mode.&lt;br /&gt;
&lt;br /&gt;
====drawtriggers====&lt;br /&gt;
Renders any active trigger zones.&lt;br /&gt;
&lt;br /&gt;
  syntax: bot drawtriggers &amp;lt;optional 1/0&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====help====&lt;br /&gt;
List all bot commands available in console.&lt;br /&gt;
&lt;br /&gt;
  syntax: bot help&lt;br /&gt;
&lt;br /&gt;
====kickall====&lt;br /&gt;
Kick all bots from the game by name.&lt;br /&gt;
&lt;br /&gt;
  syntax: bot kickall&lt;br /&gt;
&lt;br /&gt;
====kickbot====&lt;br /&gt;
Removes a bot from the game.&lt;br /&gt;
&lt;br /&gt;
  syntax: bot kickbot &amp;lt;botname&amp;gt;&lt;br /&gt;
  example: bot kickbot [BOT]Aimless&lt;br /&gt;
&lt;br /&gt;
====nav_benchmarkgetnavpoint====&lt;br /&gt;
Development tool. Performs a GetClosestWaypoint test with every waypoint. Used to test the speed of nearest waypoint lookups.&lt;br /&gt;
&lt;br /&gt;
====nav_benchmarkpathfinder====&lt;br /&gt;
Development tool. Executes a path search between every waypoint and every other waypoint. Used to test the speed of the path finding system.&lt;br /&gt;
&lt;br /&gt;
====nav_logfailedpath====&lt;br /&gt;
Saves info about failed path attempts for debugging.&lt;br /&gt;
&lt;br /&gt;
====nav_resaveall====&lt;br /&gt;
Re-save all nav files to the newest file format.&lt;br /&gt;
&lt;br /&gt;
====nav_showfailedpath====&lt;br /&gt;
Render a failed path by its index.&lt;br /&gt;
&lt;br /&gt;
====print_filesystem====&lt;br /&gt;
Prints files from file system.&lt;br /&gt;
&lt;br /&gt;
====printfs====&lt;br /&gt;
Prints the whole file system.&lt;br /&gt;
&lt;br /&gt;
====reload_weapons====&lt;br /&gt;
Reloads the weapon database from script files on disc.&lt;br /&gt;
&lt;br /&gt;
====revision====&lt;br /&gt;
Shows the revision the bot dll was built from.&lt;br /&gt;
&lt;br /&gt;
====script_collect====&lt;br /&gt;
Performs a garbage collection.&lt;br /&gt;
&lt;br /&gt;
====script_debug====&lt;br /&gt;
Enables/disables debug messages in the scripting system.&lt;br /&gt;
&lt;br /&gt;
  syntax: bot script_debug 1/0/on/off&lt;br /&gt;
  example: bot script_debug 1 turns on debugging information in the script system.&lt;br /&gt;
  &lt;br /&gt;
  usage: when enabled, if an error occurs in script execution, it will be printed to the console.&lt;br /&gt;
&lt;br /&gt;
====script_docs====&lt;br /&gt;
Dumps a file of gm bound type info.&lt;br /&gt;
  &lt;br /&gt;
====script_run====&lt;br /&gt;
Executes a string as a script snippet.&lt;br /&gt;
Apostrophes are converted to quotation marks.&lt;br /&gt;
&lt;br /&gt;
  syntax: bot script_run &amp;lt;string&amp;gt;&lt;br /&gt;
  example: bot script_run &amp;quot;print(&#039;Time left:&#039;); print(GetGameTimeLeft())&amp;quot;&lt;br /&gt;
&lt;br /&gt;
====script_runfile====&lt;br /&gt;
Executes a specified script file.&lt;br /&gt;
&lt;br /&gt;
  syntax: bot script_runfile &amp;lt;filename&amp;gt;&lt;br /&gt;
  example: bot script_runfile testing.gm&lt;br /&gt;
&lt;br /&gt;
====script_stats====&lt;br /&gt;
Shows scripting system memory usage/stats.&lt;br /&gt;
&lt;br /&gt;
  syntax: bot script_stats&lt;br /&gt;
   &lt;br /&gt;
  usage: displays memory use and garbage collection stats in console&lt;br /&gt;
&lt;br /&gt;
====show_bb====&lt;br /&gt;
Shows the contents of the global blackboard.&lt;br /&gt;
&lt;br /&gt;
  syntax: bot show_bb&lt;br /&gt;
&lt;br /&gt;
====show_goalroutes====&lt;br /&gt;
Prints route info for matching map goals.&lt;br /&gt;
&lt;br /&gt;
====show_goals====&lt;br /&gt;
Prints out the names of each goal.&lt;br /&gt;
&lt;br /&gt;
  syntax: bot show_goals &amp;lt;optional expression&amp;gt; &amp;lt;optional p&amp;gt;&lt;br /&gt;
  example: bot show_goals DEFEND.* will list all defend goals in console&lt;br /&gt;
  example: bot show_goals .* p will list all goals and their sub priorities (for &amp;gt;= 0.7)&lt;br /&gt;
  &lt;br /&gt;
  notes: this command supports expressions for the optional parameter&lt;br /&gt;
&lt;br /&gt;
Explanation of goal-list-entry by example:&lt;br /&gt;
&lt;br /&gt;
  33: FLAG_the_War_Documents -&amp;gt; 0100 serial 3 priority 0.55&lt;br /&gt;
      ALLIES AXIS SOLDIER MEDIC ENGINEER LIEUTENANT 1.80 &lt;br /&gt;
  &lt;br /&gt;
  &amp;lt;goal-no&amp;gt;: &amp;lt;goal-name&amp;gt; -&amp;gt; &amp;lt;team-availability&amp;gt; serial &amp;lt;serial&amp;gt; priority &amp;lt;priority&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
  goal-no: number of goal&lt;br /&gt;
  goal-name: name of goal&lt;br /&gt;
  team-availability: availability team1 team2 team3 team4&lt;br /&gt;
  serial: serial number&lt;br /&gt;
  priority: default priority&lt;br /&gt;
  &lt;br /&gt;
  The optional p parameter displays properties set with the SetGoalPriority function which&lt;br /&gt;
  enables Team and Class properties to be set.  &lt;br /&gt;
&lt;br /&gt;
  notes: team-availability shows boolean value for each team  &lt;br /&gt;
         team3 and team4 are obsoleted in ET, since ET only has 2 teams:&lt;br /&gt;
         TEAM.AXIS and TEAM.ALLIES or TEAM.TEAM1 and TEAM.TEAM2.&lt;br /&gt;
&lt;br /&gt;
====showprocesses====&lt;br /&gt;
Shows a NavMesh or Recast process by its name.&lt;br /&gt;
&lt;br /&gt;
  syntax: bot showprocesses&lt;br /&gt;
  &lt;br /&gt;
  usage: for debug use only&lt;br /&gt;
&lt;br /&gt;
====stopprocess====&lt;br /&gt;
Stops a process by its name.&lt;br /&gt;
&lt;br /&gt;
  syntax: bot stopprocess&lt;br /&gt;
  &lt;br /&gt;
  usage: for debug use only&lt;br /&gt;
&lt;br /&gt;
====version====&lt;br /&gt;
Prints out the bot version number.&lt;br /&gt;
&lt;br /&gt;
  syntax: bot version&lt;br /&gt;
&lt;br /&gt;
====ab====&lt;br /&gt;
        Add Bots, add a given number of bots&lt;br /&gt;
        Usage: /bot ab &amp;lt;numbots&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====addroute====&lt;br /&gt;
        Add Route, adds a route node at players current position&lt;br /&gt;
        Usage: bot ar &amp;lt;name&amp;gt; &amp;lt;optional radius&amp;gt;&lt;br /&gt;
        Version note: RTCW only&lt;br /&gt;
&lt;br /&gt;
====aim_debug_reload====&lt;br /&gt;
        Aim Debug Reload, reloads each bots profile&lt;br /&gt;
        Usage: /bot aim_debug_reload&lt;br /&gt;
&lt;br /&gt;
====aim_pos====&lt;br /&gt;
        Aim Position, lists the players current aim position&lt;br /&gt;
        Usage: /bot aim_pos&lt;br /&gt;
&lt;br /&gt;
====ar====&lt;br /&gt;
        Add Route, adds a route node at players current position&lt;br /&gt;
        Usage: bot ar &amp;lt;name&amp;gt; &amp;lt;optional radius&amp;gt;&lt;br /&gt;
        Version note: RTCW only&lt;br /&gt;
&lt;br /&gt;
====autosave====&lt;br /&gt;
Enables waypoint view and autosave.&lt;br /&gt;
		&lt;br /&gt;
====balanceteams====&lt;br /&gt;
Forces bots to keep teams balanced.&lt;br /&gt;
&lt;br /&gt;
  syntax: bot balanceteams 1/0&lt;br /&gt;
  example: bot balanceteams 1 turns on bot balancing&lt;br /&gt;
  &lt;br /&gt;
  notes: by default, omni-bot will keep teams balanced when adding bots unless bots are added specifically to a team&lt;br /&gt;
&lt;br /&gt;
====botgoal====&lt;br /&gt;
Bot Goal, used for debugging a bots goal on remote server.&lt;br /&gt;
&lt;br /&gt;
====botsperhuman====&lt;br /&gt;
Set the team the ratio of bots per humans in a humans vs bots game.&lt;br /&gt;
&lt;br /&gt;
====botteam====&lt;br /&gt;
Set the team the bots should be on in a humans vs bots game.&lt;br /&gt;
&lt;br /&gt;
====botwar====&lt;br /&gt;
Enable or disable bots vs human teams.&lt;br /&gt;
  syntax: bot botwar &amp;lt;botTeam&amp;gt; &amp;lt;humanTeam&amp;gt; &amp;lt;botsPerHuman&amp;gt;&lt;br /&gt;
  example: bot botwar 2 1 3 // set bots to be on allies with a 3 to 1 ratio compared to humans on axis team&lt;br /&gt;
  bot botwar -1 // disable it&lt;br /&gt;
&lt;br /&gt;
====bvp====&lt;br /&gt;
        Build Vehicle Path, assists the waypointer in creating the vehicle path&lt;br /&gt;
        Usage: /bot bvp &amp;lt;goalname&amp;gt; &amp;lt;optional seconds&amp;gt;&lt;br /&gt;
               goalname should be set to the MOVER or BUILD goal of the vehicle&lt;br /&gt;
               seconds can be optionally set to adjust the interval between the vehicle being damaged&lt;br /&gt;
               run the command again to turn it off&lt;br /&gt;
        Version note: ET only&lt;br /&gt;
&lt;br /&gt;
====campnext====&lt;br /&gt;
Advance to the next camp goal position. It will automatically select the goal. Waypoint tool for adding camp facings.&lt;br /&gt;
        Version note: ET only&lt;br /&gt;
		&lt;br /&gt;
====campstart====&lt;br /&gt;
Start iterating through the camp goals in the map (CAMP, DEFEND, ATTACK, SNIPE). Waypoint tool for adding camp facings. Binding a key to /bot goal_setproperty facing 99 will make things fast!&lt;br /&gt;
        Version note: ET only&lt;br /&gt;
		&lt;br /&gt;
====cg====&lt;br /&gt;
        Clear Goal, disables the given goalname for the given team&lt;br /&gt;
        Usage: /bot cg &amp;lt;goalname&amp;gt; &amp;lt;team&amp;gt;&lt;br /&gt;
====cleargoalflags====&lt;br /&gt;
Removes all deprecated waypoint flags (defend, snipe, ...) which were used in Omni-bot 0.71.&lt;br /&gt;
&lt;br /&gt;
====cvp====&lt;br /&gt;
        Check Vehicle Path, test bots ability to repair the vehicle along its entire path&lt;br /&gt;
        Usage: /bot cvp &amp;lt;goalname&amp;gt; &amp;lt;optional seconds&amp;gt;&lt;br /&gt;
               goalname should be set to the BUILD goal of the vehicle&lt;br /&gt;
               seconds can be optionally set to adjust the interval between the vehicle being damaged&lt;br /&gt;
               run the command again to turn it off&lt;br /&gt;
        Version note: ET only&lt;br /&gt;
&lt;br /&gt;
====cwn====&lt;br /&gt;
        Clear Waypoint Names, remove all waypoint names&lt;br /&gt;
        Usage: /bot cwn &amp;lt;optional true&amp;gt;&lt;br /&gt;
        Note: the true parameter will list each waypoint that has been cleared&lt;br /&gt;
&lt;br /&gt;
====dbg_goalavailability====&lt;br /&gt;
Toggle goal availability debugging. It will print all active goals to the console when Util.MapDebugPrint is called.&lt;br /&gt;
&lt;br /&gt;
====dbg_mapscripts====&lt;br /&gt;
Toggle map script debugging (Util.MapDebugPrint messages).&lt;br /&gt;
&lt;br /&gt;
====dbg_scriptgoals====&lt;br /&gt;
Toggle script goals debugging (pathfailed, timedout, ...).&lt;br /&gt;
&lt;br /&gt;
====dg====&lt;br /&gt;
        Display Goal, runs a thread that lists the given goals name, position, and facing&lt;br /&gt;
        Usage: /bot dg &amp;lt;goalname&amp;gt; &amp;lt;true|false&amp;gt;&lt;br /&gt;
        Note: useful for mover type goals&lt;br /&gt;
&lt;br /&gt;
====difficulty====&lt;br /&gt;
        Sets the bots difficulty. 0 is easy, 4 is default, 6 is hard, -1 is random&lt;br /&gt;
        Usage: /bot difficulty 3&lt;br /&gt;
Difficulty can also be set from the referee menu in ET:Legacy.&lt;br /&gt;
&lt;br /&gt;
====dist====&lt;br /&gt;
        Distance View, gives distance to a players aim position&lt;br /&gt;
        Usage: /bot dist, /bot dist off&lt;br /&gt;
&lt;br /&gt;
====draw_oids====&lt;br /&gt;
Draw Objective Info Displays, waypoint tool. draws the bounds of all OID&#039;s in the map.&lt;br /&gt;
&lt;br /&gt;
====draw_paththrough====&lt;br /&gt;
Render 3d text over paththrough node locations.&lt;br /&gt;
&lt;br /&gt;
====draw_spawns====&lt;br /&gt;
Draw spawn points, waypoint tool. draws the bounds of all spawn points in the map.&lt;br /&gt;
&lt;br /&gt;
====dstats====&lt;br /&gt;
        Dump Stats, writes each bots current round stats to user&amp;lt;mapname&amp;gt;_stats.gm&lt;br /&gt;
        Usage: /bot dstats&lt;br /&gt;
        Version note: RTCW only&lt;br /&gt;
&lt;br /&gt;
====dump_autocomplete====&lt;br /&gt;
        Creates an xml file for autocompletion with Notepad++&lt;br /&gt;
&lt;br /&gt;
====dumpglobals====&lt;br /&gt;
        Dump Globals, writes all functions and references to files in the ~user directory&lt;br /&gt;
        Usage: /bot dumpglobals&lt;br /&gt;
&lt;br /&gt;
====dwoff====&lt;br /&gt;
        Debug Window Off, closes the debug window.&lt;br /&gt;
        Usage: /bot dwoff&lt;br /&gt;
&lt;br /&gt;
====dwon====&lt;br /&gt;
        Debug Window On, opens up the debug window.&lt;br /&gt;
		Not implemented in release version of omni-bot.&lt;br /&gt;
		You can download debug version from assembla SVN repository from dw_enabled folder.&lt;br /&gt;
        Usage: /bot dwon&lt;br /&gt;
&lt;br /&gt;
====eob====&lt;br /&gt;
        Exec on Bots, executes the given command on all bots&lt;br /&gt;
        Usage: /bot eob &amp;lt;command&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====humanteam====&lt;br /&gt;
Set the team the humans should be on in a humans vs bots game.&lt;br /&gt;
&lt;br /&gt;
====initialdelaytime====&lt;br /&gt;
Sets delay time for server manager to execute on map changes.&lt;br /&gt;
&lt;br /&gt;
====ip====&lt;br /&gt;
        Ignore Player, bots won&#039;t shoot player&lt;br /&gt;
        Usage: /bot ip &amp;lt;on|off&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====keepbot====&lt;br /&gt;
        Keep Bot, remove all bots without the given partial name&lt;br /&gt;
        Usage: /bot keepbot &amp;lt;partial botname&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====kg====&lt;br /&gt;
        Kill Goal, damage a given goal if cheats are allowed&lt;br /&gt;
        Usage: /bot kg &amp;lt;goalname&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====kt====&lt;br /&gt;
        Kill Team, kills all bots on the given team&lt;br /&gt;
        Usage: /bot kt &amp;lt;teamname&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====makegm====&lt;br /&gt;
        Make GM, creates a map script and test map script for the current map&lt;br /&gt;
        Usage: /bot makegm&lt;br /&gt;
&lt;br /&gt;
====makemapgm====&lt;br /&gt;
        Make Map GM, creates a map script for the current map&lt;br /&gt;
        Usage: /bot makemapgm&lt;br /&gt;
&lt;br /&gt;
====makemapgoallist====&lt;br /&gt;
        Make Map Goal List, creates a map goal list for the current map&lt;br /&gt;
        Usage: /bot makemapgoallist&lt;br /&gt;
&lt;br /&gt;
====maketestmapgm====&lt;br /&gt;
        Make Test Map GM, creates a test map script for the current map&lt;br /&gt;
        Usage: /bot maketestmapgm&lt;br /&gt;
&lt;br /&gt;
====maxbots====&lt;br /&gt;
The maximum bots to keep in play. It is the number of all players (bots + humans). The MaxBots value is saved to file omni-bot.cfg (but only if SaveConfigChanges = 1). Bots automatically join game if there are not enough human players. Bots leave game after new human player selects team (if CountSpectators = 0), or when new player connects to the server (if CountSpectators = 1). If you want to add bots or kick bots manually, you can set maxbots to -1.&lt;br /&gt;
&lt;br /&gt;
  Usage: bot maxbots 20&lt;br /&gt;
It can be also set in the referee menu in the legacy mod.&lt;br /&gt;
&lt;br /&gt;
====maxxp====&lt;br /&gt;
Max xp before bots should reset.&lt;br /&gt;
        Version note: ET Only&lt;br /&gt;
&lt;br /&gt;
====minbots====&lt;br /&gt;
The minimum players to keep in play.&lt;br /&gt;
&lt;br /&gt;
  syntax: bot minbots #&lt;br /&gt;
  example: bot minbots 2&lt;br /&gt;
&lt;br /&gt;
====minformobilemg====&lt;br /&gt;
set the minimum number of players playing in order for bots to choose the mobile mg42.&lt;br /&gt;
        Version note: ET Only&lt;br /&gt;
&lt;br /&gt;
====minformortar====&lt;br /&gt;
set the minimum number of players playing in order for bots to choose the mobile mortar.&lt;br /&gt;
        Version note: ET Only&lt;br /&gt;
&lt;br /&gt;
====moveskill====&lt;br /&gt;
        Combat Difficulty, sets persistent combat movement difficulty&lt;br /&gt;
        0 = off, 1 = easy, 2 = medium, 3 = hard, 4 = random&lt;br /&gt;
&lt;br /&gt;
====mypos====&lt;br /&gt;
        My Position, gets the players current position&lt;br /&gt;
        Usage: /bot mypos&lt;br /&gt;
&lt;br /&gt;
====mywpmode====&lt;br /&gt;
        My Waypoint Mode, enables waypoint view and autosave&lt;br /&gt;
        Usage: /bot mywpmode&lt;br /&gt;
&lt;br /&gt;
====numthreads====&lt;br /&gt;
        Number of Threads, prints the number of current threads&lt;br /&gt;
        Usage: /bot numthreads&lt;br /&gt;
&lt;br /&gt;
====plantnext====&lt;br /&gt;
Advance to the next PLANT goal position. It will automatically select the goal. Waypoint tool for adding cover spots.&lt;br /&gt;
        Version note: ET only&lt;br /&gt;
		&lt;br /&gt;
====plantstart====&lt;br /&gt;
Start iterating through the PLANT goals in the map. Waypoint tool for adding cover spots.&lt;br /&gt;
        Version note: ET only&lt;br /&gt;
&lt;br /&gt;
====resetxp====&lt;br /&gt;
Enables bots resetting xp. Use 1 to enable or -1 to disable.&lt;br /&gt;
&lt;br /&gt;
Shrubbot is required. Flag M must be enabled for level 0 in the file shrubbot.cfg. &lt;br /&gt;
        Version note: ET only&lt;br /&gt;
&lt;br /&gt;
====rollcall====&lt;br /&gt;
        Roll Call, lists each bots name, team, class, and entity&lt;br /&gt;
        Usage: /bot rollcall&lt;br /&gt;
&lt;br /&gt;
====sag====&lt;br /&gt;
alias for showactive&lt;br /&gt;
&lt;br /&gt;
====saveplayerpos====&lt;br /&gt;
Writes player positions to a file in user folder.&lt;br /&gt;
&lt;br /&gt;
====saveusepoint====&lt;br /&gt;
Writes player position as Util.AddUsePoint command to a file in user folder. Optional parameter is goal name expression.&lt;br /&gt;
&lt;br /&gt;
====sei====&lt;br /&gt;
alias for showentityinfo&lt;br /&gt;
&lt;br /&gt;
====sendtrigger====&lt;br /&gt;
Test command and example of sending a trigger from script.&lt;br /&gt;
&lt;br /&gt;
====sg====&lt;br /&gt;
        Set Goal, enables the given goalname for the given team&lt;br /&gt;
        Usage: /bot sg &amp;lt;goalname&amp;gt; &amp;lt;team&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====sgi====&lt;br /&gt;
        Show Goal Info, lists information about the given goal&lt;br /&gt;
        Usage: /bot sgi &amp;lt;goalname&amp;gt;&lt;br /&gt;
        Note: lists goals health, DEAD status, entity number, and position&lt;br /&gt;
&lt;br /&gt;
====sgn====&lt;br /&gt;
        Show Goal Name, lists all goals found within the given radius&lt;br /&gt;
        Usage: /bot sgn &amp;lt;radius&amp;gt; &amp;lt;optional true&amp;gt;&lt;br /&gt;
        Note: passing the optional true parameter will give player offset&lt;br /&gt;
&lt;br /&gt;
====sgo====&lt;br /&gt;
        Show Goal Offset, lists players offset to the given goal&lt;br /&gt;
        Usage: /bot sgo &amp;lt;goalname&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====showactive====&lt;br /&gt;
        Show Active Goals, lists each currently active goal by team&lt;br /&gt;
        Usage: /bot sag &amp;lt;optional team 0/1/2&amp;gt; &amp;lt;optional routes&amp;gt; &amp;lt;optional showuse&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====showentityinfo====&lt;br /&gt;
        Show Entity Info, runs a traceline and returns Entity information&lt;br /&gt;
        Usage: /bot showentityinfo &amp;lt;optional traceType&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====showevents====&lt;br /&gt;
        Show Events, lists all events in the EVENT table&lt;br /&gt;
        Usage: /bot showevents&lt;br /&gt;
&lt;br /&gt;
====showgroup====&lt;br /&gt;
Lists all goals of a given group in console.&lt;br /&gt;
&lt;br /&gt;
====showweapons====&lt;br /&gt;
        Show Weapons, lists all weapons in the WEAPON table&lt;br /&gt;
        Usage: /bot showweapons&lt;br /&gt;
&lt;br /&gt;
====skip====&lt;br /&gt;
        Skip, sets Util.Skip to true&lt;br /&gt;
        Usage: /bot skip&lt;br /&gt;
        Note: Util.Skip is used in some debugging functions&lt;br /&gt;
&lt;br /&gt;
====skipreset====&lt;br /&gt;
        Skip Reset, sets Util.Skip to false&lt;br /&gt;
        Usage: /bot skipreset&lt;br /&gt;
        Note: Util.Skip is used in some debugging functions&lt;br /&gt;
&lt;br /&gt;
====spp====&lt;br /&gt;
alias for saveplayerpos&lt;br /&gt;
&lt;br /&gt;
====stresstest====&lt;br /&gt;
        Stress Test, this command should only be used by developers&lt;br /&gt;
        Usage: /bot stresstest&lt;br /&gt;
&lt;br /&gt;
====stucknext====&lt;br /&gt;
Used for stuckage checking. Advance to the next stuckage position.&lt;br /&gt;
&lt;br /&gt;
====stuckstart====&lt;br /&gt;
Start iterating through the stuckage table for the map. Before you use this command, you must move file &amp;lt;mapname&amp;gt;_stuckages.gm from et/user folder to et/scripts folder.&lt;br /&gt;
&lt;br /&gt;
====sup====&lt;br /&gt;
alias for saveusepoint&lt;br /&gt;
&lt;br /&gt;
====sysusage====&lt;br /&gt;
Writes a timeline of system usage stats to systemtimeline.gm.&lt;br /&gt;
&lt;br /&gt;
====table_members====&lt;br /&gt;
Prints a sorted list of table members to the console for the given table name.&lt;br /&gt;
&lt;br /&gt;
====test_priorities====&lt;br /&gt;
        Test Priorities, test SetGoalPriorities calls on all map goals&lt;br /&gt;
        usage, /bot test_priorities &amp;lt;bool allgoals&amp;gt;&lt;br /&gt;
        example: /bot test_priorities true will loop through all goals in the map table&lt;br /&gt;
&lt;br /&gt;
====testbot====&lt;br /&gt;
        Test Bot, adds a testbot to the given team with the given class&lt;br /&gt;
        Usage: /bot testbot &amp;lt;team&amp;gt; &amp;lt;class&amp;gt;&lt;br /&gt;
        Usage: /bot testbot 0 - kicks the test bot&lt;br /&gt;
&lt;br /&gt;
====testmap====&lt;br /&gt;
        Test Map, starts the auto testing of maps based on the testmap scripts&lt;br /&gt;
        Usage: /bot testmap&lt;br /&gt;
&lt;br /&gt;
====testme====&lt;br /&gt;
        Test command, prints out all arguments&lt;br /&gt;
        Usage: /bot testme&lt;br /&gt;
&lt;br /&gt;
====testsuicide====&lt;br /&gt;
        Set Suicide, sets botSuicide session variable to given param&lt;br /&gt;
        Bots will /kill 2 seconds before next spawn&lt;br /&gt;
        Version note: RTCW only&lt;br /&gt;
&lt;br /&gt;
====testvoice====&lt;br /&gt;
         Test Voice Macro, used for testing a bots usage of given voice macro &lt;br /&gt;
         usage, /bot testvoice &amp;lt;partial bot name&amp;gt; &amp;lt;voice macro name&amp;gt;&lt;br /&gt;
        example, /bot testvoice Walt NEED_MEDIC&lt;br /&gt;
&lt;br /&gt;
====testwin====&lt;br /&gt;
        Test Windows, tests the debug window script testdebugwindows.gm&lt;br /&gt;
        Usage: /bot testwin&lt;br /&gt;
&lt;br /&gt;
====time====&lt;br /&gt;
Echo&#039;s the current time to the screen.&lt;br /&gt;
&lt;br /&gt;
====trace_pos====&lt;br /&gt;
Prints position from a trace.&lt;br /&gt;
&lt;br /&gt;
====tracearty====&lt;br /&gt;
Runs a trace to find visible Artillery_s or Artillery_d goals from closest Callartillery goal.&lt;br /&gt;
&lt;br /&gt;
====tracebox====&lt;br /&gt;
        Trace Box, builds an AABB based on the players position&lt;br /&gt;
        Usage: /bot tracebox&lt;br /&gt;
&lt;br /&gt;
====tracetrajectory====&lt;br /&gt;
Draws trajectory from player position and facing.&lt;br /&gt;
        Usage: /bot tracetrajectory speed &amp;lt;optional interval&amp;gt; &amp;lt;optional duration&amp;gt; &amp;lt;optional bounceloss&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====trigger_aimpos====&lt;br /&gt;
        Trigger Aim Position, creates a region trigger based on the players aim position&lt;br /&gt;
        Usage: /bot trigger_aimpos&lt;br /&gt;
&lt;br /&gt;
====trigger_bounds====&lt;br /&gt;
        Trigger Bounds, builds an AABB region trigger based on the players position&lt;br /&gt;
        Usage: /bot trigger_bounds&lt;br /&gt;
&lt;br /&gt;
====wab====&lt;br /&gt;
alias for warpanybot&lt;br /&gt;
&lt;br /&gt;
====warpanybot====&lt;br /&gt;
Will teleport a bot matching given name to the player if cheats are enabled.&lt;br /&gt;
&lt;br /&gt;
====warpbot====&lt;br /&gt;
Warp Test Bot, will teleport testbot to given waypoint name or player position if cheats are enabled.&lt;br /&gt;
        Usage: /bot warpbot &amp;lt;optional wpname&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====warpto====&lt;br /&gt;
        Warp To, will teleport player to given goal or waypoint name if cheats are enabled.&lt;br /&gt;
		ET accepts also waypoint ID or paththrough name.&lt;br /&gt;
        Usage: /bot warpto &amp;lt;goalname|wpname&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====warptogoaloffset====&lt;br /&gt;
        Warp To Goal Offset, will teleport player to given goal real world offset if cheats are enabled&lt;br /&gt;
        Usage: /bot warptogoaloffset &amp;lt;goalname&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====wb====&lt;br /&gt;
alias for warpbot&lt;br /&gt;
&lt;br /&gt;
====wiki_commands====&lt;br /&gt;
Writes all script commands to a file in wiki markup.&lt;br /&gt;
&lt;br /&gt;
====wpa====&lt;br /&gt;
        Waypoint Array, adds an array of waypoints numx by numy, distx and disty apart&lt;br /&gt;
        Usage: /bot wpa &amp;lt;numx&amp;gt; &amp;lt;distx&amp;gt; &amp;lt;numy&amp;gt; &amp;lt;disty&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====wt====&lt;br /&gt;
alias for warpto&lt;br /&gt;
&lt;br /&gt;
====wtgo====&lt;br /&gt;
alias for warptogoaloffset&lt;/div&gt;</summary>
		<author><name>Palota</name></author>
	</entry>
	<entry>
		<id>https://mygamingtalk.com/wiki/index.php?title=Scripting_waypoints_flags&amp;diff=1754</id>
		<title>Scripting waypoints flags</title>
		<link rel="alternate" type="text/html" href="https://mygamingtalk.com/wiki/index.php?title=Scripting_waypoints_flags&amp;diff=1754"/>
		<updated>2025-05-16T12:29:18Z</updated>

		<summary type="html">&lt;p&gt;Palota: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{process header&lt;br /&gt;
 | title    = Scripting Waypoints flags&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;
During the process of running a map things can change such as doors no longer been axis only.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The following flags can be added/removed via script&lt;br /&gt;
&lt;br /&gt;
* axis&lt;br /&gt;
* allies&lt;br /&gt;
* closed&lt;br /&gt;
&lt;br /&gt;
There are a few other flags that can be added removed but these are the only ones that you are likely to need to change in the game.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The waypoint must be named in the map &amp;quot;&#039;&#039;/bot waypoint_setname name&#039;&#039;&amp;quot; so the script knows which waypoint to add/remove the flag&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The command to use in the script is &amp;quot;&#039;&#039;Wp.SetWaypointFlag&#039;&#039;&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;
        Wp.SetWaypointFlag( &amp;quot;waypoint_name&amp;quot;, &amp;quot;flag&amp;quot;, true/false );&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This command initially must be added to the &amp;quot;&#039;&#039;global OnMapLoad&#039;&#039;&amp;quot; section so the status of the flag is known at the start of the map.  The flag must then be added to any &#039;&#039;function triggers&#039;&#039; that causes the need to add/remove the flag.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Below is an example of the script to remove a axis only flag to allow both teams to use.&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()&lt;br /&gt;
	{&lt;br /&gt;
		Wp.SetWaypointFlag( &amp;quot;door1&amp;quot;, &amp;quot;axis&amp;quot;, false );&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;
        Wp.SetWaypointFlag( &amp;quot;door1&amp;quot;, &amp;quot;axis&amp;quot;, true );&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Note: Using this to remove a closed flag is not needed on blockable section of a map unless the blockwall flag does not work like in the Caen map.&lt;/div&gt;</summary>
		<author><name>Palota</name></author>
	</entry>
	<entry>
		<id>https://mygamingtalk.com/wiki/index.php?title=Changing_spawns&amp;diff=1753</id>
		<title>Changing spawns</title>
		<link rel="alternate" type="text/html" href="https://mygamingtalk.com/wiki/index.php?title=Changing_spawns&amp;diff=1753"/>
		<updated>2025-05-16T12:24:59Z</updated>

		<summary type="html">&lt;p&gt;Palota: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Spawn points should always be changed in the &#039;&#039;&#039;OnBotJoin&#039;&#039;&#039; function, otherwise they would not work on dedicated servers, because players can join or leave during game.&lt;br /&gt;
&lt;br /&gt;
You need to change spawn points in triggers too. It is recommended to define one function which will be called from both triggers and OnBotJoin.&lt;br /&gt;
&lt;br /&gt;
This example sets spawn point for 50% of allied bots after they have taken the gold. You can adjust number 5 after RandInt if you want more or less bots to use new spawn.&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;
	TruckLoaded = false,&lt;br /&gt;
&lt;br /&gt;
	SetSpawn1 = function(bot)&lt;br /&gt;
	{&lt;br /&gt;
		if (bot.GetTeam() == TEAM.ALLIES) {&lt;br /&gt;
			if (Map.TruckLoaded &amp;amp;&amp;amp; RandInt(0,9) &amp;lt; 5) {&lt;br /&gt;
				bot.ChangeSpawnPoint(3);&lt;br /&gt;
			} else {&lt;br /&gt;
				bot.ChangeSpawnPoint(0);&lt;br /&gt;
			}&lt;br /&gt;
		}&lt;br /&gt;
	},&lt;br /&gt;
&lt;br /&gt;
	SetSpawn = function()&lt;br /&gt;
	{&lt;br /&gt;
		foreach(bot in BotTable)&lt;br /&gt;
		{&lt;br /&gt;
			Map.SetSpawn1(bot);&lt;br /&gt;
		}&lt;br /&gt;
	},&lt;br /&gt;
&lt;br /&gt;
	allies_taking_gold = function()&lt;br /&gt;
	{&lt;br /&gt;
		Map.TruckLoaded = true;&lt;br /&gt;
		Map.SetSpawn();&lt;br /&gt;
	},&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
global OnMapLoad = function()&lt;br /&gt;
{&lt;br /&gt;
	OnTrigger( &amp;quot;Allied team is escaping with the Gold Crates!&amp;quot;, Map.allies_taking_gold );&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
global OnBotJoin = function( bot )&lt;br /&gt;
{&lt;br /&gt;
	Map.SetSpawn1(bot);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>Palota</name></author>
	</entry>
	<entry>
		<id>https://mygamingtalk.com/wiki/index.php?title=Roles&amp;diff=1752</id>
		<title>Roles</title>
		<link rel="alternate" type="text/html" href="https://mygamingtalk.com/wiki/index.php?title=Roles&amp;diff=1752"/>
		<updated>2025-05-16T12:23:51Z</updated>

		<summary type="html">&lt;p&gt;Palota: /* Region triggers */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{process header&lt;br /&gt;
 | title    = Roles&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;
== Intro ==&lt;br /&gt;
&lt;br /&gt;
Bot roles were added in version 0.8 as a method to focus specific bots on specific goals. Any goal that has a role defined will be ignored by bots that do not have the same role defined. This is particularly useful when there are multiple defense points in a map that are simultaneously active or in large dual objective maps.&lt;br /&gt;
&lt;br /&gt;
The Enemy Territory map Radar is one such example as the last stage of the map has two separate objectives for the Allied team to steal; the East and West Radar Parts. The defense has been setup so that one group of defenders will focus on the West Parts and another will focus on the East Parts. Since the defend goals have an equal priority, setting roles ensures that the bots won&#039;t be wandering between locations; which results in a much weaker defense.&lt;br /&gt;
&lt;br /&gt;
Another very specific usage of roles is for Covert Ops bots in Enemy Territory that have the ability to steal an enemies uniform. Once in uniform, the bot is automatically assigned an Infiltrator role; which makes certain goals available that normally would not be reachable.&lt;br /&gt;
&lt;br /&gt;
A more common use of roles would be for the Capture the Flag type maps seen in Doom 3 and Quake 4 as there is a need for dedicated base defenders.&lt;br /&gt;
&lt;br /&gt;
Roles however are not limited to the scenarios given. Any time there is a need for specific goals to be limited in usage to one or more bots, setting roles is a simple way to solve the problem.  &lt;br /&gt;
&lt;br /&gt;
== Setup ==&lt;br /&gt;
&lt;br /&gt;
Setup requires that both bots and goals are given the desired roles with one of the predefined roles. Valid roles are as follows:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
ROLE.ATTACKER&lt;br /&gt;
ROLE.ATTACKER1&lt;br /&gt;
ROLE.ATTACKER2&lt;br /&gt;
ROLE.ATTACKER3&lt;br /&gt;
ROLE.OFFENSECAPTAIN&lt;br /&gt;
ROLE.DEFENDER&lt;br /&gt;
ROLE.DEFENDER1&lt;br /&gt;
ROLE.DEFENDER2&lt;br /&gt;
ROLE.DEFENDER3&lt;br /&gt;
ROLE.DEFENSECAPTAIN&lt;br /&gt;
ROLE.TEAMCAPTAIN&lt;br /&gt;
ROLE.FIRETEAMCAPTAIN&lt;br /&gt;
ROLE.AMBUSHER&lt;br /&gt;
ROLE.INFILTRATOR&lt;br /&gt;
ROLE.ROAMER&lt;br /&gt;
ROLE.SNIPER&lt;br /&gt;
ROLE.ESCORT&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Goals ===&lt;br /&gt;
&lt;br /&gt;
Roles can be added to goals either in the editor or in a map script. To add a role in the editor, simply use the following commands:&lt;br /&gt;
 /bot goal_edit&lt;br /&gt;
 /bot goal_setproperty roles DEFENDER&lt;br /&gt;
 /bot goal_finish&lt;br /&gt;
&lt;br /&gt;
You can set multiple roles on a goal by using the | operator:&lt;br /&gt;
 /bot goal_setproperty roles DEFENDER|DEFENDER1&lt;br /&gt;
&lt;br /&gt;
Once completed, /bot goal_save will commit the changes to the goals file.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Setting roles in the editor is preferred since it reduces script size, but users wishing to set them in the map script can use the following helper functions:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
SetGoalRole( &amp;lt;goal expression or table&amp;gt;, &amp;lt;roles&amp;gt;, &amp;lt;persistent&amp;gt; );&lt;br /&gt;
Util.SetRoleForGroup( &amp;lt;goal group&amp;gt;, &amp;lt;roles&amp;gt; );&lt;br /&gt;
ClearGoalRole( &amp;lt;goal expression or table&amp;gt;, &amp;lt;roles&amp;gt; );&lt;br /&gt;
Util.ClearRoleForGroup( &amp;lt;goal group&amp;gt;, &amp;lt;roles&amp;gt; );&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
SetGoalRole(&amp;quot;DEFEND_East.*&amp;quot;, ROLE.DEFENDER); //set the defender role on goals that have a name starting with DEFEND_East&lt;br /&gt;
SetGoalRole(&amp;quot;DEFUSE_wall.*&amp;quot;, ROLE.DEFENDER2, true); //set role for dynamically created goal&lt;br /&gt;
SetGoalRole(&amp;quot;MOUNTMG42_bank&amp;quot;, { ROLE.DEFENDER2, ROLE.DEFENDER3 }); //set multiple roles to one goal&lt;br /&gt;
SetGoalRole({ &amp;quot;DEFEND_docs.*&amp;quot;, &amp;quot;MOUNTMG42_docs&amp;quot; }, ROLE.DEFENDER1); //set role on multiple goals&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Priority ===&lt;br /&gt;
&lt;br /&gt;
Almost every map goal has property RolePriorityBonus which is added to priority if the goal has any role. That&#039;s why bots prefer goals which have role. Camp goals (attack/defend/camp/snipe) have RolePriorityBonus only 0.01. Other goals have RolePriorityBonus 0.1.&lt;br /&gt;
&lt;br /&gt;
Sometimes the default RolePriorityBonus is not enough and it&#039;s necessary to use function SetGoalPriority to change priorities. For example, if some CHECKPOINT goal without role is active, all DEFEND goals are ignored and all bots go to capture checkpoint. Even if the DEFEND goals have DEFENDER role and some bots have DEFENDER role, nobody will use DEFEND goals if they have default priority.&lt;br /&gt;
&lt;br /&gt;
=== Bots ===&lt;br /&gt;
&lt;br /&gt;
The simplest way to assign bot roles is to set up the map script to use the Role Manager. The Role Manager will automatically assign the bots&#039; roles based on a Map.Roles table in the map script.&lt;br /&gt;
&lt;br /&gt;
A commented example of the Role Manager setup:&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;
	Roles =&lt;br /&gt;
	{&lt;br /&gt;
		AXIS = // Team&lt;br /&gt;
		{&lt;br /&gt;
			AllBots = true, // each bot is considered for a role&lt;br /&gt;
			DEFENDER = // the DEFENDER role&lt;br /&gt;
			{&lt;br /&gt;
				voice = &amp;quot;defend&amp;quot;, 		// signals voice chat to randomly announce&lt;br /&gt;
				spawnpt = 2,			// users of this role will choose spawnpt 2&lt;br /&gt;
				numbots = 4,			// maximum of 4 bots&lt;br /&gt;
				crucialClass = CLASS.ENGINEER,	// class for the first bot&lt;br /&gt;
				MinBotsForRole = 4,             // only assign this role if there are already 4 bots in game&lt;br /&gt;
			},&lt;br /&gt;
			ATTACKER =&lt;br /&gt;
			{&lt;br /&gt;
				voice = &amp;quot;attack&amp;quot;,&lt;br /&gt;
				numbots = 4,&lt;br /&gt;
				crucialClass = {CLASS.ENGINEER, CLASS.COVERTOPS}, //the first is engineer, the second is covertops&lt;br /&gt;
			},&lt;br /&gt;
		},&lt;br /&gt;
&lt;br /&gt;
		ALLIES =&lt;br /&gt;
		{&lt;br /&gt;
			AllBots = false, // default: every other bot&lt;br /&gt;
			DEFENDER =&lt;br /&gt;
			{&lt;br /&gt;
				numbots = 3,&lt;br /&gt;
			},&lt;br /&gt;
			ATTACKER =&lt;br /&gt;
			{&lt;br /&gt;
				numbots = 4,&lt;br /&gt;
			},&lt;br /&gt;
		},&lt;br /&gt;
	},&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this example, each team will have bots assigned to two different roles. For each role there can be a maximum number of bots set, a spawn point defined, a crucial class given, and even a voice chat for the bot to randomly use when assigned the role. All of the role flags are optional except for numbots:&lt;br /&gt;
&lt;br /&gt;
 numbots - the number of bots the role manager will attempt to keep assigned the role at all times&lt;br /&gt;
 crucialClass - the first bot assigned the role will switch to this class, can be a table of classes for more bots&lt;br /&gt;
 spawnpt - bots with this role will choose this spawn point&lt;br /&gt;
 voice - &amp;quot;attack&amp;quot; and &amp;quot;defend&amp;quot; are the two valid values&lt;br /&gt;
 MinBotsForRole - set the number of bots required to be in game before assigning the role.&lt;br /&gt;
&lt;br /&gt;
=== Region triggers ===&lt;br /&gt;
&lt;br /&gt;
If some goals are behind a door or gate which can be opened or destroyed by one team, and closed or rebuilt by the other team, then it is recommended to use region triggers. It will prevent path failed errors. It is usually possible to create one large region which covers entire area behind door (see maps mml_minastirith_fp3, nod_temple). Bots inside the region will have a role, but bots outside the region will not have the role. Goals behind door or gate will have the role only if the door is closed or gate is built.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
Rocket_room =&lt;br /&gt;
{&lt;br /&gt;
	Name = &amp;quot;Rocket_room&amp;quot;,&lt;br /&gt;
	TriggerOnClass = CLASS.ANYPLAYER,&lt;br /&gt;
	OnEnter = function(ent)&lt;br /&gt;
	{&lt;br /&gt;
		bot = Util.IsBot(ent);&lt;br /&gt;
		if(bot){ bot.SetRoles(ROLE.ATTACKER); }&lt;br /&gt;
	},&lt;br /&gt;
	OnExit = function(ent)&lt;br /&gt;
	{&lt;br /&gt;
		bot = Util.IsBot(ent);&lt;br /&gt;
		if(bot){ bot.ClearRoles(ROLE.ATTACKER); }&lt;br /&gt;
	},&lt;br /&gt;
},&lt;br /&gt;
&lt;br /&gt;
Door_Open = function()&lt;br /&gt;
{&lt;br /&gt;
	ClearGoalRole({ &amp;quot;PLANT_rocket&amp;quot;, &amp;quot;ATTACK_rocket.*&amp;quot; }, ROLE.ATTACKER);&lt;br /&gt;
},&lt;br /&gt;
&lt;br /&gt;
Door_Close = function()&lt;br /&gt;
{&lt;br /&gt;
	SetGoalRole({ &amp;quot;PLANT_rocket&amp;quot;, &amp;quot;ATTACK_rocket.*&amp;quot; }, ROLE.ATTACKER);&lt;br /&gt;
},&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sometimes it&#039;s not possible to create one large region (see map sfx_endor). Then it is necessary to create the first region just behind the gate (OnEnter function sets bot&#039;s role) and other regions in front of the gate and at every spawn (OnEnter function clears bot&#039;s role).&lt;/div&gt;</summary>
		<author><name>Palota</name></author>
	</entry>
	<entry>
		<id>https://mygamingtalk.com/wiki/index.php?title=Talking_bots&amp;diff=1751</id>
		<title>Talking bots</title>
		<link rel="alternate" type="text/html" href="https://mygamingtalk.com/wiki/index.php?title=Talking_bots&amp;diff=1751"/>
		<updated>2025-05-16T12:18:28Z</updated>

		<summary type="html">&lt;p&gt;Palota: /* Scripting */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{process header&lt;br /&gt;
 | title    = Talking Bots&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;
== Before you make the bots talk ==&lt;br /&gt;
&lt;br /&gt;
Be aware that bots talking too much can annoy players so please be sensible when using this command.&lt;br /&gt;
&lt;br /&gt;
== Forward ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In previous versions of omni-bot the normal way to make the bots talk was to set up a random number &amp;amp; depending on the number the bots would talk.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In 0.81, a Three new commands were added to get rid of the old commands need to use a random number to define the number of bots that would talk.&lt;br /&gt;
&lt;br /&gt;
  Util.BotSay&lt;br /&gt;
  ETUtil.WinningChat&lt;br /&gt;
  ETUtil.LosingChat&lt;br /&gt;
&lt;br /&gt;
== Usage ==&lt;br /&gt;
&lt;br /&gt;
=== Util.BotChat === &lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt; &lt;br /&gt;
Util.BotChat (Team, msgType, Msg, NumBots)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Team: &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&amp;quot;TEAM.ALLIES&amp;quot; / &amp;quot;TEAM.AXIS&amp;quot; / &amp;quot;0&amp;quot; &amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
MsgTypes:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&amp;quot;say&amp;quot;, &amp;quot;sayteam&amp;quot;, &amp;quot;vsay&amp;quot;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Msg: &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For say/sayteam this is just plain text.  For vsay this must be one of the voicechat commands defined on the [[VOICE | Voice page]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
NumBots : &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The number of bots that will speak. Please do not set to a high number.&lt;br /&gt;
&lt;br /&gt;
=== ETUtil.WinningChat ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Team: &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&amp;quot;TEAM.ALLIES&amp;quot; / &amp;quot;TEAM.AXIS&amp;quot; / &amp;quot;0&amp;quot; &amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Example :&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;ETUtil.WinningChat( TEAM.ALLIES );&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== ETUtil.LosingChat ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Team: &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&amp;quot;TEAM.ALLIES&amp;quot; / &amp;quot;TEAM.AXIS&amp;quot; / &amp;quot;0&amp;quot; &amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Example :&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;ETUtil.LosingChat( TEAM.AXIS );&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Notes ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
There is no longer the need to add &amp;quot;Talk = true,&amp;quot; remove this line if you are using the new command on an old script.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Wether or not the bots talk is defined in ~omni-bot\et\scripts\et_autoexec.gm&lt;br /&gt;
Default is this&lt;br /&gt;
global MAP_TALK = true;&lt;br /&gt;
If this line is set to false the bots will not talk&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Scripting ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;One Axis bot saying a plain text message to all players&#039;&#039;&#039;&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;
	Radar_Destroyed = function()&lt;br /&gt;
	{&lt;br /&gt;
		Util.BotChat(TEAM.AXIS, &amp;quot;say&amp;quot;, &amp;quot;Pesky Allies&amp;quot;, 1);&lt;br /&gt;
&lt;br /&gt;
		Util.MapDebugPrint( &amp;quot;Radar_Destroyed&amp;quot; );&lt;br /&gt;
	},&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;One Allied bot saying a plain text message to team.&#039;&#039;&#039;&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;
	Radar_Destroyed = function()&lt;br /&gt;
	{&lt;br /&gt;
		Util.BotChat(TEAM.ALLIES, &amp;quot;sayteam&amp;quot;, &amp;quot;ok lets get the doc&#039;s now&amp;quot;, 1);&lt;br /&gt;
&lt;br /&gt;
		Util.MapDebugPrint( &amp;quot;Radar_Destroyed&amp;quot; );&lt;br /&gt;
	},&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Two bots for both teams saying a voicechat command.&#039;&#039;&#039;&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;
	Axis_Break_Something = function()&lt;br /&gt;
	{&lt;br /&gt;
		Util.BotChat(TEAM.AXIS, &amp;quot;vsay&amp;quot;, VOICE.G_CHEER, 2);&lt;br /&gt;
		Util.BotChat(TEAM.ALLIES, &amp;quot;vsay&amp;quot;, VOICE.G_NEGATIVE, 2);&lt;br /&gt;
&lt;br /&gt;
		Util.MapDebugPrint( &amp;quot;Axis_Break_Something&amp;quot; );&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;
&#039;&#039;&#039; Example for end of a map where the bots Cheer/Say no&#039;&#039;&#039; &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;
	Allies_win = function()&lt;br /&gt;
	{&lt;br /&gt;
		ETUtil.WinningChat( TEAM.ALLIES );  &lt;br /&gt;
		ETUtil.LosingChat( TEAM.AXIS );  &lt;br /&gt;
&lt;br /&gt;
		Util.MapDebugPrint( &amp;quot;Allies_win&amp;quot; );&lt;br /&gt;
	},&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>Palota</name></author>
	</entry>
	<entry>
		<id>https://mygamingtalk.com/wiki/index.php?title=Template:Baserouting&amp;diff=1750</id>
		<title>Template:Baserouting</title>
		<link rel="alternate" type="text/html" href="https://mygamingtalk.com/wiki/index.php?title=Template:Baserouting&amp;diff=1750"/>
		<updated>2025-05-16T12:15:13Z</updated>

		<summary type="html">&lt;p&gt;Palota: /* Step 3: Scripting the routes */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:ET|Routing]]&lt;br /&gt;
[[Category:Doom 3|Routing]]&lt;br /&gt;
[[Category:Quake 4|Routing]]&lt;br /&gt;
[[Category:RTCW|Routing]]&lt;br /&gt;
[[Category:Waypointing]]&lt;br /&gt;
==Routing Overview==&lt;br /&gt;
&lt;br /&gt;
Until version 0.65, omni-bot path selection relied on the shortest path to a goal. While this typically provided for very focused attacks, game play became very predictable. The solution is Routing. Routing provides alternate goals for the bots to go to before heading to their main goal. When positioned correctly, these alternate goals provide the effect of bots choosing realistic and varied paths to their main goals.&lt;br /&gt;
&lt;br /&gt;
Routing requires some setup in script and in the waypoints, but the results are worth the effort.  The objective of this article is to provide an overview of how the routing system works and to clearly define how to set it up by walking through a working example on Goldrush.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:Gr_routes2.jpg|Goldrush Multiple Routes Example]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In this picture, Squares are route nodes and the Dots are potential paths. The color of the Dots correspond to the color of the Route nodes. Once they reach a route node, they will travel along the path(s) of the same color IF the route node is set up for their current main goal.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Walking through the picture, let’s say the tank construction goal is set up for an allied engineer within the AllySpawn route nodes, and that the engineer has the tank construct as its goal. The engineer will randomly choose whether to go to the green route node (as_right) or the yellow route node (depotgate). For the purpose of this example, let’s say the bot chose to go to the green route node. From there, he will randomly choose to go to the white or red route node.  The bot will continue to make these decisions until there are no route nodes left to go to. From that point, the bot will take the shortest path to the tank construct goal.&lt;br /&gt;
As you can see, this opens up several different points of attack for the bots; which creates a sense of realism in terms of predictability. Defenses will now need to be set up to be able to react to all of the entry points rather than focusing on easily predicted choke points if the shortest path is always used.&lt;br /&gt;
&lt;br /&gt;
==Setting It Up==&lt;br /&gt;
&lt;br /&gt;
Setting up Routes involves waypointing and scripting. This section will take you step by step through the process of setting up the routes in the Goldrush example. &lt;br /&gt;
&lt;br /&gt;
===Step 1: Setting up the script===&lt;br /&gt;
&lt;br /&gt;
The first requirement for routing is that the routes are defined in the map script. The method to do this consists of building a table for the routes and calling a utility function that will register the routes.&lt;br /&gt;
&lt;br /&gt;
If a map script does not exist yet, open up your favorite text editor and add the following to a new file:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 global InitializeRoutes = function()&lt;br /&gt;
 {&lt;br /&gt;
 }; &amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Save the file as &amp;lt;mapname&amp;gt;.gm in your Omni-Bot\et\nav folder. You are now ready to start building the routes.  Inside the InitializeRoutes function is where the route definitions are placed and they all start with a basic layout:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 global InitializeRoutes = function()&lt;br /&gt;
 {&lt;br /&gt;
     MapRoutes =&lt;br /&gt;
     {&lt;br /&gt;
     };&lt;br /&gt;
  &lt;br /&gt;
     Util.Routes(MapRoutes);&lt;br /&gt;
 }; &amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You now have a MapRoutes table defined and are registering everything within that table with the Util.Routes function.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Step 2: Adding route goal ===&lt;br /&gt;
&lt;br /&gt;
Route goals are fairly straight forward. They have two important properties; route name and radius. You can use any name you want for the route nodes, but they should be somewhat intuitive. To see the full guide on adding route goals see the [[Route_Goal]] page.&lt;br /&gt;
&lt;br /&gt;
Route goals are placed in positions where a bot might receive the goal you want them to use alternate paths for. The bot MUST be inside the route node radius when receiving a goal for it to work. Spawn points are good spots for route nodes because bots always receive a goal when they spawn. &lt;br /&gt;
&lt;br /&gt;
In the spawns area you need to place the goal over the spawn positions and give it a large radius to cover the spawn points. Issue the following commands in console:&lt;br /&gt;
&lt;br /&gt;
  /bot show_spawns&lt;br /&gt;
  /bot goal_create route AllySpawn&lt;br /&gt;
  /bot goal_setproperty radius 500&lt;br /&gt;
  /bot goal_finish &lt;br /&gt;
&lt;br /&gt;
The radius of the route nodes at spawn positions are very critical because the bots must be inside its radius for it to work. Be sure that the radius covers the entire spawn area. Bots do not always receive goals immediately at spawn. Sometimes they receive goals 2 seconds after spawn. That&#039;s why it&#039;s always better to set bigger radius. But be careful, route nodes must not overlap. &lt;br /&gt;
&lt;br /&gt;
For routing to be effective, you will need at least two defined because once they reach the route node, they will take the shortest path to their goal UNLESS there is another route node set up for them to go to. Continuing with our example, create a route node where the green square is in the picture and name it as_right:&lt;br /&gt;
&lt;br /&gt;
  /bot goal_create route as_right&lt;br /&gt;
  /bot goal_finish &lt;br /&gt;
&lt;br /&gt;
You now have two route nodes; meeting the requirement for working routes. In our example, we want the bots to use two paths from the spawn, so add the route node depicted by the yellow square at the depot gate:&lt;br /&gt;
&lt;br /&gt;
  /bot goal_create route depotgate&lt;br /&gt;
  /bot goal_finish &lt;br /&gt;
&lt;br /&gt;
Be sure to save the goals at this point. The next step is to set up the goals and route node selection in the script.&lt;br /&gt;
&lt;br /&gt;
  /bot goal_save&lt;br /&gt;
&lt;br /&gt;
===Step 3: Scripting the routes===&lt;br /&gt;
&lt;br /&gt;
The Maproutes table is set up with the following format:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  MapRoutes =&lt;br /&gt;
  {&lt;br /&gt;
      GOALNAME =&lt;br /&gt;
      {&lt;br /&gt;
          ROUTNAME = {},&lt;br /&gt;
      },&lt;br /&gt;
      GOALNAME2 =&lt;br /&gt;
      {&lt;br /&gt;
          ROUTENAME = {},&lt;br /&gt;
      },&lt;br /&gt;
  };&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you are new to map scripting, this may appear a bit intimidating. The key is to follow the steps and syntax exactly, then let the understanding of the syntax come naturally. If you are comfortable with gm scripting, the routing set up consists of nested tables. &lt;br /&gt;
&lt;br /&gt;
The goal name must match the output from show_goals and the route name is the waypoint name prepended with ROUTE_. For the Goldrush example, set up the tank construct routing as follows:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 global InitializeRoutes = function()&lt;br /&gt;
 {&lt;br /&gt;
 	MapRoutes =&lt;br /&gt;
 	{&lt;br /&gt;
 		BUILD_tank_construct =&lt;br /&gt;
 		{&lt;br /&gt;
 		},&lt;br /&gt;
 	};&lt;br /&gt;
 &lt;br /&gt;
 	Util.Routes(MapRoutes);&lt;br /&gt;
 }; &amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You have just added a map goal to the Maproutes table. The syntax of the goal name is VERY important. Be sure to double check the goal name with /bot show_goals. Once you are sure the goal name is correct, you can add the route nodes:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 global InitializeRoutes = function()&lt;br /&gt;
 {&lt;br /&gt;
 	MapRoutes =&lt;br /&gt;
 	{&lt;br /&gt;
 		BUILD_tank_construct =&lt;br /&gt;
 		{&lt;br /&gt;
 			ROUTE_AllySpawn = {},&lt;br /&gt;
 		},&lt;br /&gt;
 	};&lt;br /&gt;
 &lt;br /&gt;
 	Util.Routes(MapRoutes);&lt;br /&gt;
 }; &amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The AllySpawn route node is now a valid route node for the tank construct goal. If a bot spawns within its radius and receives the tank construct as a goal, it will use that route node. In and of itself, this route node will not do anything because at spawn the bot is already at it. So let’s add the two path options we want to give the bots from the Allied Spawn:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
global InitializeRoutes = function()&lt;br /&gt;
{&lt;br /&gt;
    MapRoutes =&lt;br /&gt;
    {&lt;br /&gt;
        BUILD_tank_construct =&lt;br /&gt;
        {&lt;br /&gt;
            ROUTE_AllySpawn =&lt;br /&gt;
            {&lt;br /&gt;
                ROUTE_as_right = {},&lt;br /&gt;
                ROUTE_depotgate = {},&lt;br /&gt;
            },&lt;br /&gt;
        },&lt;br /&gt;
    };&lt;br /&gt;
&lt;br /&gt;
    Util.Routes(MapRoutes);&lt;br /&gt;
}; &amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It’s important to understand what we just did with this:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 ROUTE_AllySpawn = &lt;br /&gt;
 {&lt;br /&gt;
     ROUTE_as_right = {},&lt;br /&gt;
     ROUTE_depotgate = {},&lt;br /&gt;
 },&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The bot reaches the AllySpawn route node by default when it spawns; and because we have added the two routes inside the brackets, the bots will randomly choose between them. At this point, you have randomized routes for Allied engineers with the tank construct goal. Half the time they will choose to go to route as_right and half the time they will choose to go to route depotgate.&lt;br /&gt;
&lt;br /&gt;
Let’s make them even less predictable. Looking at the example picture, you can see that we want them to have a couple different options once they reach the route nodes we just set up. Repeating step 2, add the rest of the route nodes depicted by the colored squares.&lt;br /&gt;
&lt;br /&gt;
The scripting for the path options in the picture is as follows:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 global InitializeRoutes = function()&lt;br /&gt;
 {&lt;br /&gt;
     MapRoutes =&lt;br /&gt;
     {&lt;br /&gt;
         BUILD_tank_construct =&lt;br /&gt;
         {&lt;br /&gt;
             ROUTE_AllySpawn = &lt;br /&gt;
             {    &lt;br /&gt;
                 ROUTE_as_right =&lt;br /&gt;
                 {&lt;br /&gt;
                     ROUTE_as_rightsplit1 = {},&lt;br /&gt;
                     ROUTE_as_rightsplit2 =&lt;br /&gt;
                     {&lt;br /&gt;
                         ROUTE_depotflank = {},&lt;br /&gt;
                     },&lt;br /&gt;
                 },&lt;br /&gt;
                 ROUTE_depotgate = &lt;br /&gt;
                 {&lt;br /&gt;
                     ROUTE_cproute = {},&lt;br /&gt;
                     ROUTE_depotgatesplit = {},&lt;br /&gt;
                     ROUTE_as_rightsplit1 = {},&lt;br /&gt;
                 },&lt;br /&gt;
             },&lt;br /&gt;
         },&lt;br /&gt;
     };&lt;br /&gt;
 &lt;br /&gt;
     Util.Routes(Maproutes);&lt;br /&gt;
 }; &amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Step 4: Testing the routes===&lt;br /&gt;
&lt;br /&gt;
Testing the routes is by far the most important step. It is recommended that you test routes individually as you start to learn the routing system. Once you are comfortable with the setup, you may want to add routes for an entire phase and then test them to make the process a bit faster. &lt;br /&gt;
&lt;br /&gt;
If the routing is not working as expected, there are some basic troubleshooting options. It’s important to remember the criteria for the routes; the bot must be within the radius of the route node when receiving the goal, and the route node must be set up to support the goal. The basic troubleshooting steps are:&lt;br /&gt;
&lt;br /&gt;
# Check in console when the map loads for any error messages. It should list any goal names not found when initializing the routes.&lt;br /&gt;
# Check the radius of the route where the bot receives the goal&lt;br /&gt;
# Make sure the bot can reach the goal &lt;br /&gt;
# Make sure the bot is getting the expected goal&lt;br /&gt;
&lt;br /&gt;
For numbers 2 and 3, consider using the command /bot debugbot all goals with only one bot connected. In console, it should give success / failure messages for short term and long term goals. An example of a known problem is if there are priority type goals (like radar parts stealing) that are active when they aren’t reachable. The solution is to set them to be not active in OnMapLoad if they are unreachable.&lt;br /&gt;
&lt;br /&gt;
===Step 5: Adding priorities to routes===&lt;br /&gt;
&lt;br /&gt;
In some cases, you may want bots to use a certain route more often than others. This can be done by adding a “weight” to the route table:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 ROUTE_as_right =&lt;br /&gt;
 {&lt;br /&gt;
     Weight = 2,&lt;br /&gt;
     ROUTE_as_rightsplit1 = {},&lt;br /&gt;
     ROUTE_as_rightsplit2 =&lt;br /&gt;
     {&lt;br /&gt;
 	  Weight = 2,&lt;br /&gt;
 	  ROUTE_depotflank = {},&lt;br /&gt;
     },&lt;br /&gt;
 },&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this example, the bots will randomly choose to go to route as_right twice as much as route depotgate. And then they will choose to go to route as_rightsplit2 twice as much as route as_rightsplit1.&lt;br /&gt;
&lt;br /&gt;
===Step 6: Copying routes===&lt;br /&gt;
&lt;br /&gt;
If you have more than one goal that you want to share the same routing with, you can copy the routing. In the Goldrush example, say we have some attack goals in the yard that we want to route to. Rather than writing out the tables for each attack goal, we can copy them like this:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 MapRoutes[&amp;quot;ATTACK_Depot_.*&amp;quot;] = MapRoutes.BUILD_tank;&lt;br /&gt;
 MapRoutes.MOUNT_tank = MapRoutes.BUILD_Tank;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The key point to remember when doing this is that the route table that exists must be on the right side of the equation. In this case, we have created routes for multiple attack goals and a mount goal that are the same as our example routing to build the tank.&lt;br /&gt;
&lt;br /&gt;
These should be placed in OnMapLoad as well, below the Maproutes table and above the Utility function that registers the routes:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 global InitializeRoutes = function()&lt;br /&gt;
 {&lt;br /&gt;
     MapRoutes =&lt;br /&gt;
     {&lt;br /&gt;
         BUILD_Tank =&lt;br /&gt;
         {&lt;br /&gt;
 	&lt;br /&gt;
         },&lt;br /&gt;
     };&lt;br /&gt;
   &lt;br /&gt;
     MapRoutes[&amp;quot;ATTACK_Depot_.*&amp;quot;] = MapRoutes.BUILD_tank;&lt;br /&gt;
     MapRoutes.MOUNT_tank = MapRoutes.BUILD_Tank;&lt;br /&gt;
   &lt;br /&gt;
     Util.Routes(MapRoutes);&lt;br /&gt;
 };&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Step 7: Toggling routes===&lt;br /&gt;
&lt;br /&gt;
Routes are treated very similar to map goals. They will show up in your list if you do a /bot show_goals. They can be turned on and off via scripting with the SetAvailableMapGoals function. As an example, say we have route that we want opened up when barrier is destroyed, then closed when that barrier is constructed. This can be done inside the OnTriggers for those events:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  Barrier_construct = function ()&lt;br /&gt;
  {&lt;br /&gt;
  	Util.DisableGoal( &amp;quot;ROUTE_routname&amp;quot; ); &lt;br /&gt;
  };&lt;br /&gt;
  &lt;br /&gt;
  Barrier_destroyed = function ()&lt;br /&gt;
  {&lt;br /&gt;
  	Util.EnableGoal( &amp;quot;ROUTE_routname&amp;quot; ); &lt;br /&gt;
  };&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Step 8: Route maker===&lt;br /&gt;
* Windows users can use the route maker tool to easily create routes.&lt;br /&gt;
* Download it from http://svn.assembla.com/svn/omnibot/Enemy-Territory/0.8/tools/route_tool/&lt;br /&gt;
* Extract both RouteMaker.zip and RouteMaker2.zip into the same folder.&lt;br /&gt;
* Run RouteMaker2.exe&lt;br /&gt;
* You must set rcon password on your Enemy Territory or RTCW server.&lt;br /&gt;
* Then use menu command File / Load From RCON&lt;br /&gt;
* Drag &amp;amp; drop goals from left panel into middle panel.&lt;br /&gt;
* Drag &amp;amp; drop routes from right panel into middle panel.&lt;br /&gt;
* Double-click to delete routes.&lt;br /&gt;
* Finally use menu command Write / Script&lt;br /&gt;
* Output script will be copied to the clipboard. Paste it into the InitializeRoutes function in your map gm script.&lt;br /&gt;
&lt;br /&gt;
===Step 9: Ask for help===&lt;br /&gt;
&lt;br /&gt;
If you are having trouble with the syntax, set up, or understanding the routing system, ask for help. This guide is by no means comprehensive and complex maps will offer different challenges. Please post in the forums if you have questions / problems / bug reports.&lt;/div&gt;</summary>
		<author><name>Palota</name></author>
	</entry>
	<entry>
		<id>https://mygamingtalk.com/wiki/index.php?title=Template:Baserouting&amp;diff=1749</id>
		<title>Template:Baserouting</title>
		<link rel="alternate" type="text/html" href="https://mygamingtalk.com/wiki/index.php?title=Template:Baserouting&amp;diff=1749"/>
		<updated>2025-05-16T12:10:47Z</updated>

		<summary type="html">&lt;p&gt;Palota: /* Step 7: Toggling routes */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:ET|Routing]]&lt;br /&gt;
[[Category:Doom 3|Routing]]&lt;br /&gt;
[[Category:Quake 4|Routing]]&lt;br /&gt;
[[Category:RTCW|Routing]]&lt;br /&gt;
[[Category:Waypointing]]&lt;br /&gt;
==Routing Overview==&lt;br /&gt;
&lt;br /&gt;
Until version 0.65, omni-bot path selection relied on the shortest path to a goal. While this typically provided for very focused attacks, game play became very predictable. The solution is Routing. Routing provides alternate goals for the bots to go to before heading to their main goal. When positioned correctly, these alternate goals provide the effect of bots choosing realistic and varied paths to their main goals.&lt;br /&gt;
&lt;br /&gt;
Routing requires some setup in script and in the waypoints, but the results are worth the effort.  The objective of this article is to provide an overview of how the routing system works and to clearly define how to set it up by walking through a working example on Goldrush.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:Gr_routes2.jpg|Goldrush Multiple Routes Example]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In this picture, Squares are route nodes and the Dots are potential paths. The color of the Dots correspond to the color of the Route nodes. Once they reach a route node, they will travel along the path(s) of the same color IF the route node is set up for their current main goal.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Walking through the picture, let’s say the tank construction goal is set up for an allied engineer within the AllySpawn route nodes, and that the engineer has the tank construct as its goal. The engineer will randomly choose whether to go to the green route node (as_right) or the yellow route node (depotgate). For the purpose of this example, let’s say the bot chose to go to the green route node. From there, he will randomly choose to go to the white or red route node.  The bot will continue to make these decisions until there are no route nodes left to go to. From that point, the bot will take the shortest path to the tank construct goal.&lt;br /&gt;
As you can see, this opens up several different points of attack for the bots; which creates a sense of realism in terms of predictability. Defenses will now need to be set up to be able to react to all of the entry points rather than focusing on easily predicted choke points if the shortest path is always used.&lt;br /&gt;
&lt;br /&gt;
==Setting It Up==&lt;br /&gt;
&lt;br /&gt;
Setting up Routes involves waypointing and scripting. This section will take you step by step through the process of setting up the routes in the Goldrush example. &lt;br /&gt;
&lt;br /&gt;
===Step 1: Setting up the script===&lt;br /&gt;
&lt;br /&gt;
The first requirement for routing is that the routes are defined in the map script. The method to do this consists of building a table for the routes and calling a utility function that will register the routes.&lt;br /&gt;
&lt;br /&gt;
If a map script does not exist yet, open up your favorite text editor and add the following to a new file:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 global InitializeRoutes = function()&lt;br /&gt;
 {&lt;br /&gt;
 }; &amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Save the file as &amp;lt;mapname&amp;gt;.gm in your Omni-Bot\et\nav folder. You are now ready to start building the routes.  Inside the InitializeRoutes function is where the route definitions are placed and they all start with a basic layout:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 global InitializeRoutes = function()&lt;br /&gt;
 {&lt;br /&gt;
     MapRoutes =&lt;br /&gt;
     {&lt;br /&gt;
     };&lt;br /&gt;
  &lt;br /&gt;
     Util.Routes(MapRoutes);&lt;br /&gt;
 }; &amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You now have a MapRoutes table defined and are registering everything within that table with the Util.Routes function.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Step 2: Adding route goal ===&lt;br /&gt;
&lt;br /&gt;
Route goals are fairly straight forward. They have two important properties; route name and radius. You can use any name you want for the route nodes, but they should be somewhat intuitive. To see the full guide on adding route goals see the [[Route_Goal]] page.&lt;br /&gt;
&lt;br /&gt;
Route goals are placed in positions where a bot might receive the goal you want them to use alternate paths for. The bot MUST be inside the route node radius when receiving a goal for it to work. Spawn points are good spots for route nodes because bots always receive a goal when they spawn. &lt;br /&gt;
&lt;br /&gt;
In the spawns area you need to place the goal over the spawn positions and give it a large radius to cover the spawn points. Issue the following commands in console:&lt;br /&gt;
&lt;br /&gt;
  /bot show_spawns&lt;br /&gt;
  /bot goal_create route AllySpawn&lt;br /&gt;
  /bot goal_setproperty radius 500&lt;br /&gt;
  /bot goal_finish &lt;br /&gt;
&lt;br /&gt;
The radius of the route nodes at spawn positions are very critical because the bots must be inside its radius for it to work. Be sure that the radius covers the entire spawn area. Bots do not always receive goals immediately at spawn. Sometimes they receive goals 2 seconds after spawn. That&#039;s why it&#039;s always better to set bigger radius. But be careful, route nodes must not overlap. &lt;br /&gt;
&lt;br /&gt;
For routing to be effective, you will need at least two defined because once they reach the route node, they will take the shortest path to their goal UNLESS there is another route node set up for them to go to. Continuing with our example, create a route node where the green square is in the picture and name it as_right:&lt;br /&gt;
&lt;br /&gt;
  /bot goal_create route as_right&lt;br /&gt;
  /bot goal_finish &lt;br /&gt;
&lt;br /&gt;
You now have two route nodes; meeting the requirement for working routes. In our example, we want the bots to use two paths from the spawn, so add the route node depicted by the yellow square at the depot gate:&lt;br /&gt;
&lt;br /&gt;
  /bot goal_create route depotgate&lt;br /&gt;
  /bot goal_finish &lt;br /&gt;
&lt;br /&gt;
Be sure to save the goals at this point. The next step is to set up the goals and route node selection in the script.&lt;br /&gt;
&lt;br /&gt;
  /bot goal_save&lt;br /&gt;
&lt;br /&gt;
===Step 3: Scripting the routes===&lt;br /&gt;
&lt;br /&gt;
The Maproutes table is set up with the following format:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  MapRoutes =&lt;br /&gt;
  {&lt;br /&gt;
      GOALNAME =&lt;br /&gt;
      {&lt;br /&gt;
          ROUTNAME = {},&lt;br /&gt;
      },&lt;br /&gt;
      GOALNAME2 =&lt;br /&gt;
      {&lt;br /&gt;
          ROUTENAME = {},&lt;br /&gt;
      },&lt;br /&gt;
  };&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you are new to map scripting, this may appear a bit intimidating. The key is to follow the steps and syntax exactly, then let the understanding of the syntax come naturally. If you are comfortable with gm scripting, the routing set up consists of nested tables. &lt;br /&gt;
&lt;br /&gt;
The goal name must match the output from show_goals and the route name is the waypoint name prepended with ROUTE_. For the Goldrush example, set up the tank construct routing as follows:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 global InitializeRoutes = function()&lt;br /&gt;
 {&lt;br /&gt;
 	MapRoutes =&lt;br /&gt;
 	{&lt;br /&gt;
 		BUILD_tank_construct =&lt;br /&gt;
 		{&lt;br /&gt;
 		},&lt;br /&gt;
 	};&lt;br /&gt;
 &lt;br /&gt;
 	Util.Routes(MapRoutes);&lt;br /&gt;
 }; &amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You have just added a map goal to the Maproutes table. The syntax of the goal name is VERY important. Be sure to double check the goal name with /bot show_goals. Once you are sure the goal name is correct, you can add the route nodes:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 global InitializeRoutes = function()&lt;br /&gt;
 {&lt;br /&gt;
 	MapRoutes =&lt;br /&gt;
 	{&lt;br /&gt;
 		BUILD_tank_construct =&lt;br /&gt;
 		{&lt;br /&gt;
 			ROUTE_AllySpawn = {},&lt;br /&gt;
 		},&lt;br /&gt;
 	};&lt;br /&gt;
 &lt;br /&gt;
 	Util.Routes(MapRoutes);&lt;br /&gt;
 }; &amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The AllySpawn route node is now a valid route node for the tank construct goal. If a bot spawns within its radius and receives the tank construct as a goal, it will use that route node. In and of itself, this route node will not do anything because at spawn the bot is already at it. So let’s add the two path options we want to give the bots from the Allied Spawn:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 global InitializeRoutes = function()&lt;br /&gt;
 {&lt;br /&gt;
 	MapRoutes =&lt;br /&gt;
 	{&lt;br /&gt;
 		BUILD_tank_construct =&lt;br /&gt;
 		{&lt;br /&gt;
  			ROUTE_AllySpawn = &lt;br /&gt;
                       {&lt;br /&gt;
 	                    ROUTE_as_right = {},&lt;br /&gt;
 	                    ROUTE_depotgate = {},&lt;br /&gt;
                        },&lt;br /&gt;
 	        },&lt;br /&gt;
       };&lt;br /&gt;
 &lt;br /&gt;
 	Util.Routes(MapRoutes);&lt;br /&gt;
 }; &amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It’s important to understand what we just did with this:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 ROUTE_AllySpawn = &lt;br /&gt;
 {&lt;br /&gt;
     ROUTE_as_right = {},&lt;br /&gt;
     ROUTE_depotgate = {},&lt;br /&gt;
 },&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The bot reaches the AllySpawn route node by default when it spawns; and because we have added the two routes inside the brackets, the bots will randomly choose between them. At this point, you have randomized routes for Allied engineers with the tank construct goal. Half the time they will choose to go to route as_right and half the time they will choose to go to route depotgate.&lt;br /&gt;
&lt;br /&gt;
Let’s make them even less predictable. Looking at the example picture, you can see that we want them to have a couple different options once they reach the route nodes we just set up. Repeating step 2, add the rest of the route nodes depicted by the colored squares.&lt;br /&gt;
&lt;br /&gt;
The scripting for the path options in the picture is as follows:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 global InitializeRoutes = function()&lt;br /&gt;
 {&lt;br /&gt;
     MapRoutes =&lt;br /&gt;
     {&lt;br /&gt;
         BUILD_tank_construct =&lt;br /&gt;
         {&lt;br /&gt;
             ROUTE_AllySpawn = &lt;br /&gt;
             {    &lt;br /&gt;
                 ROUTE_as_right =&lt;br /&gt;
                 {&lt;br /&gt;
                     ROUTE_as_rightsplit1 = {},&lt;br /&gt;
                     ROUTE_as_rightsplit2 =&lt;br /&gt;
                     {&lt;br /&gt;
                         ROUTE_depotflank = {},&lt;br /&gt;
                     },&lt;br /&gt;
                 },&lt;br /&gt;
                 ROUTE_depotgate = &lt;br /&gt;
                 {&lt;br /&gt;
                     ROUTE_cproute = {},&lt;br /&gt;
                     ROUTE_depotgatesplit = {},&lt;br /&gt;
                     ROUTE_as_rightsplit1 = {},&lt;br /&gt;
                 },&lt;br /&gt;
             },&lt;br /&gt;
         },&lt;br /&gt;
     };&lt;br /&gt;
 &lt;br /&gt;
     Util.Routes(Maproutes);&lt;br /&gt;
 }; &amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Step 4: Testing the routes===&lt;br /&gt;
&lt;br /&gt;
Testing the routes is by far the most important step. It is recommended that you test routes individually as you start to learn the routing system. Once you are comfortable with the setup, you may want to add routes for an entire phase and then test them to make the process a bit faster. &lt;br /&gt;
&lt;br /&gt;
If the routing is not working as expected, there are some basic troubleshooting options. It’s important to remember the criteria for the routes; the bot must be within the radius of the route node when receiving the goal, and the route node must be set up to support the goal. The basic troubleshooting steps are:&lt;br /&gt;
&lt;br /&gt;
# Check in console when the map loads for any error messages. It should list any goal names not found when initializing the routes.&lt;br /&gt;
# Check the radius of the route where the bot receives the goal&lt;br /&gt;
# Make sure the bot can reach the goal &lt;br /&gt;
# Make sure the bot is getting the expected goal&lt;br /&gt;
&lt;br /&gt;
For numbers 2 and 3, consider using the command /bot debugbot all goals with only one bot connected. In console, it should give success / failure messages for short term and long term goals. An example of a known problem is if there are priority type goals (like radar parts stealing) that are active when they aren’t reachable. The solution is to set them to be not active in OnMapLoad if they are unreachable.&lt;br /&gt;
&lt;br /&gt;
===Step 5: Adding priorities to routes===&lt;br /&gt;
&lt;br /&gt;
In some cases, you may want bots to use a certain route more often than others. This can be done by adding a “weight” to the route table:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 ROUTE_as_right =&lt;br /&gt;
 {&lt;br /&gt;
     Weight = 2,&lt;br /&gt;
     ROUTE_as_rightsplit1 = {},&lt;br /&gt;
     ROUTE_as_rightsplit2 =&lt;br /&gt;
     {&lt;br /&gt;
 	  Weight = 2,&lt;br /&gt;
 	  ROUTE_depotflank = {},&lt;br /&gt;
     },&lt;br /&gt;
 },&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this example, the bots will randomly choose to go to route as_right twice as much as route depotgate. And then they will choose to go to route as_rightsplit2 twice as much as route as_rightsplit1.&lt;br /&gt;
&lt;br /&gt;
===Step 6: Copying routes===&lt;br /&gt;
&lt;br /&gt;
If you have more than one goal that you want to share the same routing with, you can copy the routing. In the Goldrush example, say we have some attack goals in the yard that we want to route to. Rather than writing out the tables for each attack goal, we can copy them like this:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 MapRoutes[&amp;quot;ATTACK_Depot_.*&amp;quot;] = MapRoutes.BUILD_tank;&lt;br /&gt;
 MapRoutes.MOUNT_tank = MapRoutes.BUILD_Tank;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The key point to remember when doing this is that the route table that exists must be on the right side of the equation. In this case, we have created routes for multiple attack goals and a mount goal that are the same as our example routing to build the tank.&lt;br /&gt;
&lt;br /&gt;
These should be placed in OnMapLoad as well, below the Maproutes table and above the Utility function that registers the routes:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 global InitializeRoutes = function()&lt;br /&gt;
 {&lt;br /&gt;
     MapRoutes =&lt;br /&gt;
     {&lt;br /&gt;
         BUILD_Tank =&lt;br /&gt;
         {&lt;br /&gt;
 	&lt;br /&gt;
         },&lt;br /&gt;
     };&lt;br /&gt;
   &lt;br /&gt;
     MapRoutes[&amp;quot;ATTACK_Depot_.*&amp;quot;] = MapRoutes.BUILD_tank;&lt;br /&gt;
     MapRoutes.MOUNT_tank = MapRoutes.BUILD_Tank;&lt;br /&gt;
   &lt;br /&gt;
     Util.Routes(MapRoutes);&lt;br /&gt;
 };&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Step 7: Toggling routes===&lt;br /&gt;
&lt;br /&gt;
Routes are treated very similar to map goals. They will show up in your list if you do a /bot show_goals. They can be turned on and off via scripting with the SetAvailableMapGoals function. As an example, say we have route that we want opened up when barrier is destroyed, then closed when that barrier is constructed. This can be done inside the OnTriggers for those events:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  Barrier_construct = function ()&lt;br /&gt;
  {&lt;br /&gt;
  	Util.DisableGoal( &amp;quot;ROUTE_routname&amp;quot; ); &lt;br /&gt;
  };&lt;br /&gt;
  &lt;br /&gt;
  Barrier_destroyed = function ()&lt;br /&gt;
  {&lt;br /&gt;
  	Util.EnableGoal( &amp;quot;ROUTE_routname&amp;quot; ); &lt;br /&gt;
  };&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Step 8: Route maker===&lt;br /&gt;
* Windows users can use the route maker tool to easily create routes.&lt;br /&gt;
* Download it from http://svn.assembla.com/svn/omnibot/Enemy-Territory/0.8/tools/route_tool/&lt;br /&gt;
* Extract both RouteMaker.zip and RouteMaker2.zip into the same folder.&lt;br /&gt;
* Run RouteMaker2.exe&lt;br /&gt;
* You must set rcon password on your Enemy Territory or RTCW server.&lt;br /&gt;
* Then use menu command File / Load From RCON&lt;br /&gt;
* Drag &amp;amp; drop goals from left panel into middle panel.&lt;br /&gt;
* Drag &amp;amp; drop routes from right panel into middle panel.&lt;br /&gt;
* Double-click to delete routes.&lt;br /&gt;
* Finally use menu command Write / Script&lt;br /&gt;
* Output script will be copied to the clipboard. Paste it into the InitializeRoutes function in your map gm script.&lt;br /&gt;
&lt;br /&gt;
===Step 9: Ask for help===&lt;br /&gt;
&lt;br /&gt;
If you are having trouble with the syntax, set up, or understanding the routing system, ask for help. This guide is by no means comprehensive and complex maps will offer different challenges. Please post in the forums if you have questions / problems / bug reports.&lt;/div&gt;</summary>
		<author><name>Palota</name></author>
	</entry>
	<entry>
		<id>https://mygamingtalk.com/wiki/index.php?title=Bot&amp;diff=1748</id>
		<title>Bot</title>
		<link rel="alternate" type="text/html" href="https://mygamingtalk.com/wiki/index.php?title=Bot&amp;diff=1748"/>
		<updated>2025-05-13T08:58:40Z</updated>

		<summary type="html">&lt;p&gt;Palota: /* HasTarget */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{process header&lt;br /&gt;
 | title    = Bot Functions&lt;br /&gt;
 | section  =&lt;br /&gt;
 | previous = [[Omni-bot_Script_Reference | Script Reference]]&lt;br /&gt;
 | next     = &lt;br /&gt;
 | shortcut =&lt;br /&gt;
 | notes    =&lt;br /&gt;
}}&lt;br /&gt;
{{TOCright}}&lt;br /&gt;
==Bot Properties==&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Unless otherwise noted, all properties can be get and set.&lt;br /&gt;
&lt;br /&gt;
=== AimDamping ===&lt;br /&gt;
Effects the acceleration and turn rate.&lt;br /&gt;
=== AimPersistance ===&lt;br /&gt;
The time(in seconds) the bot will continue to aim at the last position of a target before aborting.&lt;br /&gt;
=== AimStiffness ===&lt;br /&gt;
Effects the acceleration of turning.&lt;br /&gt;
=== AimTolerance ===&lt;br /&gt;
The tolerance(in degrees) the bot tries to aim at stuff with.&lt;br /&gt;
=== Armor ===&lt;br /&gt;
Current Armor&lt;br /&gt;
=== FieldOfView ===&lt;br /&gt;
The angle(in degrees) the bot is capable of &#039;seeing&#039;.&lt;br /&gt;
=== Health ===&lt;br /&gt;
Current health.&lt;br /&gt;
=== MaxArmor ===&lt;br /&gt;
Max Armor&lt;br /&gt;
=== MaxHealth ===&lt;br /&gt;
Max Health&lt;br /&gt;
=== MaxTurnSpeed ===&lt;br /&gt;
The maximum speed(in degrees/second) the bot can rotate his aim at.&lt;br /&gt;
=== MaxViewDistance ===&lt;br /&gt;
The max distance(in game units) the bot is capable of seeing.&lt;br /&gt;
=== MemorySpan ===&lt;br /&gt;
The time(in seconds) taken for the memory about an entity to become stale.&lt;br /&gt;
=== Name ===&lt;br /&gt;
Name of the bot.&lt;br /&gt;
&lt;br /&gt;
=== ReactionTime ===&lt;br /&gt;
The time(in seconds) it takes the bot to begin responding to a newly sensed threat.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== Enemy Territory Addendum ===&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== DoNotKill ====&lt;br /&gt;
Set it to true to prevent medics to kill the bot for revive. It is used by BUILD, PLANT and PLANTMINE goals.&lt;br /&gt;
==== TargetBreakableDist ====&lt;br /&gt;
The maximum distance (in game units) the bot will attempt to target breakable entities. It can be set by [[Pre-Scripted_Regions#BreakableDistance|pre-scripted trigger region]] or inside [[Creating_a_script|OnBotJoin]] function.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==Bot Functions==&lt;br /&gt;
----&lt;br /&gt;
===AddScriptGoal===&lt;br /&gt;
Adds a goal to the bots behavior tree by name. Useful when a script goal has AutoAdd set to false, so you can more explicitly control when a bot gets the goal.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (name of script goal to add to bot behavior tree)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; true on success, false on failure&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 b.AddScriptGoal(&amp;quot;TestBot&amp;quot;);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
===RemoveState===&lt;br /&gt;
Removes a state from a bots behavior tree by name.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (name of script goal to remove from bot behavior tree)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 b.RemoveState(&amp;quot;TestBot&amp;quot;);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
===SetStateEnabled===&lt;br /&gt;
Enables/Disables a state by name.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (name of state, bool enable)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 b.SetStateEnabled(&amp;quot;Attack&amp;quot;, false); // disable attack state&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===CanGrabItem===&lt;br /&gt;
Returns true if bot can take item (flag, gold, radar parts, ...).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (GameEntity)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (FLAG or FLAG_dropped goal name)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; true/false&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 if (b.CanGrabItem(&amp;quot;FLAG_gold&amp;quot;)) {&lt;br /&gt;
 }&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===ChangeClass===&lt;br /&gt;
Changes the bot to a specified class.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (classId)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 b.ChangeClass(CLASS.SOLDIER);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===ChangeTeam===&lt;br /&gt;
Changes the bot to a specified team.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (teamId)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 b.ChangeTeam(TEAM.AXIS);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===ClearRoles===&lt;br /&gt;
Takes away a role from the bot.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; roleId&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 b.ClearRoles(ROLE.ATTACKER);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;See Also:&#039;&#039;&#039; &lt;br /&gt;
[[Bot#SetRoles| SetRoles]], [[Bot#HasRole| HasRole]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===DisableBotPush===&lt;br /&gt;
Used by [[Pre-Scripted_Regions#DisableBotPush|pre-scripted trigger region]].&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (true/false)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 b.DisableBotPush(true);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===DistanceTo===&lt;br /&gt;
Overloaded utility function for simplified distance checks.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (Vector3, notUseEyePosition&amp;lt;default false&amp;gt;) &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (MapGoal, notUseEyePosition&amp;lt;default false&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (GameEntity/GameId, notUseEyePosition&amp;lt;default false&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; float - distance from bot to Vector3, MapGoal, GameEntity or GameId&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 v = Vector3(10,20,30);&lt;br /&gt;
 target = b.GetTarget();&lt;br /&gt;
 // distance from bot to target entity&lt;br /&gt;
 d1 = b.DistanceTo(target, true);&lt;br /&gt;
 // distance from bot to world position&lt;br /&gt;
 d2 = b.DistanceTo(v, true);&lt;br /&gt;
 // distance from bot eye to world position&lt;br /&gt;
 d3 = b.DistanceTo(v);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===DumpBotTable===&lt;br /&gt;
Dumps a file with the bot&#039;s table to a file in the user folder.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (filename)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 b.DumpBotTable(&amp;quot;foo.txt&amp;quot;);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===Enable===&lt;br /&gt;
Disables all thinking for the bot.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (true/false)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 b.Enable(false);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===ExecCommand===&lt;br /&gt;
Executes a string command on the bot as if the bot executed a console command.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (command)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 b.ExecCommand(&amp;quot;kill&amp;quot;);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===Weapons/Ammo===&lt;br /&gt;
====CanSnipe====&lt;br /&gt;
It&#039;s deprecated and has been replaced by Util.CanBotSnipe(bot) in Enemy Territory.&lt;br /&gt;
&lt;br /&gt;
Checks if the bot can snipe based on the internally implemented snipe checks. Vary by game. Typically involves checking if the bot has a snipe enabled weapon and has ammo.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; true if the bot can snipe, else false&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 if(b.CanSnipe()) {}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====EnableShooting====&lt;br /&gt;
Disables all shooting for the bot.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (true/false)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 b.EnableShooting(false);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
====GetWeapon====&lt;br /&gt;
Gets a reference to a specific weapon from the bot.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (weaponId)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; [[Weapon]] reference, or NULL if the bot doesn&#039;t have the weapon.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 wpn = b.GetWeapon(WEAPON.SHOTGUN);&lt;br /&gt;
 wpn.PrimaryFire.AimOffset = Vector3(0,0,10);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
====GetBestWeapon====&lt;br /&gt;
Gets a weapon id for the best weapon versus current target or a specific entity.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none - uses current target&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (entity) evaluate weapon versus specific target entity&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; weapon id of weapon that is chosen.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 best = b.GetBestWeapon();&lt;br /&gt;
 // OR&lt;br /&gt;
 best = b.GetBestWeapon(someEnt);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
====GetRandomWeapon====&lt;br /&gt;
Gets a random weapon id from the list of weapons the bot currently has.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; random weapon id&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 randwpn = b.GetRandomWeapon();&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====GetCurrentWeapon====&lt;br /&gt;
Gets the current weapon id for the bot.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; weapon Id for bot&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 mywpn = b.GetCurrentWeapon();&lt;br /&gt;
 if(mywpn == WEAPON.SHOTGUN)&lt;br /&gt;
 {&lt;br /&gt;
 }&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
====GetCurrentAmmo====&lt;br /&gt;
Gets the ammo information for a weapon.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (table)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (table, firemode)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (table, firemode, weaponId)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; true if successful, false if not&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 ammoTable = {};&lt;br /&gt;
 // Get primary ammo for current weapon&lt;br /&gt;
 b.GetCurrentAmmo(ammoTable);&lt;br /&gt;
 // Get secondary ammo for current weapon&lt;br /&gt;
 b.GetCurrentAmmo(ammoTable, 1);&lt;br /&gt;
 // Get primary ammo for another weapon.&lt;br /&gt;
 b.GetCurrentAmmo(ammoTable, 0, WEAPON.SHOTGUN);&lt;br /&gt;
&lt;br /&gt;
 print(&amp;quot;Current Ammo:&amp;quot;, ammoTable.CurrentAmmo);&lt;br /&gt;
 print(&amp;quot;Max Ammo:&amp;quot;, ammoTable.MaxAmmo);&lt;br /&gt;
 print(&amp;quot;Current Clips:&amp;quot;, ammoTable.CurrentClip);&lt;br /&gt;
 print(&amp;quot;Max Clips:&amp;quot;, ammoTable.MaxClip);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====GetMostDesiredAmmo====&lt;br /&gt;
Gets information about the currently most needed ammo.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (table)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
* AmmoType - weapon ID&lt;br /&gt;
* Desire - [[Weapon#LowAmmoPriority|LowAmmoPriority]]; It will be zero if bot has more ammo than  [[Weapon#LowAmmoThreshold|LowAmmoThreshold]]&lt;br /&gt;
* GetAmmo - [[Weapon#LowAmmoGetAmmoAmount|LowAmmoGetAmmoAmount]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 mostNeededAmmo = {};&lt;br /&gt;
 b.GetMostDesiredAmmo(mostNeededAmmo);&lt;br /&gt;
 if( mostNeededAmmo.Desire &amp;gt; 0) {&lt;br /&gt;
  print(&amp;quot;Need ammo for weapon&amp;quot;, Util.WeaponName(mostNeededAmmo.AmmoType));&lt;br /&gt;
 }&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====FireWeapon====&lt;br /&gt;
Fires the current weapon.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 b.FireWeapon();&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
====HasAmmo====&lt;br /&gt;
Checks if the bot has a certain ammo type.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; () - If no parameters passed, checks current weapon ammo.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (WeaponId)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (WeaponId, needed amount)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; true/false if the bot has ammo.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 if(b.HasAmmo())&lt;br /&gt;
 {&lt;br /&gt;
 }&lt;br /&gt;
 if(b.HasAmmo(WEAPON.MP40))&lt;br /&gt;
 {&lt;br /&gt;
 }&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====HasAnyWeapon====&lt;br /&gt;
Checks if the bot has any of specified weapons. Table keys are weaponIDs, table values should be set to true.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (weapons, options&amp;lt;optional&amp;gt;, weaponList&amp;lt;optional&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
The second parameter is table which has items CheckAmmo and CheckCharged. Both options are true by default.&lt;br /&gt;
&lt;br /&gt;
The third parameter is empty table to store all results.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; weaponId if the bot has that weapon, 0 if the bot does not have any weapon from the list.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 weapons = table();&lt;br /&gt;
 weapons[WEAPON.MP40] = true;&lt;br /&gt;
 weapons[WEAPON.THOMPSON] = true;&lt;br /&gt;
 weapon = b.HasAnyWeapon(weapons, { CheckAmmo=true, CheckCharged=false } );&lt;br /&gt;
 if (weapon) {&lt;br /&gt;
 }&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====HasWeapon====&lt;br /&gt;
Checks if the bot has a specific weapon.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (weaponId)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; true if the bot has it, false if not.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 if(b.HasWeapon(WEAPON.SHOTGUN))&lt;br /&gt;
 {&lt;br /&gt;
 }&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
====IsWeaponCharged====&lt;br /&gt;
Checks if a weapon is &#039;&#039;charged&#039;&#039;. A charged weapon is one that is capable of being used that might occasionally be unavailable for use due to lack of character &#039;charge&#039;, whether that be a gameplay charge bar, stamina, skill, etc.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (weaponId, firemode&amp;lt;optional&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; true if weapon is charged, false if not.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 if(b.IsWeaponCharged(WEAPON.MORTAR, 0))&lt;br /&gt;
 {&lt;br /&gt;
 }&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===GetAllAlly===&lt;br /&gt;
Fills a table with all known allied entities (from bot&#039;s sensory memory) that match a desired criteria.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (category, class, table)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 // Get all known soldier players.&lt;br /&gt;
 players = table();&lt;br /&gt;
 b.GetAllAlly(CAT.PLAYER, CLASS.SOLDIER, players);&lt;br /&gt;
 foreach ( ent in players )&lt;br /&gt;
 {&lt;br /&gt;
     print(ent);&lt;br /&gt;
 }&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===GetAllEnemy===&lt;br /&gt;
Fills a table with all known enemy entities (from bot&#039;s sensory memory) that match a desired criteria.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (category, class, table)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 // Get all known soldier players.&lt;br /&gt;
 players = table();&lt;br /&gt;
 b.GetAllEnemy(CAT.PLAYER, CLASS.SOLDIER, players);&lt;br /&gt;
 foreach ( ent in players )&lt;br /&gt;
 {&lt;br /&gt;
     print(ent);&lt;br /&gt;
 }&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===GetAllType===&lt;br /&gt;
Fills a table with all known entities (from bot&#039;s sensory memory) that match a desired criteria.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (category, class, table)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 // Get all known soldier players.&lt;br /&gt;
 players = table();&lt;br /&gt;
 b.GetAllType(CAT.PLAYER, CLASS.SOLDIER, players);&lt;br /&gt;
 foreach ( ent in players )&lt;br /&gt;
 {&lt;br /&gt;
     print(ent);&lt;br /&gt;
 }&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===GetClass===&lt;br /&gt;
Gets the current class id for the bot.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; class Id for bot&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 myclass = b.GetClass();&lt;br /&gt;
 if(myClass == CLASS.SOLDIER)&lt;br /&gt;
 {&lt;br /&gt;
 }&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===GetEyePosition===&lt;br /&gt;
Gets the world position of the bots &#039;eye&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; Vector3 eye position&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 eyepos = b.GetEyePosition();&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===GetFacing===&lt;br /&gt;
Gets the facing vector for the bots aim. This method is fast, but can return incorrect value if the aim request is restricted by the game or mod (for example after revive). You can use function GetEntFacing to get correct facing.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; Vector3 facing vector&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 facing = b.GetFacing();&lt;br /&gt;
 pointinfront = b.GetEyePosition() + facing * 100;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===GetGameEntity===&lt;br /&gt;
Gets the game entity for the bot.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; entity&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 ent = b.GetGameEntity();&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===GetGameId===&lt;br /&gt;
Gets the game id for the bot.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; entity&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 gameid = b.GetGameId();&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===GetHealthPercent===&lt;br /&gt;
Gets the bot&#039;s current health percentage.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; 0.0 - 1.0 health scalar&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 if(bot.GetHealthPercent() &amp;lt; 0.5) &lt;br /&gt;
 {&lt;br /&gt;
     // &amp;lt; 50% health&lt;br /&gt;
 }&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
===GetHighLevelGoalName===&lt;br /&gt;
Gets the bot&#039;s current high level goal name.&lt;br /&gt;
&lt;br /&gt;
Examples: UseCabinet, WatchForProjectile, CovertOps, BUILD, PLANT, CAMP, SWITCH, ROAMING, ...&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Some goal names changed after they were moved to scripts.&lt;br /&gt;
&lt;br /&gt;
Goals in 0.81: DefuseDynamite, ReviveTeammate, TakeCheckPoint, RepairMg42&lt;br /&gt;
&lt;br /&gt;
Goals in 0.82: DEFUSE, REVIVE, CHECKPOINT, REPAIRMG42&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Goals in 0.83: CaptureTheFlag, ReturnTheFlag, MobileMortar, PlantMine, CallArtillery&lt;br /&gt;
&lt;br /&gt;
Goals in 0.84: FLAG, FLAGRETURN, MOBILEMORTAR, PLANTMINE, CALLARTILLERY&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; goal name, or NULL if the bot doesn&#039;t have a high level goal.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 g = bot.GetHighLevelGoalName();&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===GetMapGoalName===&lt;br /&gt;
Gets the bot&#039;s current map goal name (for example: BUILD_Tank, DEFEND_depot1, ...).&lt;br /&gt;
&lt;br /&gt;
Returns NULL if the current high level goal is ROAMING, WatchForProjectile or CovertOps.&lt;br /&gt;
&lt;br /&gt;
Note: This function has been added in 0.82.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; goal name or NULL.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 g = bot.GetMapGoalName();&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===GetLastTarget===&lt;br /&gt;
Gets the target the bot had before the current target.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; entity OR null&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 last = b.GetLastTarget();&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===GetNearest===&lt;br /&gt;
Gets the nearest target matching the desired criteria, friend or foe.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (category)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (category, classId)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (category, table of classIds)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; entity OR null&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 // get nearest player, defaults to any class within that category&lt;br /&gt;
 p = b.GetNearest(CAT.PLAYER);&lt;br /&gt;
 // get nearest soldier or medic player&lt;br /&gt;
 s = b.GetNearest(CAT.PLAYER, {CLASS.SOLDIER, CLASS.MEDIC});&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===GetNearestAlly===&lt;br /&gt;
Gets the nearest target matching the desired criteria, only allies&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (category)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (category, classId)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (category, table of classIds)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; entity OR null&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 // get nearest player, defaults to any class within that category&lt;br /&gt;
 p = b.GetNearestAlly(CAT.PLAYER);&lt;br /&gt;
 // get nearest soldier player&lt;br /&gt;
 s = b.GetNearestAlly(CAT.PLAYER, CLASS.SOLDIER);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===GetNearestEnemy===&lt;br /&gt;
Gets the nearest target matching the desired criteria, only enemies&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (category)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (category, classId)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (category, table of classIds)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; entity OR null&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 // get nearest player, defaults to any class within that category&lt;br /&gt;
 p = b.GetNearestEnemy(CAT.PLAYER);&lt;br /&gt;
 // get nearest soldier player&lt;br /&gt;
 s = b.GetNearestEnemy(CAT.PLAYER, CLASS.SOLDIER);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== GetNearestDestination ===&lt;br /&gt;
Finds paths from the current bot position to multiple destination positions. Returns index of the destination which has the shortest path. It can depend on navigation flags (e.g. teleports, axis/allied waypoints).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (table of vectors)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; index OR null&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 positions = { Vec3(105,4564,0), Vec3(-48,1234,0) };&lt;br /&gt;
 id = bot.GetNearestDestination(positions);&lt;br /&gt;
 if(typeId(id)==0)&lt;br /&gt;
 {&lt;br /&gt;
 	print(&amp;quot;path not found&amp;quot;);&lt;br /&gt;
 }else{&lt;br /&gt;
 	print(&amp;quot;path found to destination&amp;quot;, positions[id]);&lt;br /&gt;
 }&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===GetPosition===&lt;br /&gt;
Gets the world position of the bot.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; Vector3 world position&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 mypos = b.GetPosition();&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===GetTarget===&lt;br /&gt;
Gets the current target.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; entity OR null&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 target = b.GetTarget();&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===GetTargetInfo===&lt;br /&gt;
Returns the [[TargetInfo]] for an entity.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (entity/gameId)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; [[TargetInfo]] for entity.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 ti = b.GetTargetInfo(b.GetTarget());&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===GetTeam===&lt;br /&gt;
Gets the current team the bot is on.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; team #&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 myteam = b.GetTeam();&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;See also:&#039;&#039;&#039; [[TEAM]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===GetVelocity===&lt;br /&gt;
Gets the world velocity of the bot. The bot must be alive. It returns wrong vector if the bot is injured.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; Vector3 world velocity &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 myvel = b.GetVelocity();&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===HasTarget===&lt;br /&gt;
Checks if the bot has a current target (enemy)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; true if bot has a target&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 if(b.HasTarget())&lt;br /&gt;
 {&lt;br /&gt;
 }&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===HasAnyEntityFlag===&lt;br /&gt;
Checks if the bot has a given entity flag. This function can take any number of flags to check, and will return true if the bot has at least one of the flags, or false if it doesn&#039;t have any of them.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (entityflag, ...)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; true if bot has any flag, false if not&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 // checking 1 flag&lt;br /&gt;
 if(b.HasAnyEntityFlag(ENTFLAG.ZOOMING))&lt;br /&gt;
 {&lt;br /&gt;
 }&lt;br /&gt;
 // checking multiple flags.&lt;br /&gt;
 if(b.HasAnyEntityFlag(ENTFLAG.MOUNTED, ENTFLAG.ON_LADDER))&lt;br /&gt;
 {&lt;br /&gt;
 }&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===HasEntityFlag===&lt;br /&gt;
Checks if the bot has a given entity flag. This function can take any number of flags to check, and will return true if the bot has all the flags, or false if it is missing any.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (entityflag, ...)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; true if bot has all flags, false if not&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 // checking 1 flag&lt;br /&gt;
 if(b.HasEntityFlag(ENTFLAG.RELOADING))&lt;br /&gt;
 {&lt;br /&gt;
 }&lt;br /&gt;
 // checking multiple flags.&lt;br /&gt;
 if(b.HasEntityFlag(ENTFLAG.INWATER, ENTFLAG.UNDERWATER))&lt;br /&gt;
 {&lt;br /&gt;
 }&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===HasLineOfSightTo===&lt;br /&gt;
This functions checks whether the bot has line of sight to a 3d position. This function does not account for field of view, simply does a raycast for obstructions between the bots eye position and the provided position. To account for field of view, use [[Bot#InFieldOfView|InFieldOfView]]. If an entity or gameId is provided as the 2nd parameter, the function will return true if the raycast hits nothing on its way to the position OR if it hits the entity that is passed.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (Vector3 position)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (Vector3 position, entity)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; true if the bot has line of sight to the position or entity passed. false if the bot&#039;s view is obstructed.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; This function calls  [[Bot_Library#TraceLine|TraceLine]] with parameter TRACE.SHOT | TRACE.SMOKEBOMB&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 if(b.HasLineOfSightTo( Vec3(30,50,10) ))&lt;br /&gt;
 {&lt;br /&gt;
 }&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===HasPowerUp===&lt;br /&gt;
Checks if the bot has a given powerup. This function can take any number of flags to check, and will return true if the bot has all the flags, or false if it is missing any.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (powerup, ...)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; true if bot has all powerups, false if not&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 // checking 1 flag&lt;br /&gt;
 if(b.HasPowerUp(POWERUP.INVINCIBLE))&lt;br /&gt;
 {&lt;br /&gt;
 }&lt;br /&gt;
 // checking multiple flags.&lt;br /&gt;
 if(b.HasPowerUp(POWERUP.INVINCIBLE, POWERUP.QUADDAMAGE))&lt;br /&gt;
 {&lt;br /&gt;
 }&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===HasRole===&lt;br /&gt;
Checks if the bot has a specific role or any role.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; roleId &amp;lt;optional&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; true if the bot has role, false if not.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 if(b.HasRole(ROLE.INFILTRATOR)){&lt;br /&gt;
 }&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;See Also:&#039;&#039;&#039; &lt;br /&gt;
[[Bot#ClearRoles| ClearRoles]], [[Bot#SetRoles| SetRoles]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===HoldButton===&lt;br /&gt;
Makes the bot &#039;press&#039; a button, and hold it for an amount of time. This function can take any number of buttons as parameters, and will apply the effect to all of them. The time value is &#039;&#039;&#039;ALWAYS&#039;&#039;&#039; the last parameter.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (buttonId, ..., time in seconds)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 // hold crouch for 5 seconds&lt;br /&gt;
 b.HoldButton(BTN.CROUCH, 5);&lt;br /&gt;
 // hold multiple buttons for 5 seconds&lt;br /&gt;
 b.HoldButton(BTN.CROUCH, BTN.SPRINT, 5);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;See Also:&#039;&#039;&#039; [[Bot#PressButton| PressButton]], [[Bot#ReleaseButton| ReleaseButton]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===IgnoreTarget===&lt;br /&gt;
This function causes the bot to ignore specific entities for targeting for some duration of time.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (entity/gameId or goal name or table, seconds to ignore &amp;lt;optional&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 // ignore the entity, so the bot won&#039;t shoot at it.&lt;br /&gt;
 bot.IgnoreTarget(&amp;quot;MOVER_bird1&amp;quot;);&lt;br /&gt;
 bot.IgnoreTarget(Map.Movers);&lt;br /&gt;
 bot.IgnoreTarget(GetLocalEntity(), 100);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;See also:&#039;&#039;&#039; [[Bots shooting map objects]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===InFieldOfView===&lt;br /&gt;
Checks whether a position is within the bots current [[Bot#FieldOfView | FieldOfView]]. This function can take an optional field of view(in degrees) to check. If not provided, it will use the bots current [[Bot#FieldOfView | FieldOfView]].&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (Vector3 position)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (Vector3 position, fov angles)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; Vector3 - center point of the AABB.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 v = Vector3(10,10,10);&lt;br /&gt;
 // check if in default field of view&lt;br /&gt;
 if(b.InFieldOfView(v))&lt;br /&gt;
 {&lt;br /&gt;
 }&lt;br /&gt;
 // check if in custom field of view&lt;br /&gt;
 if(b.InFieldOfView(v, 180))&lt;br /&gt;
 {&lt;br /&gt;
 }&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===IsAllied===&lt;br /&gt;
Checks if the bot is allied with a given entity.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (entity/gameId)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; true if allied, false if not.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 if(b.IsAllied(someentity))&lt;br /&gt;
 {&lt;br /&gt;
 }&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===IsCarryingFlag===&lt;br /&gt;
Checks if the bot is carrying objective (flag, gold, documents, radar parts, ...).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; true/false&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 if(b.IsCarryingFlag())&lt;br /&gt;
 {&lt;br /&gt;
 }&lt;br /&gt;
 &amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
===IsStuck===&lt;br /&gt;
Checks if the bot considers himself to be stuck. Stuckness is typically defined as an insignificant amount of movement over a short period of time. The time can be optionally passed to the function for flexibility.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; () - If no params passed, the time used is 0.5 seconds.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (time in seconds)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; true if bot is &#039;&#039;stuck&#039;&#039;, false if not.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 if(b.IsStuck())&lt;br /&gt;
 {&lt;br /&gt;
 }&lt;br /&gt;
 // or check stuckness for 1.5 seconds.&lt;br /&gt;
 if(b.IsStuck(1.5))&lt;br /&gt;
 {&lt;br /&gt;
 }&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===MoveTowards===&lt;br /&gt;
Can be used in paththrough navigation or script goals. Cannot be called from map triggers.&lt;br /&gt;
Causes the bot to blindly move towards a target. This function does no path finding. It&#039;s primary use is short range movement when you are reasonably sure the bot can run right at the target. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (Vector3 position) - if distance tolerance not specified, default of 32 units is used.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (Vector3 position, distance tolerance)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; true if the bot is within the distance tolerance, false if not.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 // get within 64 units of this position&lt;br /&gt;
 v = Vector3(10,10,10);&lt;br /&gt;
 while(b.MoveTowards(v, 64) == false)&lt;br /&gt;
 {&lt;br /&gt;
     yield();&lt;br /&gt;
 } &amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===PressButton===&lt;br /&gt;
Makes the bot &#039;press&#039; a button. This function can take any number of buttons as parameters, and will apply the effect to all of them. Buttons that are &#039;&#039;pressed&#039;&#039; using this function are released automatically for the next bot update.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (buttonId, ...)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 // press crouch&lt;br /&gt;
 b.PressButton(BTN.CROUCH);&lt;br /&gt;
 // press multiple buttons&lt;br /&gt;
 b.PressButton(BTN.CROUCH, BTN.SPRINT);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;See Also:&#039;&#039;&#039; [[Bot#HoldButton | HoldButton]], [[Bot#ReleaseButton| ReleaseButton]]&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===ReleaseButton===&lt;br /&gt;
Makes the bot &#039;release&#039; a button. This function can take any number of buttons as parameters, and will apply the effect to all of them. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (buttonId, ...)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 // release crouch&lt;br /&gt;
 b.ReleaseButton(BTN.CROUCH);&lt;br /&gt;
 // release multiple buttons&lt;br /&gt;
 b.ReleaseButton(BTN.CROUCH, BTN.SPRINT);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;See Also:&#039;&#039;&#039; [[Bot#HoldButton | HoldButton]], [[Bot#PressButton| PressButton]]&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===ReloadProfile===&lt;br /&gt;
Reloads the bots profile. The profile is any script associated with the bots name.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 b.ReloadProfile();&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===ResetStuckTime===&lt;br /&gt;
Reset the stuck timer.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 b.ResetStuckTime();&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===Say===&lt;br /&gt;
Chat function used for bots to &#039;&#039;say&#039;&#039; messages through the normal chat channels of the game. For flexibility, this function can take any number and type of parameters, which it will convert to a single long string and use as the chat message.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (string, ...)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 b.Say(&amp;quot;My name is &amp;quot;, b.Name);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;See Also:&#039;&#039;&#039; &lt;br /&gt;
[[Bot#SayTeam| SayTeam]], [[Bot#SayVoice| SayVoice]]&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===SayTeam===&lt;br /&gt;
Chat function used for bots to &#039;&#039;say&#039;&#039; messages through the team chat channel of the game. For flexibility, this function can take any number and type of parameters, which it will convert to a single long string and use as the chat message.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (string, ...)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 b.SayTeam(&amp;quot;My name is &amp;quot;, b.Name);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;See Also:&#039;&#039;&#039; &lt;br /&gt;
[[Bot#Say| Say]], [[Bot#SayVoice| SayVoice]]&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===SayVoice===&lt;br /&gt;
Broadcasts a voice macro to the game. Used with global [[VOICE]] table values.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (macroId)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 b.SayVoice(VOICE.NEED_MEDIC);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;See Also:&#039;&#039;&#039; &lt;br /&gt;
[[Bot#Say| Say]], [[Bot#SayTeam| SayTeam]]&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===ScriptEvent===&lt;br /&gt;
Sends [[EVENT#SCRIPTMSG|SCRIPTMSG]] event.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (name, param1, param2, param3)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===SetDebugFlag===&lt;br /&gt;
Enables a debug flag for the bot. See the global [[DEBUG]] table for available options. Enabling debug flags typically cause various debug visualizations to render in order to help identify whats going on with various systems of the bot.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (flag, true/false to enable)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 b.SetDebugFlag(DEBUG.AIM, true);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===SetRoles===&lt;br /&gt;
Assign a role to the bot.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; roleId&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 b.SetRoles(ROLE.DEFENDER);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;See Also:&#039;&#039;&#039; &lt;br /&gt;
[[Bot#ClearRoles| ClearRoles]], [[Bot#HasRole| HasRole]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===ToLocalSpace===&lt;br /&gt;
Converts a vector into local bot space. This results in a position relative to the bots current position and rotation. This function is useful for simplifying some types of logic.&lt;br /&gt;
&lt;br /&gt;
* x axis is side to side.&lt;br /&gt;
* y axis is forward and back.&lt;br /&gt;
* z axis is up and down.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (Vector3)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; Vector3 local space position.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 v = Vector3(4356,342,276); // some world position.&lt;br /&gt;
 v2 = b.ToLocalSpace(v);&lt;br /&gt;
 if(v2.y &amp;lt; 0)&lt;br /&gt;
 {&lt;br /&gt;
     // the position is behind the bot.&lt;br /&gt;
 }&lt;br /&gt;
 if(v2.x &amp;lt; 0)&lt;br /&gt;
 {&lt;br /&gt;
     // the position is to the right of the bot&lt;br /&gt;
 }&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===ToWorldSpace===&lt;br /&gt;
Converts a vector from local bot space to world space. &lt;br /&gt;
&lt;br /&gt;
* x axis is side to side.&lt;br /&gt;
* y axis is forward and back.&lt;br /&gt;
* z axis is up and down.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (Vector3)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; Vector3 world space position.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 // slightly forward and to the right.&lt;br /&gt;
 v = Vector3(10,10,0);&lt;br /&gt;
 v2 = b.ToWorldSpace(v);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Enemy Territory Addendum===&lt;br /&gt;
&lt;br /&gt;
====ChangePrimaryWeapon====&lt;br /&gt;
Selects a new primary weapon for the bot. Should take effect next spawn. You must not use this function inside map scripts. You should use [[Utility_Functions#WeaponTable.SetWeaponAvailability|SetWeaponAvailability]] if you want to disable some weapons.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (weaponId)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; true if successful, false if not&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 b.ChangePrimaryWeapon(WEAPON.PANZERFAUST);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;See Also:&#039;&#039;&#039; &lt;br /&gt;
[[Bot#ChangeSecondaryWeapon| ChangeSecondaryWeapon]]&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====ChangeSecondaryWeapon====&lt;br /&gt;
Selects a new secondary weapon for the bot. Should take effect next spawn.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (weaponId)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; true if successful, false if not&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 b.ChangeSecondaryWeapon(WEAPON.LUGER);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;See Also:&#039;&#039;&#039; &lt;br /&gt;
[[Bot#ChangePrimaryWeapon| ChangePrimaryWeapon]]&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====ChangeSpawnPoint====&lt;br /&gt;
Changes the desired spawn point for the bot to respawn at.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (spawnpoint #)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 b.ChangeSpawnPoint(2); &amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====GetConstructableState====&lt;br /&gt;
Check state of a BUILD goal.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (entity)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; 1 if the bot can build the entity, 0 if the entity is already built, -1 if the entity is not constructable or has been built by enemy.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 if(b.GetConstructableState(TargetEntity) &amp;lt; 1 ) { &lt;br /&gt;
 }&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====GetCursorHint====&lt;br /&gt;
When a player is near enough something to get a hint icon, such as for dynamiting, this function can access what hint is showing. Some of these hints may or may not ever show up, they were taken as-is from the ET SDK.&lt;br /&gt;
&lt;br /&gt;
* NONE - 0&lt;br /&gt;
* PLAYER - 1 &lt;br /&gt;
* ACTIVATE - 2 &lt;br /&gt;
* DOOR - 3&lt;br /&gt;
* DOOR_ROTATING - 4&lt;br /&gt;
* DOOR_LOCKED - 5&lt;br /&gt;
* DOOR_ROTATING_LOCKED - 6&lt;br /&gt;
* MG42 - 7&lt;br /&gt;
* BREAKABLE - 8&lt;br /&gt;
* BREAKABLE_DYNAMITE - 9&lt;br /&gt;
* CHAIR - 10&lt;br /&gt;
* ALARM - 11&lt;br /&gt;
* HEALTH - 12&lt;br /&gt;
* TREASURE - 13&lt;br /&gt;
* KNIFE - 14&lt;br /&gt;
* LADDER - 15&lt;br /&gt;
* BUTTON - 16&lt;br /&gt;
* WATER - 17&lt;br /&gt;
* CAUTION - 18&lt;br /&gt;
* DANGER - 19&lt;br /&gt;
* SECRET - 20&lt;br /&gt;
* QUESTION - 21&lt;br /&gt;
* EXCLAMATION - 22 &lt;br /&gt;
* CLIPBOARD - 23&lt;br /&gt;
* WEAPON - 24&lt;br /&gt;
* AMMO - 25&lt;br /&gt;
* ARMOR - 26&lt;br /&gt;
* POWERUP - 27&lt;br /&gt;
* HOLDABLE - 28&lt;br /&gt;
* INVENTORY - 29&lt;br /&gt;
* SCENARIC - 30&lt;br /&gt;
* EXIT - 31&lt;br /&gt;
* NOEXIT - 32&lt;br /&gt;
* PLYR_FRIEND - 33&lt;br /&gt;
* PLYR_NEUTRAL - 34&lt;br /&gt;
* PLYR_ENEMY - 35&lt;br /&gt;
* PLYR_UNKNOWN - 36&lt;br /&gt;
* BUILD - 37&lt;br /&gt;
* DISARM - 38&lt;br /&gt;
* REVIVE - 39&lt;br /&gt;
* DYNAMITE - 40&lt;br /&gt;
* CONSTRUCTIBLE - 41&lt;br /&gt;
* UNIFORM - 42&lt;br /&gt;
* LANDMINE - 43&lt;br /&gt;
* TANK - 44&lt;br /&gt;
* SATCHELCHARGE - 45&lt;br /&gt;
* LOCKPICK - 46&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (table)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 hint = table();&lt;br /&gt;
 b.GetCursorHint(hint);&lt;br /&gt;
&lt;br /&gt;
 print(hint.type); // one of the values above&lt;br /&gt;
 print(hint.value); // usually a health associated with certain types &amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====GetDestroyableState====&lt;br /&gt;
Check state of a PLANT goal.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (entity)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; 1 if the bot can destroy the entity, -1 if the entity is not destroyable or is friendly objective.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 if(b.GetDestroyableState(TargetEntity) &amp;lt; 1 ) { &lt;br /&gt;
 }&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====GetExplosiveState====&lt;br /&gt;
Check state of a dynamite, landmine or tripmine.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; It does not work for a poison mine and bouncing betty in Jaymod.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (entity)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; 1 if the dynamite/mine can be armed, 0 if the dynamite is ticking or the mine is activated.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 if(b.GetExplosiveState(TargetEntity) == 1 ) { &lt;br /&gt;
 }&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====GetMG42Info====&lt;br /&gt;
Gets information about currently mounted MG42 - vector CenterFacing and angles MinHorizontal, MaxHorizontal, MinVertical, MaxVertical.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (table)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; true if info has been stored into table&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====GetMountedPlayerOnMG42====&lt;br /&gt;
Gets player who is mounting MG42.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (mg42Entity)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; player&#039;s entity or null&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====GetReinforceTime====&lt;br /&gt;
Gets the current time left(in seconds) before reinforcements spawn for the bots team.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; seconds left till reinforcements spawn&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 if(b.GetReinforceTime() &amp;lt; 2)&lt;br /&gt;
 {&lt;br /&gt;
     // 2 seconds to reinforcements&lt;br /&gt;
 }&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====GetSkills====&lt;br /&gt;
Gets the current skill values and puts them into the table parameter.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (table)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 skills = table();&lt;br /&gt;
 b.GetSkills(skills);&lt;br /&gt;
 print(&amp;quot;Battle Sense:&amp;quot;, skills[SKILL.BATTLE_SENSE]);&lt;br /&gt;
 print(&amp;quot;Engineering:&amp;quot;, skills[SKILL.ENGINEERING]);&lt;br /&gt;
 print(&amp;quot;First Aid:&amp;quot;, skills[SKILL.FIRST_AID]);&lt;br /&gt;
 print(&amp;quot;Signals:&amp;quot;, skills[SKILL.SIGNALS]);&lt;br /&gt;
 print(&amp;quot;Light Weapons:&amp;quot;, skills[SKILL.LIGHT_WEAPONS]);&lt;br /&gt;
 print(&amp;quot;Heavy Weapons:&amp;quot;, skills[SKILL.HEAVY_WEAPONS]);&lt;br /&gt;
 print(&amp;quot;Coverops:&amp;quot;, skills[SKILL.COVERTOPS]); &amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;See Also:&#039;&#039;&#039; [[SKILL]]&lt;br /&gt;
----&lt;br /&gt;
====GetStat====&lt;br /&gt;
Gets a current stat from the bot by name.  Valid stat names for ET are kills, deaths and xp.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (string) the stat name&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; the value of the stat&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 xp = b.GetStat(&amp;quot;xp&amp;quot;);&lt;br /&gt;
 print(&amp;quot;Bot xp value is&amp;quot;,xp);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====IsMG42Repairable====&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (mg42Entity)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; true if mg42 is damaged and can be repaired&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
====TeamLandminesAvailable====&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; remaining count of team landmines&lt;br /&gt;
&lt;br /&gt;
----&lt;/div&gt;</summary>
		<author><name>Palota</name></author>
	</entry>
	<entry>
		<id>https://mygamingtalk.com/wiki/index.php?title=Bot&amp;diff=1747</id>
		<title>Bot</title>
		<link rel="alternate" type="text/html" href="https://mygamingtalk.com/wiki/index.php?title=Bot&amp;diff=1747"/>
		<updated>2025-05-13T08:44:36Z</updated>

		<summary type="html">&lt;p&gt;Palota: /* MoveTowards */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{process header&lt;br /&gt;
 | title    = Bot Functions&lt;br /&gt;
 | section  =&lt;br /&gt;
 | previous = [[Omni-bot_Script_Reference | Script Reference]]&lt;br /&gt;
 | next     = &lt;br /&gt;
 | shortcut =&lt;br /&gt;
 | notes    =&lt;br /&gt;
}}&lt;br /&gt;
{{TOCright}}&lt;br /&gt;
==Bot Properties==&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Unless otherwise noted, all properties can be get and set.&lt;br /&gt;
&lt;br /&gt;
=== AimDamping ===&lt;br /&gt;
Effects the acceleration and turn rate.&lt;br /&gt;
=== AimPersistance ===&lt;br /&gt;
The time(in seconds) the bot will continue to aim at the last position of a target before aborting.&lt;br /&gt;
=== AimStiffness ===&lt;br /&gt;
Effects the acceleration of turning.&lt;br /&gt;
=== AimTolerance ===&lt;br /&gt;
The tolerance(in degrees) the bot tries to aim at stuff with.&lt;br /&gt;
=== Armor ===&lt;br /&gt;
Current Armor&lt;br /&gt;
=== FieldOfView ===&lt;br /&gt;
The angle(in degrees) the bot is capable of &#039;seeing&#039;.&lt;br /&gt;
=== Health ===&lt;br /&gt;
Current health.&lt;br /&gt;
=== MaxArmor ===&lt;br /&gt;
Max Armor&lt;br /&gt;
=== MaxHealth ===&lt;br /&gt;
Max Health&lt;br /&gt;
=== MaxTurnSpeed ===&lt;br /&gt;
The maximum speed(in degrees/second) the bot can rotate his aim at.&lt;br /&gt;
=== MaxViewDistance ===&lt;br /&gt;
The max distance(in game units) the bot is capable of seeing.&lt;br /&gt;
=== MemorySpan ===&lt;br /&gt;
The time(in seconds) taken for the memory about an entity to become stale.&lt;br /&gt;
=== Name ===&lt;br /&gt;
Name of the bot.&lt;br /&gt;
&lt;br /&gt;
=== ReactionTime ===&lt;br /&gt;
The time(in seconds) it takes the bot to begin responding to a newly sensed threat.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== Enemy Territory Addendum ===&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== DoNotKill ====&lt;br /&gt;
Set it to true to prevent medics to kill the bot for revive. It is used by BUILD, PLANT and PLANTMINE goals.&lt;br /&gt;
==== TargetBreakableDist ====&lt;br /&gt;
The maximum distance (in game units) the bot will attempt to target breakable entities. It can be set by [[Pre-Scripted_Regions#BreakableDistance|pre-scripted trigger region]] or inside [[Creating_a_script|OnBotJoin]] function.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==Bot Functions==&lt;br /&gt;
----&lt;br /&gt;
===AddScriptGoal===&lt;br /&gt;
Adds a goal to the bots behavior tree by name. Useful when a script goal has AutoAdd set to false, so you can more explicitly control when a bot gets the goal.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (name of script goal to add to bot behavior tree)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; true on success, false on failure&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 b.AddScriptGoal(&amp;quot;TestBot&amp;quot;);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
===RemoveState===&lt;br /&gt;
Removes a state from a bots behavior tree by name.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (name of script goal to remove from bot behavior tree)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 b.RemoveState(&amp;quot;TestBot&amp;quot;);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
===SetStateEnabled===&lt;br /&gt;
Enables/Disables a state by name.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (name of state, bool enable)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 b.SetStateEnabled(&amp;quot;Attack&amp;quot;, false); // disable attack state&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===CanGrabItem===&lt;br /&gt;
Returns true if bot can take item (flag, gold, radar parts, ...).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (GameEntity)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (FLAG or FLAG_dropped goal name)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; true/false&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 if (b.CanGrabItem(&amp;quot;FLAG_gold&amp;quot;)) {&lt;br /&gt;
 }&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===ChangeClass===&lt;br /&gt;
Changes the bot to a specified class.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (classId)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 b.ChangeClass(CLASS.SOLDIER);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===ChangeTeam===&lt;br /&gt;
Changes the bot to a specified team.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (teamId)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 b.ChangeTeam(TEAM.AXIS);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===ClearRoles===&lt;br /&gt;
Takes away a role from the bot.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; roleId&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 b.ClearRoles(ROLE.ATTACKER);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;See Also:&#039;&#039;&#039; &lt;br /&gt;
[[Bot#SetRoles| SetRoles]], [[Bot#HasRole| HasRole]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===DisableBotPush===&lt;br /&gt;
Used by [[Pre-Scripted_Regions#DisableBotPush|pre-scripted trigger region]].&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (true/false)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 b.DisableBotPush(true);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===DistanceTo===&lt;br /&gt;
Overloaded utility function for simplified distance checks.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (Vector3, notUseEyePosition&amp;lt;default false&amp;gt;) &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (MapGoal, notUseEyePosition&amp;lt;default false&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (GameEntity/GameId, notUseEyePosition&amp;lt;default false&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; float - distance from bot to Vector3, MapGoal, GameEntity or GameId&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 v = Vector3(10,20,30);&lt;br /&gt;
 target = b.GetTarget();&lt;br /&gt;
 // distance from bot to target entity&lt;br /&gt;
 d1 = b.DistanceTo(target, true);&lt;br /&gt;
 // distance from bot to world position&lt;br /&gt;
 d2 = b.DistanceTo(v, true);&lt;br /&gt;
 // distance from bot eye to world position&lt;br /&gt;
 d3 = b.DistanceTo(v);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===DumpBotTable===&lt;br /&gt;
Dumps a file with the bot&#039;s table to a file in the user folder.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (filename)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 b.DumpBotTable(&amp;quot;foo.txt&amp;quot;);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===Enable===&lt;br /&gt;
Disables all thinking for the bot.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (true/false)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 b.Enable(false);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===ExecCommand===&lt;br /&gt;
Executes a string command on the bot as if the bot executed a console command.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (command)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 b.ExecCommand(&amp;quot;kill&amp;quot;);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===Weapons/Ammo===&lt;br /&gt;
====CanSnipe====&lt;br /&gt;
It&#039;s deprecated and has been replaced by Util.CanBotSnipe(bot) in Enemy Territory.&lt;br /&gt;
&lt;br /&gt;
Checks if the bot can snipe based on the internally implemented snipe checks. Vary by game. Typically involves checking if the bot has a snipe enabled weapon and has ammo.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; true if the bot can snipe, else false&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 if(b.CanSnipe()) {}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====EnableShooting====&lt;br /&gt;
Disables all shooting for the bot.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (true/false)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 b.EnableShooting(false);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
====GetWeapon====&lt;br /&gt;
Gets a reference to a specific weapon from the bot.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (weaponId)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; [[Weapon]] reference, or NULL if the bot doesn&#039;t have the weapon.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 wpn = b.GetWeapon(WEAPON.SHOTGUN);&lt;br /&gt;
 wpn.PrimaryFire.AimOffset = Vector3(0,0,10);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
====GetBestWeapon====&lt;br /&gt;
Gets a weapon id for the best weapon versus current target or a specific entity.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none - uses current target&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (entity) evaluate weapon versus specific target entity&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; weapon id of weapon that is chosen.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 best = b.GetBestWeapon();&lt;br /&gt;
 // OR&lt;br /&gt;
 best = b.GetBestWeapon(someEnt);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
====GetRandomWeapon====&lt;br /&gt;
Gets a random weapon id from the list of weapons the bot currently has.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; random weapon id&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 randwpn = b.GetRandomWeapon();&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====GetCurrentWeapon====&lt;br /&gt;
Gets the current weapon id for the bot.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; weapon Id for bot&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 mywpn = b.GetCurrentWeapon();&lt;br /&gt;
 if(mywpn == WEAPON.SHOTGUN)&lt;br /&gt;
 {&lt;br /&gt;
 }&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
====GetCurrentAmmo====&lt;br /&gt;
Gets the ammo information for a weapon.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (table)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (table, firemode)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (table, firemode, weaponId)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; true if successful, false if not&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 ammoTable = {};&lt;br /&gt;
 // Get primary ammo for current weapon&lt;br /&gt;
 b.GetCurrentAmmo(ammoTable);&lt;br /&gt;
 // Get secondary ammo for current weapon&lt;br /&gt;
 b.GetCurrentAmmo(ammoTable, 1);&lt;br /&gt;
 // Get primary ammo for another weapon.&lt;br /&gt;
 b.GetCurrentAmmo(ammoTable, 0, WEAPON.SHOTGUN);&lt;br /&gt;
&lt;br /&gt;
 print(&amp;quot;Current Ammo:&amp;quot;, ammoTable.CurrentAmmo);&lt;br /&gt;
 print(&amp;quot;Max Ammo:&amp;quot;, ammoTable.MaxAmmo);&lt;br /&gt;
 print(&amp;quot;Current Clips:&amp;quot;, ammoTable.CurrentClip);&lt;br /&gt;
 print(&amp;quot;Max Clips:&amp;quot;, ammoTable.MaxClip);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====GetMostDesiredAmmo====&lt;br /&gt;
Gets information about the currently most needed ammo.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (table)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
* AmmoType - weapon ID&lt;br /&gt;
* Desire - [[Weapon#LowAmmoPriority|LowAmmoPriority]]; It will be zero if bot has more ammo than  [[Weapon#LowAmmoThreshold|LowAmmoThreshold]]&lt;br /&gt;
* GetAmmo - [[Weapon#LowAmmoGetAmmoAmount|LowAmmoGetAmmoAmount]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 mostNeededAmmo = {};&lt;br /&gt;
 b.GetMostDesiredAmmo(mostNeededAmmo);&lt;br /&gt;
 if( mostNeededAmmo.Desire &amp;gt; 0) {&lt;br /&gt;
  print(&amp;quot;Need ammo for weapon&amp;quot;, Util.WeaponName(mostNeededAmmo.AmmoType));&lt;br /&gt;
 }&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====FireWeapon====&lt;br /&gt;
Fires the current weapon.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 b.FireWeapon();&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
====HasAmmo====&lt;br /&gt;
Checks if the bot has a certain ammo type.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; () - If no parameters passed, checks current weapon ammo.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (WeaponId)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (WeaponId, needed amount)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; true/false if the bot has ammo.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 if(b.HasAmmo())&lt;br /&gt;
 {&lt;br /&gt;
 }&lt;br /&gt;
 if(b.HasAmmo(WEAPON.MP40))&lt;br /&gt;
 {&lt;br /&gt;
 }&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====HasAnyWeapon====&lt;br /&gt;
Checks if the bot has any of specified weapons. Table keys are weaponIDs, table values should be set to true.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (weapons, options&amp;lt;optional&amp;gt;, weaponList&amp;lt;optional&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
The second parameter is table which has items CheckAmmo and CheckCharged. Both options are true by default.&lt;br /&gt;
&lt;br /&gt;
The third parameter is empty table to store all results.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; weaponId if the bot has that weapon, 0 if the bot does not have any weapon from the list.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 weapons = table();&lt;br /&gt;
 weapons[WEAPON.MP40] = true;&lt;br /&gt;
 weapons[WEAPON.THOMPSON] = true;&lt;br /&gt;
 weapon = b.HasAnyWeapon(weapons, { CheckAmmo=true, CheckCharged=false } );&lt;br /&gt;
 if (weapon) {&lt;br /&gt;
 }&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====HasWeapon====&lt;br /&gt;
Checks if the bot has a specific weapon.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (weaponId)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; true if the bot has it, false if not.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 if(b.HasWeapon(WEAPON.SHOTGUN))&lt;br /&gt;
 {&lt;br /&gt;
 }&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
====IsWeaponCharged====&lt;br /&gt;
Checks if a weapon is &#039;&#039;charged&#039;&#039;. A charged weapon is one that is capable of being used that might occasionally be unavailable for use due to lack of character &#039;charge&#039;, whether that be a gameplay charge bar, stamina, skill, etc.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (weaponId, firemode&amp;lt;optional&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; true if weapon is charged, false if not.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 if(b.IsWeaponCharged(WEAPON.MORTAR, 0))&lt;br /&gt;
 {&lt;br /&gt;
 }&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===GetAllAlly===&lt;br /&gt;
Fills a table with all known allied entities (from bot&#039;s sensory memory) that match a desired criteria.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (category, class, table)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 // Get all known soldier players.&lt;br /&gt;
 players = table();&lt;br /&gt;
 b.GetAllAlly(CAT.PLAYER, CLASS.SOLDIER, players);&lt;br /&gt;
 foreach ( ent in players )&lt;br /&gt;
 {&lt;br /&gt;
     print(ent);&lt;br /&gt;
 }&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===GetAllEnemy===&lt;br /&gt;
Fills a table with all known enemy entities (from bot&#039;s sensory memory) that match a desired criteria.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (category, class, table)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 // Get all known soldier players.&lt;br /&gt;
 players = table();&lt;br /&gt;
 b.GetAllEnemy(CAT.PLAYER, CLASS.SOLDIER, players);&lt;br /&gt;
 foreach ( ent in players )&lt;br /&gt;
 {&lt;br /&gt;
     print(ent);&lt;br /&gt;
 }&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===GetAllType===&lt;br /&gt;
Fills a table with all known entities (from bot&#039;s sensory memory) that match a desired criteria.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (category, class, table)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 // Get all known soldier players.&lt;br /&gt;
 players = table();&lt;br /&gt;
 b.GetAllType(CAT.PLAYER, CLASS.SOLDIER, players);&lt;br /&gt;
 foreach ( ent in players )&lt;br /&gt;
 {&lt;br /&gt;
     print(ent);&lt;br /&gt;
 }&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===GetClass===&lt;br /&gt;
Gets the current class id for the bot.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; class Id for bot&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 myclass = b.GetClass();&lt;br /&gt;
 if(myClass == CLASS.SOLDIER)&lt;br /&gt;
 {&lt;br /&gt;
 }&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===GetEyePosition===&lt;br /&gt;
Gets the world position of the bots &#039;eye&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; Vector3 eye position&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 eyepos = b.GetEyePosition();&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===GetFacing===&lt;br /&gt;
Gets the facing vector for the bots aim. This method is fast, but can return incorrect value if the aim request is restricted by the game or mod (for example after revive). You can use function GetEntFacing to get correct facing.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; Vector3 facing vector&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 facing = b.GetFacing();&lt;br /&gt;
 pointinfront = b.GetEyePosition() + facing * 100;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===GetGameEntity===&lt;br /&gt;
Gets the game entity for the bot.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; entity&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 ent = b.GetGameEntity();&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===GetGameId===&lt;br /&gt;
Gets the game id for the bot.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; entity&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 gameid = b.GetGameId();&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===GetHealthPercent===&lt;br /&gt;
Gets the bot&#039;s current health percentage.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; 0.0 - 1.0 health scalar&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 if(bot.GetHealthPercent() &amp;lt; 0.5) &lt;br /&gt;
 {&lt;br /&gt;
     // &amp;lt; 50% health&lt;br /&gt;
 }&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
===GetHighLevelGoalName===&lt;br /&gt;
Gets the bot&#039;s current high level goal name.&lt;br /&gt;
&lt;br /&gt;
Examples: UseCabinet, WatchForProjectile, CovertOps, BUILD, PLANT, CAMP, SWITCH, ROAMING, ...&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Some goal names changed after they were moved to scripts.&lt;br /&gt;
&lt;br /&gt;
Goals in 0.81: DefuseDynamite, ReviveTeammate, TakeCheckPoint, RepairMg42&lt;br /&gt;
&lt;br /&gt;
Goals in 0.82: DEFUSE, REVIVE, CHECKPOINT, REPAIRMG42&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Goals in 0.83: CaptureTheFlag, ReturnTheFlag, MobileMortar, PlantMine, CallArtillery&lt;br /&gt;
&lt;br /&gt;
Goals in 0.84: FLAG, FLAGRETURN, MOBILEMORTAR, PLANTMINE, CALLARTILLERY&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; goal name, or NULL if the bot doesn&#039;t have a high level goal.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 g = bot.GetHighLevelGoalName();&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===GetMapGoalName===&lt;br /&gt;
Gets the bot&#039;s current map goal name (for example: BUILD_Tank, DEFEND_depot1, ...).&lt;br /&gt;
&lt;br /&gt;
Returns NULL if the current high level goal is ROAMING, WatchForProjectile or CovertOps.&lt;br /&gt;
&lt;br /&gt;
Note: This function has been added in 0.82.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; goal name or NULL.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 g = bot.GetMapGoalName();&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===GetLastTarget===&lt;br /&gt;
Gets the target the bot had before the current target.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; entity OR null&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 last = b.GetLastTarget();&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===GetNearest===&lt;br /&gt;
Gets the nearest target matching the desired criteria, friend or foe.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (category)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (category, classId)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (category, table of classIds)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; entity OR null&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 // get nearest player, defaults to any class within that category&lt;br /&gt;
 p = b.GetNearest(CAT.PLAYER);&lt;br /&gt;
 // get nearest soldier or medic player&lt;br /&gt;
 s = b.GetNearest(CAT.PLAYER, {CLASS.SOLDIER, CLASS.MEDIC});&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===GetNearestAlly===&lt;br /&gt;
Gets the nearest target matching the desired criteria, only allies&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (category)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (category, classId)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (category, table of classIds)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; entity OR null&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 // get nearest player, defaults to any class within that category&lt;br /&gt;
 p = b.GetNearestAlly(CAT.PLAYER);&lt;br /&gt;
 // get nearest soldier player&lt;br /&gt;
 s = b.GetNearestAlly(CAT.PLAYER, CLASS.SOLDIER);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===GetNearestEnemy===&lt;br /&gt;
Gets the nearest target matching the desired criteria, only enemies&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (category)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (category, classId)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (category, table of classIds)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; entity OR null&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 // get nearest player, defaults to any class within that category&lt;br /&gt;
 p = b.GetNearestEnemy(CAT.PLAYER);&lt;br /&gt;
 // get nearest soldier player&lt;br /&gt;
 s = b.GetNearestEnemy(CAT.PLAYER, CLASS.SOLDIER);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== GetNearestDestination ===&lt;br /&gt;
Finds paths from the current bot position to multiple destination positions. Returns index of the destination which has the shortest path. It can depend on navigation flags (e.g. teleports, axis/allied waypoints).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (table of vectors)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; index OR null&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 positions = { Vec3(105,4564,0), Vec3(-48,1234,0) };&lt;br /&gt;
 id = bot.GetNearestDestination(positions);&lt;br /&gt;
 if(typeId(id)==0)&lt;br /&gt;
 {&lt;br /&gt;
 	print(&amp;quot;path not found&amp;quot;);&lt;br /&gt;
 }else{&lt;br /&gt;
 	print(&amp;quot;path found to destination&amp;quot;, positions[id]);&lt;br /&gt;
 }&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===GetPosition===&lt;br /&gt;
Gets the world position of the bot.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; Vector3 world position&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 mypos = b.GetPosition();&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===GetTarget===&lt;br /&gt;
Gets the current target.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; entity OR null&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 target = b.GetTarget();&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===GetTargetInfo===&lt;br /&gt;
Returns the [[TargetInfo]] for an entity.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (entity/gameId)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; [[TargetInfo]] for entity.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 ti = b.GetTargetInfo(b.GetTarget());&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===GetTeam===&lt;br /&gt;
Gets the current team the bot is on.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; team #&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 myteam = b.GetTeam();&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;See also:&#039;&#039;&#039; [[TEAM]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===GetVelocity===&lt;br /&gt;
Gets the world velocity of the bot. The bot must be alive. It returns wrong vector if the bot is injured.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; Vector3 world velocity &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 myvel = b.GetVelocity();&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===HasTarget===&lt;br /&gt;
Checks if the bot has a current target&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; true if bot has a target&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 if(b.HasTarget())&lt;br /&gt;
 {&lt;br /&gt;
 }&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===HasAnyEntityFlag===&lt;br /&gt;
Checks if the bot has a given entity flag. This function can take any number of flags to check, and will return true if the bot has at least one of the flags, or false if it doesn&#039;t have any of them.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (entityflag, ...)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; true if bot has any flag, false if not&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 // checking 1 flag&lt;br /&gt;
 if(b.HasAnyEntityFlag(ENTFLAG.ZOOMING))&lt;br /&gt;
 {&lt;br /&gt;
 }&lt;br /&gt;
 // checking multiple flags.&lt;br /&gt;
 if(b.HasAnyEntityFlag(ENTFLAG.MOUNTED, ENTFLAG.ON_LADDER))&lt;br /&gt;
 {&lt;br /&gt;
 }&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===HasEntityFlag===&lt;br /&gt;
Checks if the bot has a given entity flag. This function can take any number of flags to check, and will return true if the bot has all the flags, or false if it is missing any.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (entityflag, ...)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; true if bot has all flags, false if not&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 // checking 1 flag&lt;br /&gt;
 if(b.HasEntityFlag(ENTFLAG.RELOADING))&lt;br /&gt;
 {&lt;br /&gt;
 }&lt;br /&gt;
 // checking multiple flags.&lt;br /&gt;
 if(b.HasEntityFlag(ENTFLAG.INWATER, ENTFLAG.UNDERWATER))&lt;br /&gt;
 {&lt;br /&gt;
 }&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===HasLineOfSightTo===&lt;br /&gt;
This functions checks whether the bot has line of sight to a 3d position. This function does not account for field of view, simply does a raycast for obstructions between the bots eye position and the provided position. To account for field of view, use [[Bot#InFieldOfView|InFieldOfView]]. If an entity or gameId is provided as the 2nd parameter, the function will return true if the raycast hits nothing on its way to the position OR if it hits the entity that is passed.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (Vector3 position)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (Vector3 position, entity)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; true if the bot has line of sight to the position or entity passed. false if the bot&#039;s view is obstructed.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; This function calls  [[Bot_Library#TraceLine|TraceLine]] with parameter TRACE.SHOT | TRACE.SMOKEBOMB&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 if(b.HasLineOfSightTo( Vec3(30,50,10) ))&lt;br /&gt;
 {&lt;br /&gt;
 }&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===HasPowerUp===&lt;br /&gt;
Checks if the bot has a given powerup. This function can take any number of flags to check, and will return true if the bot has all the flags, or false if it is missing any.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (powerup, ...)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; true if bot has all powerups, false if not&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 // checking 1 flag&lt;br /&gt;
 if(b.HasPowerUp(POWERUP.INVINCIBLE))&lt;br /&gt;
 {&lt;br /&gt;
 }&lt;br /&gt;
 // checking multiple flags.&lt;br /&gt;
 if(b.HasPowerUp(POWERUP.INVINCIBLE, POWERUP.QUADDAMAGE))&lt;br /&gt;
 {&lt;br /&gt;
 }&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===HasRole===&lt;br /&gt;
Checks if the bot has a specific role or any role.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; roleId &amp;lt;optional&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; true if the bot has role, false if not.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 if(b.HasRole(ROLE.INFILTRATOR)){&lt;br /&gt;
 }&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;See Also:&#039;&#039;&#039; &lt;br /&gt;
[[Bot#ClearRoles| ClearRoles]], [[Bot#SetRoles| SetRoles]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===HoldButton===&lt;br /&gt;
Makes the bot &#039;press&#039; a button, and hold it for an amount of time. This function can take any number of buttons as parameters, and will apply the effect to all of them. The time value is &#039;&#039;&#039;ALWAYS&#039;&#039;&#039; the last parameter.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (buttonId, ..., time in seconds)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 // hold crouch for 5 seconds&lt;br /&gt;
 b.HoldButton(BTN.CROUCH, 5);&lt;br /&gt;
 // hold multiple buttons for 5 seconds&lt;br /&gt;
 b.HoldButton(BTN.CROUCH, BTN.SPRINT, 5);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;See Also:&#039;&#039;&#039; [[Bot#PressButton| PressButton]], [[Bot#ReleaseButton| ReleaseButton]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===IgnoreTarget===&lt;br /&gt;
This function causes the bot to ignore specific entities for targeting for some duration of time.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (entity/gameId or goal name or table, seconds to ignore &amp;lt;optional&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 // ignore the entity, so the bot won&#039;t shoot at it.&lt;br /&gt;
 bot.IgnoreTarget(&amp;quot;MOVER_bird1&amp;quot;);&lt;br /&gt;
 bot.IgnoreTarget(Map.Movers);&lt;br /&gt;
 bot.IgnoreTarget(GetLocalEntity(), 100);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;See also:&#039;&#039;&#039; [[Bots shooting map objects]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===InFieldOfView===&lt;br /&gt;
Checks whether a position is within the bots current [[Bot#FieldOfView | FieldOfView]]. This function can take an optional field of view(in degrees) to check. If not provided, it will use the bots current [[Bot#FieldOfView | FieldOfView]].&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (Vector3 position)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (Vector3 position, fov angles)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; Vector3 - center point of the AABB.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 v = Vector3(10,10,10);&lt;br /&gt;
 // check if in default field of view&lt;br /&gt;
 if(b.InFieldOfView(v))&lt;br /&gt;
 {&lt;br /&gt;
 }&lt;br /&gt;
 // check if in custom field of view&lt;br /&gt;
 if(b.InFieldOfView(v, 180))&lt;br /&gt;
 {&lt;br /&gt;
 }&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===IsAllied===&lt;br /&gt;
Checks if the bot is allied with a given entity.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (entity/gameId)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; true if allied, false if not.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 if(b.IsAllied(someentity))&lt;br /&gt;
 {&lt;br /&gt;
 }&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===IsCarryingFlag===&lt;br /&gt;
Checks if the bot is carrying objective (flag, gold, documents, radar parts, ...).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; true/false&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 if(b.IsCarryingFlag())&lt;br /&gt;
 {&lt;br /&gt;
 }&lt;br /&gt;
 &amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
===IsStuck===&lt;br /&gt;
Checks if the bot considers himself to be stuck. Stuckness is typically defined as an insignificant amount of movement over a short period of time. The time can be optionally passed to the function for flexibility.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; () - If no params passed, the time used is 0.5 seconds.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (time in seconds)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; true if bot is &#039;&#039;stuck&#039;&#039;, false if not.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 if(b.IsStuck())&lt;br /&gt;
 {&lt;br /&gt;
 }&lt;br /&gt;
 // or check stuckness for 1.5 seconds.&lt;br /&gt;
 if(b.IsStuck(1.5))&lt;br /&gt;
 {&lt;br /&gt;
 }&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===MoveTowards===&lt;br /&gt;
Can be used in paththrough navigation or script goals. Cannot be called from map triggers.&lt;br /&gt;
Causes the bot to blindly move towards a target. This function does no path finding. It&#039;s primary use is short range movement when you are reasonably sure the bot can run right at the target. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (Vector3 position) - if distance tolerance not specified, default of 32 units is used.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (Vector3 position, distance tolerance)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; true if the bot is within the distance tolerance, false if not.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 // get within 64 units of this position&lt;br /&gt;
 v = Vector3(10,10,10);&lt;br /&gt;
 while(b.MoveTowards(v, 64) == false)&lt;br /&gt;
 {&lt;br /&gt;
     yield();&lt;br /&gt;
 } &amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===PressButton===&lt;br /&gt;
Makes the bot &#039;press&#039; a button. This function can take any number of buttons as parameters, and will apply the effect to all of them. Buttons that are &#039;&#039;pressed&#039;&#039; using this function are released automatically for the next bot update.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (buttonId, ...)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 // press crouch&lt;br /&gt;
 b.PressButton(BTN.CROUCH);&lt;br /&gt;
 // press multiple buttons&lt;br /&gt;
 b.PressButton(BTN.CROUCH, BTN.SPRINT);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;See Also:&#039;&#039;&#039; [[Bot#HoldButton | HoldButton]], [[Bot#ReleaseButton| ReleaseButton]]&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===ReleaseButton===&lt;br /&gt;
Makes the bot &#039;release&#039; a button. This function can take any number of buttons as parameters, and will apply the effect to all of them. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (buttonId, ...)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 // release crouch&lt;br /&gt;
 b.ReleaseButton(BTN.CROUCH);&lt;br /&gt;
 // release multiple buttons&lt;br /&gt;
 b.ReleaseButton(BTN.CROUCH, BTN.SPRINT);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;See Also:&#039;&#039;&#039; [[Bot#HoldButton | HoldButton]], [[Bot#PressButton| PressButton]]&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===ReloadProfile===&lt;br /&gt;
Reloads the bots profile. The profile is any script associated with the bots name.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 b.ReloadProfile();&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===ResetStuckTime===&lt;br /&gt;
Reset the stuck timer.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 b.ResetStuckTime();&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===Say===&lt;br /&gt;
Chat function used for bots to &#039;&#039;say&#039;&#039; messages through the normal chat channels of the game. For flexibility, this function can take any number and type of parameters, which it will convert to a single long string and use as the chat message.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (string, ...)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 b.Say(&amp;quot;My name is &amp;quot;, b.Name);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;See Also:&#039;&#039;&#039; &lt;br /&gt;
[[Bot#SayTeam| SayTeam]], [[Bot#SayVoice| SayVoice]]&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===SayTeam===&lt;br /&gt;
Chat function used for bots to &#039;&#039;say&#039;&#039; messages through the team chat channel of the game. For flexibility, this function can take any number and type of parameters, which it will convert to a single long string and use as the chat message.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (string, ...)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 b.SayTeam(&amp;quot;My name is &amp;quot;, b.Name);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;See Also:&#039;&#039;&#039; &lt;br /&gt;
[[Bot#Say| Say]], [[Bot#SayVoice| SayVoice]]&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===SayVoice===&lt;br /&gt;
Broadcasts a voice macro to the game. Used with global [[VOICE]] table values.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (macroId)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 b.SayVoice(VOICE.NEED_MEDIC);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;See Also:&#039;&#039;&#039; &lt;br /&gt;
[[Bot#Say| Say]], [[Bot#SayTeam| SayTeam]]&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===ScriptEvent===&lt;br /&gt;
Sends [[EVENT#SCRIPTMSG|SCRIPTMSG]] event.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (name, param1, param2, param3)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===SetDebugFlag===&lt;br /&gt;
Enables a debug flag for the bot. See the global [[DEBUG]] table for available options. Enabling debug flags typically cause various debug visualizations to render in order to help identify whats going on with various systems of the bot.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (flag, true/false to enable)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 b.SetDebugFlag(DEBUG.AIM, true);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===SetRoles===&lt;br /&gt;
Assign a role to the bot.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; roleId&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 b.SetRoles(ROLE.DEFENDER);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;See Also:&#039;&#039;&#039; &lt;br /&gt;
[[Bot#ClearRoles| ClearRoles]], [[Bot#HasRole| HasRole]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===ToLocalSpace===&lt;br /&gt;
Converts a vector into local bot space. This results in a position relative to the bots current position and rotation. This function is useful for simplifying some types of logic.&lt;br /&gt;
&lt;br /&gt;
* x axis is side to side.&lt;br /&gt;
* y axis is forward and back.&lt;br /&gt;
* z axis is up and down.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (Vector3)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; Vector3 local space position.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 v = Vector3(4356,342,276); // some world position.&lt;br /&gt;
 v2 = b.ToLocalSpace(v);&lt;br /&gt;
 if(v2.y &amp;lt; 0)&lt;br /&gt;
 {&lt;br /&gt;
     // the position is behind the bot.&lt;br /&gt;
 }&lt;br /&gt;
 if(v2.x &amp;lt; 0)&lt;br /&gt;
 {&lt;br /&gt;
     // the position is to the right of the bot&lt;br /&gt;
 }&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===ToWorldSpace===&lt;br /&gt;
Converts a vector from local bot space to world space. &lt;br /&gt;
&lt;br /&gt;
* x axis is side to side.&lt;br /&gt;
* y axis is forward and back.&lt;br /&gt;
* z axis is up and down.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (Vector3)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; Vector3 world space position.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 // slightly forward and to the right.&lt;br /&gt;
 v = Vector3(10,10,0);&lt;br /&gt;
 v2 = b.ToWorldSpace(v);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Enemy Territory Addendum===&lt;br /&gt;
&lt;br /&gt;
====ChangePrimaryWeapon====&lt;br /&gt;
Selects a new primary weapon for the bot. Should take effect next spawn. You must not use this function inside map scripts. You should use [[Utility_Functions#WeaponTable.SetWeaponAvailability|SetWeaponAvailability]] if you want to disable some weapons.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (weaponId)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; true if successful, false if not&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 b.ChangePrimaryWeapon(WEAPON.PANZERFAUST);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;See Also:&#039;&#039;&#039; &lt;br /&gt;
[[Bot#ChangeSecondaryWeapon| ChangeSecondaryWeapon]]&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====ChangeSecondaryWeapon====&lt;br /&gt;
Selects a new secondary weapon for the bot. Should take effect next spawn.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (weaponId)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; true if successful, false if not&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 b.ChangeSecondaryWeapon(WEAPON.LUGER);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;See Also:&#039;&#039;&#039; &lt;br /&gt;
[[Bot#ChangePrimaryWeapon| ChangePrimaryWeapon]]&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====ChangeSpawnPoint====&lt;br /&gt;
Changes the desired spawn point for the bot to respawn at.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (spawnpoint #)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 b.ChangeSpawnPoint(2); &amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====GetConstructableState====&lt;br /&gt;
Check state of a BUILD goal.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (entity)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; 1 if the bot can build the entity, 0 if the entity is already built, -1 if the entity is not constructable or has been built by enemy.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 if(b.GetConstructableState(TargetEntity) &amp;lt; 1 ) { &lt;br /&gt;
 }&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====GetCursorHint====&lt;br /&gt;
When a player is near enough something to get a hint icon, such as for dynamiting, this function can access what hint is showing. Some of these hints may or may not ever show up, they were taken as-is from the ET SDK.&lt;br /&gt;
&lt;br /&gt;
* NONE - 0&lt;br /&gt;
* PLAYER - 1 &lt;br /&gt;
* ACTIVATE - 2 &lt;br /&gt;
* DOOR - 3&lt;br /&gt;
* DOOR_ROTATING - 4&lt;br /&gt;
* DOOR_LOCKED - 5&lt;br /&gt;
* DOOR_ROTATING_LOCKED - 6&lt;br /&gt;
* MG42 - 7&lt;br /&gt;
* BREAKABLE - 8&lt;br /&gt;
* BREAKABLE_DYNAMITE - 9&lt;br /&gt;
* CHAIR - 10&lt;br /&gt;
* ALARM - 11&lt;br /&gt;
* HEALTH - 12&lt;br /&gt;
* TREASURE - 13&lt;br /&gt;
* KNIFE - 14&lt;br /&gt;
* LADDER - 15&lt;br /&gt;
* BUTTON - 16&lt;br /&gt;
* WATER - 17&lt;br /&gt;
* CAUTION - 18&lt;br /&gt;
* DANGER - 19&lt;br /&gt;
* SECRET - 20&lt;br /&gt;
* QUESTION - 21&lt;br /&gt;
* EXCLAMATION - 22 &lt;br /&gt;
* CLIPBOARD - 23&lt;br /&gt;
* WEAPON - 24&lt;br /&gt;
* AMMO - 25&lt;br /&gt;
* ARMOR - 26&lt;br /&gt;
* POWERUP - 27&lt;br /&gt;
* HOLDABLE - 28&lt;br /&gt;
* INVENTORY - 29&lt;br /&gt;
* SCENARIC - 30&lt;br /&gt;
* EXIT - 31&lt;br /&gt;
* NOEXIT - 32&lt;br /&gt;
* PLYR_FRIEND - 33&lt;br /&gt;
* PLYR_NEUTRAL - 34&lt;br /&gt;
* PLYR_ENEMY - 35&lt;br /&gt;
* PLYR_UNKNOWN - 36&lt;br /&gt;
* BUILD - 37&lt;br /&gt;
* DISARM - 38&lt;br /&gt;
* REVIVE - 39&lt;br /&gt;
* DYNAMITE - 40&lt;br /&gt;
* CONSTRUCTIBLE - 41&lt;br /&gt;
* UNIFORM - 42&lt;br /&gt;
* LANDMINE - 43&lt;br /&gt;
* TANK - 44&lt;br /&gt;
* SATCHELCHARGE - 45&lt;br /&gt;
* LOCKPICK - 46&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (table)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 hint = table();&lt;br /&gt;
 b.GetCursorHint(hint);&lt;br /&gt;
&lt;br /&gt;
 print(hint.type); // one of the values above&lt;br /&gt;
 print(hint.value); // usually a health associated with certain types &amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====GetDestroyableState====&lt;br /&gt;
Check state of a PLANT goal.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (entity)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; 1 if the bot can destroy the entity, -1 if the entity is not destroyable or is friendly objective.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 if(b.GetDestroyableState(TargetEntity) &amp;lt; 1 ) { &lt;br /&gt;
 }&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====GetExplosiveState====&lt;br /&gt;
Check state of a dynamite, landmine or tripmine.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; It does not work for a poison mine and bouncing betty in Jaymod.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (entity)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; 1 if the dynamite/mine can be armed, 0 if the dynamite is ticking or the mine is activated.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 if(b.GetExplosiveState(TargetEntity) == 1 ) { &lt;br /&gt;
 }&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====GetMG42Info====&lt;br /&gt;
Gets information about currently mounted MG42 - vector CenterFacing and angles MinHorizontal, MaxHorizontal, MinVertical, MaxVertical.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (table)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; true if info has been stored into table&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====GetMountedPlayerOnMG42====&lt;br /&gt;
Gets player who is mounting MG42.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (mg42Entity)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; player&#039;s entity or null&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====GetReinforceTime====&lt;br /&gt;
Gets the current time left(in seconds) before reinforcements spawn for the bots team.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; seconds left till reinforcements spawn&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 if(b.GetReinforceTime() &amp;lt; 2)&lt;br /&gt;
 {&lt;br /&gt;
     // 2 seconds to reinforcements&lt;br /&gt;
 }&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====GetSkills====&lt;br /&gt;
Gets the current skill values and puts them into the table parameter.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (table)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 skills = table();&lt;br /&gt;
 b.GetSkills(skills);&lt;br /&gt;
 print(&amp;quot;Battle Sense:&amp;quot;, skills[SKILL.BATTLE_SENSE]);&lt;br /&gt;
 print(&amp;quot;Engineering:&amp;quot;, skills[SKILL.ENGINEERING]);&lt;br /&gt;
 print(&amp;quot;First Aid:&amp;quot;, skills[SKILL.FIRST_AID]);&lt;br /&gt;
 print(&amp;quot;Signals:&amp;quot;, skills[SKILL.SIGNALS]);&lt;br /&gt;
 print(&amp;quot;Light Weapons:&amp;quot;, skills[SKILL.LIGHT_WEAPONS]);&lt;br /&gt;
 print(&amp;quot;Heavy Weapons:&amp;quot;, skills[SKILL.HEAVY_WEAPONS]);&lt;br /&gt;
 print(&amp;quot;Coverops:&amp;quot;, skills[SKILL.COVERTOPS]); &amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;See Also:&#039;&#039;&#039; [[SKILL]]&lt;br /&gt;
----&lt;br /&gt;
====GetStat====&lt;br /&gt;
Gets a current stat from the bot by name.  Valid stat names for ET are kills, deaths and xp.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (string) the stat name&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; the value of the stat&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 xp = b.GetStat(&amp;quot;xp&amp;quot;);&lt;br /&gt;
 print(&amp;quot;Bot xp value is&amp;quot;,xp);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====IsMG42Repairable====&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (mg42Entity)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; true if mg42 is damaged and can be repaired&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
====TeamLandminesAvailable====&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; remaining count of team landmines&lt;br /&gt;
&lt;br /&gt;
----&lt;/div&gt;</summary>
		<author><name>Palota</name></author>
	</entry>
	<entry>
		<id>https://mygamingtalk.com/wiki/index.php?title=Bot&amp;diff=1746</id>
		<title>Bot</title>
		<link rel="alternate" type="text/html" href="https://mygamingtalk.com/wiki/index.php?title=Bot&amp;diff=1746"/>
		<updated>2025-05-13T08:33:29Z</updated>

		<summary type="html">&lt;p&gt;Palota: /* GetFacing */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{process header&lt;br /&gt;
 | title    = Bot Functions&lt;br /&gt;
 | section  =&lt;br /&gt;
 | previous = [[Omni-bot_Script_Reference | Script Reference]]&lt;br /&gt;
 | next     = &lt;br /&gt;
 | shortcut =&lt;br /&gt;
 | notes    =&lt;br /&gt;
}}&lt;br /&gt;
{{TOCright}}&lt;br /&gt;
==Bot Properties==&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Unless otherwise noted, all properties can be get and set.&lt;br /&gt;
&lt;br /&gt;
=== AimDamping ===&lt;br /&gt;
Effects the acceleration and turn rate.&lt;br /&gt;
=== AimPersistance ===&lt;br /&gt;
The time(in seconds) the bot will continue to aim at the last position of a target before aborting.&lt;br /&gt;
=== AimStiffness ===&lt;br /&gt;
Effects the acceleration of turning.&lt;br /&gt;
=== AimTolerance ===&lt;br /&gt;
The tolerance(in degrees) the bot tries to aim at stuff with.&lt;br /&gt;
=== Armor ===&lt;br /&gt;
Current Armor&lt;br /&gt;
=== FieldOfView ===&lt;br /&gt;
The angle(in degrees) the bot is capable of &#039;seeing&#039;.&lt;br /&gt;
=== Health ===&lt;br /&gt;
Current health.&lt;br /&gt;
=== MaxArmor ===&lt;br /&gt;
Max Armor&lt;br /&gt;
=== MaxHealth ===&lt;br /&gt;
Max Health&lt;br /&gt;
=== MaxTurnSpeed ===&lt;br /&gt;
The maximum speed(in degrees/second) the bot can rotate his aim at.&lt;br /&gt;
=== MaxViewDistance ===&lt;br /&gt;
The max distance(in game units) the bot is capable of seeing.&lt;br /&gt;
=== MemorySpan ===&lt;br /&gt;
The time(in seconds) taken for the memory about an entity to become stale.&lt;br /&gt;
=== Name ===&lt;br /&gt;
Name of the bot.&lt;br /&gt;
&lt;br /&gt;
=== ReactionTime ===&lt;br /&gt;
The time(in seconds) it takes the bot to begin responding to a newly sensed threat.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== Enemy Territory Addendum ===&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== DoNotKill ====&lt;br /&gt;
Set it to true to prevent medics to kill the bot for revive. It is used by BUILD, PLANT and PLANTMINE goals.&lt;br /&gt;
==== TargetBreakableDist ====&lt;br /&gt;
The maximum distance (in game units) the bot will attempt to target breakable entities. It can be set by [[Pre-Scripted_Regions#BreakableDistance|pre-scripted trigger region]] or inside [[Creating_a_script|OnBotJoin]] function.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==Bot Functions==&lt;br /&gt;
----&lt;br /&gt;
===AddScriptGoal===&lt;br /&gt;
Adds a goal to the bots behavior tree by name. Useful when a script goal has AutoAdd set to false, so you can more explicitly control when a bot gets the goal.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (name of script goal to add to bot behavior tree)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; true on success, false on failure&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 b.AddScriptGoal(&amp;quot;TestBot&amp;quot;);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
===RemoveState===&lt;br /&gt;
Removes a state from a bots behavior tree by name.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (name of script goal to remove from bot behavior tree)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 b.RemoveState(&amp;quot;TestBot&amp;quot;);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
===SetStateEnabled===&lt;br /&gt;
Enables/Disables a state by name.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (name of state, bool enable)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 b.SetStateEnabled(&amp;quot;Attack&amp;quot;, false); // disable attack state&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===CanGrabItem===&lt;br /&gt;
Returns true if bot can take item (flag, gold, radar parts, ...).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (GameEntity)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (FLAG or FLAG_dropped goal name)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; true/false&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 if (b.CanGrabItem(&amp;quot;FLAG_gold&amp;quot;)) {&lt;br /&gt;
 }&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===ChangeClass===&lt;br /&gt;
Changes the bot to a specified class.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (classId)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 b.ChangeClass(CLASS.SOLDIER);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===ChangeTeam===&lt;br /&gt;
Changes the bot to a specified team.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (teamId)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 b.ChangeTeam(TEAM.AXIS);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===ClearRoles===&lt;br /&gt;
Takes away a role from the bot.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; roleId&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 b.ClearRoles(ROLE.ATTACKER);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;See Also:&#039;&#039;&#039; &lt;br /&gt;
[[Bot#SetRoles| SetRoles]], [[Bot#HasRole| HasRole]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===DisableBotPush===&lt;br /&gt;
Used by [[Pre-Scripted_Regions#DisableBotPush|pre-scripted trigger region]].&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (true/false)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 b.DisableBotPush(true);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===DistanceTo===&lt;br /&gt;
Overloaded utility function for simplified distance checks.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (Vector3, notUseEyePosition&amp;lt;default false&amp;gt;) &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (MapGoal, notUseEyePosition&amp;lt;default false&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (GameEntity/GameId, notUseEyePosition&amp;lt;default false&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; float - distance from bot to Vector3, MapGoal, GameEntity or GameId&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 v = Vector3(10,20,30);&lt;br /&gt;
 target = b.GetTarget();&lt;br /&gt;
 // distance from bot to target entity&lt;br /&gt;
 d1 = b.DistanceTo(target, true);&lt;br /&gt;
 // distance from bot to world position&lt;br /&gt;
 d2 = b.DistanceTo(v, true);&lt;br /&gt;
 // distance from bot eye to world position&lt;br /&gt;
 d3 = b.DistanceTo(v);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===DumpBotTable===&lt;br /&gt;
Dumps a file with the bot&#039;s table to a file in the user folder.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (filename)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 b.DumpBotTable(&amp;quot;foo.txt&amp;quot;);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===Enable===&lt;br /&gt;
Disables all thinking for the bot.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (true/false)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 b.Enable(false);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===ExecCommand===&lt;br /&gt;
Executes a string command on the bot as if the bot executed a console command.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (command)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 b.ExecCommand(&amp;quot;kill&amp;quot;);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===Weapons/Ammo===&lt;br /&gt;
====CanSnipe====&lt;br /&gt;
It&#039;s deprecated and has been replaced by Util.CanBotSnipe(bot) in Enemy Territory.&lt;br /&gt;
&lt;br /&gt;
Checks if the bot can snipe based on the internally implemented snipe checks. Vary by game. Typically involves checking if the bot has a snipe enabled weapon and has ammo.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; true if the bot can snipe, else false&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 if(b.CanSnipe()) {}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====EnableShooting====&lt;br /&gt;
Disables all shooting for the bot.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (true/false)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 b.EnableShooting(false);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
====GetWeapon====&lt;br /&gt;
Gets a reference to a specific weapon from the bot.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (weaponId)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; [[Weapon]] reference, or NULL if the bot doesn&#039;t have the weapon.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 wpn = b.GetWeapon(WEAPON.SHOTGUN);&lt;br /&gt;
 wpn.PrimaryFire.AimOffset = Vector3(0,0,10);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
====GetBestWeapon====&lt;br /&gt;
Gets a weapon id for the best weapon versus current target or a specific entity.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none - uses current target&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (entity) evaluate weapon versus specific target entity&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; weapon id of weapon that is chosen.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 best = b.GetBestWeapon();&lt;br /&gt;
 // OR&lt;br /&gt;
 best = b.GetBestWeapon(someEnt);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
====GetRandomWeapon====&lt;br /&gt;
Gets a random weapon id from the list of weapons the bot currently has.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; random weapon id&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 randwpn = b.GetRandomWeapon();&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====GetCurrentWeapon====&lt;br /&gt;
Gets the current weapon id for the bot.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; weapon Id for bot&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 mywpn = b.GetCurrentWeapon();&lt;br /&gt;
 if(mywpn == WEAPON.SHOTGUN)&lt;br /&gt;
 {&lt;br /&gt;
 }&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
====GetCurrentAmmo====&lt;br /&gt;
Gets the ammo information for a weapon.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (table)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (table, firemode)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (table, firemode, weaponId)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; true if successful, false if not&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 ammoTable = {};&lt;br /&gt;
 // Get primary ammo for current weapon&lt;br /&gt;
 b.GetCurrentAmmo(ammoTable);&lt;br /&gt;
 // Get secondary ammo for current weapon&lt;br /&gt;
 b.GetCurrentAmmo(ammoTable, 1);&lt;br /&gt;
 // Get primary ammo for another weapon.&lt;br /&gt;
 b.GetCurrentAmmo(ammoTable, 0, WEAPON.SHOTGUN);&lt;br /&gt;
&lt;br /&gt;
 print(&amp;quot;Current Ammo:&amp;quot;, ammoTable.CurrentAmmo);&lt;br /&gt;
 print(&amp;quot;Max Ammo:&amp;quot;, ammoTable.MaxAmmo);&lt;br /&gt;
 print(&amp;quot;Current Clips:&amp;quot;, ammoTable.CurrentClip);&lt;br /&gt;
 print(&amp;quot;Max Clips:&amp;quot;, ammoTable.MaxClip);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====GetMostDesiredAmmo====&lt;br /&gt;
Gets information about the currently most needed ammo.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (table)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
* AmmoType - weapon ID&lt;br /&gt;
* Desire - [[Weapon#LowAmmoPriority|LowAmmoPriority]]; It will be zero if bot has more ammo than  [[Weapon#LowAmmoThreshold|LowAmmoThreshold]]&lt;br /&gt;
* GetAmmo - [[Weapon#LowAmmoGetAmmoAmount|LowAmmoGetAmmoAmount]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 mostNeededAmmo = {};&lt;br /&gt;
 b.GetMostDesiredAmmo(mostNeededAmmo);&lt;br /&gt;
 if( mostNeededAmmo.Desire &amp;gt; 0) {&lt;br /&gt;
  print(&amp;quot;Need ammo for weapon&amp;quot;, Util.WeaponName(mostNeededAmmo.AmmoType));&lt;br /&gt;
 }&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====FireWeapon====&lt;br /&gt;
Fires the current weapon.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 b.FireWeapon();&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
====HasAmmo====&lt;br /&gt;
Checks if the bot has a certain ammo type.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; () - If no parameters passed, checks current weapon ammo.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (WeaponId)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (WeaponId, needed amount)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; true/false if the bot has ammo.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 if(b.HasAmmo())&lt;br /&gt;
 {&lt;br /&gt;
 }&lt;br /&gt;
 if(b.HasAmmo(WEAPON.MP40))&lt;br /&gt;
 {&lt;br /&gt;
 }&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====HasAnyWeapon====&lt;br /&gt;
Checks if the bot has any of specified weapons. Table keys are weaponIDs, table values should be set to true.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (weapons, options&amp;lt;optional&amp;gt;, weaponList&amp;lt;optional&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
The second parameter is table which has items CheckAmmo and CheckCharged. Both options are true by default.&lt;br /&gt;
&lt;br /&gt;
The third parameter is empty table to store all results.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; weaponId if the bot has that weapon, 0 if the bot does not have any weapon from the list.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 weapons = table();&lt;br /&gt;
 weapons[WEAPON.MP40] = true;&lt;br /&gt;
 weapons[WEAPON.THOMPSON] = true;&lt;br /&gt;
 weapon = b.HasAnyWeapon(weapons, { CheckAmmo=true, CheckCharged=false } );&lt;br /&gt;
 if (weapon) {&lt;br /&gt;
 }&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====HasWeapon====&lt;br /&gt;
Checks if the bot has a specific weapon.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (weaponId)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; true if the bot has it, false if not.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 if(b.HasWeapon(WEAPON.SHOTGUN))&lt;br /&gt;
 {&lt;br /&gt;
 }&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
====IsWeaponCharged====&lt;br /&gt;
Checks if a weapon is &#039;&#039;charged&#039;&#039;. A charged weapon is one that is capable of being used that might occasionally be unavailable for use due to lack of character &#039;charge&#039;, whether that be a gameplay charge bar, stamina, skill, etc.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (weaponId, firemode&amp;lt;optional&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; true if weapon is charged, false if not.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 if(b.IsWeaponCharged(WEAPON.MORTAR, 0))&lt;br /&gt;
 {&lt;br /&gt;
 }&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===GetAllAlly===&lt;br /&gt;
Fills a table with all known allied entities (from bot&#039;s sensory memory) that match a desired criteria.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (category, class, table)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 // Get all known soldier players.&lt;br /&gt;
 players = table();&lt;br /&gt;
 b.GetAllAlly(CAT.PLAYER, CLASS.SOLDIER, players);&lt;br /&gt;
 foreach ( ent in players )&lt;br /&gt;
 {&lt;br /&gt;
     print(ent);&lt;br /&gt;
 }&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===GetAllEnemy===&lt;br /&gt;
Fills a table with all known enemy entities (from bot&#039;s sensory memory) that match a desired criteria.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (category, class, table)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 // Get all known soldier players.&lt;br /&gt;
 players = table();&lt;br /&gt;
 b.GetAllEnemy(CAT.PLAYER, CLASS.SOLDIER, players);&lt;br /&gt;
 foreach ( ent in players )&lt;br /&gt;
 {&lt;br /&gt;
     print(ent);&lt;br /&gt;
 }&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===GetAllType===&lt;br /&gt;
Fills a table with all known entities (from bot&#039;s sensory memory) that match a desired criteria.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (category, class, table)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 // Get all known soldier players.&lt;br /&gt;
 players = table();&lt;br /&gt;
 b.GetAllType(CAT.PLAYER, CLASS.SOLDIER, players);&lt;br /&gt;
 foreach ( ent in players )&lt;br /&gt;
 {&lt;br /&gt;
     print(ent);&lt;br /&gt;
 }&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===GetClass===&lt;br /&gt;
Gets the current class id for the bot.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; class Id for bot&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 myclass = b.GetClass();&lt;br /&gt;
 if(myClass == CLASS.SOLDIER)&lt;br /&gt;
 {&lt;br /&gt;
 }&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===GetEyePosition===&lt;br /&gt;
Gets the world position of the bots &#039;eye&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; Vector3 eye position&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 eyepos = b.GetEyePosition();&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===GetFacing===&lt;br /&gt;
Gets the facing vector for the bots aim. This method is fast, but can return incorrect value if the aim request is restricted by the game or mod (for example after revive). You can use function GetEntFacing to get correct facing.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; Vector3 facing vector&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 facing = b.GetFacing();&lt;br /&gt;
 pointinfront = b.GetEyePosition() + facing * 100;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===GetGameEntity===&lt;br /&gt;
Gets the game entity for the bot.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; entity&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 ent = b.GetGameEntity();&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===GetGameId===&lt;br /&gt;
Gets the game id for the bot.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; entity&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 gameid = b.GetGameId();&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===GetHealthPercent===&lt;br /&gt;
Gets the bot&#039;s current health percentage.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; 0.0 - 1.0 health scalar&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 if(bot.GetHealthPercent() &amp;lt; 0.5) &lt;br /&gt;
 {&lt;br /&gt;
     // &amp;lt; 50% health&lt;br /&gt;
 }&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
===GetHighLevelGoalName===&lt;br /&gt;
Gets the bot&#039;s current high level goal name.&lt;br /&gt;
&lt;br /&gt;
Examples: UseCabinet, WatchForProjectile, CovertOps, BUILD, PLANT, CAMP, SWITCH, ROAMING, ...&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Some goal names changed after they were moved to scripts.&lt;br /&gt;
&lt;br /&gt;
Goals in 0.81: DefuseDynamite, ReviveTeammate, TakeCheckPoint, RepairMg42&lt;br /&gt;
&lt;br /&gt;
Goals in 0.82: DEFUSE, REVIVE, CHECKPOINT, REPAIRMG42&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Goals in 0.83: CaptureTheFlag, ReturnTheFlag, MobileMortar, PlantMine, CallArtillery&lt;br /&gt;
&lt;br /&gt;
Goals in 0.84: FLAG, FLAGRETURN, MOBILEMORTAR, PLANTMINE, CALLARTILLERY&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; goal name, or NULL if the bot doesn&#039;t have a high level goal.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 g = bot.GetHighLevelGoalName();&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===GetMapGoalName===&lt;br /&gt;
Gets the bot&#039;s current map goal name (for example: BUILD_Tank, DEFEND_depot1, ...).&lt;br /&gt;
&lt;br /&gt;
Returns NULL if the current high level goal is ROAMING, WatchForProjectile or CovertOps.&lt;br /&gt;
&lt;br /&gt;
Note: This function has been added in 0.82.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; goal name or NULL.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 g = bot.GetMapGoalName();&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===GetLastTarget===&lt;br /&gt;
Gets the target the bot had before the current target.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; entity OR null&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 last = b.GetLastTarget();&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===GetNearest===&lt;br /&gt;
Gets the nearest target matching the desired criteria, friend or foe.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (category)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (category, classId)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (category, table of classIds)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; entity OR null&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 // get nearest player, defaults to any class within that category&lt;br /&gt;
 p = b.GetNearest(CAT.PLAYER);&lt;br /&gt;
 // get nearest soldier or medic player&lt;br /&gt;
 s = b.GetNearest(CAT.PLAYER, {CLASS.SOLDIER, CLASS.MEDIC});&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===GetNearestAlly===&lt;br /&gt;
Gets the nearest target matching the desired criteria, only allies&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (category)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (category, classId)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (category, table of classIds)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; entity OR null&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 // get nearest player, defaults to any class within that category&lt;br /&gt;
 p = b.GetNearestAlly(CAT.PLAYER);&lt;br /&gt;
 // get nearest soldier player&lt;br /&gt;
 s = b.GetNearestAlly(CAT.PLAYER, CLASS.SOLDIER);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===GetNearestEnemy===&lt;br /&gt;
Gets the nearest target matching the desired criteria, only enemies&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (category)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (category, classId)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (category, table of classIds)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; entity OR null&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 // get nearest player, defaults to any class within that category&lt;br /&gt;
 p = b.GetNearestEnemy(CAT.PLAYER);&lt;br /&gt;
 // get nearest soldier player&lt;br /&gt;
 s = b.GetNearestEnemy(CAT.PLAYER, CLASS.SOLDIER);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== GetNearestDestination ===&lt;br /&gt;
Finds paths from the current bot position to multiple destination positions. Returns index of the destination which has the shortest path. It can depend on navigation flags (e.g. teleports, axis/allied waypoints).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (table of vectors)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; index OR null&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 positions = { Vec3(105,4564,0), Vec3(-48,1234,0) };&lt;br /&gt;
 id = bot.GetNearestDestination(positions);&lt;br /&gt;
 if(typeId(id)==0)&lt;br /&gt;
 {&lt;br /&gt;
 	print(&amp;quot;path not found&amp;quot;);&lt;br /&gt;
 }else{&lt;br /&gt;
 	print(&amp;quot;path found to destination&amp;quot;, positions[id]);&lt;br /&gt;
 }&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===GetPosition===&lt;br /&gt;
Gets the world position of the bot.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; Vector3 world position&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 mypos = b.GetPosition();&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===GetTarget===&lt;br /&gt;
Gets the current target.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; entity OR null&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 target = b.GetTarget();&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===GetTargetInfo===&lt;br /&gt;
Returns the [[TargetInfo]] for an entity.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (entity/gameId)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; [[TargetInfo]] for entity.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 ti = b.GetTargetInfo(b.GetTarget());&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===GetTeam===&lt;br /&gt;
Gets the current team the bot is on.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; team #&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 myteam = b.GetTeam();&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;See also:&#039;&#039;&#039; [[TEAM]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===GetVelocity===&lt;br /&gt;
Gets the world velocity of the bot. The bot must be alive. It returns wrong vector if the bot is injured.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; Vector3 world velocity &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 myvel = b.GetVelocity();&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===HasTarget===&lt;br /&gt;
Checks if the bot has a current target&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; true if bot has a target&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 if(b.HasTarget())&lt;br /&gt;
 {&lt;br /&gt;
 }&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===HasAnyEntityFlag===&lt;br /&gt;
Checks if the bot has a given entity flag. This function can take any number of flags to check, and will return true if the bot has at least one of the flags, or false if it doesn&#039;t have any of them.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (entityflag, ...)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; true if bot has any flag, false if not&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 // checking 1 flag&lt;br /&gt;
 if(b.HasAnyEntityFlag(ENTFLAG.ZOOMING))&lt;br /&gt;
 {&lt;br /&gt;
 }&lt;br /&gt;
 // checking multiple flags.&lt;br /&gt;
 if(b.HasAnyEntityFlag(ENTFLAG.MOUNTED, ENTFLAG.ON_LADDER))&lt;br /&gt;
 {&lt;br /&gt;
 }&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===HasEntityFlag===&lt;br /&gt;
Checks if the bot has a given entity flag. This function can take any number of flags to check, and will return true if the bot has all the flags, or false if it is missing any.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (entityflag, ...)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; true if bot has all flags, false if not&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 // checking 1 flag&lt;br /&gt;
 if(b.HasEntityFlag(ENTFLAG.RELOADING))&lt;br /&gt;
 {&lt;br /&gt;
 }&lt;br /&gt;
 // checking multiple flags.&lt;br /&gt;
 if(b.HasEntityFlag(ENTFLAG.INWATER, ENTFLAG.UNDERWATER))&lt;br /&gt;
 {&lt;br /&gt;
 }&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===HasLineOfSightTo===&lt;br /&gt;
This functions checks whether the bot has line of sight to a 3d position. This function does not account for field of view, simply does a raycast for obstructions between the bots eye position and the provided position. To account for field of view, use [[Bot#InFieldOfView|InFieldOfView]]. If an entity or gameId is provided as the 2nd parameter, the function will return true if the raycast hits nothing on its way to the position OR if it hits the entity that is passed.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (Vector3 position)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (Vector3 position, entity)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; true if the bot has line of sight to the position or entity passed. false if the bot&#039;s view is obstructed.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; This function calls  [[Bot_Library#TraceLine|TraceLine]] with parameter TRACE.SHOT | TRACE.SMOKEBOMB&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 if(b.HasLineOfSightTo( Vec3(30,50,10) ))&lt;br /&gt;
 {&lt;br /&gt;
 }&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===HasPowerUp===&lt;br /&gt;
Checks if the bot has a given powerup. This function can take any number of flags to check, and will return true if the bot has all the flags, or false if it is missing any.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (powerup, ...)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; true if bot has all powerups, false if not&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 // checking 1 flag&lt;br /&gt;
 if(b.HasPowerUp(POWERUP.INVINCIBLE))&lt;br /&gt;
 {&lt;br /&gt;
 }&lt;br /&gt;
 // checking multiple flags.&lt;br /&gt;
 if(b.HasPowerUp(POWERUP.INVINCIBLE, POWERUP.QUADDAMAGE))&lt;br /&gt;
 {&lt;br /&gt;
 }&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===HasRole===&lt;br /&gt;
Checks if the bot has a specific role or any role.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; roleId &amp;lt;optional&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; true if the bot has role, false if not.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 if(b.HasRole(ROLE.INFILTRATOR)){&lt;br /&gt;
 }&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;See Also:&#039;&#039;&#039; &lt;br /&gt;
[[Bot#ClearRoles| ClearRoles]], [[Bot#SetRoles| SetRoles]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===HoldButton===&lt;br /&gt;
Makes the bot &#039;press&#039; a button, and hold it for an amount of time. This function can take any number of buttons as parameters, and will apply the effect to all of them. The time value is &#039;&#039;&#039;ALWAYS&#039;&#039;&#039; the last parameter.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (buttonId, ..., time in seconds)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 // hold crouch for 5 seconds&lt;br /&gt;
 b.HoldButton(BTN.CROUCH, 5);&lt;br /&gt;
 // hold multiple buttons for 5 seconds&lt;br /&gt;
 b.HoldButton(BTN.CROUCH, BTN.SPRINT, 5);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;See Also:&#039;&#039;&#039; [[Bot#PressButton| PressButton]], [[Bot#ReleaseButton| ReleaseButton]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===IgnoreTarget===&lt;br /&gt;
This function causes the bot to ignore specific entities for targeting for some duration of time.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (entity/gameId or goal name or table, seconds to ignore &amp;lt;optional&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 // ignore the entity, so the bot won&#039;t shoot at it.&lt;br /&gt;
 bot.IgnoreTarget(&amp;quot;MOVER_bird1&amp;quot;);&lt;br /&gt;
 bot.IgnoreTarget(Map.Movers);&lt;br /&gt;
 bot.IgnoreTarget(GetLocalEntity(), 100);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;See also:&#039;&#039;&#039; [[Bots shooting map objects]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===InFieldOfView===&lt;br /&gt;
Checks whether a position is within the bots current [[Bot#FieldOfView | FieldOfView]]. This function can take an optional field of view(in degrees) to check. If not provided, it will use the bots current [[Bot#FieldOfView | FieldOfView]].&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (Vector3 position)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (Vector3 position, fov angles)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; Vector3 - center point of the AABB.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 v = Vector3(10,10,10);&lt;br /&gt;
 // check if in default field of view&lt;br /&gt;
 if(b.InFieldOfView(v))&lt;br /&gt;
 {&lt;br /&gt;
 }&lt;br /&gt;
 // check if in custom field of view&lt;br /&gt;
 if(b.InFieldOfView(v, 180))&lt;br /&gt;
 {&lt;br /&gt;
 }&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===IsAllied===&lt;br /&gt;
Checks if the bot is allied with a given entity.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (entity/gameId)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; true if allied, false if not.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 if(b.IsAllied(someentity))&lt;br /&gt;
 {&lt;br /&gt;
 }&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===IsCarryingFlag===&lt;br /&gt;
Checks if the bot is carrying objective (flag, gold, documents, radar parts, ...).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; true/false&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 if(b.IsCarryingFlag())&lt;br /&gt;
 {&lt;br /&gt;
 }&lt;br /&gt;
 &amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
===IsStuck===&lt;br /&gt;
Checks if the bot considers himself to be stuck. Stuckness is typically defined as an insignificant amount of movement over a short period of time. The time can be optionally passed to the function for flexibility.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; () - If no params passed, the time used is 0.5 seconds.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (time in seconds)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; true if bot is &#039;&#039;stuck&#039;&#039;, false if not.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 if(b.IsStuck())&lt;br /&gt;
 {&lt;br /&gt;
 }&lt;br /&gt;
 // or check stuckness for 1.5 seconds.&lt;br /&gt;
 if(b.IsStuck(1.5))&lt;br /&gt;
 {&lt;br /&gt;
 }&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===MoveTowards===&lt;br /&gt;
Causes the bot to blindly move towards a target. This function does no path finding. It&#039;s primary use is short range movement when you are reasonably sure the bot can run right at the target.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (Vector3 position) - if distance tolerance not specified, default of 32 units is used.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (Vector3 position, distance tolerance)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; true if the bot is within the distance tolerance, false if not.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 // get within 64 units of this position&lt;br /&gt;
 v = Vector3(10,10,10);&lt;br /&gt;
 while(b.MoveTowards(v, 64) == false)&lt;br /&gt;
 {&lt;br /&gt;
     yield();&lt;br /&gt;
 } &amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===PressButton===&lt;br /&gt;
Makes the bot &#039;press&#039; a button. This function can take any number of buttons as parameters, and will apply the effect to all of them. Buttons that are &#039;&#039;pressed&#039;&#039; using this function are released automatically for the next bot update.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (buttonId, ...)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 // press crouch&lt;br /&gt;
 b.PressButton(BTN.CROUCH);&lt;br /&gt;
 // press multiple buttons&lt;br /&gt;
 b.PressButton(BTN.CROUCH, BTN.SPRINT);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;See Also:&#039;&#039;&#039; [[Bot#HoldButton | HoldButton]], [[Bot#ReleaseButton| ReleaseButton]]&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===ReleaseButton===&lt;br /&gt;
Makes the bot &#039;release&#039; a button. This function can take any number of buttons as parameters, and will apply the effect to all of them. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (buttonId, ...)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 // release crouch&lt;br /&gt;
 b.ReleaseButton(BTN.CROUCH);&lt;br /&gt;
 // release multiple buttons&lt;br /&gt;
 b.ReleaseButton(BTN.CROUCH, BTN.SPRINT);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;See Also:&#039;&#039;&#039; [[Bot#HoldButton | HoldButton]], [[Bot#PressButton| PressButton]]&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===ReloadProfile===&lt;br /&gt;
Reloads the bots profile. The profile is any script associated with the bots name.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 b.ReloadProfile();&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===ResetStuckTime===&lt;br /&gt;
Reset the stuck timer.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 b.ResetStuckTime();&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===Say===&lt;br /&gt;
Chat function used for bots to &#039;&#039;say&#039;&#039; messages through the normal chat channels of the game. For flexibility, this function can take any number and type of parameters, which it will convert to a single long string and use as the chat message.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (string, ...)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 b.Say(&amp;quot;My name is &amp;quot;, b.Name);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;See Also:&#039;&#039;&#039; &lt;br /&gt;
[[Bot#SayTeam| SayTeam]], [[Bot#SayVoice| SayVoice]]&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===SayTeam===&lt;br /&gt;
Chat function used for bots to &#039;&#039;say&#039;&#039; messages through the team chat channel of the game. For flexibility, this function can take any number and type of parameters, which it will convert to a single long string and use as the chat message.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (string, ...)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 b.SayTeam(&amp;quot;My name is &amp;quot;, b.Name);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;See Also:&#039;&#039;&#039; &lt;br /&gt;
[[Bot#Say| Say]], [[Bot#SayVoice| SayVoice]]&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===SayVoice===&lt;br /&gt;
Broadcasts a voice macro to the game. Used with global [[VOICE]] table values.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (macroId)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 b.SayVoice(VOICE.NEED_MEDIC);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;See Also:&#039;&#039;&#039; &lt;br /&gt;
[[Bot#Say| Say]], [[Bot#SayTeam| SayTeam]]&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===ScriptEvent===&lt;br /&gt;
Sends [[EVENT#SCRIPTMSG|SCRIPTMSG]] event.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (name, param1, param2, param3)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===SetDebugFlag===&lt;br /&gt;
Enables a debug flag for the bot. See the global [[DEBUG]] table for available options. Enabling debug flags typically cause various debug visualizations to render in order to help identify whats going on with various systems of the bot.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (flag, true/false to enable)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 b.SetDebugFlag(DEBUG.AIM, true);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===SetRoles===&lt;br /&gt;
Assign a role to the bot.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; roleId&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 b.SetRoles(ROLE.DEFENDER);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;See Also:&#039;&#039;&#039; &lt;br /&gt;
[[Bot#ClearRoles| ClearRoles]], [[Bot#HasRole| HasRole]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===ToLocalSpace===&lt;br /&gt;
Converts a vector into local bot space. This results in a position relative to the bots current position and rotation. This function is useful for simplifying some types of logic.&lt;br /&gt;
&lt;br /&gt;
* x axis is side to side.&lt;br /&gt;
* y axis is forward and back.&lt;br /&gt;
* z axis is up and down.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (Vector3)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; Vector3 local space position.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 v = Vector3(4356,342,276); // some world position.&lt;br /&gt;
 v2 = b.ToLocalSpace(v);&lt;br /&gt;
 if(v2.y &amp;lt; 0)&lt;br /&gt;
 {&lt;br /&gt;
     // the position is behind the bot.&lt;br /&gt;
 }&lt;br /&gt;
 if(v2.x &amp;lt; 0)&lt;br /&gt;
 {&lt;br /&gt;
     // the position is to the right of the bot&lt;br /&gt;
 }&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===ToWorldSpace===&lt;br /&gt;
Converts a vector from local bot space to world space. &lt;br /&gt;
&lt;br /&gt;
* x axis is side to side.&lt;br /&gt;
* y axis is forward and back.&lt;br /&gt;
* z axis is up and down.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (Vector3)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; Vector3 world space position.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 // slightly forward and to the right.&lt;br /&gt;
 v = Vector3(10,10,0);&lt;br /&gt;
 v2 = b.ToWorldSpace(v);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Enemy Territory Addendum===&lt;br /&gt;
&lt;br /&gt;
====ChangePrimaryWeapon====&lt;br /&gt;
Selects a new primary weapon for the bot. Should take effect next spawn. You must not use this function inside map scripts. You should use [[Utility_Functions#WeaponTable.SetWeaponAvailability|SetWeaponAvailability]] if you want to disable some weapons.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (weaponId)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; true if successful, false if not&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 b.ChangePrimaryWeapon(WEAPON.PANZERFAUST);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;See Also:&#039;&#039;&#039; &lt;br /&gt;
[[Bot#ChangeSecondaryWeapon| ChangeSecondaryWeapon]]&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====ChangeSecondaryWeapon====&lt;br /&gt;
Selects a new secondary weapon for the bot. Should take effect next spawn.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (weaponId)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; true if successful, false if not&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 b.ChangeSecondaryWeapon(WEAPON.LUGER);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;See Also:&#039;&#039;&#039; &lt;br /&gt;
[[Bot#ChangePrimaryWeapon| ChangePrimaryWeapon]]&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====ChangeSpawnPoint====&lt;br /&gt;
Changes the desired spawn point for the bot to respawn at.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (spawnpoint #)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 b.ChangeSpawnPoint(2); &amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====GetConstructableState====&lt;br /&gt;
Check state of a BUILD goal.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (entity)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; 1 if the bot can build the entity, 0 if the entity is already built, -1 if the entity is not constructable or has been built by enemy.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 if(b.GetConstructableState(TargetEntity) &amp;lt; 1 ) { &lt;br /&gt;
 }&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====GetCursorHint====&lt;br /&gt;
When a player is near enough something to get a hint icon, such as for dynamiting, this function can access what hint is showing. Some of these hints may or may not ever show up, they were taken as-is from the ET SDK.&lt;br /&gt;
&lt;br /&gt;
* NONE - 0&lt;br /&gt;
* PLAYER - 1 &lt;br /&gt;
* ACTIVATE - 2 &lt;br /&gt;
* DOOR - 3&lt;br /&gt;
* DOOR_ROTATING - 4&lt;br /&gt;
* DOOR_LOCKED - 5&lt;br /&gt;
* DOOR_ROTATING_LOCKED - 6&lt;br /&gt;
* MG42 - 7&lt;br /&gt;
* BREAKABLE - 8&lt;br /&gt;
* BREAKABLE_DYNAMITE - 9&lt;br /&gt;
* CHAIR - 10&lt;br /&gt;
* ALARM - 11&lt;br /&gt;
* HEALTH - 12&lt;br /&gt;
* TREASURE - 13&lt;br /&gt;
* KNIFE - 14&lt;br /&gt;
* LADDER - 15&lt;br /&gt;
* BUTTON - 16&lt;br /&gt;
* WATER - 17&lt;br /&gt;
* CAUTION - 18&lt;br /&gt;
* DANGER - 19&lt;br /&gt;
* SECRET - 20&lt;br /&gt;
* QUESTION - 21&lt;br /&gt;
* EXCLAMATION - 22 &lt;br /&gt;
* CLIPBOARD - 23&lt;br /&gt;
* WEAPON - 24&lt;br /&gt;
* AMMO - 25&lt;br /&gt;
* ARMOR - 26&lt;br /&gt;
* POWERUP - 27&lt;br /&gt;
* HOLDABLE - 28&lt;br /&gt;
* INVENTORY - 29&lt;br /&gt;
* SCENARIC - 30&lt;br /&gt;
* EXIT - 31&lt;br /&gt;
* NOEXIT - 32&lt;br /&gt;
* PLYR_FRIEND - 33&lt;br /&gt;
* PLYR_NEUTRAL - 34&lt;br /&gt;
* PLYR_ENEMY - 35&lt;br /&gt;
* PLYR_UNKNOWN - 36&lt;br /&gt;
* BUILD - 37&lt;br /&gt;
* DISARM - 38&lt;br /&gt;
* REVIVE - 39&lt;br /&gt;
* DYNAMITE - 40&lt;br /&gt;
* CONSTRUCTIBLE - 41&lt;br /&gt;
* UNIFORM - 42&lt;br /&gt;
* LANDMINE - 43&lt;br /&gt;
* TANK - 44&lt;br /&gt;
* SATCHELCHARGE - 45&lt;br /&gt;
* LOCKPICK - 46&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (table)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 hint = table();&lt;br /&gt;
 b.GetCursorHint(hint);&lt;br /&gt;
&lt;br /&gt;
 print(hint.type); // one of the values above&lt;br /&gt;
 print(hint.value); // usually a health associated with certain types &amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====GetDestroyableState====&lt;br /&gt;
Check state of a PLANT goal.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (entity)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; 1 if the bot can destroy the entity, -1 if the entity is not destroyable or is friendly objective.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 if(b.GetDestroyableState(TargetEntity) &amp;lt; 1 ) { &lt;br /&gt;
 }&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====GetExplosiveState====&lt;br /&gt;
Check state of a dynamite, landmine or tripmine.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; It does not work for a poison mine and bouncing betty in Jaymod.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (entity)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; 1 if the dynamite/mine can be armed, 0 if the dynamite is ticking or the mine is activated.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 if(b.GetExplosiveState(TargetEntity) == 1 ) { &lt;br /&gt;
 }&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====GetMG42Info====&lt;br /&gt;
Gets information about currently mounted MG42 - vector CenterFacing and angles MinHorizontal, MaxHorizontal, MinVertical, MaxVertical.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (table)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; true if info has been stored into table&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====GetMountedPlayerOnMG42====&lt;br /&gt;
Gets player who is mounting MG42.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (mg42Entity)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; player&#039;s entity or null&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====GetReinforceTime====&lt;br /&gt;
Gets the current time left(in seconds) before reinforcements spawn for the bots team.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; seconds left till reinforcements spawn&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 if(b.GetReinforceTime() &amp;lt; 2)&lt;br /&gt;
 {&lt;br /&gt;
     // 2 seconds to reinforcements&lt;br /&gt;
 }&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====GetSkills====&lt;br /&gt;
Gets the current skill values and puts them into the table parameter.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (table)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 skills = table();&lt;br /&gt;
 b.GetSkills(skills);&lt;br /&gt;
 print(&amp;quot;Battle Sense:&amp;quot;, skills[SKILL.BATTLE_SENSE]);&lt;br /&gt;
 print(&amp;quot;Engineering:&amp;quot;, skills[SKILL.ENGINEERING]);&lt;br /&gt;
 print(&amp;quot;First Aid:&amp;quot;, skills[SKILL.FIRST_AID]);&lt;br /&gt;
 print(&amp;quot;Signals:&amp;quot;, skills[SKILL.SIGNALS]);&lt;br /&gt;
 print(&amp;quot;Light Weapons:&amp;quot;, skills[SKILL.LIGHT_WEAPONS]);&lt;br /&gt;
 print(&amp;quot;Heavy Weapons:&amp;quot;, skills[SKILL.HEAVY_WEAPONS]);&lt;br /&gt;
 print(&amp;quot;Coverops:&amp;quot;, skills[SKILL.COVERTOPS]); &amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;See Also:&#039;&#039;&#039; [[SKILL]]&lt;br /&gt;
----&lt;br /&gt;
====GetStat====&lt;br /&gt;
Gets a current stat from the bot by name.  Valid stat names for ET are kills, deaths and xp.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (string) the stat name&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; the value of the stat&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 xp = b.GetStat(&amp;quot;xp&amp;quot;);&lt;br /&gt;
 print(&amp;quot;Bot xp value is&amp;quot;,xp);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====IsMG42Repairable====&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (mg42Entity)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; true if mg42 is damaged and can be repaired&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
====TeamLandminesAvailable====&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; remaining count of team landmines&lt;br /&gt;
&lt;br /&gt;
----&lt;/div&gt;</summary>
		<author><name>Palota</name></author>
	</entry>
	<entry>
		<id>https://mygamingtalk.com/wiki/index.php?title=Bot&amp;diff=1745</id>
		<title>Bot</title>
		<link rel="alternate" type="text/html" href="https://mygamingtalk.com/wiki/index.php?title=Bot&amp;diff=1745"/>
		<updated>2025-02-10T19:09:02Z</updated>

		<summary type="html">&lt;p&gt;Palota: /* DistanceTo */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{process header&lt;br /&gt;
 | title    = Bot Functions&lt;br /&gt;
 | section  =&lt;br /&gt;
 | previous = [[Omni-bot_Script_Reference | Script Reference]]&lt;br /&gt;
 | next     = &lt;br /&gt;
 | shortcut =&lt;br /&gt;
 | notes    =&lt;br /&gt;
}}&lt;br /&gt;
{{TOCright}}&lt;br /&gt;
==Bot Properties==&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Unless otherwise noted, all properties can be get and set.&lt;br /&gt;
&lt;br /&gt;
=== AimDamping ===&lt;br /&gt;
Effects the acceleration and turn rate.&lt;br /&gt;
=== AimPersistance ===&lt;br /&gt;
The time(in seconds) the bot will continue to aim at the last position of a target before aborting.&lt;br /&gt;
=== AimStiffness ===&lt;br /&gt;
Effects the acceleration of turning.&lt;br /&gt;
=== AimTolerance ===&lt;br /&gt;
The tolerance(in degrees) the bot tries to aim at stuff with.&lt;br /&gt;
=== Armor ===&lt;br /&gt;
Current Armor&lt;br /&gt;
=== FieldOfView ===&lt;br /&gt;
The angle(in degrees) the bot is capable of &#039;seeing&#039;.&lt;br /&gt;
=== Health ===&lt;br /&gt;
Current health.&lt;br /&gt;
=== MaxArmor ===&lt;br /&gt;
Max Armor&lt;br /&gt;
=== MaxHealth ===&lt;br /&gt;
Max Health&lt;br /&gt;
=== MaxTurnSpeed ===&lt;br /&gt;
The maximum speed(in degrees/second) the bot can rotate his aim at.&lt;br /&gt;
=== MaxViewDistance ===&lt;br /&gt;
The max distance(in game units) the bot is capable of seeing.&lt;br /&gt;
=== MemorySpan ===&lt;br /&gt;
The time(in seconds) taken for the memory about an entity to become stale.&lt;br /&gt;
=== Name ===&lt;br /&gt;
Name of the bot.&lt;br /&gt;
&lt;br /&gt;
=== ReactionTime ===&lt;br /&gt;
The time(in seconds) it takes the bot to begin responding to a newly sensed threat.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== Enemy Territory Addendum ===&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== DoNotKill ====&lt;br /&gt;
Set it to true to prevent medics to kill the bot for revive. It is used by BUILD, PLANT and PLANTMINE goals.&lt;br /&gt;
==== TargetBreakableDist ====&lt;br /&gt;
The maximum distance (in game units) the bot will attempt to target breakable entities. It can be set by [[Pre-Scripted_Regions#BreakableDistance|pre-scripted trigger region]] or inside [[Creating_a_script|OnBotJoin]] function.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==Bot Functions==&lt;br /&gt;
----&lt;br /&gt;
===AddScriptGoal===&lt;br /&gt;
Adds a goal to the bots behavior tree by name. Useful when a script goal has AutoAdd set to false, so you can more explicitly control when a bot gets the goal.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (name of script goal to add to bot behavior tree)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; true on success, false on failure&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 b.AddScriptGoal(&amp;quot;TestBot&amp;quot;);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
===RemoveState===&lt;br /&gt;
Removes a state from a bots behavior tree by name.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (name of script goal to remove from bot behavior tree)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 b.RemoveState(&amp;quot;TestBot&amp;quot;);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
===SetStateEnabled===&lt;br /&gt;
Enables/Disables a state by name.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (name of state, bool enable)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 b.SetStateEnabled(&amp;quot;Attack&amp;quot;, false); // disable attack state&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===CanGrabItem===&lt;br /&gt;
Returns true if bot can take item (flag, gold, radar parts, ...).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (GameEntity)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (FLAG or FLAG_dropped goal name)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; true/false&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 if (b.CanGrabItem(&amp;quot;FLAG_gold&amp;quot;)) {&lt;br /&gt;
 }&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===ChangeClass===&lt;br /&gt;
Changes the bot to a specified class.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (classId)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 b.ChangeClass(CLASS.SOLDIER);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===ChangeTeam===&lt;br /&gt;
Changes the bot to a specified team.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (teamId)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 b.ChangeTeam(TEAM.AXIS);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===ClearRoles===&lt;br /&gt;
Takes away a role from the bot.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; roleId&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 b.ClearRoles(ROLE.ATTACKER);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;See Also:&#039;&#039;&#039; &lt;br /&gt;
[[Bot#SetRoles| SetRoles]], [[Bot#HasRole| HasRole]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===DisableBotPush===&lt;br /&gt;
Used by [[Pre-Scripted_Regions#DisableBotPush|pre-scripted trigger region]].&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (true/false)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 b.DisableBotPush(true);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===DistanceTo===&lt;br /&gt;
Overloaded utility function for simplified distance checks.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (Vector3, notUseEyePosition&amp;lt;default false&amp;gt;) &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (MapGoal, notUseEyePosition&amp;lt;default false&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (GameEntity/GameId, notUseEyePosition&amp;lt;default false&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; float - distance from bot to Vector3, MapGoal, GameEntity or GameId&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 v = Vector3(10,20,30);&lt;br /&gt;
 target = b.GetTarget();&lt;br /&gt;
 // distance from bot to target entity&lt;br /&gt;
 d1 = b.DistanceTo(target, true);&lt;br /&gt;
 // distance from bot to world position&lt;br /&gt;
 d2 = b.DistanceTo(v, true);&lt;br /&gt;
 // distance from bot eye to world position&lt;br /&gt;
 d3 = b.DistanceTo(v);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===DumpBotTable===&lt;br /&gt;
Dumps a file with the bot&#039;s table to a file in the user folder.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (filename)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 b.DumpBotTable(&amp;quot;foo.txt&amp;quot;);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===Enable===&lt;br /&gt;
Disables all thinking for the bot.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (true/false)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 b.Enable(false);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===ExecCommand===&lt;br /&gt;
Executes a string command on the bot as if the bot executed a console command.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (command)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 b.ExecCommand(&amp;quot;kill&amp;quot;);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===Weapons/Ammo===&lt;br /&gt;
====CanSnipe====&lt;br /&gt;
It&#039;s deprecated and has been replaced by Util.CanBotSnipe(bot) in Enemy Territory.&lt;br /&gt;
&lt;br /&gt;
Checks if the bot can snipe based on the internally implemented snipe checks. Vary by game. Typically involves checking if the bot has a snipe enabled weapon and has ammo.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; true if the bot can snipe, else false&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 if(b.CanSnipe()) {}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====EnableShooting====&lt;br /&gt;
Disables all shooting for the bot.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (true/false)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 b.EnableShooting(false);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
====GetWeapon====&lt;br /&gt;
Gets a reference to a specific weapon from the bot.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (weaponId)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; [[Weapon]] reference, or NULL if the bot doesn&#039;t have the weapon.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 wpn = b.GetWeapon(WEAPON.SHOTGUN);&lt;br /&gt;
 wpn.PrimaryFire.AimOffset = Vector3(0,0,10);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
====GetBestWeapon====&lt;br /&gt;
Gets a weapon id for the best weapon versus current target or a specific entity.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none - uses current target&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (entity) evaluate weapon versus specific target entity&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; weapon id of weapon that is chosen.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 best = b.GetBestWeapon();&lt;br /&gt;
 // OR&lt;br /&gt;
 best = b.GetBestWeapon(someEnt);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
====GetRandomWeapon====&lt;br /&gt;
Gets a random weapon id from the list of weapons the bot currently has.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; random weapon id&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 randwpn = b.GetRandomWeapon();&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====GetCurrentWeapon====&lt;br /&gt;
Gets the current weapon id for the bot.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; weapon Id for bot&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 mywpn = b.GetCurrentWeapon();&lt;br /&gt;
 if(mywpn == WEAPON.SHOTGUN)&lt;br /&gt;
 {&lt;br /&gt;
 }&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
====GetCurrentAmmo====&lt;br /&gt;
Gets the ammo information for a weapon.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (table)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (table, firemode)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (table, firemode, weaponId)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; true if successful, false if not&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 ammoTable = {};&lt;br /&gt;
 // Get primary ammo for current weapon&lt;br /&gt;
 b.GetCurrentAmmo(ammoTable);&lt;br /&gt;
 // Get secondary ammo for current weapon&lt;br /&gt;
 b.GetCurrentAmmo(ammoTable, 1);&lt;br /&gt;
 // Get primary ammo for another weapon.&lt;br /&gt;
 b.GetCurrentAmmo(ammoTable, 0, WEAPON.SHOTGUN);&lt;br /&gt;
&lt;br /&gt;
 print(&amp;quot;Current Ammo:&amp;quot;, ammoTable.CurrentAmmo);&lt;br /&gt;
 print(&amp;quot;Max Ammo:&amp;quot;, ammoTable.MaxAmmo);&lt;br /&gt;
 print(&amp;quot;Current Clips:&amp;quot;, ammoTable.CurrentClip);&lt;br /&gt;
 print(&amp;quot;Max Clips:&amp;quot;, ammoTable.MaxClip);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====GetMostDesiredAmmo====&lt;br /&gt;
Gets information about the currently most needed ammo.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (table)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
* AmmoType - weapon ID&lt;br /&gt;
* Desire - [[Weapon#LowAmmoPriority|LowAmmoPriority]]; It will be zero if bot has more ammo than  [[Weapon#LowAmmoThreshold|LowAmmoThreshold]]&lt;br /&gt;
* GetAmmo - [[Weapon#LowAmmoGetAmmoAmount|LowAmmoGetAmmoAmount]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 mostNeededAmmo = {};&lt;br /&gt;
 b.GetMostDesiredAmmo(mostNeededAmmo);&lt;br /&gt;
 if( mostNeededAmmo.Desire &amp;gt; 0) {&lt;br /&gt;
  print(&amp;quot;Need ammo for weapon&amp;quot;, Util.WeaponName(mostNeededAmmo.AmmoType));&lt;br /&gt;
 }&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====FireWeapon====&lt;br /&gt;
Fires the current weapon.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 b.FireWeapon();&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
====HasAmmo====&lt;br /&gt;
Checks if the bot has a certain ammo type.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; () - If no parameters passed, checks current weapon ammo.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (WeaponId)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (WeaponId, needed amount)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; true/false if the bot has ammo.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 if(b.HasAmmo())&lt;br /&gt;
 {&lt;br /&gt;
 }&lt;br /&gt;
 if(b.HasAmmo(WEAPON.MP40))&lt;br /&gt;
 {&lt;br /&gt;
 }&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====HasAnyWeapon====&lt;br /&gt;
Checks if the bot has any of specified weapons. Table keys are weaponIDs, table values should be set to true.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (weapons, options&amp;lt;optional&amp;gt;, weaponList&amp;lt;optional&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
The second parameter is table which has items CheckAmmo and CheckCharged. Both options are true by default.&lt;br /&gt;
&lt;br /&gt;
The third parameter is empty table to store all results.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; weaponId if the bot has that weapon, 0 if the bot does not have any weapon from the list.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 weapons = table();&lt;br /&gt;
 weapons[WEAPON.MP40] = true;&lt;br /&gt;
 weapons[WEAPON.THOMPSON] = true;&lt;br /&gt;
 weapon = b.HasAnyWeapon(weapons, { CheckAmmo=true, CheckCharged=false } );&lt;br /&gt;
 if (weapon) {&lt;br /&gt;
 }&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====HasWeapon====&lt;br /&gt;
Checks if the bot has a specific weapon.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (weaponId)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; true if the bot has it, false if not.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 if(b.HasWeapon(WEAPON.SHOTGUN))&lt;br /&gt;
 {&lt;br /&gt;
 }&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
====IsWeaponCharged====&lt;br /&gt;
Checks if a weapon is &#039;&#039;charged&#039;&#039;. A charged weapon is one that is capable of being used that might occasionally be unavailable for use due to lack of character &#039;charge&#039;, whether that be a gameplay charge bar, stamina, skill, etc.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (weaponId, firemode&amp;lt;optional&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; true if weapon is charged, false if not.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 if(b.IsWeaponCharged(WEAPON.MORTAR, 0))&lt;br /&gt;
 {&lt;br /&gt;
 }&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===GetAllAlly===&lt;br /&gt;
Fills a table with all known allied entities (from bot&#039;s sensory memory) that match a desired criteria.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (category, class, table)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 // Get all known soldier players.&lt;br /&gt;
 players = table();&lt;br /&gt;
 b.GetAllAlly(CAT.PLAYER, CLASS.SOLDIER, players);&lt;br /&gt;
 foreach ( ent in players )&lt;br /&gt;
 {&lt;br /&gt;
     print(ent);&lt;br /&gt;
 }&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===GetAllEnemy===&lt;br /&gt;
Fills a table with all known enemy entities (from bot&#039;s sensory memory) that match a desired criteria.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (category, class, table)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 // Get all known soldier players.&lt;br /&gt;
 players = table();&lt;br /&gt;
 b.GetAllEnemy(CAT.PLAYER, CLASS.SOLDIER, players);&lt;br /&gt;
 foreach ( ent in players )&lt;br /&gt;
 {&lt;br /&gt;
     print(ent);&lt;br /&gt;
 }&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===GetAllType===&lt;br /&gt;
Fills a table with all known entities (from bot&#039;s sensory memory) that match a desired criteria.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (category, class, table)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 // Get all known soldier players.&lt;br /&gt;
 players = table();&lt;br /&gt;
 b.GetAllType(CAT.PLAYER, CLASS.SOLDIER, players);&lt;br /&gt;
 foreach ( ent in players )&lt;br /&gt;
 {&lt;br /&gt;
     print(ent);&lt;br /&gt;
 }&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===GetClass===&lt;br /&gt;
Gets the current class id for the bot.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; class Id for bot&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 myclass = b.GetClass();&lt;br /&gt;
 if(myClass == CLASS.SOLDIER)&lt;br /&gt;
 {&lt;br /&gt;
 }&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===GetEyePosition===&lt;br /&gt;
Gets the world position of the bots &#039;eye&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; Vector3 eye position&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 eyepos = b.GetEyePosition();&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===GetFacing===&lt;br /&gt;
Gets the facing vector for the bots aim.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; Vector3 facing vector&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 facing = b.GetFacing();&lt;br /&gt;
 pointinfront = b.GetEyePosition() + facing * 100;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===GetGameEntity===&lt;br /&gt;
Gets the game entity for the bot.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; entity&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 ent = b.GetGameEntity();&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===GetGameId===&lt;br /&gt;
Gets the game id for the bot.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; entity&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 gameid = b.GetGameId();&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===GetHealthPercent===&lt;br /&gt;
Gets the bot&#039;s current health percentage.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; 0.0 - 1.0 health scalar&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 if(bot.GetHealthPercent() &amp;lt; 0.5) &lt;br /&gt;
 {&lt;br /&gt;
     // &amp;lt; 50% health&lt;br /&gt;
 }&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
===GetHighLevelGoalName===&lt;br /&gt;
Gets the bot&#039;s current high level goal name.&lt;br /&gt;
&lt;br /&gt;
Examples: UseCabinet, WatchForProjectile, CovertOps, BUILD, PLANT, CAMP, SWITCH, ROAMING, ...&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Some goal names changed after they were moved to scripts.&lt;br /&gt;
&lt;br /&gt;
Goals in 0.81: DefuseDynamite, ReviveTeammate, TakeCheckPoint, RepairMg42&lt;br /&gt;
&lt;br /&gt;
Goals in 0.82: DEFUSE, REVIVE, CHECKPOINT, REPAIRMG42&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Goals in 0.83: CaptureTheFlag, ReturnTheFlag, MobileMortar, PlantMine, CallArtillery&lt;br /&gt;
&lt;br /&gt;
Goals in 0.84: FLAG, FLAGRETURN, MOBILEMORTAR, PLANTMINE, CALLARTILLERY&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; goal name, or NULL if the bot doesn&#039;t have a high level goal.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 g = bot.GetHighLevelGoalName();&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===GetMapGoalName===&lt;br /&gt;
Gets the bot&#039;s current map goal name (for example: BUILD_Tank, DEFEND_depot1, ...).&lt;br /&gt;
&lt;br /&gt;
Returns NULL if the current high level goal is ROAMING, WatchForProjectile or CovertOps.&lt;br /&gt;
&lt;br /&gt;
Note: This function has been added in 0.82.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; goal name or NULL.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 g = bot.GetMapGoalName();&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===GetLastTarget===&lt;br /&gt;
Gets the target the bot had before the current target.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; entity OR null&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 last = b.GetLastTarget();&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===GetNearest===&lt;br /&gt;
Gets the nearest target matching the desired criteria, friend or foe.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (category)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (category, classId)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (category, table of classIds)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; entity OR null&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 // get nearest player, defaults to any class within that category&lt;br /&gt;
 p = b.GetNearest(CAT.PLAYER);&lt;br /&gt;
 // get nearest soldier or medic player&lt;br /&gt;
 s = b.GetNearest(CAT.PLAYER, {CLASS.SOLDIER, CLASS.MEDIC});&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===GetNearestAlly===&lt;br /&gt;
Gets the nearest target matching the desired criteria, only allies&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (category)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (category, classId)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (category, table of classIds)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; entity OR null&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 // get nearest player, defaults to any class within that category&lt;br /&gt;
 p = b.GetNearestAlly(CAT.PLAYER);&lt;br /&gt;
 // get nearest soldier player&lt;br /&gt;
 s = b.GetNearestAlly(CAT.PLAYER, CLASS.SOLDIER);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===GetNearestEnemy===&lt;br /&gt;
Gets the nearest target matching the desired criteria, only enemies&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (category)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (category, classId)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (category, table of classIds)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; entity OR null&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 // get nearest player, defaults to any class within that category&lt;br /&gt;
 p = b.GetNearestEnemy(CAT.PLAYER);&lt;br /&gt;
 // get nearest soldier player&lt;br /&gt;
 s = b.GetNearestEnemy(CAT.PLAYER, CLASS.SOLDIER);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== GetNearestDestination ===&lt;br /&gt;
Finds paths from the current bot position to multiple destination positions. Returns index of the destination which has the shortest path. It can depend on navigation flags (e.g. teleports, axis/allied waypoints).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (table of vectors)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; index OR null&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 positions = { Vec3(105,4564,0), Vec3(-48,1234,0) };&lt;br /&gt;
 id = bot.GetNearestDestination(positions);&lt;br /&gt;
 if(typeId(id)==0)&lt;br /&gt;
 {&lt;br /&gt;
 	print(&amp;quot;path not found&amp;quot;);&lt;br /&gt;
 }else{&lt;br /&gt;
 	print(&amp;quot;path found to destination&amp;quot;, positions[id]);&lt;br /&gt;
 }&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===GetPosition===&lt;br /&gt;
Gets the world position of the bot.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; Vector3 world position&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 mypos = b.GetPosition();&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===GetTarget===&lt;br /&gt;
Gets the current target.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; entity OR null&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 target = b.GetTarget();&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===GetTargetInfo===&lt;br /&gt;
Returns the [[TargetInfo]] for an entity.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (entity/gameId)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; [[TargetInfo]] for entity.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 ti = b.GetTargetInfo(b.GetTarget());&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===GetTeam===&lt;br /&gt;
Gets the current team the bot is on.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; team #&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 myteam = b.GetTeam();&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;See also:&#039;&#039;&#039; [[TEAM]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===GetVelocity===&lt;br /&gt;
Gets the world velocity of the bot. The bot must be alive. It returns wrong vector if the bot is injured.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; Vector3 world velocity &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 myvel = b.GetVelocity();&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===HasTarget===&lt;br /&gt;
Checks if the bot has a current target&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; true if bot has a target&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 if(b.HasTarget())&lt;br /&gt;
 {&lt;br /&gt;
 }&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===HasAnyEntityFlag===&lt;br /&gt;
Checks if the bot has a given entity flag. This function can take any number of flags to check, and will return true if the bot has at least one of the flags, or false if it doesn&#039;t have any of them.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (entityflag, ...)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; true if bot has any flag, false if not&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 // checking 1 flag&lt;br /&gt;
 if(b.HasAnyEntityFlag(ENTFLAG.ZOOMING))&lt;br /&gt;
 {&lt;br /&gt;
 }&lt;br /&gt;
 // checking multiple flags.&lt;br /&gt;
 if(b.HasAnyEntityFlag(ENTFLAG.MOUNTED, ENTFLAG.ON_LADDER))&lt;br /&gt;
 {&lt;br /&gt;
 }&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===HasEntityFlag===&lt;br /&gt;
Checks if the bot has a given entity flag. This function can take any number of flags to check, and will return true if the bot has all the flags, or false if it is missing any.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (entityflag, ...)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; true if bot has all flags, false if not&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 // checking 1 flag&lt;br /&gt;
 if(b.HasEntityFlag(ENTFLAG.RELOADING))&lt;br /&gt;
 {&lt;br /&gt;
 }&lt;br /&gt;
 // checking multiple flags.&lt;br /&gt;
 if(b.HasEntityFlag(ENTFLAG.INWATER, ENTFLAG.UNDERWATER))&lt;br /&gt;
 {&lt;br /&gt;
 }&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===HasLineOfSightTo===&lt;br /&gt;
This functions checks whether the bot has line of sight to a 3d position. This function does not account for field of view, simply does a raycast for obstructions between the bots eye position and the provided position. To account for field of view, use [[Bot#InFieldOfView|InFieldOfView]]. If an entity or gameId is provided as the 2nd parameter, the function will return true if the raycast hits nothing on its way to the position OR if it hits the entity that is passed.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (Vector3 position)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (Vector3 position, entity)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; true if the bot has line of sight to the position or entity passed. false if the bot&#039;s view is obstructed.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; This function calls  [[Bot_Library#TraceLine|TraceLine]] with parameter TRACE.SHOT | TRACE.SMOKEBOMB&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 if(b.HasLineOfSightTo( Vec3(30,50,10) ))&lt;br /&gt;
 {&lt;br /&gt;
 }&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===HasPowerUp===&lt;br /&gt;
Checks if the bot has a given powerup. This function can take any number of flags to check, and will return true if the bot has all the flags, or false if it is missing any.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (powerup, ...)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; true if bot has all powerups, false if not&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 // checking 1 flag&lt;br /&gt;
 if(b.HasPowerUp(POWERUP.INVINCIBLE))&lt;br /&gt;
 {&lt;br /&gt;
 }&lt;br /&gt;
 // checking multiple flags.&lt;br /&gt;
 if(b.HasPowerUp(POWERUP.INVINCIBLE, POWERUP.QUADDAMAGE))&lt;br /&gt;
 {&lt;br /&gt;
 }&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===HasRole===&lt;br /&gt;
Checks if the bot has a specific role or any role.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; roleId &amp;lt;optional&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; true if the bot has role, false if not.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 if(b.HasRole(ROLE.INFILTRATOR)){&lt;br /&gt;
 }&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;See Also:&#039;&#039;&#039; &lt;br /&gt;
[[Bot#ClearRoles| ClearRoles]], [[Bot#SetRoles| SetRoles]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===HoldButton===&lt;br /&gt;
Makes the bot &#039;press&#039; a button, and hold it for an amount of time. This function can take any number of buttons as parameters, and will apply the effect to all of them. The time value is &#039;&#039;&#039;ALWAYS&#039;&#039;&#039; the last parameter.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (buttonId, ..., time in seconds)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 // hold crouch for 5 seconds&lt;br /&gt;
 b.HoldButton(BTN.CROUCH, 5);&lt;br /&gt;
 // hold multiple buttons for 5 seconds&lt;br /&gt;
 b.HoldButton(BTN.CROUCH, BTN.SPRINT, 5);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;See Also:&#039;&#039;&#039; [[Bot#PressButton| PressButton]], [[Bot#ReleaseButton| ReleaseButton]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===IgnoreTarget===&lt;br /&gt;
This function causes the bot to ignore specific entities for targeting for some duration of time.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (entity/gameId or goal name or table, seconds to ignore &amp;lt;optional&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 // ignore the entity, so the bot won&#039;t shoot at it.&lt;br /&gt;
 bot.IgnoreTarget(&amp;quot;MOVER_bird1&amp;quot;);&lt;br /&gt;
 bot.IgnoreTarget(Map.Movers);&lt;br /&gt;
 bot.IgnoreTarget(GetLocalEntity(), 100);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;See also:&#039;&#039;&#039; [[Bots shooting map objects]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===InFieldOfView===&lt;br /&gt;
Checks whether a position is within the bots current [[Bot#FieldOfView | FieldOfView]]. This function can take an optional field of view(in degrees) to check. If not provided, it will use the bots current [[Bot#FieldOfView | FieldOfView]].&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (Vector3 position)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (Vector3 position, fov angles)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; Vector3 - center point of the AABB.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 v = Vector3(10,10,10);&lt;br /&gt;
 // check if in default field of view&lt;br /&gt;
 if(b.InFieldOfView(v))&lt;br /&gt;
 {&lt;br /&gt;
 }&lt;br /&gt;
 // check if in custom field of view&lt;br /&gt;
 if(b.InFieldOfView(v, 180))&lt;br /&gt;
 {&lt;br /&gt;
 }&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===IsAllied===&lt;br /&gt;
Checks if the bot is allied with a given entity.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (entity/gameId)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; true if allied, false if not.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 if(b.IsAllied(someentity))&lt;br /&gt;
 {&lt;br /&gt;
 }&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===IsCarryingFlag===&lt;br /&gt;
Checks if the bot is carrying objective (flag, gold, documents, radar parts, ...).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; true/false&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 if(b.IsCarryingFlag())&lt;br /&gt;
 {&lt;br /&gt;
 }&lt;br /&gt;
 &amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
===IsStuck===&lt;br /&gt;
Checks if the bot considers himself to be stuck. Stuckness is typically defined as an insignificant amount of movement over a short period of time. The time can be optionally passed to the function for flexibility.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; () - If no params passed, the time used is 0.5 seconds.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (time in seconds)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; true if bot is &#039;&#039;stuck&#039;&#039;, false if not.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 if(b.IsStuck())&lt;br /&gt;
 {&lt;br /&gt;
 }&lt;br /&gt;
 // or check stuckness for 1.5 seconds.&lt;br /&gt;
 if(b.IsStuck(1.5))&lt;br /&gt;
 {&lt;br /&gt;
 }&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===MoveTowards===&lt;br /&gt;
Causes the bot to blindly move towards a target. This function does no path finding. It&#039;s primary use is short range movement when you are reasonably sure the bot can run right at the target.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (Vector3 position) - if distance tolerance not specified, default of 32 units is used.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (Vector3 position, distance tolerance)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; true if the bot is within the distance tolerance, false if not.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 // get within 64 units of this position&lt;br /&gt;
 v = Vector3(10,10,10);&lt;br /&gt;
 while(b.MoveTowards(v, 64) == false)&lt;br /&gt;
 {&lt;br /&gt;
     yield();&lt;br /&gt;
 } &amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===PressButton===&lt;br /&gt;
Makes the bot &#039;press&#039; a button. This function can take any number of buttons as parameters, and will apply the effect to all of them. Buttons that are &#039;&#039;pressed&#039;&#039; using this function are released automatically for the next bot update.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (buttonId, ...)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 // press crouch&lt;br /&gt;
 b.PressButton(BTN.CROUCH);&lt;br /&gt;
 // press multiple buttons&lt;br /&gt;
 b.PressButton(BTN.CROUCH, BTN.SPRINT);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;See Also:&#039;&#039;&#039; [[Bot#HoldButton | HoldButton]], [[Bot#ReleaseButton| ReleaseButton]]&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===ReleaseButton===&lt;br /&gt;
Makes the bot &#039;release&#039; a button. This function can take any number of buttons as parameters, and will apply the effect to all of them. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (buttonId, ...)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 // release crouch&lt;br /&gt;
 b.ReleaseButton(BTN.CROUCH);&lt;br /&gt;
 // release multiple buttons&lt;br /&gt;
 b.ReleaseButton(BTN.CROUCH, BTN.SPRINT);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;See Also:&#039;&#039;&#039; [[Bot#HoldButton | HoldButton]], [[Bot#PressButton| PressButton]]&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===ReloadProfile===&lt;br /&gt;
Reloads the bots profile. The profile is any script associated with the bots name.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 b.ReloadProfile();&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===ResetStuckTime===&lt;br /&gt;
Reset the stuck timer.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 b.ResetStuckTime();&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===Say===&lt;br /&gt;
Chat function used for bots to &#039;&#039;say&#039;&#039; messages through the normal chat channels of the game. For flexibility, this function can take any number and type of parameters, which it will convert to a single long string and use as the chat message.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (string, ...)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 b.Say(&amp;quot;My name is &amp;quot;, b.Name);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;See Also:&#039;&#039;&#039; &lt;br /&gt;
[[Bot#SayTeam| SayTeam]], [[Bot#SayVoice| SayVoice]]&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===SayTeam===&lt;br /&gt;
Chat function used for bots to &#039;&#039;say&#039;&#039; messages through the team chat channel of the game. For flexibility, this function can take any number and type of parameters, which it will convert to a single long string and use as the chat message.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (string, ...)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 b.SayTeam(&amp;quot;My name is &amp;quot;, b.Name);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;See Also:&#039;&#039;&#039; &lt;br /&gt;
[[Bot#Say| Say]], [[Bot#SayVoice| SayVoice]]&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===SayVoice===&lt;br /&gt;
Broadcasts a voice macro to the game. Used with global [[VOICE]] table values.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (macroId)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 b.SayVoice(VOICE.NEED_MEDIC);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;See Also:&#039;&#039;&#039; &lt;br /&gt;
[[Bot#Say| Say]], [[Bot#SayTeam| SayTeam]]&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===ScriptEvent===&lt;br /&gt;
Sends [[EVENT#SCRIPTMSG|SCRIPTMSG]] event.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (name, param1, param2, param3)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===SetDebugFlag===&lt;br /&gt;
Enables a debug flag for the bot. See the global [[DEBUG]] table for available options. Enabling debug flags typically cause various debug visualizations to render in order to help identify whats going on with various systems of the bot.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (flag, true/false to enable)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 b.SetDebugFlag(DEBUG.AIM, true);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===SetRoles===&lt;br /&gt;
Assign a role to the bot.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; roleId&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 b.SetRoles(ROLE.DEFENDER);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;See Also:&#039;&#039;&#039; &lt;br /&gt;
[[Bot#ClearRoles| ClearRoles]], [[Bot#HasRole| HasRole]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===ToLocalSpace===&lt;br /&gt;
Converts a vector into local bot space. This results in a position relative to the bots current position and rotation. This function is useful for simplifying some types of logic.&lt;br /&gt;
&lt;br /&gt;
* x axis is side to side.&lt;br /&gt;
* y axis is forward and back.&lt;br /&gt;
* z axis is up and down.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (Vector3)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; Vector3 local space position.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 v = Vector3(4356,342,276); // some world position.&lt;br /&gt;
 v2 = b.ToLocalSpace(v);&lt;br /&gt;
 if(v2.y &amp;lt; 0)&lt;br /&gt;
 {&lt;br /&gt;
     // the position is behind the bot.&lt;br /&gt;
 }&lt;br /&gt;
 if(v2.x &amp;lt; 0)&lt;br /&gt;
 {&lt;br /&gt;
     // the position is to the right of the bot&lt;br /&gt;
 }&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===ToWorldSpace===&lt;br /&gt;
Converts a vector from local bot space to world space. &lt;br /&gt;
&lt;br /&gt;
* x axis is side to side.&lt;br /&gt;
* y axis is forward and back.&lt;br /&gt;
* z axis is up and down.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (Vector3)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; Vector3 world space position.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 // slightly forward and to the right.&lt;br /&gt;
 v = Vector3(10,10,0);&lt;br /&gt;
 v2 = b.ToWorldSpace(v);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Enemy Territory Addendum===&lt;br /&gt;
&lt;br /&gt;
====ChangePrimaryWeapon====&lt;br /&gt;
Selects a new primary weapon for the bot. Should take effect next spawn. You must not use this function inside map scripts. You should use [[Utility_Functions#WeaponTable.SetWeaponAvailability|SetWeaponAvailability]] if you want to disable some weapons.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (weaponId)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; true if successful, false if not&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 b.ChangePrimaryWeapon(WEAPON.PANZERFAUST);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;See Also:&#039;&#039;&#039; &lt;br /&gt;
[[Bot#ChangeSecondaryWeapon| ChangeSecondaryWeapon]]&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====ChangeSecondaryWeapon====&lt;br /&gt;
Selects a new secondary weapon for the bot. Should take effect next spawn.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (weaponId)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; true if successful, false if not&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 b.ChangeSecondaryWeapon(WEAPON.LUGER);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;See Also:&#039;&#039;&#039; &lt;br /&gt;
[[Bot#ChangePrimaryWeapon| ChangePrimaryWeapon]]&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====ChangeSpawnPoint====&lt;br /&gt;
Changes the desired spawn point for the bot to respawn at.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (spawnpoint #)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 b.ChangeSpawnPoint(2); &amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====GetConstructableState====&lt;br /&gt;
Check state of a BUILD goal.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (entity)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; 1 if the bot can build the entity, 0 if the entity is already built, -1 if the entity is not constructable or has been built by enemy.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 if(b.GetConstructableState(TargetEntity) &amp;lt; 1 ) { &lt;br /&gt;
 }&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====GetCursorHint====&lt;br /&gt;
When a player is near enough something to get a hint icon, such as for dynamiting, this function can access what hint is showing. Some of these hints may or may not ever show up, they were taken as-is from the ET SDK.&lt;br /&gt;
&lt;br /&gt;
* NONE - 0&lt;br /&gt;
* PLAYER - 1 &lt;br /&gt;
* ACTIVATE - 2 &lt;br /&gt;
* DOOR - 3&lt;br /&gt;
* DOOR_ROTATING - 4&lt;br /&gt;
* DOOR_LOCKED - 5&lt;br /&gt;
* DOOR_ROTATING_LOCKED - 6&lt;br /&gt;
* MG42 - 7&lt;br /&gt;
* BREAKABLE - 8&lt;br /&gt;
* BREAKABLE_DYNAMITE - 9&lt;br /&gt;
* CHAIR - 10&lt;br /&gt;
* ALARM - 11&lt;br /&gt;
* HEALTH - 12&lt;br /&gt;
* TREASURE - 13&lt;br /&gt;
* KNIFE - 14&lt;br /&gt;
* LADDER - 15&lt;br /&gt;
* BUTTON - 16&lt;br /&gt;
* WATER - 17&lt;br /&gt;
* CAUTION - 18&lt;br /&gt;
* DANGER - 19&lt;br /&gt;
* SECRET - 20&lt;br /&gt;
* QUESTION - 21&lt;br /&gt;
* EXCLAMATION - 22 &lt;br /&gt;
* CLIPBOARD - 23&lt;br /&gt;
* WEAPON - 24&lt;br /&gt;
* AMMO - 25&lt;br /&gt;
* ARMOR - 26&lt;br /&gt;
* POWERUP - 27&lt;br /&gt;
* HOLDABLE - 28&lt;br /&gt;
* INVENTORY - 29&lt;br /&gt;
* SCENARIC - 30&lt;br /&gt;
* EXIT - 31&lt;br /&gt;
* NOEXIT - 32&lt;br /&gt;
* PLYR_FRIEND - 33&lt;br /&gt;
* PLYR_NEUTRAL - 34&lt;br /&gt;
* PLYR_ENEMY - 35&lt;br /&gt;
* PLYR_UNKNOWN - 36&lt;br /&gt;
* BUILD - 37&lt;br /&gt;
* DISARM - 38&lt;br /&gt;
* REVIVE - 39&lt;br /&gt;
* DYNAMITE - 40&lt;br /&gt;
* CONSTRUCTIBLE - 41&lt;br /&gt;
* UNIFORM - 42&lt;br /&gt;
* LANDMINE - 43&lt;br /&gt;
* TANK - 44&lt;br /&gt;
* SATCHELCHARGE - 45&lt;br /&gt;
* LOCKPICK - 46&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (table)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 hint = table();&lt;br /&gt;
 b.GetCursorHint(hint);&lt;br /&gt;
&lt;br /&gt;
 print(hint.type); // one of the values above&lt;br /&gt;
 print(hint.value); // usually a health associated with certain types &amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====GetDestroyableState====&lt;br /&gt;
Check state of a PLANT goal.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (entity)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; 1 if the bot can destroy the entity, -1 if the entity is not destroyable or is friendly objective.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 if(b.GetDestroyableState(TargetEntity) &amp;lt; 1 ) { &lt;br /&gt;
 }&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====GetExplosiveState====&lt;br /&gt;
Check state of a dynamite, landmine or tripmine.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; It does not work for a poison mine and bouncing betty in Jaymod.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (entity)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; 1 if the dynamite/mine can be armed, 0 if the dynamite is ticking or the mine is activated.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 if(b.GetExplosiveState(TargetEntity) == 1 ) { &lt;br /&gt;
 }&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====GetMG42Info====&lt;br /&gt;
Gets information about currently mounted MG42 - vector CenterFacing and angles MinHorizontal, MaxHorizontal, MinVertical, MaxVertical.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (table)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; true if info has been stored into table&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====GetMountedPlayerOnMG42====&lt;br /&gt;
Gets player who is mounting MG42.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (mg42Entity)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; player&#039;s entity or null&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====GetReinforceTime====&lt;br /&gt;
Gets the current time left(in seconds) before reinforcements spawn for the bots team.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; seconds left till reinforcements spawn&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 if(b.GetReinforceTime() &amp;lt; 2)&lt;br /&gt;
 {&lt;br /&gt;
     // 2 seconds to reinforcements&lt;br /&gt;
 }&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====GetSkills====&lt;br /&gt;
Gets the current skill values and puts them into the table parameter.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (table)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 skills = table();&lt;br /&gt;
 b.GetSkills(skills);&lt;br /&gt;
 print(&amp;quot;Battle Sense:&amp;quot;, skills[SKILL.BATTLE_SENSE]);&lt;br /&gt;
 print(&amp;quot;Engineering:&amp;quot;, skills[SKILL.ENGINEERING]);&lt;br /&gt;
 print(&amp;quot;First Aid:&amp;quot;, skills[SKILL.FIRST_AID]);&lt;br /&gt;
 print(&amp;quot;Signals:&amp;quot;, skills[SKILL.SIGNALS]);&lt;br /&gt;
 print(&amp;quot;Light Weapons:&amp;quot;, skills[SKILL.LIGHT_WEAPONS]);&lt;br /&gt;
 print(&amp;quot;Heavy Weapons:&amp;quot;, skills[SKILL.HEAVY_WEAPONS]);&lt;br /&gt;
 print(&amp;quot;Coverops:&amp;quot;, skills[SKILL.COVERTOPS]); &amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;See Also:&#039;&#039;&#039; [[SKILL]]&lt;br /&gt;
----&lt;br /&gt;
====GetStat====&lt;br /&gt;
Gets a current stat from the bot by name.  Valid stat names for ET are kills, deaths and xp.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (string) the stat name&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; the value of the stat&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 xp = b.GetStat(&amp;quot;xp&amp;quot;);&lt;br /&gt;
 print(&amp;quot;Bot xp value is&amp;quot;,xp);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
====IsMG42Repairable====&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; (mg42Entity)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; true if mg42 is damaged and can be repaired&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
====TeamLandminesAvailable====&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters:&#039;&#039;&#039; none&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Returns:&#039;&#039;&#039; remaining count of team landmines&lt;br /&gt;
&lt;br /&gt;
----&lt;/div&gt;</summary>
		<author><name>Palota</name></author>
	</entry>
</feed>