Implemented a WayPoints functionality for GROUPS

WayPoints can be modified on a GROUP.
A function hook is called whenever a group moves over a waypoint.
This commit is contained in:
FlightControl
2016-04-12 14:32:40 +02:00
parent d6d6f40760
commit 6232c9a67c
68 changed files with 16573 additions and 423 deletions

View File

@@ -23,6 +23,7 @@
<li><a href="Client.html">Client</a></li>
<li><a href="DCSAirbase.html">DCSAirbase</a></li>
<li><a href="DCSCoalitionObject.html">DCSCoalitionObject</a></li>
<li><a href="DCSCommand.html">DCSCommand</a></li>
<li><a href="DCSController.html">DCSController</a></li>
<li><a href="DCSGroup.html">DCSGroup</a></li>
<li><a href="DCSObject.html">DCSObject</a></li>
@@ -145,6 +146,12 @@ You can use the <a href="GROUP.html">GROUP</a> object to do further actions with
<h2><a id="#(SPAWN)">Type <code>SPAWN</code></a></h2>
<table class="function_list">
<tr>
<td class="name" nowrap="nowrap"><a href="##(SPAWN).AliveFactor">SPAWN.AliveFactor</a></td>
<td class="summary">
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(SPAWN).Array">SPAWN:Array(SpawnAngle, SpawnWidth, SpawnDeltaX, SpawnDeltaY)</a></td>
<td class="summary">
<p>Makes the groups visible before start (like a batallion).</p>
@@ -160,6 +167,12 @@ You can use the <a href="GROUP.html">GROUP</a> object to do further actions with
<td class="name" nowrap="nowrap"><a href="##(SPAWN).CleanUp">SPAWN:CleanUp(SpawnCleanUpInterval)</a></td>
<td class="summary">
<p>CleanUp groups when they are still alive, but inactive.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(SPAWN).CleanUpFunction">SPAWN.CleanUpFunction</a></td>
<td class="summary">
</td>
</tr>
<tr>
@@ -235,13 +248,13 @@ You can use the <a href="GROUP.html">GROUP</a> object to do further actions with
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(SPAWN).RepeatOnEngineShutDown">SPAWN:RepeatOnEngineShutDown()</a></td>
<td class="name" nowrap="nowrap"><a href="##(SPAWN).RepeatOnEngineShutDown">SPAWN.RepeatOnEngineShutDown</a></td>
<td class="summary">
<p>Same as the @{#SPAWN.Repeat) method, but now the Group will respawn after its engines have shut down.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(SPAWN).RepeatOnLanding">SPAWN:RepeatOnLanding()</a></td>
<td class="name" nowrap="nowrap"><a href="##(SPAWN).RepeatOnLanding">SPAWN.RepeatOnLanding</a></td>
<td class="summary">
</td>
@@ -249,25 +262,127 @@ You can use the <a href="GROUP.html">GROUP</a> object to do further actions with
<tr>
<td class="name" nowrap="nowrap"><a href="##(SPAWN).Spawn">SPAWN:Spawn()</a></td>
<td class="summary">
<p>Will re-spawn a group based on a given index.</p>
<p>Will spawn a group based on the internal index.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(SPAWN).SpawnAliasPrefix">SPAWN.SpawnAliasPrefix</a></td>
<td class="summary">
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(SPAWN).SpawnCleanUpInterval">SPAWN.SpawnCleanUpInterval</a></td>
<td class="summary">
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(SPAWN).SpawnCleanUpTimeStamps">SPAWN.SpawnCleanUpTimeStamps</a></td>
<td class="summary">
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(SPAWN).SpawnCurrentTimer">SPAWN.SpawnCurrentTimer</a></td>
<td class="summary">
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(SPAWN).SpawnFromUnit">SPAWN:SpawnFromUnit(HostUnit, OuterRadius, InnerRadius, SpawnIndex)</a></td>
<td class="summary">
<p>Will spawn a group from a hosting unit.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(SPAWN).SpawnFunction">SPAWN:SpawnFunction(SpawnFunctionHook, SpawnFunctionArguments, ...)</a></td>
<td class="summary">
<p>Allows to place a CallFunction hook when a new group spawns.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(SPAWN).SpawnFunctionArguments">SPAWN.SpawnFunctionArguments</a></td>
<td class="summary">
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(SPAWN).SpawnFunctionHook">SPAWN.SpawnFunctionHook</a></td>
<td class="summary">
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(SPAWN).SpawnGroupName">SPAWN:SpawnGroupName(SpawnIndex)</a></td>
<td class="summary">
<p>Will return the SpawnGroupName either with with a specific count number or without any count.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(SPAWN).SpawnHighTimer">SPAWN.SpawnHighTimer</a></td>
<td class="summary">
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(SPAWN).SpawnInZone">SPAWN:SpawnInZone(Zone, SpawnIndex)</a></td>
<td class="summary">
<p>Will spawn a Group within a given <a href="ZONE.html">ZONE</a>.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(SPAWN).SpawnLowTimer">SPAWN.SpawnLowTimer</a></td>
<td class="summary">
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(SPAWN).SpawnMaxGroups">SPAWN.SpawnMaxGroups</a></td>
<td class="summary">
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(SPAWN).SpawnMaxUnitsAlive">SPAWN.SpawnMaxUnitsAlive</a></td>
<td class="summary">
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(SPAWN).SpawnRandomizeRoute">SPAWN.SpawnRandomizeRoute</a></td>
<td class="summary">
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(SPAWN).SpawnRandomizeRouteEndPoint">SPAWN.SpawnRandomizeRouteEndPoint</a></td>
<td class="summary">
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(SPAWN).SpawnRandomizeRouteRadius">SPAWN.SpawnRandomizeRouteRadius</a></td>
<td class="summary">
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(SPAWN).SpawnRandomizeRouteStartPoint">SPAWN.SpawnRandomizeRouteStartPoint</a></td>
<td class="summary">
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(SPAWN).SpawnRandomizeTemplate">SPAWN.SpawnRandomizeTemplate</a></td>
<td class="summary">
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(SPAWN).SpawnRepeat">SPAWN.SpawnRepeat</a></td>
<td class="summary">
</td>
</tr>
<tr>
@@ -286,6 +401,30 @@ You can use the <a href="GROUP.html">GROUP</a> object to do further actions with
<td class="name" nowrap="nowrap"><a href="##(SPAWN).SpawnScheduled">SPAWN:SpawnScheduled(SpawnTime, SpawnTimeVariation)</a></td>
<td class="summary">
<p>Spawns new groups at varying time intervals.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(SPAWN).SpawnSetTimer">SPAWN.SpawnSetTimer</a></td>
<td class="summary">
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(SPAWN).SpawnTemplatePrefix">SPAWN.SpawnTemplatePrefix</a></td>
<td class="summary">
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(SPAWN).SpawnTemplatePrefixTable">SPAWN.SpawnTemplatePrefixTable</a></td>
<td class="summary">
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(SPAWN).SpawnVisible">SPAWN.SpawnVisible</a></td>
<td class="summary">
</td>
</tr>
<tr>
@@ -370,6 +509,12 @@ You can use the <a href="GROUP.html">GROUP</a> object to do further actions with
<td class="name" nowrap="nowrap"><a href="##(SPAWN)._OnDeadOrCrash">SPAWN:_OnDeadOrCrash(event)</a></td>
<td class="summary">
<p>Obscolete</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(SPAWN)._OnEngineShutDown">SPAWN:_OnEngineShutDown(event)</a></td>
<td class="summary">
<p>Will detect AIR Units shutting down their engines ...</p>
</td>
</tr>
<tr>
@@ -447,6 +592,20 @@ You can use the <a href="GROUP.html">GROUP</a> object to do further actions with
<dl class="function">
<dt>
<em>#number</em>
<a id="#(SPAWN).AliveFactor" >
<strong>SPAWN.AliveFactor</strong>
</a>
</dt>
<dd>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(SPAWN).Array" >
<strong>SPAWN:Array(SpawnAngle, SpawnWidth, SpawnDeltaX, SpawnDeltaY)</strong>
</a>
@@ -544,6 +703,20 @@ self</p>
<h3>Usage:</h3>
<pre class="example"><code>Spawn_Helicopter:CleanUp( 20 ) -- CleanUp the spawning of the helicopters every 20 seconds when they become inactive.</code></pre>
</dd>
</dl>
<dl class="function">
<dt>
<em></em>
<a id="#(SPAWN).CleanUpFunction" >
<strong>SPAWN.CleanUpFunction</strong>
</a>
</dt>
<dd>
</dd>
</dl>
<dl class="function">
@@ -570,7 +743,7 @@ A number holding the index from where to find the first group from.</p>
<ol>
<li>
<p><em><a href="GROUP.html##(GROUP)">GROUP#GROUP</a>, #number:</em>
<p><em><a href="Group.html##(GROUP)">Group#GROUP</a>, #number:</em>
The group found, the new index where the group was found.</p>
</li>
@@ -609,7 +782,7 @@ The index of the group to return.</p>
</ul>
<h3>Return value</h3>
<p><em><a href="GROUP.html##(GROUP)">GROUP#GROUP</a>:</em></p>
<p><em><a href="Group.html##(GROUP)">Group#GROUP</a>:</em></p>
</dd>
@@ -651,7 +824,7 @@ A number holding the last found previous index.</p>
<ol>
<li>
<p><em><a href="GROUP.html##(GROUP)">GROUP#GROUP</a>, #number:</em>
<p><em><a href="Group.html##(GROUP)">Group#GROUP</a>, #number:</em>
The group found, the new index where the group was found.</p>
</li>
@@ -930,7 +1103,7 @@ The index of the group to be spawned.</p>
</ul>
<h3>Return value</h3>
<p><em><a href="GROUP.html##(GROUP)">GROUP#GROUP</a>:</em>
<p><em><a href="Group.html##(GROUP)">Group#GROUP</a>:</em>
The group that was spawned. You can use this group for further actions.</p>
</dd>
@@ -967,26 +1140,23 @@ SpawnRU_SU34 = SPAWN:New( 'TF1 RU Su-34 Krymsk@AI - Attack Ships' ):Schedule( 2,
<dl class="function">
<dt>
<em>#boolean</em>
<a id="#(SPAWN).RepeatOnEngineShutDown" >
<strong>SPAWN:RepeatOnEngineShutDown()</strong>
<strong>SPAWN.RepeatOnEngineShutDown</strong>
</a>
</dt>
<dd>
<p>Same as the @{#SPAWN.Repeat) method, but now the Group will respawn after its engines have shut down.</p>
<h3>Return value</h3>
<p>SPAWN</p>
</dd>
</dl>
<dl class="function">
<dt>
<em>#boolean</em>
<a id="#(SPAWN).RepeatOnLanding" >
<strong>SPAWN:RepeatOnLanding()</strong>
<strong>SPAWN.RepeatOnLanding</strong>
</a>
</dt>
<dd>
@@ -1004,16 +1174,75 @@ SpawnRU_SU34 = SPAWN:New( 'TF1 RU Su-34 Krymsk@AI - Attack Ships' ):Schedule( 2,
</dt>
<dd>
<p>Will re-spawn a group based on a given index.</p>
<p>Will spawn a group based on the internal index.</p>
<p>Note: Uses <a href="DATABASE.html">DATABASE</a> module defined in MOOSE.</p>
<h3>Return value</h3>
<p><em><a href="GROUP.html##(GROUP)">GROUP#GROUP</a>:</em>
<p><em><a href="Group.html##(GROUP)">Group#GROUP</a>:</em>
The group that was spawned. You can use this group for further actions.</p>
</dd>
</dl>
<dl class="function">
<dt>
<em>#string</em>
<a id="#(SPAWN).SpawnAliasPrefix" >
<strong>SPAWN.SpawnAliasPrefix</strong>
</a>
</dt>
<dd>
</dd>
</dl>
<dl class="function">
<dt>
<em></em>
<a id="#(SPAWN).SpawnCleanUpInterval" >
<strong>SPAWN.SpawnCleanUpInterval</strong>
</a>
</dt>
<dd>
</dd>
</dl>
<dl class="function">
<dt>
<em></em>
<a id="#(SPAWN).SpawnCleanUpTimeStamps" >
<strong>SPAWN.SpawnCleanUpTimeStamps</strong>
</a>
</dt>
<dd>
</dd>
</dl>
<dl class="function">
<dt>
<em>#number</em>
<a id="#(SPAWN).SpawnCurrentTimer" >
<strong>SPAWN.SpawnCurrentTimer</strong>
</a>
</dt>
<dd>
<p> The internal timer counter to trigger a scheduled spawning of SpawnTemplatePrefix.</p>
</dd>
</dl>
<dl class="function">
@@ -1074,6 +1303,76 @@ Nothing was spawned.</p>
</li>
</ol>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(SPAWN).SpawnFunction" >
<strong>SPAWN:SpawnFunction(SpawnFunctionHook, SpawnFunctionArguments, ...)</strong>
</a>
</dt>
<dd>
<p>Allows to place a CallFunction hook when a new group spawns.</p>
<p>The provided function will be called when a new group is spawned, including its given parameters.
The first parameter of the SpawnFunction is the <a href="Group.html##(GROUP)">Group#GROUP</a> that was spawned.</p>
<h3>Parameters</h3>
<ul>
<li>
<p><code><em>#function SpawnFunctionHook </em></code>:
The function to be called when a group spawns.</p>
</li>
<li>
<p><code><em> SpawnFunctionArguments </em></code>:
A random amount of arguments to be provided to the function when the group spawns.</p>
</li>
<li>
<p><code><em> ... </em></code>: </p>
</li>
</ul>
<h3>Return value</h3>
<p><em><a href="##(SPAWN)">#SPAWN</a>:</em></p>
</dd>
</dl>
<dl class="function">
<dt>
<em></em>
<a id="#(SPAWN).SpawnFunctionArguments" >
<strong>SPAWN.SpawnFunctionArguments</strong>
</a>
</dt>
<dd>
</dd>
</dl>
<dl class="function">
<dt>
<em></em>
<a id="#(SPAWN).SpawnFunctionHook" >
<strong>SPAWN.SpawnFunctionHook</strong>
</a>
</dt>
<dd>
</dd>
</dl>
<dl class="function">
@@ -1098,8 +1397,22 @@ Is the number of the Group that is to be spawned.</p>
</ul>
<h3>Return value</h3>
<p><em>#string:</em>
SpawnGroupName</p>
</dd>
</dl>
<dl class="function">
<dt>
<em>#number</em>
<a id="#(SPAWN).SpawnHighTimer" >
<strong>SPAWN.SpawnHighTimer</strong>
</a>
</dt>
<dd>
<p>string SpawnGroupName</p>
</dd>
</dl>
@@ -1133,7 +1446,7 @@ The zone where the group is to be spawned.</p>
<ol>
<li>
<p><em><a href="GROUP.html##(GROUP)">GROUP#GROUP</a>:</em>
<p><em><a href="Group.html##(GROUP)">Group#GROUP</a>:</em>
that was spawned.</p>
</li>
@@ -1144,6 +1457,138 @@ when nothing was spawned.</p>
</li>
</ol>
</dd>
</dl>
<dl class="function">
<dt>
<em>#number</em>
<a id="#(SPAWN).SpawnLowTimer" >
<strong>SPAWN.SpawnLowTimer</strong>
</a>
</dt>
<dd>
</dd>
</dl>
<dl class="function">
<dt>
<em></em>
<a id="#(SPAWN).SpawnMaxGroups" >
<strong>SPAWN.SpawnMaxGroups</strong>
</a>
</dt>
<dd>
<p> The maximum amount of groups that can be spawned.</p>
</dd>
</dl>
<dl class="function">
<dt>
<em></em>
<a id="#(SPAWN).SpawnMaxUnitsAlive" >
<strong>SPAWN.SpawnMaxUnitsAlive</strong>
</a>
</dt>
<dd>
<p> The maximum amount of groups that can be alive of SpawnTemplatePrefix at the same time.</p>
</dd>
</dl>
<dl class="function">
<dt>
<em>#boolean</em>
<a id="#(SPAWN).SpawnRandomizeRoute" >
<strong>SPAWN.SpawnRandomizeRoute</strong>
</a>
</dt>
<dd>
</dd>
</dl>
<dl class="function">
<dt>
<em></em>
<a id="#(SPAWN).SpawnRandomizeRouteEndPoint" >
<strong>SPAWN.SpawnRandomizeRouteEndPoint</strong>
</a>
</dt>
<dd>
</dd>
</dl>
<dl class="function">
<dt>
<em></em>
<a id="#(SPAWN).SpawnRandomizeRouteRadius" >
<strong>SPAWN.SpawnRandomizeRouteRadius</strong>
</a>
</dt>
<dd>
</dd>
</dl>
<dl class="function">
<dt>
<em></em>
<a id="#(SPAWN).SpawnRandomizeRouteStartPoint" >
<strong>SPAWN.SpawnRandomizeRouteStartPoint</strong>
</a>
</dt>
<dd>
</dd>
</dl>
<dl class="function">
<dt>
<em>#boolean</em>
<a id="#(SPAWN).SpawnRandomizeTemplate" >
<strong>SPAWN.SpawnRandomizeTemplate</strong>
</a>
</dt>
<dd>
</dd>
</dl>
<dl class="function">
<dt>
<em>#boolean</em>
<a id="#(SPAWN).SpawnRepeat" >
<strong>SPAWN.SpawnRepeat</strong>
</a>
</dt>
<dd>
</dd>
</dl>
<dl class="function">
@@ -1220,6 +1665,68 @@ self</p>
-- Between these two values, a random amount of seconds will be choosen for each new spawn of the helicopters.
Spawn_BE_KA50 = SPAWN:New( 'BE KA-50@RAMP-Ground Defense' ):Schedule( 600, 0.5 )</code></pre>
</dd>
</dl>
<dl class="function">
<dt>
<em>#number</em>
<a id="#(SPAWN).SpawnSetTimer" >
<strong>SPAWN.SpawnSetTimer</strong>
</a>
</dt>
<dd>
<p> The internal timer value when a scheduled spawning of SpawnTemplatePrefix occurs.</p>
</dd>
</dl>
<dl class="function">
<dt>
<em>#string</em>
<a id="#(SPAWN).SpawnTemplatePrefix" >
<strong>SPAWN.SpawnTemplatePrefix</strong>
</a>
</dt>
<dd>
</dd>
</dl>
<dl class="function">
<dt>
<em></em>
<a id="#(SPAWN).SpawnTemplatePrefixTable" >
<strong>SPAWN.SpawnTemplatePrefixTable</strong>
</a>
</dt>
<dd>
</dd>
</dl>
<dl class="function">
<dt>
<em>#boolean</em>
<a id="#(SPAWN).SpawnVisible" >
<strong>SPAWN.SpawnVisible</strong>
</a>
</dt>
<dd>
<p> When the first Spawn executes, all the Groups need to be made visible before start.</p>
</dd>
</dl>
<dl class="function">
@@ -1246,7 +1753,7 @@ Spawn_BE_KA50 = SPAWN:New( 'BE KA-50@RAMP-Ground Defense' ):Schedule( 600, 0.5 )
</ul>
<h3>Return value</h3>
<p><em><a href="GROUP.html##(GROUP)">GROUP#GROUP</a>:</em>
<p><em><a href="Group.html##(GROUP)">Group#GROUP</a>:</em>
The group that was spawned. You can use this group for further actions.</p>
</dd>
@@ -1568,6 +2075,31 @@ Nothing found</p>
<dl class="function">
<dt>
<a id="#(SPAWN)._OnEngineShutDown" >
<strong>SPAWN:_OnEngineShutDown(event)</strong>
</a>
</dt>
<dd>
<p>Will detect AIR Units shutting down their engines ...</p>
<p>When the event takes place, and the method <a href="RepeatOnEngineShutDown.html">RepeatOnEngineShutDown</a> was called, the spawned Group will Re-SPAWN.
But only when the Unit was registered to have landed.</p>
<h3>Parameter</h3>
<ul>
<li>
<p><code><em> event </em></code>: </p>
</li>
</ul>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(SPAWN)._OnLand" >
<strong>SPAWN:_OnLand(event)</strong>
</a>