Fixed AI_CAP

-- ROE fine tuned.
-- Detection events cross firing and exploding...
-- Crash, Ejected, PilotDead is detected, makes the FSM stop.
-- FSM bug fixed. There was an issue with the onbefore and onleave
events returning false, which did not stop the transition! Fixed now.
-- Event calling can return errors, and these must be logged correctly
-> xpcall implemented.
-- Added help from moose club members as a reference in the
documentation. -> delta99 en whisper.
-- ...
This commit is contained in:
FlightControl
2017-01-19 19:51:37 +01:00
parent b52dd7cf57
commit 15fdb0fd45
83 changed files with 613 additions and 326 deletions

View File

@@ -86,7 +86,7 @@ and automatically engage any airborne enemies that are within a certain range or
<p><img src="..\Presentations\AI_Cap\Dia3.JPG" alt="Process"/></p>
<p>The AI<em>CAP</em>ZONE is assigned a @(Group) and this must be done before the AI<em>CAP</em>ZONE process can be started using the <strong>Start</strong> event.</p>
<p>The AI<em>CAP</em>ZONE is assigned a <a href="Group.html">Group</a> and this must be done before the AI<em>CAP</em>ZONE process can be started using the <strong>Start</strong> event.</p>
<p><img src="..\Presentations\AI_Cap\Dia4.JPG" alt="Process"/></p>
@@ -186,6 +186,8 @@ Use the method <a href="AI.AI_Cap.html##(AI_CAP_ZONE).SetEngageZone">AI.AI<em>Ca
<li><strong><a href="https://forums.eagle.ru/member.php?u=90530">Quax</a></strong>: Concept, Advice &amp; Testing.</li>
<li><strong><a href="https://forums.eagle.ru/member.php?u=62835">Pikey</a></strong>: Concept, Advice &amp; Testing.</li>
<li><strong><a href="http://forums.eagle.ru:8080/member.php?u=75036">Gunterlund</a></strong>: Test case revision.</li>
<li>**<a href="http://forums.eagle.ru/member.php?u=3829">Whisper</a>: Testing.</li>
<li>**<a href="https://forums.eagle.ru/member.php?u=125166">Delta99</a>: Testing. </li>
</ul>
<h3>Authors:</h3>
@@ -246,12 +248,6 @@ Use the method <a href="AI.AI_Cap.html##(AI_CAP_ZONE).SetEngageZone">AI.AI<em>Ca
<td class="name" nowrap="nowrap"><a href="##(AI_CAP_ZONE).Destroy">AI_CAP_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_CAP_ZONE).DetectUnits">AI_CAP_ZONE.DetectUnits</a></td>
<td class="summary">
</td>
</tr>
<tr>
@@ -348,12 +344,6 @@ Use the method <a href="AI.AI_Cap.html##(AI_CAP_ZONE).SetEngageZone">AI.AI<em>Ca
<td class="name" nowrap="nowrap"><a href="##(AI_CAP_ZONE).OnBeforeFired">AI_CAP_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_CAP_ZONE).OnDead">AI_CAP_ZONE:OnDead(EventData)</a></td>
<td class="summary">
</td>
</tr>
<tr>
@@ -576,20 +566,6 @@ Use the method <a href="AI.AI_Cap.html##(AI_CAP_ZONE).SetEngageZone">AI.AI<em>Ca
<p>Synchronous Event Trigger for Event Destroy.</p>
</dd>
</dl>
<dl class="function">
<dt>
<em>#boolean</em>
<a id="#(AI_CAP_ZONE).DetectUnits" >
<strong>AI_CAP_ZONE.DetectUnits</strong>
</a>
</dt>
<dd>
</dd>
</dl>
<dl class="function">
@@ -1139,27 +1115,6 @@ Return false to cancel Transition.</p>
<dl class="function">
<dt>
<a id="#(AI_CAP_ZONE).OnDead" >
<strong>AI_CAP_ZONE:OnDead(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_CAP_ZONE).OnEnterEngaging" >
<strong>AI_CAP_ZONE:OnEnterEngaging(Controllable, From, Event, To)</strong>
</a>

View File

