MOOSE/docs/Documentation/AI_Bai.html
2017-09-15 14:20:39 +02:00

1965 lines
49 KiB
HTML

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<link rel="stylesheet" href="stylesheet.css" type="text/css"/>
</head>
<body>
<div id="container">
<div id="product">
<div id="product_logo"></div>
<div id="product_name"><big><b></b></big></div>
<div id="product_description"></div>
</div>
<div id="main">
<div id="navigation">
<h2>Modules</h2>
<ul><li>
<a href="index.html">index</a>
</li></ul>
<ul>
<li><a href="AI_A2A.html">AI_A2A</a></li>
<li><a href="AI_A2A_Cap.html">AI_A2A_Cap</a></li>
<li><a href="AI_A2A_Dispatcher.html">AI_A2A_Dispatcher</a></li>
<li><a href="AI_A2A_GCI.html">AI_A2A_GCI</a></li>
<li><a href="AI_A2A_Patrol.html">AI_A2A_Patrol</a></li>
<li>AI_Bai</li>
<li><a href="AI_Balancer.html">AI_Balancer</a></li>
<li><a href="AI_Cap.html">AI_Cap</a></li>
<li><a href="AI_Cas.html">AI_Cas</a></li>
<li><a href="AI_Formation.html">AI_Formation</a></li>
<li><a href="AI_Patrol.html">AI_Patrol</a></li>
<li><a href="Account.html">Account</a></li>
<li><a href="Airbase.html">Airbase</a></li>
<li><a href="AirbasePolice.html">AirbasePolice</a></li>
<li><a href="Assign.html">Assign</a></li>
<li><a href="Base.html">Base</a></li>
<li><a href="Cargo.html">Cargo</a></li>
<li><a href="CleanUp.html">CleanUp</a></li>
<li><a href="Client.html">Client</a></li>
<li><a href="CommandCenter.html">CommandCenter</a></li>
<li><a href="Controllable.html">Controllable</a></li>
<li><a href="Database.html">Database</a></li>
<li><a href="Designate.html">Designate</a></li>
<li><a href="Detection.html">Detection</a></li>
<li><a href="DetectionManager.html">DetectionManager</a></li>
<li><a href="Escort.html">Escort</a></li>
<li><a href="Event.html">Event</a></li>
<li><a href="Fsm.html">Fsm</a></li>
<li><a href="Group.html">Group</a></li>
<li><a href="Identifiable.html">Identifiable</a></li>
<li><a href="Menu.html">Menu</a></li>
<li><a href="Message.html">Message</a></li>
<li><a href="MissileTrainer.html">MissileTrainer</a></li>
<li><a href="Mission.html">Mission</a></li>
<li><a href="Movement.html">Movement</a></li>
<li><a href="Object.html">Object</a></li>
<li><a href="Point.html">Point</a></li>
<li><a href="Positionable.html">Positionable</a></li>
<li><a href="Process_JTAC.html">Process_JTAC</a></li>
<li><a href="Process_Pickup.html">Process_Pickup</a></li>
<li><a href="Radio.html">Radio</a></li>
<li><a href="Rat.html">Rat</a></li>
<li><a href="Route.html">Route</a></li>
<li><a href="Scenery.html">Scenery</a></li>
<li><a href="ScheduleDispatcher.html">ScheduleDispatcher</a></li>
<li><a href="Scheduler.html">Scheduler</a></li>
<li><a href="Scoring.html">Scoring</a></li>
<li><a href="Sead.html">Sead</a></li>
<li><a href="Set.html">Set</a></li>
<li><a href="Settings.html">Settings</a></li>
<li><a href="Smoke.html">Smoke</a></li>
<li><a href="Spawn.html">Spawn</a></li>
<li><a href="SpawnStatic.html">SpawnStatic</a></li>
<li><a href="Spot.html">Spot</a></li>
<li><a href="Static.html">Static</a></li>
<li><a href="Task.html">Task</a></li>
<li><a href="Task_A2A.html">Task_A2A</a></li>
<li><a href="Task_A2A_Dispatcher.html">Task_A2A_Dispatcher</a></li>
<li><a href="Task_A2G.html">Task_A2G</a></li>
<li><a href="Task_A2G_Dispatcher.html">Task_A2G_Dispatcher</a></li>
<li><a href="Task_Cargo.html">Task_Cargo</a></li>
<li><a href="Task_PICKUP.html">Task_PICKUP</a></li>
<li><a href="Unit.html">Unit</a></li>
<li><a href="Utils.html">Utils</a></li>
<li><a href="Zone.html">Zone</a></li>
<li><a href="routines.html">routines</a></li>
</ul>
</div>
<div id="content">
<h1>Module <code>AI_Bai</code></h1>
<p><strong>AI</strong> -- <strong>Provide Battlefield Air Interdiction (bombing).</strong></p>
<p><img src="..\Presentations\AI_BAI\Dia1.JPG" alt="Banner Image"/></p>
<hr/>
<p>AI_BAI classes makes AI Controllables execute bombing tasks.</p>
<p>There are the following types of BAI classes defined:</p>
<ul>
<li><a href="##(AI_BAI_ZONE)">#AI<em>BAI</em>ZONE</a>: Perform a BAI in a zone.</li>
</ul>
<hr/>
<h1>Demo Missions</h1>
<h3><a href="https://github.com/FlightControl-Master/MOOSE_MISSIONS/tree/master-release/BOMB%20-%20Close%20Air%20Support">AI_BAI Demo Missions source code</a></h3>
<h3><a href="https://github.com/FlightControl-Master/MOOSE_MISSIONS/tree/master/BOMB%20-%20Close%20Air%20Support">AI_BAI Demo Missions, only for beta testers</a></h3>
<h3><a href="https://github.com/FlightControl-Master/MOOSE_MISSIONS/releases">ALL Demo Missions pack of the last release</a></h3>
<hr/>
<h1>YouTube Channel</h1>
<h3><a href="https://www.youtube.com/playlist?list=PL7ZUrU4zZUl3JBO1WDqqpyYRRmIkR2ir2">AI_BAI YouTube Channel</a></h3>
<hr/>
<h3>Author: <strong>Sven Van de Velde (FlightControl)</strong></h3>
<h3>Contributions:</h3>
<ul>
<li><strong><a href="http://forums.eagle.ru:8080/member.php?u=75036">Gunterlund</a></strong>: Test case revision.</li>
</ul>
<hr/>
<h2>Global(s)</h2>
<table class="function_list">
<tr>
<td class="name" nowrap="nowrap"><a href="#AI_BAI_ZONE">AI_BAI_ZONE</a></td>
<td class="summary">
<h1>AI<em>BAI</em>ZONE class, extends <a href="AI_Patrol.html##(AI_PATROL_ZONE)">AI<em>Patrol#AI</em>PATROL_ZONE</a></h1>
<p>AI<em>BAI</em>ZONE derives from the <a href="AI_Patrol.html##(AI_PATROL_ZONE)">AI<em>Patrol#AI</em>PATROL_ZONE</a>, inheriting its methods and behaviour.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="#_NewEngageRoute">_NewEngageRoute(AIControllable)</a></td>
<td class="summary">
</td>
</tr>
</table>
<h2><a id="#(AI_BAI_ZONE)">Type <code>AI_BAI_ZONE</code></a></h2>
<table class="function_list">
<tr>
<td class="name" nowrap="nowrap"><a href="##(AI_BAI_ZONE).AIControllable">AI_BAI_ZONE.AIControllable</a></td>
<td class="summary">
<p>The <a href="Controllable.html">Controllable</a> patrolling.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(AI_BAI_ZONE).Abort">AI_BAI_ZONE:Abort()</a></td>
<td class="summary">
<p>Synchronous Event Trigger for Event Abort.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(AI_BAI_ZONE).Accomplish">AI_BAI_ZONE:Accomplish()</a></td>
<td class="summary">
<p>Synchronous Event Trigger for Event Accomplish.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(AI_BAI_ZONE).Accomplished">AI_BAI_ZONE.Accomplished</a></td>
<td class="summary">
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(AI_BAI_ZONE).Destroy">AI_BAI_ZONE:Destroy()</a></td>
<td class="summary">
<p>Synchronous Event Trigger for Event Destroy.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(AI_BAI_ZONE).Engage">AI_BAI_ZONE:Engage(EngageSpeed, EngageAltitude, EngageWeaponExpend, EngageAttackQty, EngageDirection)</a></td>
<td class="summary">
<p>Synchronous Event Trigger for Event Engage.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(AI_BAI_ZONE).EngageAltitude">AI_BAI_ZONE.EngageAltitude</a></td>
<td class="summary">
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(AI_BAI_ZONE).EngageAttackQty">AI_BAI_ZONE.EngageAttackQty</a></td>
<td class="summary">
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(AI_BAI_ZONE).EngageDirection">AI_BAI_ZONE.EngageDirection</a></td>
<td class="summary">
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(AI_BAI_ZONE).EngageSpeed">AI_BAI_ZONE.EngageSpeed</a></td>
<td class="summary">
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(AI_BAI_ZONE).EngageWeaponExpend">AI_BAI_ZONE.EngageWeaponExpend</a></td>
<td class="summary">
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(AI_BAI_ZONE).EngageZone">AI_BAI_ZONE.EngageZone</a></td>
<td class="summary">
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(AI_BAI_ZONE).Fired">AI_BAI_ZONE:Fired()</a></td>
<td class="summary">
<p>Synchronous Event Trigger for Event Fired.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(AI_BAI_ZONE).New">AI_BAI_ZONE:New(PatrolZone, PatrolFloorAltitude, PatrolCeilingAltitude, PatrolMinSpeed, PatrolMaxSpeed, EngageZone, PatrolAltType)</a></td>
<td class="summary">
<p>Creates a new AI<em>BAI</em>ZONE object</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(AI_BAI_ZONE).OnAfterAbort">AI_BAI_ZONE:OnAfterAbort(Controllable, From, Event, To)</a></td>
<td class="summary">
<p>OnAfter Transition Handler for Event Abort.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(AI_BAI_ZONE).OnAfterAccomplish">AI_BAI_ZONE:OnAfterAccomplish(Controllable, From, Event, To)</a></td>
<td class="summary">
<p>OnAfter Transition Handler for Event Accomplish.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(AI_BAI_ZONE).OnAfterDestroy">AI_BAI_ZONE:OnAfterDestroy(Controllable, From, Event, To)</a></td>
<td class="summary">
<p>OnAfter Transition Handler for Event Destroy.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(AI_BAI_ZONE).OnAfterEngage">AI_BAI_ZONE:OnAfterEngage(Controllable, From, Event, To)</a></td>
<td class="summary">
<p>OnAfter Transition Handler for Event Engage.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(AI_BAI_ZONE).OnAfterFired">AI_BAI_ZONE:OnAfterFired(Controllable, From, Event, To)</a></td>
<td class="summary">
<p>OnAfter Transition Handler for Event Fired.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(AI_BAI_ZONE).OnBeforeAbort">AI_BAI_ZONE:OnBeforeAbort(Controllable, From, Event, To)</a></td>
<td class="summary">
<p>OnBefore Transition Handler for Event Abort.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(AI_BAI_ZONE).OnBeforeAccomplish">AI_BAI_ZONE:OnBeforeAccomplish(Controllable, From, Event, To)</a></td>
<td class="summary">
<p>OnBefore Transition Handler for Event Accomplish.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(AI_BAI_ZONE).OnBeforeDestroy">AI_BAI_ZONE:OnBeforeDestroy(Controllable, From, Event, To)</a></td>
<td class="summary">
<p>OnBefore Transition Handler for Event Destroy.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(AI_BAI_ZONE).OnBeforeEngage">AI_BAI_ZONE:OnBeforeEngage(Controllable, From, Event, To)</a></td>
<td class="summary">
<p>OnBefore Transition Handler for Event Engage.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(AI_BAI_ZONE).OnBeforeFired">AI_BAI_ZONE:OnBeforeFired(Controllable, From, Event, To)</a></td>
<td class="summary">
<p>OnBefore Transition Handler for Event Fired.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(AI_BAI_ZONE).OnEnterEngaging">AI_BAI_ZONE:OnEnterEngaging(Controllable, From, Event, To)</a></td>
<td class="summary">
<p>OnEnter Transition Handler for State Engaging.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(AI_BAI_ZONE).OnEventDead">AI_BAI_ZONE:OnEventDead(EventData)</a></td>
<td class="summary">
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(AI_BAI_ZONE).OnLeaveEngaging">AI_BAI_ZONE:OnLeaveEngaging(Controllable, From, Event, To)</a></td>
<td class="summary">
<p>OnLeave Transition Handler for State Engaging.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(AI_BAI_ZONE).Search">AI_BAI_ZONE.Search</a></td>
<td class="summary">
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(AI_BAI_ZONE).SearchOff">AI_BAI_ZONE:SearchOff()</a></td>
<td class="summary">
<p>If Search is Off, the current zone coordinate will be the center of the bombing.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(AI_BAI_ZONE).SearchOn">AI_BAI_ZONE:SearchOn()</a></td>
<td class="summary">
<p>If Search is On, BAI will search for potential targets in the zone.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(AI_BAI_ZONE).SearchOnOff">AI_BAI_ZONE:SearchOnOff(Search)</a></td>
<td class="summary">
<p>Specifies whether to search for potential targets in the zone, or let the center of the zone be the bombing coordinate.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(AI_BAI_ZONE).SetEngageZone">AI_BAI_ZONE:SetEngageZone(EngageZone)</a></td>
<td class="summary">
<p>Set the Engage Zone where the AI is performing BOMB.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(AI_BAI_ZONE).TargetZone">AI_BAI_ZONE.TargetZone</a></td>
<td class="summary">
<p>The <a href="Zone.html">Zone</a> where the patrol needs to be executed.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(AI_BAI_ZONE).__Abort">AI_BAI_ZONE:__Abort(Delay)</a></td>
<td class="summary">
<p>Asynchronous Event Trigger for Event Abort.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(AI_BAI_ZONE).__Accomplish">AI_BAI_ZONE:__Accomplish(Delay)</a></td>
<td class="summary">
<p>Asynchronous Event Trigger for Event Accomplish.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(AI_BAI_ZONE).__Destroy">AI_BAI_ZONE:__Destroy(Delay)</a></td>
<td class="summary">
<p>Asynchronous Event Trigger for Event Destroy.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(AI_BAI_ZONE).__Engage">AI_BAI_ZONE:__Engage(Delay, EngageSpeed, EngageAltitude, EngageWeaponExpend, EngageAttackQty, EngageDirection)</a></td>
<td class="summary">
<p>Asynchronous Event Trigger for Event Engage.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(AI_BAI_ZONE).__Fired">AI_BAI_ZONE:__Fired(Delay)</a></td>
<td class="summary">
<p>Asynchronous Event Trigger for Event Fired.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(AI_BAI_ZONE).onafterAbort">AI_BAI_ZONE:onafterAbort(Controllable, From, Event, To)</a></td>
<td class="summary">
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(AI_BAI_ZONE).onafterAccomplish">AI_BAI_ZONE:onafterAccomplish(Controllable, From, Event, To)</a></td>
<td class="summary">
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(AI_BAI_ZONE).onafterDestroy">AI_BAI_ZONE:onafterDestroy(Controllable, From, Event, To, EventData)</a></td>
<td class="summary">
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(AI_BAI_ZONE).onafterEngage">AI_BAI_ZONE:onafterEngage(Controllable, From, Event, To, EngageSpeed, EngageAltitude, EngageWeaponExpend, EngageAttackQty, EngageDirection)</a></td>
<td class="summary">
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(AI_BAI_ZONE).onafterStart">AI_BAI_ZONE:onafterStart(Controllable, From, Event, To)</a></td>
<td class="summary">
<p>onafter State Transition for Event Start.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(AI_BAI_ZONE).onafterTarget">AI_BAI_ZONE:onafterTarget(Controllable, From, Event, To)</a></td>
<td class="summary">
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(AI_BAI_ZONE).onbeforeEngage">AI_BAI_ZONE:onbeforeEngage(Controllable, From, Event, To)</a></td>
<td class="summary">
</td>
</tr>
</table>
<h2>Global(s)</h2>
<dl class="function">
<dt>
<em><a href="##(AI_BAI_ZONE)">#AI_BAI_ZONE</a></em>
<a id="AI_BAI_ZONE" >
<strong>AI_BAI_ZONE</strong>
</a>
</dt>
<dd>
<h1>AI<em>BAI</em>ZONE class, extends <a href="AI_Patrol.html##(AI_PATROL_ZONE)">AI<em>Patrol#AI</em>PATROL_ZONE</a></h1>
<p>AI<em>BAI</em>ZONE derives from the <a href="AI_Patrol.html##(AI_PATROL_ZONE)">AI<em>Patrol#AI</em>PATROL_ZONE</a>, inheriting its methods and behaviour.</p>
<p>
The AI<em>BAI</em>ZONE class implements the core functions to provide BattleGround Air Interdiction in an Engage <a href="Zone.html">Zone</a> by an AIR <a href="Controllable.html">Controllable</a> or <a href="Group.html">Group</a>.
The AI<em>BAI</em>ZONE runs a process. It holds an AI in a Patrol Zone and when the AI is commanded to engage, it will fly to an Engage Zone.</p>
<p><img src="..\Presentations\AI_BAI\Dia3.JPG" alt="HoldAndEngage"/></p>
<p>The AI<em>BAI</em>ZONE is assigned a <a href="Group.html">Group</a> and this must be done before the AI<em>BAI</em>ZONE process can be started through the <strong>Start</strong> event.</p>
<p><img src="..\Presentations\AI_BAI\Dia4.JPG" alt="Start Event"/></p>
<p>Upon started, The AI will <strong>Route</strong> itself towards the random 3D point within a patrol zone,
using a random speed within the given altitude and speed limits.
Upon arrival at the 3D point, a new random 3D point will be selected within the patrol zone using the given limits.
This cycle will continue until a fuel or damage treshold has been reached by the AI, or when the AI is commanded to RTB.</p>
<p><img src="..\Presentations\AI_BAI\Dia5.JPG" alt="Route Event"/></p>
<p>When the AI is commanded to provide BattleGround Air Interdiction (through the event <strong>Engage</strong>), the AI will fly towards the Engage Zone.
Any target that is detected in the Engage Zone will be reported and will be destroyed by the AI.</p>
<p><img src="..\Presentations\AI_BAI\Dia6.JPG" alt="Engage Event"/></p>
<p>The AI will detect the targets and will only destroy the targets within the Engage Zone.</p>
<p><img src="..\Presentations\AI_BAI\Dia7.JPG" alt="Engage Event"/></p>
<p>Every target that is destroyed, is reported&lt; by the AI.</p>
<p><img src="..\Presentations\AI_BAI\Dia8.JPG" alt="Engage Event"/></p>
<p>Note that the AI does not know when the Engage Zone is cleared, and therefore will keep circling in the zone. </p>
<p><img src="..\Presentations\AI_BAI\Dia9.JPG" alt="Engage Event"/></p>
<p>Until it is notified through the event <strong>Accomplish</strong>, which is to be triggered by an observing party:</p>
<ul>
<li>a FAC</li>
<li>a timed event</li>
<li>a menu option selected by a human</li>
<li>a condition</li>
<li>others ...</li>
</ul>
<p><img src="..\Presentations\AI_BAI\Dia10.JPG" alt="Engage Event"/></p>
<p>When the AI has accomplished the Bombing, it will fly back to the Patrol Zone.</p>
<p><img src="..\Presentations\AI_BAI\Dia11.JPG" alt="Engage Event"/></p>
<p>It will keep patrolling there, until it is notified to RTB or move to another BOMB Zone.
It can be notified to go RTB through the <strong>RTB</strong> event.</p>
<p>When the fuel treshold has been reached, the airplane will fly towards the nearest friendly airbase and will land.</p>
<p><img src="..\Presentations\AI_BAI\Dia12.JPG" alt="Engage Event"/></p>
<h1>1. AI<em>BAI</em>ZONE constructor</h1>
<ul>
<li><a href="##(AI_BAI_ZONE).New">AI<em>BAI</em>ZONE.New</a>(): Creates a new AI<em>BAI</em>ZONE object.</li>
</ul>
<h2>2. AI<em>BAI</em>ZONE is a FSM</h2>
<p><img src="..\Presentations\AI_BAI\Dia2.JPG" alt="Process"/></p>
<h3>2.1. AI<em>BAI</em>ZONE States</h3>
<ul>
<li><strong>None</strong> ( Group ): The process is not started yet.</li>
<li><strong>Patrolling</strong> ( Group ): The AI is patrolling the Patrol Zone.</li>
<li><strong>Engaging</strong> ( Group ): The AI is engaging the targets in the Engage Zone, executing BOMB.</li>
<li><strong>Returning</strong> ( Group ): The AI is returning to Base..</li>
</ul>
<h3>2.2. AI<em>BAI</em>ZONE Events</h3>
<ul>
<li>**<a href="AI_Patrol.html##(AI_PATROL_ZONE).Start">AI<em>Patrol#AI</em>PATROL_ZONE.Start</a>**: Start the process.</li>
<li>**<a href="AI_Patrol.html##(AI_PATROL_ZONE).Route">AI<em>Patrol#AI</em>PATROL_ZONE.Route</a>**: Route the AI to a new random 3D point within the Patrol Zone.</li>
<li>**<a href="##(AI_BAI_ZONE).Engage">AI<em>BAI</em>ZONE.Engage</a>**: Engage the AI to provide BOMB in the Engage Zone, destroying any target it finds.</li>
<li>**<a href="##(AI_BAI_ZONE).Abort">AI<em>BAI</em>ZONE.Abort</a>**: Aborts the engagement and return patrolling in the patrol zone.</li>
<li>**<a href="AI_Patrol.html##(AI_PATROL_ZONE).RTB">AI<em>Patrol#AI</em>PATROL_ZONE.RTB</a>**: Route the AI to the home base.</li>
<li>**<a href="AI_Patrol.html##(AI_PATROL_ZONE).Detect">AI<em>Patrol#AI</em>PATROL_ZONE.Detect</a>**: The AI is detecting targets.</li>
<li>**<a href="AI_Patrol.html##(AI_PATROL_ZONE).Detected">AI<em>Patrol#AI</em>PATROL_ZONE.Detected</a>**: The AI has detected new targets.</li>
<li>**<a href="##(AI_BAI_ZONE).Destroy">AI<em>BAI</em>ZONE.Destroy</a>**: The AI has destroyed a target <a href="Unit.html">Unit</a>.</li>
<li>**<a href="##(AI_BAI_ZONE).Destroyed">AI<em>BAI</em>ZONE.Destroyed</a>**: The AI has destroyed all target <a href="Unit.html">Unit</a>s assigned in the BOMB task.</li>
<li><strong>Status</strong>: The AI is checking status (fuel and damage). When the tresholds have been reached, the AI will RTB.</li>
</ul>
<h2>3. Modify the Engage Zone behaviour to pinpoint a <strong>map object</strong> or <strong>scenery object</strong></h2>
<p>Use the method <a href="##(AI_BAI_ZONE).SearchOff">AI<em>BAI</em>ZONE.SearchOff</a>() to specify that the EngageZone is not to be searched for potential targets (UNITs), but that the center of the zone
is the point where a map object is to be destroyed (like a bridge).</p>
<p>Example:</p>
<pre><code> -- Tell the BAI not to search for potential targets in the BAIEngagementZone, but rather use the center of the BAIEngagementZone as the bombing location.
AIBAIZone:SearchOff()
</code></pre>
<p>Searching can be switched back on with the method <a href="##(AI_BAI_ZONE).SearchOn">AI<em>BAI</em>ZONE.SearchOn</a>(). Use the method <a href="##(AI_BAI_ZONE).SearchOnOff">AI<em>BAI</em>ZONE.SearchOnOff</a>() to flexibily switch searching on or off.</p>
<hr/>
</dd>
</dl>
<dl class="function">
<dt>
<a id="_NewEngageRoute" >
<strong>_NewEngageRoute(AIControllable)</strong>
</a>
</dt>
<dd>
<h3>Parameter</h3>
<ul>
<li>
<p><code><em><a href="Wrapper.Controllable.html##(CONTROLLABLE)">Wrapper.Controllable#CONTROLLABLE</a> AIControllable </em></code>: </p>
</li>
</ul>
</dd>
</dl>
<h2><a id="#(AI_Bai)" >Type <code>AI_Bai</code></a></h2>
<h2><a id="#(AI_BAI_ZONE)" >Type <code>AI_BAI_ZONE</code></a></h2>
<p>AI<em>BAI</em>ZONE class</p>
<h3>Field(s)</h3>
<dl class="function">
<dt>
<em><a href="Wrapper.Controllable.html##(CONTROLLABLE)">Wrapper.Controllable#CONTROLLABLE</a></em>
<a id="#(AI_BAI_ZONE).AIControllable" >
<strong>AI_BAI_ZONE.AIControllable</strong>
</a>
</dt>
<dd>
<p>The <a href="Controllable.html">Controllable</a> patrolling.</p>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(AI_BAI_ZONE).Abort" >
<strong>AI_BAI_ZONE:Abort()</strong>
</a>
</dt>
<dd>
<p>Synchronous Event Trigger for Event Abort.</p>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(AI_BAI_ZONE).Accomplish" >
<strong>AI_BAI_ZONE:Accomplish()</strong>
</a>
</dt>
<dd>
<p>Synchronous Event Trigger for Event Accomplish.</p>
</dd>
</dl>
<dl class="function">
<dt>
<em>#boolean</em>
<a id="#(AI_BAI_ZONE).Accomplished" >
<strong>AI_BAI_ZONE.Accomplished</strong>
</a>
</dt>
<dd>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(AI_BAI_ZONE).Destroy" >
<strong>AI_BAI_ZONE:Destroy()</strong>
</a>
</dt>
<dd>
<p>Synchronous Event Trigger for Event Destroy.</p>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(AI_BAI_ZONE).Engage" >
<strong>AI_BAI_ZONE:Engage(EngageSpeed, EngageAltitude, EngageWeaponExpend, EngageAttackQty, EngageDirection)</strong>
</a>
</dt>
<dd>
<p>Synchronous Event Trigger for Event Engage.</p>
<h3>Parameters</h3>
<ul>
<li>
<p><code><em>#number EngageSpeed </em></code>:
(optional) The speed the Group will hold when engaging to the target zone.</p>
</li>
<li>
<p><code><em><a href="Dcs.DCSTypes.html##(Distance)">Dcs.DCSTypes#Distance</a> EngageAltitude </em></code>:
(optional) Desired altitude to perform the unit engagement.</p>
</li>
<li>
<p><code><em><a href="Dcs.DCSTypes.html##(AI.Task.WeaponExpend)">Dcs.DCSTypes#AI.Task.WeaponExpend</a> EngageWeaponExpend </em></code>:
(optional) Determines how much weapon will be released at each attack.
If parameter is not defined the unit / controllable will choose expend on its own discretion.
Use the structure <a href="DCSTypes.html##(AI.Task).WeaponExpend">DCSTypes#AI.Task.WeaponExpend</a> to define the amount of weapons to be release at each attack.</p>
</li>
<li>
<p><code><em>#number EngageAttackQty </em></code>:
(optional) This parameter limits maximal quantity of attack. The aicraft/controllable will not make more attack than allowed even if the target controllable not destroyed and the aicraft/controllable still have ammo. If not defined the aircraft/controllable will attack target until it will be destroyed or until the aircraft/controllable will run out of ammo.</p>
</li>
<li>
<p><code><em><a href="Dcs.DCSTypes.html##(Azimuth)">Dcs.DCSTypes#Azimuth</a> EngageDirection </em></code>:
(optional) Desired ingress direction from the target to the attacking aircraft. Controllable/aircraft will make its attacks from the direction. Of course if there is no way to attack from the direction due the terrain controllable/aircraft will choose another direction.</p>
</li>
</ul>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(AI_BAI_ZONE).EngageAltitude" >
<strong>AI_BAI_ZONE.EngageAltitude</strong>
</a>
</dt>
<dd>
</dd>
</dl>
<dl class="function">
<dt>
<em></em>
<a id="#(AI_BAI_ZONE).EngageAttackQty" >
<strong>AI_BAI_ZONE.EngageAttackQty</strong>
</a>
</dt>
<dd>
</dd>
</dl>
<dl class="function">
<dt>
<em></em>
<a id="#(AI_BAI_ZONE).EngageDirection" >
<strong>AI_BAI_ZONE.EngageDirection</strong>
</a>
</dt>
<dd>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(AI_BAI_ZONE).EngageSpeed" >
<strong>AI_BAI_ZONE.EngageSpeed</strong>
</a>
</dt>
<dd>
</dd>
</dl>
<dl class="function">
<dt>
<em></em>
<a id="#(AI_BAI_ZONE).EngageWeaponExpend" >
<strong>AI_BAI_ZONE.EngageWeaponExpend</strong>
</a>
</dt>
<dd>
</dd>
</dl>
<dl class="function">
<dt>
<em></em>
<a id="#(AI_BAI_ZONE).EngageZone" >
<strong>AI_BAI_ZONE.EngageZone</strong>
</a>
</dt>
<dd>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(AI_BAI_ZONE).Fired" >
<strong>AI_BAI_ZONE:Fired()</strong>
</a>
</dt>
<dd>
<p>Synchronous Event Trigger for Event Fired.</p>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(AI_BAI_ZONE).New" >
<strong>AI_BAI_ZONE:New(PatrolZone, PatrolFloorAltitude, PatrolCeilingAltitude, PatrolMinSpeed, PatrolMaxSpeed, EngageZone, PatrolAltType)</strong>
</a>
</dt>
<dd>
<p>Creates a new AI<em>BAI</em>ZONE object</p>
<h3>Parameters</h3>
<ul>
<li>
<p><code><em><a href="Core.Zone.html##(ZONE_BASE)">Core.Zone#ZONE_BASE</a> PatrolZone </em></code>:
The <a href="Zone.html">Zone</a> where the patrol needs to be executed.</p>
</li>
<li>
<p><code><em><a href="Dcs.DCSTypes.html##(Altitude)">Dcs.DCSTypes#Altitude</a> PatrolFloorAltitude </em></code>:
The lowest altitude in meters where to execute the patrol.</p>
</li>
<li>
<p><code><em><a href="Dcs.DCSTypes.html##(Altitude)">Dcs.DCSTypes#Altitude</a> PatrolCeilingAltitude </em></code>:
The highest altitude in meters where to execute the patrol.</p>
</li>
<li>
<p><code><em><a href="Dcs.DCSTypes.html##(Speed)">Dcs.DCSTypes#Speed</a> PatrolMinSpeed </em></code>:
The minimum speed of the <a href="Controllable.html">Controllable</a> in km/h.</p>
</li>
<li>
<p><code><em><a href="Dcs.DCSTypes.html##(Speed)">Dcs.DCSTypes#Speed</a> PatrolMaxSpeed </em></code>:
The maximum speed of the <a href="Controllable.html">Controllable</a> in km/h.</p>
</li>
<li>
<p><code><em><a href="Core.Zone.html##(ZONE_BASE)">Core.Zone#ZONE_BASE</a> EngageZone </em></code>:
The zone where the engage will happen.</p>
</li>
<li>
<p><code><em><a href="Dcs.DCSTypes.html##(AltitudeType)">Dcs.DCSTypes#AltitudeType</a> PatrolAltType </em></code>:
The altitude type ("RADIO"=="AGL", "BARO"=="ASL"). Defaults to RADIO</p>
</li>
</ul>
<h3>Return value</h3>
<p><em><a href="##(AI_BAI_ZONE)">#AI<em>BAI</em>ZONE</a>:</em>
self</p>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(AI_BAI_ZONE).OnAfterAbort" >
<strong>AI_BAI_ZONE:OnAfterAbort(Controllable, From, Event, To)</strong>
</a>
</dt>
<dd>
<p>OnAfter Transition Handler for Event Abort.</p>
<h3>Parameters</h3>
<ul>
<li>
<p><code><em><a href="Wrapper.Controllable.html##(CONTROLLABLE)">Wrapper.Controllable#CONTROLLABLE</a> Controllable </em></code>:
The Controllable Object managed by the FSM.</p>
</li>
<li>
<p><code><em>#string From </em></code>:
The From State string.</p>
</li>
<li>
<p><code><em>#string Event </em></code>:
The Event string.</p>
</li>
<li>
<p><code><em>#string To </em></code>:
The To State string.</p>
</li>
</ul>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(AI_BAI_ZONE).OnAfterAccomplish" >
<strong>AI_BAI_ZONE:OnAfterAccomplish(Controllable, From, Event, To)</strong>
</a>
</dt>
<dd>
<p>OnAfter Transition Handler for Event Accomplish.</p>
<h3>Parameters</h3>
<ul>
<li>
<p><code><em><a href="Wrapper.Controllable.html##(CONTROLLABLE)">Wrapper.Controllable#CONTROLLABLE</a> Controllable </em></code>:
The Controllable Object managed by the FSM.</p>
</li>
<li>
<p><code><em>#string From </em></code>:
The From State string.</p>
</li>
<li>
<p><code><em>#string Event </em></code>:
The Event string.</p>
</li>
<li>
<p><code><em>#string To </em></code>:
The To State string.</p>
</li>
</ul>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(AI_BAI_ZONE).OnAfterDestroy" >
<strong>AI_BAI_ZONE:OnAfterDestroy(Controllable, From, Event, To)</strong>
</a>
</dt>
<dd>
<p>OnAfter Transition Handler for Event Destroy.</p>
<h3>Parameters</h3>
<ul>
<li>
<p><code><em><a href="Wrapper.Controllable.html##(CONTROLLABLE)">Wrapper.Controllable#CONTROLLABLE</a> Controllable </em></code>:
The Controllable Object managed by the FSM.</p>
</li>
<li>
<p><code><em>#string From </em></code>:
The From State string.</p>
</li>
<li>
<p><code><em>#string Event </em></code>:
The Event string.</p>
</li>
<li>
<p><code><em>#string To </em></code>:
The To State string.</p>
</li>
</ul>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(AI_BAI_ZONE).OnAfterEngage" >
<strong>AI_BAI_ZONE:OnAfterEngage(Controllable, From, Event, To)</strong>
</a>
</dt>
<dd>
<p>OnAfter Transition Handler for Event Engage.</p>
<h3>Parameters</h3>
<ul>
<li>
<p><code><em><a href="Wrapper.Controllable.html##(CONTROLLABLE)">Wrapper.Controllable#CONTROLLABLE</a> Controllable </em></code>:
The Controllable Object managed by the FSM.</p>
</li>
<li>
<p><code><em>#string From </em></code>:
The From State string.</p>
</li>
<li>
<p><code><em>#string Event </em></code>:
The Event string.</p>
</li>
<li>
<p><code><em>#string To </em></code>:
The To State string.</p>
</li>
</ul>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(AI_BAI_ZONE).OnAfterFired" >
<strong>AI_BAI_ZONE:OnAfterFired(Controllable, From, Event, To)</strong>
</a>
</dt>
<dd>
<p>OnAfter Transition Handler for Event Fired.</p>
<h3>Parameters</h3>
<ul>
<li>
<p><code><em><a href="Wrapper.Controllable.html##(CONTROLLABLE)">Wrapper.Controllable#CONTROLLABLE</a> Controllable </em></code>:
The Controllable Object managed by the FSM.</p>
</li>
<li>
<p><code><em>#string From </em></code>:
The From State string.</p>
</li>
<li>
<p><code><em>#string Event </em></code>:
The Event string.</p>
</li>
<li>
<p><code><em>#string To </em></code>:
The To State string.</p>
</li>
</ul>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(AI_BAI_ZONE).OnBeforeAbort" >
<strong>AI_BAI_ZONE:OnBeforeAbort(Controllable, From, Event, To)</strong>
</a>
</dt>
<dd>
<p>OnBefore Transition Handler for Event Abort.</p>
<h3>Parameters</h3>
<ul>
<li>
<p><code><em><a href="Wrapper.Controllable.html##(CONTROLLABLE)">Wrapper.Controllable#CONTROLLABLE</a> Controllable </em></code>:
The Controllable Object managed by the FSM.</p>
</li>
<li>
<p><code><em>#string From </em></code>:
The From State string.</p>
</li>
<li>
<p><code><em>#string Event </em></code>:
The Event string.</p>
</li>
<li>
<p><code><em>#string To </em></code>:
The To State string.</p>
</li>
</ul>
<h3>Return value</h3>
<p><em>#boolean:</em>
Return false to cancel Transition.</p>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(AI_BAI_ZONE).OnBeforeAccomplish" >
<strong>AI_BAI_ZONE:OnBeforeAccomplish(Controllable, From, Event, To)</strong>
</a>
</dt>
<dd>
<p>OnBefore Transition Handler for Event Accomplish.</p>
<h3>Parameters</h3>
<ul>
<li>
<p><code><em><a href="Wrapper.Controllable.html##(CONTROLLABLE)">Wrapper.Controllable#CONTROLLABLE</a> Controllable </em></code>:
The Controllable Object managed by the FSM.</p>
</li>
<li>
<p><code><em>#string From </em></code>:
The From State string.</p>
</li>
<li>
<p><code><em>#string Event </em></code>:
The Event string.</p>
</li>
<li>
<p><code><em>#string To </em></code>:
The To State string.</p>
</li>
</ul>
<h3>Return value</h3>
<p><em>#boolean:</em>
Return false to cancel Transition.</p>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(AI_BAI_ZONE).OnBeforeDestroy" >
<strong>AI_BAI_ZONE:OnBeforeDestroy(Controllable, From, Event, To)</strong>
</a>
</dt>
<dd>
<p>OnBefore Transition Handler for Event Destroy.</p>
<h3>Parameters</h3>
<ul>
<li>
<p><code><em><a href="Wrapper.Controllable.html##(CONTROLLABLE)">Wrapper.Controllable#CONTROLLABLE</a> Controllable </em></code>:
The Controllable Object managed by the FSM.</p>
</li>
<li>
<p><code><em>#string From </em></code>:
The From State string.</p>
</li>
<li>
<p><code><em>#string Event </em></code>:
The Event string.</p>
</li>
<li>
<p><code><em>#string To </em></code>:
The To State string.</p>
</li>
</ul>
<h3>Return value</h3>
<p><em>#boolean:</em>
Return false to cancel Transition.</p>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(AI_BAI_ZONE).OnBeforeEngage" >
<strong>AI_BAI_ZONE:OnBeforeEngage(Controllable, From, Event, To)</strong>
</a>
</dt>
<dd>
<p>OnBefore Transition Handler for Event Engage.</p>
<h3>Parameters</h3>
<ul>
<li>
<p><code><em><a href="Wrapper.Controllable.html##(CONTROLLABLE)">Wrapper.Controllable#CONTROLLABLE</a> Controllable </em></code>:
The Controllable Object managed by the FSM.</p>
</li>
<li>
<p><code><em>#string From </em></code>:
The From State string.</p>
</li>
<li>
<p><code><em>#string Event </em></code>:
The Event string.</p>
</li>
<li>
<p><code><em>#string To </em></code>:
The To State string.</p>
</li>
</ul>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(AI_BAI_ZONE).OnBeforeFired" >
<strong>AI_BAI_ZONE:OnBeforeFired(Controllable, From, Event, To)</strong>
</a>
</dt>
<dd>
<p>OnBefore Transition Handler for Event Fired.</p>
<h3>Parameters</h3>
<ul>
<li>
<p><code><em><a href="Wrapper.Controllable.html##(CONTROLLABLE)">Wrapper.Controllable#CONTROLLABLE</a> Controllable </em></code>:
The Controllable Object managed by the FSM.</p>
</li>
<li>
<p><code><em>#string From </em></code>:
The From State string.</p>
</li>
<li>
<p><code><em>#string Event </em></code>:
The Event string.</p>
</li>
<li>
<p><code><em>#string To </em></code>:
The To State string.</p>
</li>
</ul>
<h3>Return value</h3>
<p><em>#boolean:</em>
Return false to cancel Transition.</p>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(AI_BAI_ZONE).OnEnterEngaging" >
<strong>AI_BAI_ZONE:OnEnterEngaging(Controllable, From, Event, To)</strong>
</a>
</dt>
<dd>
<p>OnEnter Transition Handler for State Engaging.</p>
<h3>Parameters</h3>
<ul>
<li>
<p><code><em><a href="Wrapper.Controllable.html##(CONTROLLABLE)">Wrapper.Controllable#CONTROLLABLE</a> Controllable </em></code>:
The Controllable Object managed by the FSM.</p>
</li>
<li>
<p><code><em>#string From </em></code>:
The From State string.</p>
</li>
<li>
<p><code><em>#string Event </em></code>:
The Event string.</p>
</li>
<li>
<p><code><em>#string To </em></code>:
The To State string.</p>
</li>
</ul>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(AI_BAI_ZONE).OnEventDead" >
<strong>AI_BAI_ZONE:OnEventDead(EventData)</strong>
</a>
</dt>
<dd>
<h3>Parameter</h3>
<ul>
<li>
<p><code><em><a href="Core.Event.html##(EVENTDATA)">Core.Event#EVENTDATA</a> EventData </em></code>: </p>
</li>
</ul>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(AI_BAI_ZONE).OnLeaveEngaging" >
<strong>AI_BAI_ZONE:OnLeaveEngaging(Controllable, From, Event, To)</strong>
</a>
</dt>
<dd>
<p>OnLeave Transition Handler for State Engaging.</p>
<h3>Parameters</h3>
<ul>
<li>
<p><code><em><a href="Wrapper.Controllable.html##(CONTROLLABLE)">Wrapper.Controllable#CONTROLLABLE</a> Controllable </em></code>:
The Controllable Object managed by the FSM.</p>
</li>
<li>
<p><code><em>#string From </em></code>:
The From State string.</p>
</li>
<li>
<p><code><em>#string Event </em></code>:
The Event string.</p>
</li>
<li>
<p><code><em>#string To </em></code>:
The To State string.</p>
</li>
</ul>
<h3>Return value</h3>
<p><em>#boolean:</em>
Return false to cancel Transition.</p>
</dd>
</dl>
<dl class="function">
<dt>
<em></em>
<a id="#(AI_BAI_ZONE).Search" >
<strong>AI_BAI_ZONE.Search</strong>
</a>
</dt>
<dd>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(AI_BAI_ZONE).SearchOff" >
<strong>AI_BAI_ZONE:SearchOff()</strong>
</a>
</dt>
<dd>
<p>If Search is Off, the current zone coordinate will be the center of the bombing.</p>
<h3>Return value</h3>
<p><em><a href="##(AI_BAI_ZONE)">#AI<em>BAI</em>ZONE</a>:</em></p>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(AI_BAI_ZONE).SearchOn" >
<strong>AI_BAI_ZONE:SearchOn()</strong>
</a>
</dt>
<dd>
<p>If Search is On, BAI will search for potential targets in the zone.</p>
<h3>Return value</h3>
<p><em><a href="##(AI_BAI_ZONE)">#AI<em>BAI</em>ZONE</a>:</em></p>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(AI_BAI_ZONE).SearchOnOff" >
<strong>AI_BAI_ZONE:SearchOnOff(Search)</strong>
</a>
</dt>
<dd>
<p>Specifies whether to search for potential targets in the zone, or let the center of the zone be the bombing coordinate.</p>
<p>AI<em>BAI</em>ZONE will search for potential targets by default.</p>
<h3>Parameter</h3>
<ul>
<li>
<p><code><em> Search </em></code>: </p>
</li>
</ul>
<h3>Return value</h3>
<p><em><a href="##(AI_BAI_ZONE)">#AI<em>BAI</em>ZONE</a>:</em></p>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(AI_BAI_ZONE).SetEngageZone" >
<strong>AI_BAI_ZONE:SetEngageZone(EngageZone)</strong>
</a>
</dt>
<dd>
<p>Set the Engage Zone where the AI is performing BOMB.</p>
<p>Note that if the EngageZone is changed, the AI needs to re-detect targets.</p>
<h3>Parameter</h3>
<ul>
<li>
<p><code><em><a href="Core.Zone.html##(ZONE)">Core.Zone#ZONE</a> EngageZone </em></code>:
The zone where the AI is performing BOMB.</p>
</li>
</ul>
<h3>Return value</h3>
<p><em><a href="##(AI_BAI_ZONE)">#AI<em>BAI</em>ZONE</a>:</em>
self</p>
</dd>
</dl>
<dl class="function">
<dt>
<em><a href="Core.Zone.html##(ZONE_BASE)">Core.Zone#ZONE_BASE</a></em>
<a id="#(AI_BAI_ZONE).TargetZone" >
<strong>AI_BAI_ZONE.TargetZone</strong>
</a>
</dt>
<dd>
<p>The <a href="Zone.html">Zone</a> where the patrol needs to be executed.</p>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(AI_BAI_ZONE).__Abort" >
<strong>AI_BAI_ZONE:__Abort(Delay)</strong>
</a>
</dt>
<dd>
<p>Asynchronous Event Trigger for Event Abort.</p>
<h3>Parameter</h3>
<ul>
<li>
<p><code><em>#number Delay </em></code>:
The delay in seconds.</p>
</li>
</ul>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(AI_BAI_ZONE).__Accomplish" >
<strong>AI_BAI_ZONE:__Accomplish(Delay)</strong>
</a>
</dt>
<dd>
<p>Asynchronous Event Trigger for Event Accomplish.</p>
<h3>Parameter</h3>
<ul>
<li>
<p><code><em>#number Delay </em></code>:
The delay in seconds. </p>
</li>
</ul>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(AI_BAI_ZONE).__Destroy" >
<strong>AI_BAI_ZONE:__Destroy(Delay)</strong>
</a>
</dt>
<dd>
<p>Asynchronous Event Trigger for Event Destroy.</p>
<h3>Parameter</h3>
<ul>
<li>
<p><code><em>#number Delay </em></code>:
The delay in seconds.</p>
</li>
</ul>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(AI_BAI_ZONE).__Engage" >
<strong>AI_BAI_ZONE:__Engage(Delay, EngageSpeed, EngageAltitude, EngageWeaponExpend, EngageAttackQty, EngageDirection)</strong>
</a>
</dt>
<dd>
<p>Asynchronous Event Trigger for Event Engage.</p>
<h3>Parameters</h3>
<ul>
<li>
<p><code><em>#number Delay </em></code>:
The delay in seconds.</p>
</li>
<li>
<p><code><em>#number EngageSpeed </em></code>:
(optional) The speed the Group will hold when engaging to the target zone.</p>
</li>
<li>
<p><code><em><a href="Dcs.DCSTypes.html##(Distance)">Dcs.DCSTypes#Distance</a> EngageAltitude </em></code>:
(optional) Desired altitude to perform the unit engagement.</p>
</li>
<li>
<p><code><em><a href="Dcs.DCSTypes.html##(AI.Task.WeaponExpend)">Dcs.DCSTypes#AI.Task.WeaponExpend</a> EngageWeaponExpend </em></code>:
(optional) Determines how much weapon will be released at each attack.
If parameter is not defined the unit / controllable will choose expend on its own discretion.
Use the structure <a href="DCSTypes.html##(AI.Task).WeaponExpend">DCSTypes#AI.Task.WeaponExpend</a> to define the amount of weapons to be release at each attack.</p>
</li>
<li>
<p><code><em>#number EngageAttackQty </em></code>:
(optional) This parameter limits maximal quantity of attack. The aicraft/controllable will not make more attack than allowed even if the target controllable not destroyed and the aicraft/controllable still have ammo. If not defined the aircraft/controllable will attack target until it will be destroyed or until the aircraft/controllable will run out of ammo.</p>
</li>
<li>
<p><code><em><a href="Dcs.DCSTypes.html##(Azimuth)">Dcs.DCSTypes#Azimuth</a> EngageDirection </em></code>:
(optional) Desired ingress direction from the target to the attacking aircraft. Controllable/aircraft will make its attacks from the direction. Of course if there is no way to attack from the direction due the terrain controllable/aircraft will choose another direction.</p>
</li>
</ul>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(AI_BAI_ZONE).__Fired" >
<strong>AI_BAI_ZONE:__Fired(Delay)</strong>
</a>
</dt>
<dd>
<p>Asynchronous Event Trigger for Event Fired.</p>
<h3>Parameter</h3>
<ul>
<li>
<p><code><em>#number Delay </em></code>:
The delay in seconds.</p>
</li>
</ul>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(AI_BAI_ZONE).onafterAbort" >
<strong>AI_BAI_ZONE:onafterAbort(Controllable, From, Event, To)</strong>
</a>
</dt>
<dd>
<h3>Parameters</h3>
<ul>
<li>
<p><code><em><a href="Wrapper.Controllable.html##(CONTROLLABLE)">Wrapper.Controllable#CONTROLLABLE</a> Controllable </em></code>:
The Controllable Object managed by the FSM.</p>
</li>
<li>
<p><code><em>#string From </em></code>:
The From State string.</p>
</li>
<li>
<p><code><em>#string Event </em></code>:
The Event string.</p>
</li>
<li>
<p><code><em>#string To </em></code>:
The To State string.</p>
</li>
</ul>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(AI_BAI_ZONE).onafterAccomplish" >
<strong>AI_BAI_ZONE:onafterAccomplish(Controllable, From, Event, To)</strong>
</a>
</dt>
<dd>
<h3>Parameters</h3>
<ul>
<li>
<p><code><em><a href="Wrapper.Controllable.html##(CONTROLLABLE)">Wrapper.Controllable#CONTROLLABLE</a> Controllable </em></code>:
The Controllable Object managed by the FSM.</p>
</li>
<li>
<p><code><em>#string From </em></code>:
The From State string.</p>
</li>
<li>
<p><code><em>#string Event </em></code>:
The Event string.</p>
</li>
<li>
<p><code><em>#string To </em></code>:
The To State string.</p>
</li>
</ul>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(AI_BAI_ZONE).onafterDestroy" >
<strong>AI_BAI_ZONE:onafterDestroy(Controllable, From, Event, To, EventData)</strong>
</a>
</dt>
<dd>
<h3>Parameters</h3>
<ul>
<li>
<p><code><em><a href="Wrapper.Controllable.html##(CONTROLLABLE)">Wrapper.Controllable#CONTROLLABLE</a> Controllable </em></code>:
The Controllable Object managed by the FSM.</p>
</li>
<li>
<p><code><em>#string From </em></code>:
The From State string.</p>
</li>
<li>
<p><code><em>#string Event </em></code>:
The Event string.</p>
</li>
<li>
<p><code><em>#string To </em></code>:
The To State string.</p>
</li>
<li>
<p><code><em><a href="Core.Event.html##(EVENTDATA)">Core.Event#EVENTDATA</a> EventData </em></code>: </p>
</li>
</ul>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(AI_BAI_ZONE).onafterEngage" >
<strong>AI_BAI_ZONE:onafterEngage(Controllable, From, Event, To, EngageSpeed, EngageAltitude, EngageWeaponExpend, EngageAttackQty, EngageDirection)</strong>
</a>
</dt>
<dd>
<h3>Parameters</h3>
<ul>
<li>
<p><code><em><a href="Wrapper.Controllable.html##(CONTROLLABLE)">Wrapper.Controllable#CONTROLLABLE</a> Controllable </em></code>:
The Controllable Object managed by the FSM.</p>
</li>
<li>
<p><code><em>#string From </em></code>:
The From State string.</p>
</li>
<li>
<p><code><em>#string Event </em></code>:
The Event string.</p>
</li>
<li>
<p><code><em>#string To </em></code>:
The To State string.</p>
</li>
<li>
<p><code><em>#number EngageSpeed </em></code>:
(optional) The speed the Group will hold when engaging to the target zone.</p>
</li>
<li>
<p><code><em><a href="Dcs.DCSTypes.html##(Distance)">Dcs.DCSTypes#Distance</a> EngageAltitude </em></code>:
(optional) Desired altitude to perform the unit engagement.</p>
</li>
<li>
<p><code><em><a href="Dcs.DCSTypes.html##(AI.Task.WeaponExpend)">Dcs.DCSTypes#AI.Task.WeaponExpend</a> EngageWeaponExpend </em></code>:
(optional) Determines how much weapon will be released at each attack. If parameter is not defined the unit / controllable will choose expend on its own discretion.</p>
</li>
<li>
<p><code><em>#number EngageAttackQty </em></code>:
(optional) This parameter limits maximal quantity of attack. The aicraft/controllable will not make more attack than allowed even if the target controllable not destroyed and the aicraft/controllable still have ammo. If not defined the aircraft/controllable will attack target until it will be destroyed or until the aircraft/controllable will run out of ammo.</p>
</li>
<li>
<p><code><em><a href="Dcs.DCSTypes.html##(Azimuth)">Dcs.DCSTypes#Azimuth</a> EngageDirection </em></code>:
(optional) Desired ingress direction from the target to the attacking aircraft. Controllable/aircraft will make its attacks from the direction. Of course if there is no way to attack from the direction due the terrain controllable/aircraft will choose another direction.</p>
</li>
</ul>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(AI_BAI_ZONE).onafterStart" >
<strong>AI_BAI_ZONE:onafterStart(Controllable, From, Event, To)</strong>
</a>
</dt>
<dd>
<p>onafter State Transition for Event Start.</p>
<h3>Parameters</h3>
<ul>
<li>
<p><code><em><a href="Wrapper.Controllable.html##(CONTROLLABLE)">Wrapper.Controllable#CONTROLLABLE</a> Controllable </em></code>:
The Controllable Object managed by the FSM.</p>
</li>
<li>
<p><code><em>#string From </em></code>:
The From State string.</p>
</li>
<li>
<p><code><em>#string Event </em></code>:
The Event string.</p>
</li>
<li>
<p><code><em>#string To </em></code>:
The To State string.</p>
</li>
</ul>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(AI_BAI_ZONE).onafterTarget" >
<strong>AI_BAI_ZONE:onafterTarget(Controllable, From, Event, To)</strong>
</a>
</dt>
<dd>
<h3>Parameters</h3>
<ul>
<li>
<p><code><em><a href="Wrapper.Controllable.html##(CONTROLLABLE)">Wrapper.Controllable#CONTROLLABLE</a> Controllable </em></code>:
The Controllable Object managed by the FSM.</p>
</li>
<li>
<p><code><em>#string From </em></code>:
The From State string.</p>
</li>
<li>
<p><code><em>#string Event </em></code>:
The Event string.</p>
</li>
<li>
<p><code><em>#string To </em></code>:
The To State string.</p>
</li>
</ul>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(AI_BAI_ZONE).onbeforeEngage" >
<strong>AI_BAI_ZONE:onbeforeEngage(Controllable, From, Event, To)</strong>
</a>
</dt>
<dd>
<h3>Parameters</h3>
<ul>
<li>
<p><code><em><a href="Wrapper.Controllable.html##(CONTROLLABLE)">Wrapper.Controllable#CONTROLLABLE</a> Controllable </em></code>:
The Controllable Object managed by the FSM.</p>
</li>
<li>
<p><code><em>#string From </em></code>:
The From State string.</p>
</li>
<li>
<p><code><em>#string Event </em></code>:
The Event string.</p>
</li>
<li>
<p><code><em>#string To </em></code>:
The To State string.</p>
</li>
</ul>
</dd>
</dl>
</div>
</div>
</body>
</html>