SPAWN: Keep unit names

-- new method SPAWN:InitKeepUnitNames() added.
-- Added test mission SPA-021
-- Documentation
-- Testing
This commit is contained in:
FlightControl
2017-03-14 05:37:36 +01:00
parent 9d67015649
commit 8d535fa3dd
31 changed files with 225 additions and 45 deletions

View File

@@ -920,9 +920,6 @@ Use the method <a href="##(AI_PATROL_ZONE).ManageDamage">AI<em>PATROL</em>ZONE.M
<p> This table contains the targets detected during patrol.</p>
</dd>
</dl>
<dl class="function">

View File

@@ -2425,7 +2425,6 @@ The UNIT carrying the package.</p>
<dl class="function">
<dt>
<em></em>
<a id="#(AI_CARGO_UNIT).CargoCarrier" >
<strong>AI_CARGO_UNIT.CargoCarrier</strong>
</a>

View File

@@ -1346,6 +1346,7 @@ The new calculated POINT_VEC2.</p>
<dl class="function">
<dt>
<em></em>
<a id="#(POINT_VEC2).z" >
<strong>POINT_VEC2.z</strong>
</a>

View File

@@ -127,6 +127,7 @@ So in principle, the group list will contain all parameters and configurations a
<p>A spawn object will behave differently based on the usage of <strong>initialization</strong> methods, which all start with the <strong>Init</strong> prefix: </p>
<ul>
<li><a href="##(SPAWN).InitKeepUnitNames">SPAWN.InitKeepUnitNames</a>(): Keeps the unit names as defined within the mission editor, but note that anything after a # mark is ignored, and any spaces before and after the resulting name are removed. IMPORTANT! This method MUST be the first used after :New !!!</li>
<li><a href="##(SPAWN).InitLimit">SPAWN.InitLimit</a>(): Limits the amount of groups that can be alive at the same time and that can be dynamically spawned.</li>
<li><a href="##(SPAWN).InitRandomizeRoute">SPAWN.InitRandomizeRoute</a>(): Randomize the routes of spawned groups, and for air groups also optionally the height.</li>
<li><a href="##(SPAWN).InitRandomizeTemplate">SPAWN.InitRandomizeTemplate</a>(): Randomize the group templates so that when a new group is spawned, a random group template is selected from one of the templates defined. </li>
@@ -207,6 +208,8 @@ A coding example is provided at the description of the <a href="##(SPAWN).OnSpaw
<p>Hereby the change log:</p>
<p>2017-03-14: SPAWN:<strong>InitKeepUnitNames()</strong> added.</p>
<p>2017-02-04: SPAWN:InitUnControlled( <strong>UnControlled</strong> ) replaces SPAWN:InitUnControlled().</p>
<p>2017-01-24: SPAWN:<strong>InitAIOnOff( AIOnOff )</strong> added.</p>
@@ -354,6 +357,14 @@ A coding example is provided at the description of the <a href="##(SPAWN).OnSpaw
<td class="name" nowrap="nowrap"><a href="##(SPAWN).InitCleanUp">SPAWN:InitCleanUp(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).InitKeepUnitNames">SPAWN:InitKeepUnitNames()</a></td>
<td class="summary">
<p>Keeps the unit names as defined within the mission editor,
but note that anything after a # mark is ignored,
and any spaces before and after the resulting name are removed.</p>
</td>
</tr>
<tr>
@@ -552,6 +563,18 @@ A coding example is provided at the description of the <a href="##(SPAWN).OnSpaw
<td class="name" nowrap="nowrap"><a href="##(SPAWN).SpawnIndex">SPAWN.SpawnIndex</a></td>
<td class="summary">
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(SPAWN).SpawnInitKeepUnitNames">SPAWN.SpawnInitKeepUnitNames</a></td>
<td class="summary">
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(SPAWN).SpawnInitLimit">SPAWN.SpawnInitLimit</a></td>
<td class="summary">
</td>
</tr>
<tr>
@@ -834,12 +857,6 @@ A coding example is provided at the description of the <a href="##(SPAWN).OnSpaw
<td class="name" nowrap="nowrap"><a href="##(SPAWN)._TranslateRotate">SPAWN:_TranslateRotate(SpawnIndex, SpawnRootX, SpawnRootY, SpawnX, SpawnY, SpawnAngle)</a></td>
<td class="summary">
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(SPAWN).uncontrolled">SPAWN.uncontrolled</a></td>
<td class="summary">
</td>
</tr>
</table>
@@ -1247,6 +1264,29 @@ self</p>
<dl class="function">
<dt>
<a id="#(SPAWN).InitKeepUnitNames" >
<strong>SPAWN:InitKeepUnitNames()</strong>
</a>
</dt>
<dd>
<p>Keeps the unit names as defined within the mission editor,
but note that anything after a # mark is ignored,
and any spaces before and after the resulting name are removed.</p>
<p>IMPORTANT! This method MUST be the first used after :New !!!</p>
<h3>Return value</h3>
<p><em><a href="##(SPAWN)">#SPAWN</a>:</em>
self</p>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(SPAWN).InitLimit" >
<strong>SPAWN:InitLimit(SpawnMaxUnitsAlive, SpawnMaxGroups)</strong>
</a>
@@ -2204,6 +2244,37 @@ when nothing was spawned.</p>
</dd>
</dl>
<dl class="function">
<dt>
<em>#boolean</em>
<a id="#(SPAWN).SpawnInitKeepUnitNames" >
<strong>SPAWN.SpawnInitKeepUnitNames</strong>
</a>
</dt>
<dd>
<p> Overwrite unit names by default with group name.</p>
</dd>
</dl>
<dl class="function">
<dt>
<em>#boolean</em>
<a id="#(SPAWN).SpawnInitLimit" >
<strong>SPAWN.SpawnInitLimit</strong>
</a>
</dt>
<dd>
</dd>
</dl>
<dl class="function">
@@ -2559,7 +2630,7 @@ Spawn_BE_KA50 = SPAWN:New( 'BE KA-50@RAMP-Ground Defense' ):Schedule( 600, 0.5 )
<p> When the first Spawn executes, all the Groups need to be made visible before start.</p>
<p> Flag that indicates if all the Groups of the SpawnGroup need to be visible when Spawned.</p>
</dd>
</dl>
@@ -3198,20 +3269,6 @@ True = Continue Scheduler</p>
</li>
</ul>
</dd>
</dl>
<dl class="function">
<dt>
<em></em>
<a id="#(SPAWN).uncontrolled" >
<strong>SPAWN.uncontrolled</strong>
</a>
</dt>
<dd>
</dd>
</dl>