@@ -88,7 +88,7 @@ The AI<em>CAS</em>ZONE runs a process. It holds an AI in a Patrol Zone and when
<p><img src="..\Presentations\AI_Cas\Dia3.JPG" alt="HoldAndEngage"/></p>
<p>The AI<em>CAS</em>ZONE is assigned a @(Group) and this must be done before the AI<em>CAS</em>ZONE process can be started through the <strong>Start</strong> event.</p>
<p>The AI<em>CAS</em>ZONE is assigned a <a href="Group.html">Group</a> and this must be done before the AI<em>CAS</em>ZONE process can be started through the <strong>Start</strong> event.</p>
<p><img src="..\Presentations\AI_Cas\Dia4.JPG" alt="Start Event"/></p>
@@ -255,12 +255,6 @@ It can be notified to go RTB through the <strong>RTB</strong> event.</p>
<td class="name" nowrap="nowrap"><a href="##(AI_CAS_ZONE).Destroy">AI_CAS_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_CAS_ZONE).DetectUnits">AI_CAS_ZONE.DetectUnits</a></td>
<td class="summary">
</td>
</tr>
<tr>
@@ -561,20 +555,6 @@ It can be notified to go RTB through the <strong>RTB</strong> event.</p>
<p>Synchronous Event Trigger for Event Destroy.</p>
</dd>
</dl>
<dl class="function">
<dt>
<em>#boolean</em>
<a id="#(AI_CAS_ZONE).DetectUnits" >
<strong>AI_CAS_ZONE.DetectUnits</strong>
</a>
</dt>
<dd>
</dd>
</dl>
<dl class="function">

View File

@@ -85,7 +85,7 @@
<p><img src="..\Presentations\AI_Patrol\Dia3.JPG" alt="Process"/></p>
<p>The AI<em>PATROL</em>ZONE is assigned a @(Group) and this must be done before the AI<em>PATROL</em>ZONE process can be started using the <strong>Start</strong> event.</p>
<p>The AI<em>PATROL</em>ZONE is assigned a <a href="Group.html">Group</a> and this must be done before the AI<em>PATROL</em>ZONE process can be started using the <strong>Start</strong> event.</p>
<p><img src="..\Presentations\AI_Patrol\Dia4.JPG" alt="Process"/></p>
@@ -276,6 +276,12 @@ Use the method <a href="##(AI_PATROL_ZONE).ManageDamage">AI<em>PATROL</em>ZONE.M
<td class="name" nowrap="nowrap"><a href="##(AI_PATROL_ZONE).Detect">AI_PATROL_ZONE:Detect()</a></td>
<td class="summary">
<p>Synchronous Event Trigger for Event Detect.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(AI_PATROL_ZONE).DetectActivated">AI_PATROL_ZONE.DetectActivated</a></td>
<td class="summary">
</td>
</tr>
<tr>
@@ -285,7 +291,7 @@ Use the method <a href="##(AI_PATROL_ZONE).ManageDamage">AI<em>PATROL</em>ZONE.M
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(AI_PATROL_ZONE).DetectUnits">AI_PATROL_ZONE.DetectUnits</a></td>
<td class="name" nowrap="nowrap"><a href="##(AI_PATROL_ZONE).DetectOn">AI_PATROL_ZONE.DetectOn</a></td>
<td class="summary">
</td>
@@ -402,6 +408,18 @@ Use the method <a href="##(AI_PATROL_ZONE).ManageDamage">AI<em>PATROL</em>ZONE.M
<td class="name" nowrap="nowrap"><a href="##(AI_PATROL_ZONE).OnBeforeStatus">AI_PATROL_ZONE:OnBeforeStatus(Controllable, From, Event, To)</a></td>
<td class="summary">
<p>OnBefore Transition Handler for Event Status.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(AI_PATROL_ZONE).OnCrash">AI_PATROL_ZONE:OnCrash(EventData)</a></td>
<td class="summary">
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(AI_PATROL_ZONE).OnEjection">AI_PATROL_ZONE:OnEjection(EventData)</a></td>
<td class="summary">
</td>
</tr>
<tr>
@@ -426,6 +444,12 @@ Use the method <a href="##(AI_PATROL_ZONE).ManageDamage">AI<em>PATROL</em>ZONE.M
<td class="name" nowrap="nowrap"><a href="##(AI_PATROL_ZONE).OnLeaveReturning">AI_PATROL_ZONE:OnLeaveReturning(Controllable, From, Event, To)</a></td>
<td class="summary">
<p>OnLeave Transition Handler for State Returning.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(AI_PATROL_ZONE).OnPilotDead">AI_PATROL_ZONE:OnPilotDead(EventData)</a></td>
<td class="summary">
</td>
</tr>
<tr>
@@ -504,6 +528,18 @@ Use the method <a href="##(AI_PATROL_ZONE).ManageDamage">AI<em>PATROL</em>ZONE.M
<td class="name" nowrap="nowrap"><a href="##(AI_PATROL_ZONE).SetAltitude">AI_PATROL_ZONE:SetAltitude(PatrolFloorAltitude, PatrolCeilingAltitude)</a></td>
<td class="summary">
<p>Sets the floor and ceiling altitude of the patrol.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(AI_PATROL_ZONE).SetDetectionActivated">AI_PATROL_ZONE:SetDetectionActivated()</a></td>
<td class="summary">
<p>Activate the detection.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(AI_PATROL_ZONE).SetDetectionDeactivated">AI_PATROL_ZONE:SetDetectionDeactivated()</a></td>
<td class="summary">
<p>Deactivate the detection.</p>
</td>
</tr>
<tr>
@@ -534,6 +570,12 @@ Use the method <a href="##(AI_PATROL_ZONE).ManageDamage">AI<em>PATROL</em>ZONE.M
<td class="name" nowrap="nowrap"><a href="##(AI_PATROL_ZONE).SetSpeed">AI_PATROL_ZONE:SetSpeed(PatrolMinSpeed, PatrolMaxSpeed)</a></td>
<td class="summary">
<p>Sets (modifies) the minimum and maximum speed of the patrol.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(AI_PATROL_ZONE).SetStatusOff">AI_PATROL_ZONE:SetStatusOff()</a></td>
<td class="summary">
<p>Set the status checking off.</p>
</td>
</tr>
<tr>
@@ -588,6 +630,12 @@ Use the method <a href="##(AI_PATROL_ZONE).ManageDamage">AI<em>PATROL</em>ZONE.M
<td class="name" nowrap="nowrap"><a href="##(AI_PATROL_ZONE).__Status">AI_PATROL_ZONE:__Status(Delay)</a></td>
<td class="summary">
<p>Asynchronous Event Trigger for Event Status.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(AI_PATROL_ZONE).onafterDead">AI_PATROL_ZONE:onafterDead()</a></td>
<td class="summary">
</td>
</tr>
<tr>
@@ -723,6 +771,20 @@ Use the method <a href="##(AI_PATROL_ZONE).ManageDamage">AI<em>PATROL</em>ZONE.M
<p>Synchronous Event Trigger for Event Detect.</p>
</dd>
</dl>
<dl class="function">
<dt>
<em>#boolean</em>
<a id="#(AI_PATROL_ZONE).DetectActivated" >
<strong>AI_PATROL_ZONE.DetectActivated</strong>
</a>
</dt>
<dd>
</dd>
</dl>
<dl class="function">
@@ -743,8 +805,8 @@ Use the method <a href="##(AI_PATROL_ZONE).ManageDamage">AI<em>PATROL</em>ZONE.M
<dt>
<em>#boolean</em>
<a id="#(AI_PATROL_ZONE).DetectUnits" >
<strong>AI_PATROL_ZONE.DetectUnits</strong>
<a id="#(AI_PATROL_ZONE).DetectOn" >
<strong>AI_PATROL_ZONE.DetectOn</strong>
</a>
</dt>
<dd>
@@ -1461,6 +1523,48 @@ Return false to cancel Transition.</p>
<dl class="function">
<dt>
<a id="#(AI_PATROL_ZONE).OnCrash" >
<strong>AI_PATROL_ZONE:OnCrash(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_PATROL_ZONE).OnEjection" >
<strong>AI_PATROL_ZONE:OnEjection(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_PATROL_ZONE).OnEnterPatrolling" >
<strong>AI_PATROL_ZONE:OnEnterPatrolling(Controllable, From, Event, To)</strong>
</a>
@@ -1626,6 +1730,27 @@ The To State string.</p>
<p><em>#boolean:</em>
Return false to cancel Transition.</p>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(AI_PATROL_ZONE).OnPilotDead" >
<strong>AI_PATROL_ZONE:OnPilotDead(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">
@@ -1830,6 +1955,48 @@ self</p>
<dl class="function">
<dt>
<a id="#(AI_PATROL_ZONE).SetDetectionActivated" >
<strong>AI_PATROL_ZONE:SetDetectionActivated()</strong>
</a>
</dt>
<dd>
<p>Activate the detection.</p>
<p>The AI will detect for targets if the Detection is switched On.</p>
<h3>Return value</h3>
<p><em><a href="##(AI_PATROL_ZONE)">#AI<em>PATROL</em>ZONE</a>:</em>
self</p>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(AI_PATROL_ZONE).SetDetectionDeactivated" >
<strong>AI_PATROL_ZONE:SetDetectionDeactivated()</strong>
</a>
</dt>
<dd>
<p>Deactivate the detection.</p>
<p>The AI will NOT detect for targets.</p>
<h3>Return value</h3>
<p><em><a href="##(AI_PATROL_ZONE)">#AI<em>PATROL</em>ZONE</a>:</em>
self</p>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(AI_PATROL_ZONE).SetDetectionInterval" >
<strong>AI_PATROL_ZONE:SetDetectionInterval(Seconds)</strong>
</a>
@@ -1966,6 +2133,24 @@ self</p>
<dl class="function">
<dt>
<a id="#(AI_PATROL_ZONE).SetStatusOff" >
<strong>AI_PATROL_ZONE:SetStatusOff()</strong>
</a>
</dt>
<dd>
<p>Set the status checking off.</p>
<h3>Return value</h3>
<p><em><a href="##(AI_PATROL_ZONE)">#AI<em>PATROL</em>ZONE</a>:</em>
self</p>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(AI_PATROL_ZONE).Start" >
<strong>AI_PATROL_ZONE:Start()</strong>
</a>
@@ -2147,6 +2332,19 @@ The delay in seconds.</p>
</li>
</ul>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(AI_PATROL_ZONE).onafterDead" >
<strong>AI_PATROL_ZONE:onafterDead()</strong>
</a>
</dt>
<dd>
</dd>
</dl>
<dl class="function">

View File

@@ -115,7 +115,7 @@ This is different from the EnRoute tasks, where the targets of the task need to
<li><a href="##(CONTROLLABLE).TaskEmbarkToTransport">CONTROLLABLE.TaskEmbarkToTransport</a>: (GROUND) Embark to a Transport landed at a location.</li>
<li><a href="##(CONTROLLABLE).TaskEscort">CONTROLLABLE.TaskEscort</a>: (AIR) Escort another airborne controllable. </li>
<li><a href="##(CONTROLLABLE).TaskFAC_AttackControllable">CONTROLLABLE.TaskFAC_AttackControllable</a>: (AIR + GROUND) The task makes the controllable/unit a FAC and orders the FAC to control the target (enemy ground controllable) destruction.</li>
<li><a href="##(CONTROLLABLE).TaskFireAtPoint">CONTROLLABLE.TaskFireAtPoint</a>: (GROUND) Fire at a VEC2 point until ammunition is finished.</li>
<li><a href="##(CONTROLLABLE).TaskFireAtPoint">CONTROLLABLE.TaskFireAtPoint</a>: (GROUND) Fire some or all ammunition at a VEC2 point.</li>
<li><a href="##(CONTROLLABLE).TaskFollow">CONTROLLABLE.TaskFollow</a>: (AIR) Following another airborne controllable.</li>
<li><a href="##(CONTROLLABLE).TaskHold">CONTROLLABLE.TaskHold</a>: (GROUND) Hold ground controllable from moving.</li>
<li><a href="##(CONTROLLABLE).TaskHoldPosition">CONTROLLABLE.TaskHoldPosition</a>: (AIR) Hold position at the current position of the first unit of the controllable.</li>
@@ -568,7 +568,7 @@ A speed can be given in km/h.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(CONTROLLABLE).TaskFireAtPoint">CONTROLLABLE:TaskFireAtPoint(Vec2, Radius)</a></td>
<td class="name" nowrap="nowrap"><a href="##(CONTROLLABLE).TaskFireAtPoint">CONTROLLABLE:TaskFireAtPoint(Vec2, Radius, AmmoCount)</a></td>
<td class="summary">
<p>(GROUND) Fire at a VEC2 point until ammunition is finished.</p>
</td>
@@ -2504,7 +2504,7 @@ The DCS task structure.</p>
<dt>
<a id="#(CONTROLLABLE).TaskFireAtPoint" >
<strong>CONTROLLABLE:TaskFireAtPoint(Vec2, Radius)</strong>
<strong>CONTROLLABLE:TaskFireAtPoint(Vec2, Radius, AmmoCount)</strong>
</a>
</dt>
<dd>
@@ -2524,6 +2524,12 @@ The point to fire at.</p>
<p><code><em><a href="Dcs.DCSTypes.html##(Distance)">Dcs.DCSTypes#Distance</a> Radius </em></code>:
The radius of the zone to deploy the fire at.</p>
</li>
<li>
<p><code><em>#number AmmoCount </em></code>:
(optional) Quantity of ammunition to expand (omit to fire until ammunition is depleted).</p>
</li>
</ul>
<h3>Return value</h3>

View File

@@ -2491,7 +2491,7 @@ Spawn_BE_KA50 = SPAWN:New( 'BE KA-50@RAMP-Ground Defense' ):Schedule( 600, 0.5 )
<p> Flag that indicates if all the Groups of the SpawnGroup need to be visible when Spawned.</p>
<p> When the first Spawn executes, all the Groups need to be made visible before start.</p>
</dd>
</dl>