MOOSE/docs/Documentation/Spawn.html
2017-10-26 14:54:59 +02:00

3898 lines
106 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><a href="AI_Bai.html">AI_Bai</a></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="ATC_Ground.html">ATC_Ground</a></li>
<li><a href="Account.html">Account</a></li>
<li><a href="Airbase.html">Airbase</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="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>
<li><a href="DCSTask.html">DCSTask</a></li>
<li><a href="DCSTypes.html">DCSTypes</a></li>
<li><a href="DCSUnit.html">DCSUnit</a></li>
<li><a href="DCSVec3.html">DCSVec3</a></li>
<li><a href="DCSWorld.html">DCSWorld</a></li>
<li><a href="DCSZone.html">DCSZone</a></li>
<li><a href="DCScountry.html">DCScountry</a></li>
<li><a href="DCStimer.html">DCStimer</a></li>
<li><a href="DCStrigger.html">DCStrigger</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="Goal.html">Goal</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="Protect.html">Protect</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>Spawn</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="StaticObject.html">StaticObject</a></li>
<li><a href="Task.html">Task</a></li>
<li><a href="TaskZoneCapture.html">TaskZoneCapture</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="UserFlag.html">UserFlag</a></li>
<li><a href="UserSound.html">UserSound</a></li>
<li><a href="Utils.html">Utils</a></li>
<li><a href="Zone.html">Zone</a></li>
<li><a href="ZoneCaptureCoalition.html">ZoneCaptureCoalition</a></li>
<li><a href="ZoneGoal.html">ZoneGoal</a></li>
<li><a href="ZoneGoalCargo.html">ZoneGoalCargo</a></li>
<li><a href="ZoneGoalCoalition.html">ZoneGoalCoalition</a></li>
<li><a href="env.html">env</a></li>
<li><a href="land.html">land</a></li>
<li><a href="routines.html">routines</a></li>
</ul>
</div>
<div id="content">
<h1>Module <code>Spawn</code></h1>
<p><strong>Core</strong> -- SPAWN class dynamically spawns new groups of units in your missions.</p>
<p>
<img src="..\Presentations\SPAWN\SPAWN.JPG" alt="Banner Image"/></p>
<hr/>
<p>The documentation of the SPAWN class can be found further in this document.</p>
<hr/>
<h1>Demo Missions</h1>
<h3><a href="https://github.com/FlightControl-Master/MOOSE_MISSIONS/tree/master-release/SPA%20-%20Spawning">SPAWN Demo Missions source code</a></h3>
<h3><a href="https://github.com/FlightControl-Master/MOOSE_MISSIONS/tree/master/SPA%20-%20Spawning">SPAWN 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=PL7ZUrU4zZUl1jirWIo4t4YxqN-HxjqRkL">SPAWN YouTube Channel</a></h3>
<hr/>
<h1><strong>AUTHORS and CONTRIBUTIONS</strong></h1>
<h3>Contributions:</h3>
<ul>
<li><strong>Aaron</strong>: Posed the idea for Group position randomization at SpawnInZone and make the Unit randomization separate from the Group randomization.</li>
<li><a href="https://forums.eagle.ru/member.php?u=111471"><strong>Entropy</strong></a>, <strong>Afinegan</strong>: Came up with the requirement for AIOnOff().</li>
</ul>
<h3>Authors:</h3>
<ul>
<li><strong>FlightControl</strong>: Design &amp; Programming</li>
</ul>
<h2>Global(s)</h2>
<table class="function_list">
<tr>
<td class="name" nowrap="nowrap"><a href="#SPAWN">SPAWN</a></td>
<td class="summary">
<h1>SPAWN class, extends <a href="Base.html##(BASE)">Base#BASE</a></h1>
<p>-- <img src="..\Presentations\SPAWN\SPAWN.JPG" alt="Banner Image"/></p>
<hr/>
<p>The SPAWN class allows to spawn dynamically new groups.</p>
</td>
</tr>
</table>
<h2><a id="#(SPAWN)">Type <code>SPAWN</code></a></h2>
<table class="function_list">
<tr>
<td class="name" nowrap="nowrap"><a href="##(SPAWN).AIOnOff">SPAWN.AIOnOff</a></td>
<td class="summary">
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(SPAWN).AliveUnits">SPAWN.AliveUnits</a></td>
<td class="summary">
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(SPAWN).ClassName">SPAWN.ClassName</a></td>
<td class="summary">
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(SPAWN).CleanUpScheduler">SPAWN.CleanUpScheduler</a></td>
<td class="summary">
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(SPAWN).DelayOnOff">SPAWN.DelayOnOff</a></td>
<td class="summary">
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(SPAWN).GetCoordinate">SPAWN:GetCoordinate()</a></td>
<td class="summary">
<p>Get the Coordinate of the Group that is Late Activated as the template for the SPAWN object.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(SPAWN).GetFirstAliveGroup">SPAWN:GetFirstAliveGroup()</a></td>
<td class="summary">
<p>Will find the first alive <a href="Group.html">Group</a> it has spawned, and return the alive <a href="Group.html">Group</a> object and the first Index where the first alive <a href="Group.html">Group</a> object has been found.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(SPAWN).GetGroupFromIndex">SPAWN:GetGroupFromIndex(SpawnIndex)</a></td>
<td class="summary">
<p>Get the group from an index.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(SPAWN).GetLastAliveGroup">SPAWN:GetLastAliveGroup()</a></td>
<td class="summary">
<p>Will find the last alive <a href="Group.html">Group</a> object, and will return a reference to the last live <a href="Group.html">Group</a> object and the last Index where the last alive <a href="Group.html">Group</a> object has been found.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(SPAWN).GetNextAliveGroup">SPAWN:GetNextAliveGroup(SpawnIndexStart)</a></td>
<td class="summary">
<p>Will find the next alive <a href="Group.html">Group</a> object from a given Index, and return a reference to the alive <a href="Group.html">Group</a> object and the next Index where the alive <a href="Group.html">Group</a> has been found.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(SPAWN).GetSpawnIndexFromGroup">SPAWN:GetSpawnIndexFromGroup(SpawnGroup)</a></td>
<td class="summary">
<p>Get the index from a given group.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(SPAWN).Grouping">SPAWN.Grouping</a></td>
<td class="summary">
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(SPAWN).InitAIOff">SPAWN:InitAIOff()</a></td>
<td class="summary">
<p>Turns the AI Off for the <a href="Group.html">Group</a> when spawning.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(SPAWN).InitAIOn">SPAWN:InitAIOn()</a></td>
<td class="summary">
<p>Turns the AI On for the <a href="Group.html">Group</a> when spawning.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(SPAWN).InitAIOnOff">SPAWN:InitAIOnOff(AIOnOff)</a></td>
<td class="summary">
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(SPAWN).InitArray">SPAWN:InitArray(SpawnAngle, SpawnWidth, SpawnDeltaX, SpawnDeltaY)</a></td>
<td class="summary">
<p>Makes the groups visible before start (like a batallion).</p>
</td>
</tr>
<tr>
<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).InitDelayOff">SPAWN:InitDelayOff()</a></td>
<td class="summary">
<p>Turns the Delay Off for the <a href="Group.html">Group</a> when spawning.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(SPAWN).InitDelayOn">SPAWN:InitDelayOn()</a></td>
<td class="summary">
<p>Turns the Delay On for the <a href="Group.html">Group</a> when spawning.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(SPAWN).InitDelayOnOff">SPAWN:InitDelayOnOff(DelayOnOff)</a></td>
<td class="summary">
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(SPAWN).InitGrouping">SPAWN:InitGrouping(Grouping)</a></td>
<td class="summary">
<p>When spawning a new group, make the grouping of the units according the InitGrouping setting.</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>
<td class="name" nowrap="nowrap"><a href="##(SPAWN).InitLimit">SPAWN:InitLimit(SpawnMaxUnitsAlive, SpawnMaxGroups)</a></td>
<td class="summary">
<p>Limits the Maximum amount of Units that can be alive at the same time, and the maximum amount of groups that can be spawned.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(SPAWN).InitRandomizePosition">SPAWN:InitRandomizePosition(RandomizePosition, OuterRadius, InnerRadius)</a></td>
<td class="summary">
<p>Randomizes the position of <a href="Group.html">Group</a>s that are spawned within a <strong>radius band</strong>, given an Outer and Inner radius, from the point that the spawn happens.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(SPAWN).InitRandomizeRoute">SPAWN:InitRandomizeRoute(SpawnStartPoint, SpawnEndPoint, SpawnRadius, SpawnHeight)</a></td>
<td class="summary">
<p>Randomizes the defined route of the SpawnTemplatePrefix group in the ME.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(SPAWN).InitRandomizeTemplate">SPAWN:InitRandomizeTemplate(SpawnTemplatePrefixTable)</a></td>
<td class="summary">
<p>This method is rather complicated to understand.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(SPAWN).InitRandomizeTemplatePrefixes">SPAWN:InitRandomizeTemplatePrefixes(SpawnTemplatePrefixes)</a></td>
<td class="summary">
<p>Randomize templates to be used as the unit representatives for the Spawned group, defined by specifying the prefix names.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(SPAWN).InitRandomizeTemplateSet">SPAWN:InitRandomizeTemplateSet(SpawnTemplateSet)</a></td>
<td class="summary">
<p>Randomize templates to be used as the unit representatives for the Spawned group, defined using a SET_GROUP object.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(SPAWN).InitRandomizeUnits">SPAWN:InitRandomizeUnits(RandomizeUnits, OuterRadius, InnerRadius)</a></td>
<td class="summary">
<p>Randomizes the UNITs that are spawned within a radius band given an Outer and Inner radius.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(SPAWN).InitRandomizeZones">SPAWN:InitRandomizeZones(SpawnZoneTable)</a></td>
<td class="summary">
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(SPAWN).InitRepeat">SPAWN:InitRepeat()</a></td>
<td class="summary">
<p>For planes and helicopters, when these groups go home and land on their home airbases and farps, they normally would taxi to the parking spot, shut-down their engines and wait forever until the Group is removed by the runtime environment.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(SPAWN).InitRepeatOnEngineShutDown">SPAWN:InitRepeatOnEngineShutDown()</a></td>
<td class="summary">
<p>Respawn after landing when its engines have shut down.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(SPAWN).InitRepeatOnLanding">SPAWN:InitRepeatOnLanding()</a></td>
<td class="summary">
<p>Respawn group after landing.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(SPAWN).InitUnControlled">SPAWN:InitUnControlled(UnControlled)</a></td>
<td class="summary">
<p>(<strong>AIR</strong>) Will spawn a plane group in UnControlled or Controlled mode...</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(SPAWN).MaxAliveGroups">SPAWN.MaxAliveGroups</a></td>
<td class="summary">
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(SPAWN).MaxAliveUnits">SPAWN.MaxAliveUnits</a></td>
<td class="summary">
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(SPAWN).New">SPAWN:New(SpawnTemplatePrefix)</a></td>
<td class="summary">
<p>Creates the main object to spawn a <a href="Group.html">Group</a> defined in the DCS ME.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(SPAWN).NewWithAlias">SPAWN:NewWithAlias(SpawnTemplatePrefix, SpawnAliasPrefix)</a></td>
<td class="summary">
<p>Creates a new SPAWN instance to create new groups based on the defined template and using a new alias for each new group.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(SPAWN).OnSpawnGroup">SPAWN:OnSpawnGroup(SpawnCallBackFunction, 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).ReSpawn">SPAWN:ReSpawn(SpawnIndex)</a></td>
<td class="summary">
<p>Will re-spawn a group based on a given index.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(SPAWN).Repeat">SPAWN.Repeat</a></td>
<td class="summary">
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(SPAWN).RepeatOnEngineShutDown">SPAWN.RepeatOnEngineShutDown</a></td>
<td class="summary">
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(SPAWN).RepeatOnLanding">SPAWN.RepeatOnLanding</a></td>
<td class="summary">
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(SPAWN).Spawn">SPAWN:Spawn()</a></td>
<td class="summary">
<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).SpawnAtAirbase">SPAWN:SpawnAtAirbase(SpawnAirbase, Takeoff, TakeoffAltitude)</a></td>
<td class="summary">
<p>Will spawn a group at an <a href="Airbase.html">Airbase</a>.</p>
</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).SpawnCount">SPAWN.SpawnCount</a></td>
<td class="summary">
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(SPAWN).SpawnFromStatic">SPAWN:SpawnFromStatic(HostStatic, SpawnIndex)</a></td>
<td class="summary">
<p>Will spawn a group from a hosting static.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(SPAWN).SpawnFromUnit">SPAWN:SpawnFromUnit(HostUnit, 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).SpawnFromVec2">SPAWN:SpawnFromVec2(Vec2, SpawnIndex)</a></td>
<td class="summary">
<p>Will spawn a group from a Vec2 in 3D space.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(SPAWN).SpawnFromVec3">SPAWN:SpawnFromVec3(Vec3, SpawnIndex)</a></td>
<td class="summary">
<p>Will spawn a group from a Vec3 in 3D space.</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).SpawnGrouping">SPAWN.SpawnGrouping</a></td>
<td class="summary">
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(SPAWN).SpawnGroups">SPAWN.SpawnGroups</a></td>
<td class="summary">
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(SPAWN).SpawnHookScheduler">SPAWN.SpawnHookScheduler</a></td>
<td class="summary">
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(SPAWN).SpawnInZone">SPAWN:SpawnInZone(Zone, RandomizeGroup, 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).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>
<td class="name" nowrap="nowrap"><a href="##(SPAWN).SpawnInnerRadius">SPAWN.SpawnInnerRadius</a></td>
<td class="summary">
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(SPAWN).SpawnIsScheduled">SPAWN.SpawnIsScheduled</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).SpawnOuterRadius">SPAWN.SpawnOuterRadius</a></td>
<td class="summary">
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(SPAWN).SpawnRandomize">SPAWN.SpawnRandomize</a></td>
<td class="summary">
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(SPAWN).SpawnRandomizePosition">SPAWN.SpawnRandomizePosition</a></td>
<td class="summary">
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(SPAWN).SpawnRandomizePositionInnerRadius">SPAWN.SpawnRandomizePositionInnerRadius</a></td>
<td class="summary">
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(SPAWN).SpawnRandomizePositionOuterRadius">SPAWN.SpawnRandomizePositionOuterRadius</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).SpawnRandomizeRouteHeight">SPAWN.SpawnRandomizeRouteHeight</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).SpawnRandomizeUnits">SPAWN.SpawnRandomizeUnits</a></td>
<td class="summary">
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(SPAWN).SpawnScheduleStart">SPAWN:SpawnScheduleStart()</a></td>
<td class="summary">
<p>Will re-start the spawning scheduler.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(SPAWN).SpawnScheduleStop">SPAWN:SpawnScheduleStop()</a></td>
<td class="summary">
<p>Will stop the scheduled spawning scheduler.</p>
</td>
</tr>
<tr>
<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).SpawnScheduler">SPAWN.SpawnScheduler</a></td>
<td class="summary">
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(SPAWN).SpawnTemplate">SPAWN.SpawnTemplate</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).SpawnUnControlled">SPAWN.SpawnUnControlled</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>
<td class="name" nowrap="nowrap"><a href="##(SPAWN).SpawnWithIndex">SPAWN:SpawnWithIndex(SpawnIndex)</a></td>
<td class="summary">
<p>Will spawn a group with a specified index number.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(SPAWN).SpawnZoneTable">SPAWN.SpawnZoneTable</a></td>
<td class="summary">
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(SPAWN).Takeoff">SPAWN.Takeoff</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>
<tr>
<td class="name" nowrap="nowrap"><a href="##(SPAWN)._GetGroupCategoryID">SPAWN:_GetGroupCategoryID(SpawnPrefix)</a></td>
<td class="summary">
<p>Gets the CategoryID of the Group with the given SpawnPrefix</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(SPAWN)._GetGroupCoalitionID">SPAWN:_GetGroupCoalitionID(SpawnPrefix)</a></td>
<td class="summary">
<p>Gets the CoalitionID of the Group with the given SpawnPrefix</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(SPAWN)._GetGroupCountryID">SPAWN:_GetGroupCountryID(SpawnPrefix)</a></td>
<td class="summary">
<p>Gets the CountryID of the Group with the given SpawnPrefix</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(SPAWN)._GetLastIndex">SPAWN:_GetLastIndex()</a></td>
<td class="summary">
<p>Return the last maximum index that can be used.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(SPAWN)._GetPrefixFromGroup">SPAWN:_GetPrefixFromGroup(DCSUnit, SpawnGroup)</a></td>
<td class="summary">
<p>Return the prefix of a SpawnUnit.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(SPAWN)._GetSpawnIndex">SPAWN:_GetSpawnIndex(SpawnIndex)</a></td>
<td class="summary">
<p>Get the next index of the groups to be spawned.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(SPAWN)._GetTemplate">SPAWN:_GetTemplate(SpawnTemplatePrefix)</a></td>
<td class="summary">
<p>Gets the Group Template from the ME environment definition.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(SPAWN)._InitializeSpawnGroups">SPAWN:_InitializeSpawnGroups(SpawnIndex)</a></td>
<td class="summary">
<p>Initalize the SpawnGroups collection.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(SPAWN)._OnBirth">SPAWN:_OnBirth(EventData)</a></td>
<td class="summary">
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(SPAWN)._OnDeadOrCrash">SPAWN:_OnDeadOrCrash(EventData)</a></td>
<td class="summary">
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(SPAWN)._OnEngineShutDown">SPAWN:_OnEngineShutDown(EventData)</a></td>
<td class="summary">
<p>Will detect AIR Units shutting down their engines ...</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(SPAWN)._OnLand">SPAWN:_OnLand(EventData)</a></td>
<td class="summary">
<p>Will detect AIR Units landing...</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(SPAWN)._OnTakeOff">SPAWN:_OnTakeOff(EventData)</a></td>
<td class="summary">
<p>Will detect AIR Units taking off...</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(SPAWN)._Prepare">SPAWN:_Prepare(SpawnTemplatePrefix, SpawnIndex)</a></td>
<td class="summary">
<p>Prepares the new Group Template.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(SPAWN)._RandomizeRoute">SPAWN:_RandomizeRoute(SpawnIndex)</a></td>
<td class="summary">
<p>Private method randomizing the routes.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(SPAWN)._RandomizeTemplate">SPAWN:_RandomizeTemplate(SpawnIndex)</a></td>
<td class="summary">
<p>Private method that randomizes the template of the group.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(SPAWN)._RandomizeZones">SPAWN:_RandomizeZones(SpawnIndex)</a></td>
<td class="summary">
<p>Private method that randomizes the <a href="Zone.html">Zone</a>s where the Group will be spawned.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(SPAWN)._Scheduler">SPAWN:_Scheduler()</a></td>
<td class="summary">
<p>This function is called automatically by the Spawning scheduler.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(SPAWN)._SpawnCleanUpScheduler">SPAWN:_SpawnCleanUpScheduler()</a></td>
<td class="summary">
<p>Schedules the CleanUp of Groups</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(SPAWN)._TranslateRotate">SPAWN:_TranslateRotate(SpawnIndex, SpawnRootX, SpawnRootY, SpawnX, SpawnY, SpawnAngle)</a></td>
<td class="summary">
</td>
</tr>
</table>
<h2>Global(s)</h2>
<dl class="function">
<dt>
<em><a href="##(SPAWN)">#SPAWN</a></em>
<a id="SPAWN" >
<strong>SPAWN</strong>
</a>
</dt>
<dd>
<h1>SPAWN class, extends <a href="Base.html##(BASE)">Base#BASE</a></h1>
<p>-- <img src="..\Presentations\SPAWN\SPAWN.JPG" alt="Banner Image"/></p>
<hr/>
<p>The SPAWN class allows to spawn dynamically new groups.</p>
<p>Each SPAWN object needs to be have related <strong>template groups</strong> setup in the Mission Editor (ME),
which is a normal group with the <strong>Late Activation</strong> flag set.
This template group will never be activated in your mission. <br/>
SPAWN uses that <strong>template group</strong> to reference to all the characteristics
(air, ground, livery, unit composition, formation, skill level etc) of each new group to be spawned. </p>
<p>Therefore, when creating a SPAWN object, the <a href="##(SPAWN).New">SPAWN.New</a> and <a href="##(SPAWN).NewWithAlias">SPAWN.NewWithAlias</a> require
<strong>the name of the template group</strong> to be given as a string to those constructor methods. </p>
<p>Initialization settings can be applied on the SPAWN object,
which modify the behaviour or the way groups are spawned.
These initialization methods have the prefix <strong>Init</strong>.
There are also spawn methods with the prefix <strong>Spawn</strong> and will spawn new groups in various ways.</p>
<h3>IMPORTANT! The methods with prefix <strong>Init</strong> must be used before any methods with prefix <strong>Spawn</strong> method are used, or unexpected results may appear!!!</h3>
<p>Because SPAWN can spawn multiple groups of a template group,
SPAWN has an <strong>internal index</strong> that keeps track
which was the latest group that was spawned. </p>
<p><strong>Limits</strong> can be set on how many groups can be spawn in each SPAWN object,
using the method <a href="##(SPAWN).InitLimit">SPAWN.InitLimit</a>. SPAWN has 2 kind of limits:</p>
<ul>
<li>The maximum amount of <a href="Unit.html">Unit</a>s that can be <strong>alive</strong> at the same time... </li>
<li>The maximum amount of <a href="Group.html">Group</a>s that can be <strong>spawned</strong>... This is more of a <strong>resource</strong>-type of limit.</li>
</ul>
<p>When new groups get spawned using the <strong>Spawn</strong> methods,
it will be evaluated whether any limits have been reached.
When no spawn limit is reached, a new group will be created by the spawning methods,
and the internal index will be increased with 1. </p>
<p>These limits ensure that your mission does not accidentally get flooded with spawned groups. <br/>
Additionally, it also guarantees that independent of the group composition,
at any time, the most optimal amount of groups are alive in your mission.
For example, if your template group has a group composition of 10 units, and you specify a limit of 100 units alive at the same time,
with unlimited resources = :InitLimit( 100, 0 ) and 10 groups are alive, but two groups have only one unit alive in the group,
then a sequent Spawn(Scheduled) will allow a new group to be spawned!!!</p>
<h3>IMPORTANT!! If a limit has been reached, it is possible that a <strong>Spawn</strong> method returns <strong>nil</strong>, meaning, no <a href="Group.html">Group</a> had been spawned!!!</h3>
<p>Spawned groups get <strong>the same name</strong> as the name of the template group. <br/>
Spawned units in those groups keep <em>by default</em> <strong>the same name</strong> as the name of the template group. <br/>
However, because multiple groups and units are created from the template group,
a suffix is added to each spawned group and unit.</p>
<p>Newly spawned groups will get the following naming structure at run-time:</p>
<ol>
<li>Spawned groups will have the name _GroupName<em>#</em>nnn_, where <em>GroupName</em> is the name of the <strong>template group</strong>,
and <em>nnn</em> is a <strong>counter from 0 to 999</strong>.</li>
<li>Spawned units will have the name _GroupName<em>#</em>nnn<em>-</em>uu_,
where <em>uu</em> is a <strong>counter from 0 to 99</strong> for each new spawned unit belonging to the group.</li>
</ol>
<p>That being said, there is a way to keep the same unit names! <br/>
The method <a href="##(SPAWN).InitKeepUnitNames">SPAWN.InitKeepUnitNames</a>() will keep the same unit names as defined within the template group, thus:</p>
<ol>
<li>Spawned units will have the name _UnitName<em>#</em>nnn<em>-</em>uu_,
where <em>UnitName</em> is the <strong>unit name as defined in the template group*,
and <em>uu</em> is a **counter from 0 to 99</strong> for each new spawned unit belonging to the group.</li>
</ol>
<p>Some <strong>additional notes that need to be considered!!</strong>:</p>
<ul>
<li>templates are actually groups defined within the mission editor, with the flag "Late Activation" set.
As such, these groups are never used within the mission, but are used by the <a href="##(SPAWN)">#SPAWN</a> module.</li>
<li>It is important to defined BEFORE you spawn new groups,
a proper initialization of the SPAWN instance is done with the options you want to use.</li>
<li>When designing a mission, NEVER name groups using a "#" within the name of the group Spawn template(s),
or the SPAWN module logic won't work anymore.</li>
</ul>
<h2>SPAWN construction methods</h2>
<p>Create a new SPAWN object with the <a href="##(SPAWN).New">SPAWN.New</a>() or the <a href="##(SPAWN).NewWithAlias">SPAWN.NewWithAlias</a>() methods:</p>
<ul>
<li><a href="##(SPAWN).New">SPAWN.New</a>(): Creates a new SPAWN object taking the name of the group that represents the GROUP template (definition).</li>
<li><a href="##(SPAWN).NewWithAlias">SPAWN.NewWithAlias</a>(): Creates a new SPAWN object taking the name of the group that represents the GROUP template (definition), and gives each spawned <a href="Group.html">Group</a> an different name.</li>
</ul>
<p>It is important to understand how the SPAWN class works internally. The SPAWN object created will contain internally a list of groups that will be spawned and that are already spawned.
The initialization methods will modify this list of groups so that when a group gets spawned, ALL information is already prepared when spawning. This is done for performance reasons.
So in principle, the group list will contain all parameters and configurations after initialization, and when groups get actually spawned, this spawning can be done quickly and efficient.</p>
<h2>SPAWN <strong>Init</strong>ialization methods</h2>
<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>
<h3>Unit Names</h3>
<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>
</ul>
<h3>Route randomization</h3>
<ul>
<li><a href="##(SPAWN).InitRandomizeRoute">SPAWN.InitRandomizeRoute</a>(): Randomize the routes of spawned groups, and for air groups also optionally the height.</li>
</ul>
<h3>Group composition randomization</h3>
<ul>
<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>
</ul>
<h3>Uncontrolled</h3>
<ul>
<li><a href="##(SPAWN).InitUnControlled">SPAWN.InitUnControlled</a>(): Spawn plane groups uncontrolled.</li>
</ul>
<h3>Array formation</h3>
<ul>
<li><a href="##(SPAWN).InitArray">SPAWN.InitArray</a>(): Make groups visible before they are actually activated, and order these groups like a batallion in an array.</li>
</ul>
<h3>Position randomization</h3>
<ul>
<li><a href="##(SPAWN).InitRandomizePosition">SPAWN.InitRandomizePosition</a>(): Randomizes the position of <a href="Group.html">Group</a>s that are spawned within a <strong>radius band</strong>, given an Outer and Inner radius, from the point that the spawn happens.</li>
<li><a href="##(SPAWN).InitRandomizeUnits">SPAWN.InitRandomizeUnits</a>(): Randomizes the <a href="Unit.html">Unit</a>s in the <a href="Group.html">Group</a> that is spawned within a <strong>radius band</strong>, given an Outer and Inner radius.</li>
<li><a href="##(SPAWN).InitRandomizeZones">SPAWN.InitRandomizeZones</a>(): Randomizes the spawning between a predefined list of <a href="Zone.html">Zone</a>s that are declared using this function. Each zone can be given a probability factor.</li>
</ul>
<h3>Enable / Disable AI when spawning a new <a href="Group.html">Group</a></h3>
<ul>
<li><a href="##(SPAWN).InitAIOn">SPAWN.InitAIOn</a>(): Turns the AI On when spawning the new <a href="Group.html">Group</a> object.</li>
<li><a href="##(SPAWN).InitAIOff">SPAWN.InitAIOff</a>(): Turns the AI Off when spawning the new <a href="Group.html">Group</a> object.</li>
<li><a href="##(SPAWN).InitAIOnOff">SPAWN.InitAIOnOff</a>(): Turns the AI On or Off when spawning the new <a href="Group.html">Group</a> object.</li>
</ul>
<h3>Limit scheduled spawning</h3>
<ul>
<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>
</ul>
<h3>Delay initial scheduled spawn</h3>
<ul>
<li><a href="##(SPAWN).InitDelayOnOff">SPAWN.InitDelayOnOff</a>(): Turns the inital delay On/Off when scheduled spawning the first <a href="Group.html">Group</a> object.</li>
<li><a href="##(SPAWN).InitDelayOn">SPAWN.InitDelayOn</a>(): Turns the inital delay On when scheduled spawning the first <a href="Group.html">Group</a> object.</li>
<li><a href="##(SPAWN).InitDelayOff">SPAWN.InitDelayOff</a>(): Turns the inital delay Off when scheduled spawning the first <a href="Group.html">Group</a> object.</li>
</ul>
<h3>Repeat spawned <a href="Group.html">Group</a>s upon landing</h3>
<ul>
<li><a href="##(SPAWN).InitRepeat">SPAWN.InitRepeat</a>() or <a href="##(SPAWN).InitRepeatOnLanding">SPAWN.InitRepeatOnLanding</a>(): This method is used to re-spawn automatically the same group after it has landed.</li>
<li><a href="##(SPAWN).InitRepeatOnEngineShutDown">SPAWN.InitRepeatOnEngineShutDown</a>(): This method is used to re-spawn automatically the same group after it has landed and it shuts down the engines at the ramp.</li>
</ul>
<h2>SPAWN <strong>Spawn</strong> methods</h2>
<p>Groups can be spawned at different times and methods:</p>
<h3><strong>Single</strong> spawning methods</h3>
<ul>
<li><a href="##(SPAWN).Spawn">SPAWN.Spawn</a>(): Spawn one new group based on the last spawned index.</li>
<li><a href="##(SPAWN).ReSpawn">SPAWN.ReSpawn</a>(): Re-spawn a group based on a given index.</li>
<li><a href="##(SPAWN).SpawnFromVec3">SPAWN.SpawnFromVec3</a>(): Spawn a new group from a Vec3 coordinate. (The group will can be spawned at a point in the air).</li>
<li><a href="##(SPAWN).SpawnFromVec2">SPAWN.SpawnFromVec2</a>(): Spawn a new group from a Vec2 coordinate. (The group will be spawned at land height ).</li>
<li><a href="##(SPAWN).SpawnFromStatic">SPAWN.SpawnFromStatic</a>(): Spawn a new group from a structure, taking the position of a <a href="Static.html">Static</a>.</li>
<li><a href="##(SPAWN).SpawnFromUnit">SPAWN.SpawnFromUnit</a>(): Spawn a new group taking the position of a <a href="Unit.html">Unit</a>.</li>
<li><a href="##(SPAWN).SpawnInZone">SPAWN.SpawnInZone</a>(): Spawn a new group in a <a href="Zone.html">Zone</a>.</li>
<li><a href="##(SPAWN).SpawnAtAirbase">SPAWN.SpawnAtAirbase</a>(): Spawn a new group at an <a href="Airbase.html">Airbase</a>, which can be an airdrome, ship or helipad.</li>
</ul>
<p>Note that <a href="##(SPAWN).Spawn">SPAWN.Spawn</a> and <a href="##(SPAWN).ReSpawn">SPAWN.ReSpawn</a> return a <a href="GROUP.html##(GROUP).New">GROUP#GROUP.New</a> object, that contains a reference to the DCSGroup object.
You can use the <a href="GROUP.html">GROUP</a> object to do further actions with the DCSGroup.</p>
<h3><strong>Scheduled</strong> spawning methods</h3>
<ul>
<li><a href="##(SPAWN).SpawnScheduled">SPAWN.SpawnScheduled</a>(): Spawn groups at scheduled but randomized intervals. </li>
<li><a href="##(SPAWN).SpawnScheduledStart">SPAWN.SpawnScheduledStart</a>(): Start or continue to spawn groups at scheduled time intervals. </li>
<li><a href="##(SPAWN).SpawnScheduledStop">SPAWN.SpawnScheduledStop</a>(): Stop the spawning of groups at scheduled time intervals. </li>
</ul>
<h2>Retrieve alive GROUPs spawned by the SPAWN object</h2>
<p>The SPAWN class administers which GROUPS it has reserved (in stock) or has created during mission execution.
Every time a SPAWN object spawns a new GROUP object, a reference to the GROUP object is added to an internal table of GROUPS.
SPAWN provides methods to iterate through that internal GROUP object reference table:</p>
<ul>
<li><a href="##(SPAWN).GetFirstAliveGroup">SPAWN.GetFirstAliveGroup</a>(): Will find the first alive GROUP it has spawned, and return the alive GROUP object and the first Index where the first alive GROUP object has been found.</li>
<li><a href="##(SPAWN).GetNextAliveGroup">SPAWN.GetNextAliveGroup</a>(): Will find the next alive GROUP object from a given Index, and return a reference to the alive GROUP object and the next Index where the alive GROUP has been found.</li>
<li><a href="##(SPAWN).GetLastAliveGroup">SPAWN.GetLastAliveGroup</a>(): Will find the last alive GROUP object, and will return a reference to the last live GROUP object and the last Index where the last alive GROUP object has been found.</li>
</ul>
<p>You can use the methods <a href="##(SPAWN).GetFirstAliveGroup">SPAWN.GetFirstAliveGroup</a>() and sequently <a href="##(SPAWN).GetNextAliveGroup">SPAWN.GetNextAliveGroup</a>() to iterate through the alive GROUPS within the SPAWN object, and to actions... See the respective methods for an example.
The method <a href="##(SPAWN).GetGroupFromIndex">SPAWN.GetGroupFromIndex</a>() will return the GROUP object reference from the given Index, dead or alive...</p>
<h2>Spawned cleaning of inactive groups</h2>
<p>Sometimes, it will occur during a mission run-time, that ground or especially air objects get damaged, and will while being damged stop their activities, while remaining alive.
In such cases, the SPAWN object will just sit there and wait until that group gets destroyed, but most of the time it won't,
and it may occur that no new groups are or can be spawned as limits are reached.
To prevent this, a <a href="##(SPAWN).InitCleanUp">SPAWN.InitCleanUp</a>() initialization method has been defined that will silently monitor the status of each spawned group.
Once a group has a velocity = 0, and has been waiting for a defined interval, that group will be cleaned or removed from run-time.
There is a catch however :-) If a damaged group has returned to an airbase within the coalition, that group will not be considered as "lost"...
In such a case, when the inactive group is cleaned, a new group will Re-spawned automatically.
This models AI that has succesfully returned to their airbase, to restart their combat activities.
Check the <a href="##(SPAWN).InitCleanUp">SPAWN.InitCleanUp</a>() for further info.</p>
<h2>Catch the <a href="Group.html">Group</a> Spawn Event in a callback function!</h2>
<p>When using the <a href="##(SPAWN).SpawnScheduled">SPAWN.SpawnScheduled</a>s are created following the spawn time interval parameters.
When a new <a href="Group.html">Group</a> is spawned, you maybe want to execute actions with that group spawned at the spawn event.
The SPAWN class supports this functionality through the method <a href="##(SPAWN).OnSpawnGroup">SPAWN.OnSpawnGroup</a>( <em>*function( SpawnedGroup ) end *</em> ),
which takes a function as a parameter that you can define locally.
Whenever a new <a href="Group.html">Group</a> is spawned, the given function is called, and the <a href="Group.html">Group</a> that was just spawned, is given as a parameter.
As a result, your spawn event handling function requires one parameter to be declared, which will contain the spawned <a href="Group.html">Group</a> object.
A coding example is provided at the description of the <a href="##(SPAWN).OnSpawnGroup">SPAWN.OnSpawnGroup</a>( <em>*function( SpawnedGroup ) end *</em> ) method.</p>
<h2>Delay the initial spawning</h2>
<p>When using the <a href="##(SPAWN).SpawnScheduled">SPAWN.SpawnScheduled</a>
immediately when :SpawnScheduled() is initiated. The methods <a href="##(SPAWN).InitDelayOnOff">SPAWN.InitDelayOnOff</a>() and <a href="##(SPAWN).InitDelayOn">SPAWN.InitDelayOn</a>() can be used to
activate a delay before the first <a href="Group.html">Group</a> is spawned. For completeness, a method <a href="##(SPAWN).InitDelayOff">SPAWN.InitDelayOff</a>() is also available, that
can be used to switch off the initial delay. Because there is no delay by default, this method would only be used when a
<a href="##(SPAWN).SpawnScheduledStop">SPAWN.SpawnScheduledStop</a>() ; <a href="##(SPAWN).SpawnScheduledStart">SPAWN.SpawnScheduledStart</a>() sequence would have been used.</p>
</dd>
</dl>
<h2><a id="#(Spawn)" >Type <code>Spawn</code></a></h2>
<h2><a id="#(SPAWN)" >Type <code>SPAWN</code></a></h2>
<p>SPAWN Class</p>
<h3>Field(s)</h3>
<dl class="function">
<dt>
<em>#boolean</em>
<a id="#(SPAWN).AIOnOff" >
<strong>SPAWN.AIOnOff</strong>
</a>
</dt>
<dd>
<p> The AI is on by default when spawning a group.</p>
</dd>
</dl>
<dl class="function">
<dt>
<em>#number</em>
<a id="#(SPAWN).AliveUnits" >
<strong>SPAWN.AliveUnits</strong>
</a>
</dt>
<dd>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(SPAWN).ClassName" >
<strong>SPAWN.ClassName</strong>
</a>
</dt>
<dd>
</dd>
</dl>
<dl class="function">
<dt>
<em></em>
<a id="#(SPAWN).CleanUpScheduler" >
<strong>SPAWN.CleanUpScheduler</strong>
</a>
</dt>
<dd>
<p>self.CleanUpFunction = routines.scheduleFunction( self._SpawnCleanUpScheduler, { self }, timer.getTime() + 1, SpawnCleanUpInterval )</p>
</dd>
</dl>
<dl class="function">
<dt>
<em>#boolean</em>
<a id="#(SPAWN).DelayOnOff" >
<strong>SPAWN.DelayOnOff</strong>
</a>
</dt>
<dd>
<p> No intial delay when spawning the first group.</p>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(SPAWN).GetCoordinate" >
<strong>SPAWN:GetCoordinate()</strong>
</a>
</dt>
<dd>
<p>Get the Coordinate of the Group that is Late Activated as the template for the SPAWN object.</p>
<h3>Return value</h3>
<p><em><a href="Core.Point.html##(COORDINATE)">Core.Point#COORDINATE</a>:</em>
The Coordinate</p>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(SPAWN).GetFirstAliveGroup" >
<strong>SPAWN:GetFirstAliveGroup()</strong>
</a>
</dt>
<dd>
<p>Will find the first alive <a href="Group.html">Group</a> it has spawned, and return the alive <a href="Group.html">Group</a> object and the first Index where the first alive <a href="Group.html">Group</a> object has been found.</p>
<h3>Return values</h3>
<ol>
<li>
<p><em><a href="Wrapper.Group.html##(GROUP)">Wrapper.Group#GROUP</a>, #number:</em>
The <a href="Group.html">Group</a> object found, the new Index where the group was found.</p>
</li>
<li>
<p><em>#nil, #nil:</em>
When no group is found, #nil is returned.</p>
</li>
</ol>
<h3>Usage:</h3>
<pre class="example"><code>-- Find the first alive @{Group} object of the SpawnPlanes SPAWN object @{Group} collection that it has spawned during the mission.
local GroupPlane, Index = SpawnPlanes:GetFirstAliveGroup()
while GroupPlane ~= nil do
-- Do actions with the GroupPlane object.
GroupPlane, Index = SpawnPlanes:GetNextAliveGroup( Index )
end</code></pre>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(SPAWN).GetGroupFromIndex" >
<strong>SPAWN:GetGroupFromIndex(SpawnIndex)</strong>
</a>
</dt>
<dd>
<p>Get the group from an index.</p>
<p>Returns the group from the SpawnGroups list.
If no index is given, it will return the first group in the list.</p>
<h3>Parameter</h3>
<ul>
<li>
<p><code><em>#number SpawnIndex </em></code>:
The index of the group to return.</p>
</li>
</ul>
<h3>Return value</h3>
<p><em><a href="Wrapper.Group.html##(GROUP)">Wrapper.Group#GROUP</a>:</em>
self</p>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(SPAWN).GetLastAliveGroup" >
<strong>SPAWN:GetLastAliveGroup()</strong>
</a>
</dt>
<dd>
<p>Will find the last alive <a href="Group.html">Group</a> object, and will return a reference to the last live <a href="Group.html">Group</a> object and the last Index where the last alive <a href="Group.html">Group</a> object has been found.</p>
<h3>Return values</h3>
<ol>
<li>
<p><em><a href="Wrapper.Group.html##(GROUP)">Wrapper.Group#GROUP</a>, #number:</em>
The last alive <a href="Group.html">Group</a> object found, the last Index where the last alive <a href="Group.html">Group</a> object was found.</p>
</li>
<li>
<p><em>#nil, #nil:</em>
When no alive <a href="Group.html">Group</a> object is found, #nil is returned.</p>
</li>
</ol>
<h3>Usage:</h3>
<pre class="example"><code>-- Find the last alive @{Group} object of the SpawnPlanes SPAWN object @{Group} collection that it has spawned during the mission.
local GroupPlane, Index = SpawnPlanes:GetLastAliveGroup()
if GroupPlane then -- GroupPlane can be nil!!!
-- Do actions with the GroupPlane object.
end</code></pre>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(SPAWN).GetNextAliveGroup" >
<strong>SPAWN:GetNextAliveGroup(SpawnIndexStart)</strong>
</a>
</dt>
<dd>
<p>Will find the next alive <a href="Group.html">Group</a> object from a given Index, and return a reference to the alive <a href="Group.html">Group</a> object and the next Index where the alive <a href="Group.html">Group</a> has been found.</p>
<h3>Parameter</h3>
<ul>
<li>
<p><code><em>#number SpawnIndexStart </em></code>:
A Index holding the start position to search from. This method can also be used to find the first alive <a href="Group.html">Group</a> object from the given Index.</p>
</li>
</ul>
<h3>Return values</h3>
<ol>
<li>
<p><em><a href="Wrapper.Group.html##(GROUP)">Wrapper.Group#GROUP</a>, #number:</em>
The next alive <a href="Group.html">Group</a> object found, the next Index where the next alive <a href="Group.html">Group</a> object was found.</p>
</li>
<li>
<p><em>#nil, #nil:</em>
When no alive <a href="Group.html">Group</a> object is found from the start Index position, #nil is returned.</p>
</li>
</ol>
<h3>Usage:</h3>
<pre class="example"><code>-- Find the first alive @{Group} object of the SpawnPlanes SPAWN object @{Group} collection that it has spawned during the mission.
local GroupPlane, Index = SpawnPlanes:GetFirstAliveGroup()
while GroupPlane ~= nil do
-- Do actions with the GroupPlane object.
GroupPlane, Index = SpawnPlanes:GetNextAliveGroup( Index )
end</code></pre>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(SPAWN).GetSpawnIndexFromGroup" >
<strong>SPAWN:GetSpawnIndexFromGroup(SpawnGroup)</strong>
</a>
</dt>
<dd>
<p>Get the index from a given group.</p>
<p>The function will search the name of the group for a #, and will return the number behind the #-mark.</p>
<h3>Parameter</h3>
<ul>
<li>
<p><code><em> SpawnGroup </em></code>: </p>
</li>
</ul>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(SPAWN).Grouping" >
<strong>SPAWN.Grouping</strong>
</a>
</dt>
<dd>
<p> No grouping</p>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(SPAWN).InitAIOff" >
<strong>SPAWN:InitAIOff()</strong>
</a>
</dt>
<dd>
<p>Turns the AI Off for the <a href="Group.html">Group</a> when spawning.</p>
<h3>Return value</h3>
<p><em><a href="##(SPAWN)">#SPAWN</a>:</em>
The SPAWN object</p>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(SPAWN).InitAIOn" >
<strong>SPAWN:InitAIOn()</strong>
</a>
</dt>
<dd>
<p>Turns the AI On for the <a href="Group.html">Group</a> when spawning.</p>
<h3>Return value</h3>
<p><em><a href="##(SPAWN)">#SPAWN</a>:</em>
The SPAWN object</p>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(SPAWN).InitAIOnOff" >
<strong>SPAWN:InitAIOnOff(AIOnOff)</strong>
</a>
</dt>
<dd>
<h3>Parameter</h3>
<ul>
<li>
<p><code><em> AIOnOff </em></code>: </p>
</li>
</ul>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(SPAWN).InitArray" >
<strong>SPAWN:InitArray(SpawnAngle, SpawnWidth, SpawnDeltaX, SpawnDeltaY)</strong>
</a>
</dt>
<dd>
<p>Makes the groups visible before start (like a batallion).</p>
<p>The method will take the position of the group as the first position in the array.</p>
<h3>Parameters</h3>
<ul>
<li>
<p><code><em>#number SpawnAngle </em></code>: </p>
<pre><code> The angle in degrees how the groups and each unit of the group will be positioned.
</code></pre>
</li>
<li>
<p><code><em>#number SpawnWidth </em></code>: </p>
<pre><code> The amount of Groups that will be positioned on the X axis.
</code></pre>
</li>
<li>
<p><code><em>#number SpawnDeltaX </em></code>: </p>
<pre><code> The space between each Group on the X-axis.
</code></pre>
</li>
<li>
<p><code><em>#number SpawnDeltaY </em></code>: </p>
<pre><code> The space between each Group on the Y-axis.
</code></pre>
</li>
</ul>
<h3>Return value</h3>
<p><em><a href="##(SPAWN)">#SPAWN</a>:</em>
self</p>
<h3>Usage:</h3>
<pre class="example"><code>-- Define an array of Groups.
Spawn_BE_Ground = SPAWN:New( 'BE Ground' ):InitLimit( 2, 24 ):InitArray( 90, "Diamond", 10, 100, 50 )</code></pre>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(SPAWN).InitCleanUp" >
<strong>SPAWN:InitCleanUp(SpawnCleanUpInterval)</strong>
</a>
</dt>
<dd>
<p>CleanUp groups when they are still alive, but inactive.</p>
<p>When groups are still alive and have become inactive due to damage and are unable to contribute anything, then this group will be removed at defined intervals in seconds.</p>
<h3>Parameter</h3>
<ul>
<li>
<p><code><em>#string SpawnCleanUpInterval </em></code>:
The interval to check for inactive groups within seconds.</p>
</li>
</ul>
<h3>Return value</h3>
<p><em><a href="##(SPAWN)">#SPAWN</a>:</em>
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>
<a id="#(SPAWN).InitDelayOff" >
<strong>SPAWN:InitDelayOff()</strong>
</a>
</dt>
<dd>
<p>Turns the Delay Off for the <a href="Group.html">Group</a> when spawning.</p>
<h3>Return value</h3>
<p><em><a href="##(SPAWN)">#SPAWN</a>:</em>
The SPAWN object</p>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(SPAWN).InitDelayOn" >
<strong>SPAWN:InitDelayOn()</strong>
</a>
</dt>
<dd>
<p>Turns the Delay On for the <a href="Group.html">Group</a> when spawning.</p>
<h3>Return value</h3>
<p><em><a href="##(SPAWN)">#SPAWN</a>:</em>
The SPAWN object</p>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(SPAWN).InitDelayOnOff" >
<strong>SPAWN:InitDelayOnOff(DelayOnOff)</strong>
</a>
</dt>
<dd>
<h3>Parameter</h3>
<ul>
<li>
<p><code><em> DelayOnOff </em></code>: </p>
</li>
</ul>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(SPAWN).InitGrouping" >
<strong>SPAWN:InitGrouping(Grouping)</strong>
</a>
</dt>
<dd>
<p>When spawning a new group, make the grouping of the units according the InitGrouping setting.</p>
<h3>Parameter</h3>
<ul>
<li>
<p><code><em>#number Grouping </em></code>:
Indicates the maximum amount of units in the group. </p>
</li>
</ul>
<h3>Return value</h3>
<p><em><a href="##(SPAWN)">#SPAWN</a>:</em></p>
</dd>
</dl>
<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>
</dt>
<dd>
<p>Limits the Maximum amount of Units that can be alive at the same time, and the maximum amount of groups that can be spawned.</p>
<p>Note that this method is exceptionally important to balance the performance of the mission. Depending on the machine etc, a mission can only process a maximum amount of units.
If the time interval must be short, but there should not be more Units or Groups alive than a maximum amount of units, then this method should be used...
When a <a href="##(SPAWN).New">SPAWN.New</a> is executed and the limit of the amount of units alive is reached, then no new spawn will happen of the group, until some of these units of the spawn object will be destroyed.</p>
<h3>Parameters</h3>
<ul>
<li>
<p><code><em>#number SpawnMaxUnitsAlive </em></code>:
The maximum amount of units that can be alive at runtime. </p>
</li>
<li>
<p><code><em>#number SpawnMaxGroups </em></code>:
The maximum amount of groups that can be spawned. When the limit is reached, then no more actual spawns will happen of the group.
This parameter is useful to define a maximum amount of airplanes, ground troops, helicopters, ships etc within a supply area.
This parameter accepts the value 0, which defines that there are no maximum group limits, but there are limits on the maximum of units that can be alive at the same time.</p>
</li>
</ul>
<h3>Return value</h3>
<p><em><a href="##(SPAWN)">#SPAWN</a>:</em>
self</p>
<h3>Usage:</h3>
<pre class="example"><code>-- NATO helicopters engaging in the battle field.
-- This helicopter group consists of one Unit. So, this group will SPAWN maximum 2 groups simultaneously within the DCSRTE.
-- There will be maximum 24 groups spawned during the whole mission lifetime.
Spawn_BE_KA50 = SPAWN:New( 'BE KA-50@RAMP-Ground Defense' ):InitLimit( 2, 24 )</code></pre>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(SPAWN).InitRandomizePosition" >
<strong>SPAWN:InitRandomizePosition(RandomizePosition, OuterRadius, InnerRadius)</strong>
</a>
</dt>
<dd>
<p>Randomizes the position of <a href="Group.html">Group</a>s that are spawned within a <strong>radius band</strong>, given an Outer and Inner radius, from the point that the spawn happens.</p>
<h3>Parameters</h3>
<ul>
<li>
<p><code><em>#boolean RandomizePosition </em></code>:
If true, SPAWN will perform the randomization of the <a href="Group.html">Group</a>s position between a given outer and inner radius. </p>
</li>
<li>
<p><code><em><a href="Dcs.DCSTypes.html##(Distance)">Dcs.DCSTypes#Distance</a> OuterRadius </em></code>:
(optional) The outer radius in meters where the new group will be spawned.</p>
</li>
<li>
<p><code><em><a href="Dcs.DCSTypes.html##(Distance)">Dcs.DCSTypes#Distance</a> InnerRadius </em></code>:
(optional) The inner radius in meters where the new group will NOT be spawned.</p>
</li>
</ul>
<h3>Return value</h3>
<p><em><a href="##(SPAWN)">#SPAWN</a>:</em></p>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(SPAWN).InitRandomizeRoute" >
<strong>SPAWN:InitRandomizeRoute(SpawnStartPoint, SpawnEndPoint, SpawnRadius, SpawnHeight)</strong>
</a>
</dt>
<dd>
<p>Randomizes the defined route of the SpawnTemplatePrefix group in the ME.</p>
<p>This is very useful to define extra variation of the behaviour of groups.</p>
<h3>Parameters</h3>
<ul>
<li>
<p><code><em>#number SpawnStartPoint </em></code>:
is the waypoint where the randomization begins.
Note that the StartPoint = 0 equaling the point where the group is spawned.</p>
</li>
<li>
<p><code><em>#number SpawnEndPoint </em></code>:
is the waypoint where the randomization ends counting backwards.
This parameter is useful to avoid randomization to end at a waypoint earlier than the last waypoint on the route.</p>
</li>
<li>
<p><code><em>#number SpawnRadius </em></code>:
is the radius in meters in which the randomization of the new waypoints, with the original waypoint of the original template located in the middle ...</p>
</li>
<li>
<p><code><em>#number SpawnHeight </em></code>:
(optional) Specifies the <strong>additional</strong> height in meters that can be added to the base height specified at each waypoint in the ME.</p>
</li>
</ul>
<h3>Return value</h3>
<p><em><a href="##(SPAWN)">#SPAWN</a>:</em></p>
<h3>Usage:</h3>
<pre class="example"><code>-- NATO helicopters engaging in the battle field.
-- The KA-50 has waypoints Start point ( =0 or SP ), 1, 2, 3, 4, End point (= 5 or DP).
-- Waypoints 2 and 3 will only be randomized. The others will remain on their original position with each new spawn of the helicopter.
-- The randomization of waypoint 2 and 3 will take place within a radius of 2000 meters.
Spawn_BE_KA50 = SPAWN:New( 'BE KA-50@RAMP-Ground Defense' ):InitRandomizeRoute( 2, 2, 2000 )</code></pre>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(SPAWN).InitRandomizeTemplate" >
<strong>SPAWN:InitRandomizeTemplate(SpawnTemplatePrefixTable)</strong>
</a>
</dt>
<dd>
<p>This method is rather complicated to understand.</p>
<p>But I'll try to explain.
This method becomes useful when you need to spawn groups with random templates of groups defined within the mission editor,
but they will all follow the same Template route and have the same prefix name.
In other words, this method randomizes between a defined set of groups the template to be used for each new spawn of a group.</p>
<h3>Parameter</h3>
<ul>
<li>
<p><code><em>#string SpawnTemplatePrefixTable </em></code>:
A table with the names of the groups defined within the mission editor, from which one will be choosen when a new group will be spawned. </p>
</li>
</ul>
<h3>Return value</h3>
<p><em><a href="##(SPAWN)">#SPAWN</a>:</em></p>
<h3>Usage:</h3>
<pre class="example"><code>-- NATO Tank Platoons invading Gori.
-- Choose between 13 different 'US Tank Platoon' configurations for each new SPAWN the Group to be spawned for the
-- 'US Tank Platoon Left', 'US Tank Platoon Middle' and 'US Tank Platoon Right' SpawnTemplatePrefixes.
-- Each new SPAWN will randomize the route, with a defined time interval of 200 seconds with 40% time variation (randomization) and
-- with a limit set of maximum 12 Units alive simulteneously and 150 Groups to be spawned during the whole mission.
Spawn_US_Platoon = { 'US Tank Platoon 1', 'US Tank Platoon 2', 'US Tank Platoon 3', 'US Tank Platoon 4', 'US Tank Platoon 5',
'US Tank Platoon 6', 'US Tank Platoon 7', 'US Tank Platoon 8', 'US Tank Platoon 9', 'US Tank Platoon 10',
'US Tank Platoon 11', 'US Tank Platoon 12', 'US Tank Platoon 13' }
Spawn_US_Platoon_Left = SPAWN:New( 'US Tank Platoon Left' ):InitLimit( 12, 150 ):Schedule( 200, 0.4 ):InitRandomizeTemplate( Spawn_US_Platoon ):InitRandomizeRoute( 3, 3, 2000 )
Spawn_US_Platoon_Middle = SPAWN:New( 'US Tank Platoon Middle' ):InitLimit( 12, 150 ):Schedule( 200, 0.4 ):InitRandomizeTemplate( Spawn_US_Platoon ):InitRandomizeRoute( 3, 3, 2000 )
Spawn_US_Platoon_Right = SPAWN:New( 'US Tank Platoon Right' ):InitLimit( 12, 150 ):Schedule( 200, 0.4 ):InitRandomizeTemplate( Spawn_US_Platoon ):InitRandomizeRoute( 3, 3, 2000 )</code></pre>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(SPAWN).InitRandomizeTemplatePrefixes" >
<strong>SPAWN:InitRandomizeTemplatePrefixes(SpawnTemplatePrefixes)</strong>
</a>
</dt>
<dd>
<p>Randomize templates to be used as the unit representatives for the Spawned group, defined by specifying the prefix names.</p>
<p>This method becomes useful when you need to spawn groups with random templates of groups defined within the mission editor,
but they will all follow the same Template route and have the same prefix name.
In other words, this method randomizes between a defined set of groups the template to be used for each new spawn of a group.</p>
<h3>Parameter</h3>
<ul>
<li>
<p><code><em>#string SpawnTemplatePrefixes </em></code>:
A string or a list of string that contains the prefixes of the groups that are possible unit representatives of the group to be spawned. </p>
</li>
</ul>
<h3>Return value</h3>
<p><em><a href="##(SPAWN)">#SPAWN</a>:</em></p>
<h3>Usage:</h3>
<pre class="example"><code>-- NATO Tank Platoons invading Gori.
-- Choose between different 'US Tank Platoon Templates' configurations to be spawned for the
-- 'US Tank Platoon Left', 'US Tank Platoon Middle' and 'US Tank Platoon Right' SPAWN objects.
-- Each new SPAWN will randomize the route, with a defined time interval of 200 seconds with 40% time variation (randomization) and
-- with a limit set of maximum 12 Units alive simulteneously and 150 Groups to be spawned during the whole mission.
Spawn_US_Platoon_Left = SPAWN:New( 'US Tank Platoon Left' ):InitLimit( 12, 150 ):Schedule( 200, 0.4 ):InitRandomizeTemplatePrefixes( "US Tank Platoon Templates" ):InitRandomizeRoute( 3, 3, 2000 )
Spawn_US_Platoon_Middle = SPAWN:New( 'US Tank Platoon Middle' ):InitLimit( 12, 150 ):Schedule( 200, 0.4 ):InitRandomizeTemplatePrefixes( "US Tank Platoon Templates" ):InitRandomizeRoute( 3, 3, 2000 )
Spawn_US_Platoon_Right = SPAWN:New( 'US Tank Platoon Right' ):InitLimit( 12, 150 ):Schedule( 200, 0.4 ):InitRandomizeTemplatePrefixes( "US Tank Platoon Templates" ):InitRandomizeRoute( 3, 3, 2000 )</code></pre>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(SPAWN).InitRandomizeTemplateSet" >
<strong>SPAWN:InitRandomizeTemplateSet(SpawnTemplateSet)</strong>
</a>
</dt>
<dd>
<p>Randomize templates to be used as the unit representatives for the Spawned group, defined using a SET_GROUP object.</p>
<p>This method becomes useful when you need to spawn groups with random templates of groups defined within the mission editor,
but they will all follow the same Template route and have the same prefix name.
In other words, this method randomizes between a defined set of groups the template to be used for each new spawn of a group.</p>
<h3>Parameter</h3>
<ul>
<li>
<p><code><em><a href="Core.Set.html##(SET_GROUP)">Core.Set#SET_GROUP</a> SpawnTemplateSet </em></code>:
A SET_GROUP object set, that contains the groups that are possible unit representatives of the group to be spawned. </p>
</li>
</ul>
<h3>Return value</h3>
<p><em><a href="##(SPAWN)">#SPAWN</a>:</em></p>
<h3>Usage:</h3>
<pre class="example"><code>-- NATO Tank Platoons invading Gori.
-- Choose between different 'US Tank Platoon Template' configurations to be spawned for the
-- 'US Tank Platoon Left', 'US Tank Platoon Middle' and 'US Tank Platoon Right' SPAWN objects.
-- Each new SPAWN will randomize the route, with a defined time interval of 200 seconds with 40% time variation (randomization) and
-- with a limit set of maximum 12 Units alive simulteneously and 150 Groups to be spawned during the whole mission.
Spawn_US_PlatoonSet = SET_GROUP:New():FilterPrefixes( "US Tank Platoon Templates" ):FilterOnce()
--- Now use the Spawn_US_PlatoonSet to define the templates using InitRandomizeTemplateSet.
Spawn_US_Platoon_Left = SPAWN:New( 'US Tank Platoon Left' ):InitLimit( 12, 150 ):Schedule( 200, 0.4 ):InitRandomizeTemplateSet( Spawn_US_PlatoonSet ):InitRandomizeRoute( 3, 3, 2000 )
Spawn_US_Platoon_Middle = SPAWN:New( 'US Tank Platoon Middle' ):InitLimit( 12, 150 ):Schedule( 200, 0.4 ):InitRandomizeTemplateSet( Spawn_US_PlatoonSet ):InitRandomizeRoute( 3, 3, 2000 )
Spawn_US_Platoon_Right = SPAWN:New( 'US Tank Platoon Right' ):InitLimit( 12, 150 ):Schedule( 200, 0.4 ):InitRandomizeTemplateSet( Spawn_US_PlatoonSet ):InitRandomizeRoute( 3, 3, 2000 )</code></pre>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(SPAWN).InitRandomizeUnits" >
<strong>SPAWN:InitRandomizeUnits(RandomizeUnits, OuterRadius, InnerRadius)</strong>
</a>
</dt>
<dd>
<p>Randomizes the UNITs that are spawned within a radius band given an Outer and Inner radius.</p>
<h3>Parameters</h3>
<ul>
<li>
<p><code><em>#boolean RandomizeUnits </em></code>:
If true, SPAWN will perform the randomization of the <a href="UNIT.html">UNIT</a>s position within the group between a given outer and inner radius. </p>
</li>
<li>
<p><code><em><a href="Dcs.DCSTypes.html##(Distance)">Dcs.DCSTypes#Distance</a> OuterRadius </em></code>:
(optional) The outer radius in meters where the new group will be spawned.</p>
</li>
<li>
<p><code><em><a href="Dcs.DCSTypes.html##(Distance)">Dcs.DCSTypes#Distance</a> InnerRadius </em></code>:
(optional) The inner radius in meters where the new group will NOT be spawned.</p>
</li>
</ul>
<h3>Return value</h3>
<p><em><a href="##(SPAWN)">#SPAWN</a>:</em></p>
<h3>Usage:</h3>
<pre class="example"><code>-- NATO helicopters engaging in the battle field.
-- The KA-50 has waypoints Start point ( =0 or SP ), 1, 2, 3, 4, End point (= 5 or DP).
-- Waypoints 2 and 3 will only be randomized. The others will remain on their original position with each new spawn of the helicopter.
-- The randomization of waypoint 2 and 3 will take place within a radius of 2000 meters.
Spawn_BE_KA50 = SPAWN:New( 'BE KA-50@RAMP-Ground Defense' ):InitRandomizeRoute( 2, 2, 2000 )</code></pre>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(SPAWN).InitRandomizeZones" >
<strong>SPAWN:InitRandomizeZones(SpawnZoneTable)</strong>
</a>
</dt>
<dd>
<p>TODO: Add example.
- This method provides the functionality to randomize the spawning of the Groups at a given list of zones of different types.
@param #SPAWN self
@param #table SpawnZoneTable A table with <a href="Zone.html">Zone</a> objects. If this table is given, then each spawn will be executed within the given list of <a href="Zone.html">Zone</a>s objects.
@return #SPAWN
@usage
-- NATO Tank Platoons invading Gori.
-- Choose between 3 different zones for each new SPAWN the Group to be executed, regardless of the zone type. </p>
<h3>Parameter</h3>
<ul>
<li>
<p><code><em> SpawnZoneTable </em></code>: </p>
</li>
</ul>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(SPAWN).InitRepeat" >
<strong>SPAWN:InitRepeat()</strong>
</a>
</dt>
<dd>
<p>For planes and helicopters, when these groups go home and land on their home airbases and farps, they normally would taxi to the parking spot, shut-down their engines and wait forever until the Group is removed by the runtime environment.</p>
<p>This method is used to re-spawn automatically (so no extra call is needed anymore) the same group after it has landed.
This will enable a spawned group to be re-spawned after it lands, until it is destroyed...
Note: When the group is respawned, it will re-spawn from the original airbase where it took off.
So ensure that the routes for groups that respawn, always return to the original airbase, or players may get confused ...</p>
<h3>Return value</h3>
<p><em><a href="##(SPAWN)">#SPAWN</a>:</em>
self</p>
<h3>Usage:</h3>
<pre class="example"><code>-- RU Su-34 - AI Ship Attack
-- Re-SPAWN the Group(s) after each landing and Engine Shut-Down automatically.
SpawnRU_SU34 = SPAWN:New( 'TF1 RU Su-34 Krymsk@AI - Attack Ships' ):Schedule( 2, 3, 1800, 0.4 ):SpawnUncontrolled():InitRandomizeRoute( 1, 1, 3000 ):RepeatOnEngineShutDown()</code></pre>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(SPAWN).InitRepeatOnEngineShutDown" >
<strong>SPAWN:InitRepeatOnEngineShutDown()</strong>
</a>
</dt>
<dd>
<p>Respawn after landing when its engines have shut down.</p>
<h3>Return value</h3>
<p><em><a href="##(SPAWN)">#SPAWN</a>:</em>
self</p>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(SPAWN).InitRepeatOnLanding" >
<strong>SPAWN:InitRepeatOnLanding()</strong>
</a>
</dt>
<dd>
<p>Respawn group after landing.</p>
<h3>Return value</h3>
<p><em><a href="##(SPAWN)">#SPAWN</a>:</em>
self</p>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(SPAWN).InitUnControlled" >
<strong>SPAWN:InitUnControlled(UnControlled)</strong>
</a>
</dt>
<dd>
<p>(<strong>AIR</strong>) Will spawn a plane group in UnControlled or Controlled mode...</p>
<p>This will be similar to the uncontrolled flag setting in the ME.
You can use UnControlled mode to simulate planes startup and ready for take-off but aren't moving (yet).
ReSpawn the plane in Controlled mode, and the plane will move...</p>
<h3>Parameter</h3>
<ul>
<li>
<p><code><em>#boolean UnControlled </em></code>:
true if UnControlled, false if Controlled.</p>
</li>
</ul>
<h3>Return value</h3>
<p><em><a href="##(SPAWN)">#SPAWN</a>:</em>
self</p>
</dd>
</dl>
<dl class="function">
<dt>
<em>#number</em>
<a id="#(SPAWN).MaxAliveGroups" >
<strong>SPAWN.MaxAliveGroups</strong>
</a>
</dt>
<dd>
</dd>
</dl>
<dl class="function">
<dt>
<em>#number</em>
<a id="#(SPAWN).MaxAliveUnits" >
<strong>SPAWN.MaxAliveUnits</strong>
</a>
</dt>
<dd>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(SPAWN).New" >
<strong>SPAWN:New(SpawnTemplatePrefix)</strong>
</a>
</dt>
<dd>
<p>Creates the main object to spawn a <a href="Group.html">Group</a> defined in the DCS ME.</p>
<h3>Parameter</h3>
<ul>
<li>
<p><code><em>#string SpawnTemplatePrefix </em></code>:
is the name of the Group in the ME that defines the Template. Each new group will have the name starting with SpawnTemplatePrefix.</p>
</li>
</ul>
<h3>Return value</h3>
<p><em><a href="##(SPAWN)">#SPAWN</a>:</em></p>
<h3>Usages:</h3>
<ul>
<li><pre class="example"><code>-- NATO helicopters engaging in the battle field.
Spawn_BE_KA50 = SPAWN:New( 'BE KA-50@RAMP-Ground Defense' )</code></pre></li>
<li><pre class="example"><code>local Plane = SPAWN:New( "Plane" ) -- Creates a new local variable that can initiate new planes with the name "Plane#ddd" using the template "Plane" as defined within the ME.</code></pre></li>
</ul>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(SPAWN).NewWithAlias" >
<strong>SPAWN:NewWithAlias(SpawnTemplatePrefix, SpawnAliasPrefix)</strong>
</a>
</dt>
<dd>
<p>Creates a new SPAWN instance to create new groups based on the defined template and using a new alias for each new group.</p>
<h3>Parameters</h3>
<ul>
<li>
<p><code><em>#string SpawnTemplatePrefix </em></code>:
is the name of the Group in the ME that defines the Template.</p>
</li>
<li>
<p><code><em>#string SpawnAliasPrefix </em></code>:
is the name that will be given to the Group at runtime.</p>
</li>
</ul>
<h3>Return value</h3>
<p><em><a href="##(SPAWN)">#SPAWN</a>:</em></p>
<h3>Usages:</h3>
<ul>
<li><pre class="example"><code>-- NATO helicopters engaging in the battle field.
Spawn_BE_KA50 = SPAWN:NewWithAlias( 'BE KA-50@RAMP-Ground Defense', 'Helicopter Attacking a City' )</code></pre></li>
<li><pre class="example"><code>local PlaneWithAlias = SPAWN:NewWithAlias( "Plane", "Bomber" ) -- Creates a new local variable that can instantiate new planes with the name "Bomber#ddd" using the template "Plane" as defined within the ME.</code></pre></li>
</ul>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(SPAWN).OnSpawnGroup" >
<strong>SPAWN:OnSpawnGroup(SpawnCallBackFunction, SpawnFunctionArguments, ...)</strong>
</a>
</dt>
<dd>
<p>Allows to place a CallFunction hook when a new group spawns.</p>
<p>The provided method 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 SpawnCallBackFunction </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>
<h3>Usage:</h3>
<pre class="example"><code>-- Declare SpawnObject and call a function when a new Group is spawned.
local SpawnObject = SPAWN
:New( "SpawnObject" )
:InitLimit( 2, 10 )
:OnSpawnGroup(
function( SpawnGroup )
SpawnGroup:E( "I am spawned" )
end
)
:SpawnScheduled( 300, 0.3 )</code></pre>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(SPAWN).ReSpawn" >
<strong>SPAWN:ReSpawn(SpawnIndex)</strong>
</a>
</dt>
<dd>
<p>Will re-spawn a group based on a given index.</p>
<p>Note: Uses <a href="DATABASE.html">DATABASE</a> module defined in MOOSE.</p>
<h3>Parameter</h3>
<ul>
<li>
<p><code><em>#string SpawnIndex </em></code>:
The index of the group to be spawned.</p>
</li>
</ul>
<h3>Return value</h3>
<p><em><a href="Wrapper.Group.html##(GROUP)">Wrapper.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>#boolean</em>
<a id="#(SPAWN).Repeat" >
<strong>SPAWN.Repeat</strong>
</a>
</dt>
<dd>
</dd>
</dl>
<dl class="function">
<dt>
<em>#boolean</em>
<a id="#(SPAWN).RepeatOnEngineShutDown" >
<strong>SPAWN.RepeatOnEngineShutDown</strong>
</a>
</dt>
<dd>
</dd>
</dl>
<dl class="function">
<dt>
<em>#boolean</em>
<a id="#(SPAWN).RepeatOnLanding" >
<strong>SPAWN.RepeatOnLanding</strong>
</a>
</dt>
<dd>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(SPAWN).Spawn" >
<strong>SPAWN:Spawn()</strong>
</a>
</dt>
<dd>
<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="Wrapper.Group.html##(GROUP)">Wrapper.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>
<a id="#(SPAWN).SpawnAtAirbase" >
<strong>SPAWN:SpawnAtAirbase(SpawnAirbase, Takeoff, TakeoffAltitude)</strong>
</a>
</dt>
<dd>
<p>Will spawn a group at an <a href="Airbase.html">Airbase</a>.</p>
<p>This method is mostly advisable to be used if you want to simulate spawning units at an airbase.
Note that each point in the route assigned to the spawning group is reset to the point of the spawn.
You can use the returned group to further define the route to be followed.</p>
<p>The <a href="Airbase.html##(AIRBASE)">Airbase#AIRBASE</a> object must refer to a valid airbase known in the sim.
You can use the following enumerations to search for the pre-defined airbases on the current known maps of DCS:</p>
<ul>
<li><a href="Airbase.html##(AIRBASE).Caucasus">Airbase#AIRBASE.Caucasus</a>: The airbases on the Caucasus map. </li>
<li><a href="Airbase.html##(AIRBASE).Nevada">Airbase#AIRBASE.Nevada</a>: The airbases on the Nevada (NTTR) map. </li>
<li><a href="Airbase.html##(AIRBASE).Normandy">Airbase#AIRBASE.Normandy</a>: The airbases on the Normandy map. </li>
</ul>
<p>Use the method <a href="Airbase.html##(AIRBASE).FindByName">Airbase#AIRBASE.FindByName</a>() to retrieve the airbase object.
The known AIRBASE objects are automatically imported at mission start by MOOSE.
Therefore, there isn't any New() constructor defined for AIRBASE objects.</p>
<p>Ships and Farps are added within the mission, and are therefore not known.
For these AIRBASE objects, there isn't an <a href="Airbase.html##(AIRBASE)">Airbase#AIRBASE</a> enumeration defined.
You need to provide the <strong>exact name</strong> of the airbase as the parameter to the <a href="Airbase.html##(AIRBASE).FindByName">Airbase#AIRBASE.FindByName</a>() method!</p>
<h3>Parameters</h3>
<ul>
<li>
<p><code><em><a href="Wrapper.Airbase.html##(AIRBASE)">Wrapper.Airbase#AIRBASE</a> SpawnAirbase </em></code>:
The <a href="Airbase.html">Airbase</a> where to spawn the group.</p>
</li>
<li>
<p><code><em><a href="##(SPAWN.Takeoff)">#SPAWN.Takeoff</a> Takeoff </em></code>:
(optional) The location and takeoff method. Default is Hot.</p>
</li>
<li>
<p><code><em>#number TakeoffAltitude </em></code>:
(optional) The altitude above the ground.</p>
</li>
</ul>
<h3>Return values</h3>
<ol>
<li>
<p><em><a href="Wrapper.Group.html##(GROUP)">Wrapper.Group#GROUP</a>:</em>
that was spawned.</p>
</li>
<li>
<p><em>#nil:</em>
Nothing was spawned.</p>
</li>
</ol>
<h3>Usage:</h3>
<pre class="example"><code> Spawn_Plane = SPAWN:New( "Plane" )
Spawn_Plane:SpawnAtAirbase( AIRBASE:FindByName( AIRBASE.Caucasus.Krymsk ), SPAWN.Takeoff.Cold )
Spawn_Plane:SpawnAtAirbase( AIRBASE:FindByName( AIRBASE.Caucasus.Krymsk ), SPAWN.Takeoff.Hot )
Spawn_Plane:SpawnAtAirbase( AIRBASE:FindByName( AIRBASE.Caucasus.Krymsk ), SPAWN.Takeoff.Runway )
Spawn_Plane:SpawnAtAirbase( AIRBASE:FindByName( "Carrier" ), SPAWN.Takeoff.Cold )
Spawn_Heli = SPAWN:New( "Heli")
Spawn_Heli:SpawnAtAirbase( AIRBASE:FindByName( "FARP Cold" ), SPAWN.Takeoff.Cold )
Spawn_Heli:SpawnAtAirbase( AIRBASE:FindByName( "FARP Hot" ), SPAWN.Takeoff.Hot )
Spawn_Heli:SpawnAtAirbase( AIRBASE:FindByName( "FARP Runway" ), SPAWN.Takeoff.Runway )
Spawn_Heli:SpawnAtAirbase( AIRBASE:FindByName( "FARP Air" ), SPAWN.Takeoff.Air )
Spawn_Heli:SpawnAtAirbase( AIRBASE:FindByName( "Carrier" ), SPAWN.Takeoff.Cold )
</code></pre>
</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).SpawnCount" >
<strong>SPAWN.SpawnCount</strong>
</a>
</dt>
<dd>
<p> The internal counter of the amount of spawning the has happened since SpawnStart.</p>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(SPAWN).SpawnFromStatic" >
<strong>SPAWN:SpawnFromStatic(HostStatic, SpawnIndex)</strong>
</a>
</dt>
<dd>
<p>Will spawn a group from a hosting static.</p>
<p>This method is mostly advisable to be used if you want to simulate spawning from buldings and structures (static buildings).
You can use the returned group to further define the route to be followed.</p>
<h3>Parameters</h3>
<ul>
<li>
<p><code><em><a href="Wrapper.Static.html##(STATIC)">Wrapper.Static#STATIC</a> HostStatic </em></code>:
The static dropping or unloading the group.</p>
</li>
<li>
<p><code><em>#number SpawnIndex </em></code>:
(optional) The index which group to spawn within the given zone.</p>
</li>
</ul>
<h3>Return values</h3>
<ol>
<li>
<p><em><a href="Wrapper.Group.html##(GROUP)">Wrapper.Group#GROUP</a>:</em>
that was spawned.</p>
</li>
<li>
<p><em>#nil:</em>
Nothing was spawned.</p>
</li>
</ol>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(SPAWN).SpawnFromUnit" >
<strong>SPAWN:SpawnFromUnit(HostUnit, SpawnIndex)</strong>
</a>
</dt>
<dd>
<p>Will spawn a group from a hosting unit.</p>
<p>This method is mostly advisable to be used if you want to simulate spawning from air units, like helicopters, which are dropping infantry into a defined Landing Zone.
Note that each point in the route assigned to the spawning group is reset to the point of the spawn.
You can use the returned group to further define the route to be followed.</p>
<h3>Parameters</h3>
<ul>
<li>
<p><code><em><a href="Wrapper.Unit.html##(UNIT)">Wrapper.Unit#UNIT</a> HostUnit </em></code>:
The air or ground unit dropping or unloading the group.</p>
</li>
<li>
<p><code><em>#number SpawnIndex </em></code>:
(optional) The index which group to spawn within the given zone.</p>
</li>
</ul>
<h3>Return values</h3>
<ol>
<li>
<p><em><a href="Wrapper.Group.html##(GROUP)">Wrapper.Group#GROUP</a>:</em>
that was spawned.</p>
</li>
<li>
<p><em>#nil:</em>
Nothing was spawned.</p>
</li>
</ol>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(SPAWN).SpawnFromVec2" >
<strong>SPAWN:SpawnFromVec2(Vec2, SpawnIndex)</strong>
</a>
</dt>
<dd>
<p>Will spawn a group from a Vec2 in 3D space.</p>
<p>This method is mostly advisable to be used if you want to simulate spawning groups on the ground from air units, like vehicles.
Note that each point in the route assigned to the spawning group is reset to the point of the spawn.
You can use the returned group to further define the route to be followed.</p>
<h3>Parameters</h3>
<ul>
<li>
<p><code><em><a href="Dcs.DCSTypes.html##(Vec2)">Dcs.DCSTypes#Vec2</a> Vec2 </em></code>:
The Vec2 coordinates where to spawn the group.</p>
</li>
<li>
<p><code><em>#number SpawnIndex </em></code>:
(optional) The index which group to spawn within the given zone.</p>
</li>
</ul>
<h3>Return values</h3>
<ol>
<li>
<p><em><a href="Wrapper.Group.html##(GROUP)">Wrapper.Group#GROUP</a>:</em>
that was spawned.</p>
</li>
<li>
<p><em>#nil:</em>
Nothing was spawned.</p>
</li>
</ol>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(SPAWN).SpawnFromVec3" >
<strong>SPAWN:SpawnFromVec3(Vec3, SpawnIndex)</strong>
</a>
</dt>
<dd>
<p>Will spawn a group from a Vec3 in 3D space.</p>
<p>This method is mostly advisable to be used if you want to simulate spawning units in the air, like helicopters or airplanes.
Note that each point in the route assigned to the spawning group is reset to the point of the spawn.
You can use the returned group to further define the route to be followed.</p>
<h3>Parameters</h3>
<ul>
<li>
<p><code><em><a href="Dcs.DCSTypes.html##(Vec3)">Dcs.DCSTypes#Vec3</a> Vec3 </em></code>:
The Vec3 coordinates where to spawn the group.</p>
</li>
<li>
<p><code><em>#number SpawnIndex </em></code>:
(optional) The index which group to spawn within the given zone.</p>
</li>
</ul>
<h3>Return values</h3>
<ol>
<li>
<p><em><a href="Wrapper.Group.html##(GROUP)">Wrapper.Group#GROUP</a>:</em>
that was spawned.</p>
</li>
<li>
<p><em>#nil:</em>
Nothing was spawned.</p>
</li>
</ol>
</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">
<dt>
<a id="#(SPAWN).SpawnGroupName" >
<strong>SPAWN:SpawnGroupName(SpawnIndex)</strong>
</a>
</dt>
<dd>
<p>Will return the SpawnGroupName either with with a specific count number or without any count.</p>
<h3>Parameter</h3>
<ul>
<li>
<p><code><em>#number SpawnIndex </em></code>:
Is the number of the Group that is to be spawned.</p>
</li>
</ul>
<h3>Return value</h3>
<p><em>#string:</em>
SpawnGroupName</p>
</dd>
</dl>
<dl class="function">
<dt>
<em></em>
<a id="#(SPAWN).SpawnGrouping" >
<strong>SPAWN.SpawnGrouping</strong>
</a>
</dt>
<dd>
</dd>
</dl>
<dl class="function">
<dt>
<em></em>
<a id="#(SPAWN).SpawnGroups" >
<strong>SPAWN.SpawnGroups</strong>
</a>
</dt>
<dd>
<p> Array containing the descriptions of each Group to be Spawned.</p>
</dd>
</dl>
<dl class="function">
<dt>
<em></em>
<a id="#(SPAWN).SpawnHookScheduler" >
<strong>SPAWN.SpawnHookScheduler</strong>
</a>
</dt>
<dd>
<p> delay calling this for .1 seconds so that it hopefully comes after the BIRTH event of the group.</p>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(SPAWN).SpawnInZone" >
<strong>SPAWN:SpawnInZone(Zone, RandomizeGroup, SpawnIndex)</strong>
</a>
</dt>
<dd>
<p>Will spawn a Group within a given <a href="Zone.html">Zone</a>.</p>
<p>The <a href="Zone.html">Zone</a> can be of any type derived from <a href="Zone.html##(ZONE_BASE)">Zone#ZONE_BASE</a>.
Once the <a href="Group.html">Group</a> is spawned within the zone, the <a href="Group.html">Group</a> will continue on its route.
The <strong>first waypoint</strong> (where the group is spawned) is replaced with the zone location coordinates.</p>
<h3>Parameters</h3>
<ul>
<li>
<p><code><em><a href="Core.Zone.html##(ZONE)">Core.Zone#ZONE</a> Zone </em></code>:
The zone where the group is to be spawned.</p>
</li>
<li>
<p><code><em>#boolean RandomizeGroup </em></code>:
(optional) Randomization of the <a href="Group.html">Group</a> position in the zone.</p>
</li>
<li>
<p><code><em>#number SpawnIndex </em></code>:
(optional) The index which group to spawn within the given zone.</p>
</li>
</ul>
<h3>Return values</h3>
<ol>
<li>
<p><em><a href="Wrapper.Group.html##(GROUP)">Wrapper.Group#GROUP</a>:</em>
that was spawned.</p>
</li>
<li>
<p><em>#nil:</em>
when nothing was spawned.</p>
</li>
</ol>
</dd>
</dl>
<dl class="function">
<dt>
<em>#number</em>
<a id="#(SPAWN).SpawnIndex" >
<strong>SPAWN.SpawnIndex</strong>
</a>
</dt>
<dd>
</dd>
</dl>
<dl class="function">
<dt>
<em>#boolean</em>
<a id="#(SPAWN).SpawnInitKeepUnitNames" >
<strong>SPAWN.SpawnInitKeepUnitNames</strong>
</a>
</dt>
<dd>
</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">
<dt>
<a id="#(SPAWN).SpawnInnerRadius" >
<strong>SPAWN.SpawnInnerRadius</strong>
</a>
</dt>
<dd>
</dd>
</dl>
<dl class="function">
<dt>
<em>#boolean</em>
<a id="#(SPAWN).SpawnIsScheduled" >
<strong>SPAWN.SpawnIsScheduled</strong>
</a>
</dt>
<dd>
<p> Reflects if the spawning for this SpawnTemplatePrefix is going to be scheduled or not.</p>
</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>
<a id="#(SPAWN).SpawnOuterRadius" >
<strong>SPAWN.SpawnOuterRadius</strong>
</a>
</dt>
<dd>
</dd>
</dl>
<dl class="function">
<dt>
<em>#boolean</em>
<a id="#(SPAWN).SpawnRandomize" >
<strong>SPAWN.SpawnRandomize</strong>
</a>
</dt>
<dd>
<p> Sets the randomization flag of new Spawned units to false.</p>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(SPAWN).SpawnRandomizePosition" >
<strong>SPAWN.SpawnRandomizePosition</strong>
</a>
</dt>
<dd>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(SPAWN).SpawnRandomizePositionInnerRadius" >
<strong>SPAWN.SpawnRandomizePositionInnerRadius</strong>
</a>
</dt>
<dd>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(SPAWN).SpawnRandomizePositionOuterRadius" >
<strong>SPAWN.SpawnRandomizePositionOuterRadius</strong>
</a>
</dt>
<dd>
</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).SpawnRandomizeRouteHeight" >
<strong>SPAWN.SpawnRandomizeRouteHeight</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>
<a id="#(SPAWN).SpawnRandomizeUnits" >
<strong>SPAWN.SpawnRandomizeUnits</strong>
</a>
</dt>
<dd>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(SPAWN).SpawnScheduleStart" >
<strong>SPAWN:SpawnScheduleStart()</strong>
</a>
</dt>
<dd>
<p>Will re-start the spawning scheduler.</p>
<p>Note: This method is only required to be called when the schedule was stopped.</p>
<h3>Return value</h3>
<p><em><a href="##(SPAWN)">#SPAWN</a>:</em></p>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(SPAWN).SpawnScheduleStop" >
<strong>SPAWN:SpawnScheduleStop()</strong>
</a>
</dt>
<dd>
<p>Will stop the scheduled spawning scheduler.</p>
<h3>Return value</h3>
<p><em><a href="##(SPAWN)">#SPAWN</a>:</em></p>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(SPAWN).SpawnScheduled" >
<strong>SPAWN:SpawnScheduled(SpawnTime, SpawnTimeVariation)</strong>
</a>
</dt>
<dd>
<p>Spawns new groups at varying time intervals.</p>
<p>This is useful if you want to have continuity within your missions of certain (AI) groups to be present (alive) within your missions.</p>
<h3>Parameters</h3>
<ul>
<li>
<p><code><em>#number SpawnTime </em></code>:
The time interval defined in seconds between each new spawn of new groups.</p>
</li>
<li>
<p><code><em>#number SpawnTimeVariation </em></code>:
The variation to be applied on the defined time interval between each new spawn.
The variation is a number between 0 and 1, representing the %-tage of variation to be applied on the time interval.</p>
</li>
</ul>
<h3>Return value</h3>
<p><em><a href="##(SPAWN)">#SPAWN</a>:</em>
self</p>
<h3>Usage:</h3>
<pre class="example"><code>-- NATO helicopters engaging in the battle field.
-- The time interval is set to SPAWN new helicopters between each 600 seconds, with a time variation of 50%.
-- The time variation in this case will be between 450 seconds and 750 seconds.
-- This is calculated as follows:
-- Low limit: 600 * ( 1 - 0.5 / 2 ) = 450
-- High limit: 600 * ( 1 + 0.5 / 2 ) = 750
-- 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></em>
<a id="#(SPAWN).SpawnScheduler" >
<strong>SPAWN.SpawnScheduler</strong>
</a>
</dt>
<dd>
</dd>
</dl>
<dl class="function">
<dt>
<em></em>
<a id="#(SPAWN).SpawnTemplate" >
<strong>SPAWN.SpawnTemplate</strong>
</a>
</dt>
<dd>
<p> Contains the template structure for a Group Spawn from the Mission Editor. Note that this group must have lateActivation always on!!!</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).SpawnUnControlled" >
<strong>SPAWN.SpawnUnControlled</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">
<dt>
<a id="#(SPAWN).SpawnWithIndex" >
<strong>SPAWN:SpawnWithIndex(SpawnIndex)</strong>
</a>
</dt>
<dd>
<p>Will spawn a group with a specified index number.</p>
<p>Uses <a href="DATABASE.html">DATABASE</a> global object defined in MOOSE.</p>
<h3>Parameter</h3>
<ul>
<li>
<p><code><em>#string SpawnIndex </em></code>:
The index of the group to be spawned.</p>
</li>
</ul>
<h3>Return value</h3>
<p><em><a href="Wrapper.Group.html##(GROUP)">Wrapper.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><a href="##(SPAWN.SpawnZoneTable)">#SPAWN.SpawnZoneTable</a></em>
<a id="#(SPAWN).SpawnZoneTable" >
<strong>SPAWN.SpawnZoneTable</strong>
</a>
</dt>
<dd>
</dd>
</dl>
<dl class="function">
<dt>
<em><a href="##(SPAWN.Takeoff)">#SPAWN.Takeoff</a></em>
<a id="#(SPAWN).Takeoff" >
<strong>SPAWN.Takeoff</strong>
</a>
</dt>
<dd>
</dd>
</dl>
<dl class="function">
<dt>
<em>#boolean</em>
<a id="#(SPAWN).UnControlled" >
<strong>SPAWN.UnControlled</strong>
</a>
</dt>
<dd>
<p> When working in UnControlled mode, all planes are Spawned in UnControlled mode before the scheduler starts.</p>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(SPAWN)._GetGroupCategoryID" >
<strong>SPAWN:_GetGroupCategoryID(SpawnPrefix)</strong>
</a>
</dt>
<dd>
<p>Gets the CategoryID of the Group with the given SpawnPrefix</p>
<h3>Parameter</h3>
<ul>
<li>
<p><code><em> SpawnPrefix </em></code>: </p>
</li>
</ul>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(SPAWN)._GetGroupCoalitionID" >
<strong>SPAWN:_GetGroupCoalitionID(SpawnPrefix)</strong>
</a>
</dt>
<dd>
<p>Gets the CoalitionID of the Group with the given SpawnPrefix</p>
<h3>Parameter</h3>
<ul>
<li>
<p><code><em> SpawnPrefix </em></code>: </p>
</li>
</ul>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(SPAWN)._GetGroupCountryID" >
<strong>SPAWN:_GetGroupCountryID(SpawnPrefix)</strong>
</a>
</dt>
<dd>
<p>Gets the CountryID of the Group with the given SpawnPrefix</p>
<h3>Parameter</h3>
<ul>
<li>
<p><code><em> SpawnPrefix </em></code>: </p>
</li>
</ul>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(SPAWN)._GetLastIndex" >
<strong>SPAWN:_GetLastIndex()</strong>
</a>
</dt>
<dd>
<p>Return the last maximum index that can be used.</p>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(SPAWN)._GetPrefixFromGroup" >
<strong>SPAWN:_GetPrefixFromGroup(DCSUnit, SpawnGroup)</strong>
</a>
</dt>
<dd>
<p>Return the prefix of a SpawnUnit.</p>
<p>The method will search for a #-mark, and will return the text before the #-mark.
It will return nil of no prefix was found.</p>
<h3>Parameters</h3>
<ul>
<li>
<p><code><em><a href="Dcs.DCSWrapper.Unit.html##(UNIT)">Dcs.DCSWrapper.Unit#UNIT</a> DCSUnit </em></code>:
The <a href="DCSUnit.html">DCSUnit</a> to be searched.</p>
</li>
<li>
<p><code><em> SpawnGroup </em></code>: </p>
</li>
</ul>
<h3>Return values</h3>
<ol>
<li>
<p><em>#string:</em>
The prefix</p>
</li>
<li>
<p><em>#nil:</em>
Nothing found</p>
</li>
</ol>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(SPAWN)._GetSpawnIndex" >
<strong>SPAWN:_GetSpawnIndex(SpawnIndex)</strong>
</a>
</dt>
<dd>
<p>Get the next index of the groups to be spawned.</p>
<p>This method is complicated, as it is used at several spaces.</p>
<h3>Parameter</h3>
<ul>
<li>
<p><code><em> SpawnIndex </em></code>: </p>
</li>
</ul>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(SPAWN)._GetTemplate" >
<strong>SPAWN:_GetTemplate(SpawnTemplatePrefix)</strong>
</a>
</dt>
<dd>
<p>Gets the Group Template from the ME environment definition.</p>
<p>This method used the <a href="DATABASE.html">DATABASE</a> object, which contains ALL initial and new spawned object in MOOSE.</p>
<h3>Parameter</h3>
<ul>
<li>
<p><code><em>#string SpawnTemplatePrefix </em></code>: </p>
</li>
</ul>
<h3>Return value</h3>
<p>@SPAWN self</p>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(SPAWN)._InitializeSpawnGroups" >
<strong>SPAWN:_InitializeSpawnGroups(SpawnIndex)</strong>
</a>
</dt>
<dd>
<p>Initalize the SpawnGroups collection.</p>
<h3>Parameter</h3>
<ul>
<li>
<p><code><em> SpawnIndex </em></code>: </p>
</li>
</ul>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(SPAWN)._OnBirth" >
<strong>SPAWN:_OnBirth(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="#(SPAWN)._OnDeadOrCrash" >
<strong>SPAWN:_OnDeadOrCrash(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="#(SPAWN)._OnEngineShutDown" >
<strong>SPAWN:_OnEngineShutDown(EventData)</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><a href="Core.Event.html##(EVENTDATA)">Core.Event#EVENTDATA</a> EventData </em></code>: </p>
</li>
</ul>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(SPAWN)._OnLand" >
<strong>SPAWN:_OnLand(EventData)</strong>
</a>
</dt>
<dd>
<p>Will detect AIR Units landing...</p>
<p>When the event takes place, the spawned Group is registered as landed.
This is needed to ensure that Re-SPAWNing is only done for landed AIR Groups.</p>
<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="#(SPAWN)._OnTakeOff" >
<strong>SPAWN:_OnTakeOff(EventData)</strong>
</a>
</dt>
<dd>
<p>Will detect AIR Units taking off...</p>
<p>When the event takes place, the spawned Group is registered as airborne...
This is needed to ensure that Re-SPAWNing only is done for landed AIR Groups.</p>
<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="#(SPAWN)._Prepare" >
<strong>SPAWN:_Prepare(SpawnTemplatePrefix, SpawnIndex)</strong>
</a>
</dt>
<dd>
<p>Prepares the new Group Template.</p>
<h3>Parameters</h3>
<ul>
<li>
<p><code><em>#string SpawnTemplatePrefix </em></code>: </p>
</li>
<li>
<p><code><em>#number SpawnIndex </em></code>: </p>
</li>
</ul>
<h3>Return value</h3>
<p><em><a href="##(SPAWN)">#SPAWN</a>:</em>
self</p>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(SPAWN)._RandomizeRoute" >
<strong>SPAWN:_RandomizeRoute(SpawnIndex)</strong>
</a>
</dt>
<dd>
<p>Private method randomizing the routes.</p>
<h3>Parameter</h3>
<ul>
<li>
<p><code><em>#number SpawnIndex </em></code>:
The index of the group to be spawned.</p>
</li>
</ul>
<h3>Return value</h3>
<p><em><a href="##(SPAWN)">#SPAWN</a>:</em></p>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(SPAWN)._RandomizeTemplate" >
<strong>SPAWN:_RandomizeTemplate(SpawnIndex)</strong>
</a>
</dt>
<dd>
<p>Private method that randomizes the template of the group.</p>
<h3>Parameter</h3>
<ul>
<li>
<p><code><em>#number SpawnIndex </em></code>: </p>
</li>
</ul>
<h3>Return value</h3>
<p><em><a href="##(SPAWN)">#SPAWN</a>:</em>
self</p>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(SPAWN)._RandomizeZones" >
<strong>SPAWN:_RandomizeZones(SpawnIndex)</strong>
</a>
</dt>
<dd>
<p>Private method that randomizes the <a href="Zone.html">Zone</a>s where the Group will be spawned.</p>
<h3>Parameter</h3>
<ul>
<li>
<p><code><em>#number SpawnIndex </em></code>: </p>
</li>
</ul>
<h3>Return value</h3>
<p><em><a href="##(SPAWN)">#SPAWN</a>:</em>
self</p>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(SPAWN)._Scheduler" >
<strong>SPAWN:_Scheduler()</strong>
</a>
</dt>
<dd>
<p>This function is called automatically by the Spawning scheduler.</p>
<p>It is the internal worker method SPAWNing new Groups on the defined time intervals.</p>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(SPAWN)._SpawnCleanUpScheduler" >
<strong>SPAWN:_SpawnCleanUpScheduler()</strong>
</a>
</dt>
<dd>
<p>Schedules the CleanUp of Groups</p>
<h3>Return value</h3>
<p><em>#boolean:</em>
True = Continue Scheduler</p>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(SPAWN)._TranslateRotate" >
<strong>SPAWN:_TranslateRotate(SpawnIndex, SpawnRootX, SpawnRootY, SpawnX, SpawnY, SpawnAngle)</strong>
</a>
</dt>
<dd>
<h3>Parameters</h3>
<ul>
<li>
<p><code><em> SpawnIndex </em></code>: </p>
</li>
<li>
<p><code><em> SpawnRootX </em></code>: </p>
</li>
<li>
<p><code><em> SpawnRootY </em></code>: </p>
</li>
<li>
<p><code><em> SpawnX </em></code>: </p>
</li>
<li>
<p><code><em> SpawnY </em></code>: </p>
</li>
<li>
<p><code><em> SpawnAngle </em></code>: </p>
</li>
</ul>
</dd>
</dl>
<h2><a id="#(SPAWN.SpawnZoneTable)" >Type <code>SPAWN.SpawnZoneTable</code></a></h2>
<h2><a id="#(SPAWN.Takeoff)" >Type <code>SPAWN.Takeoff</code></a></h2>
<p>Enumerator for spawns at airbases</p>
</div>
</div>
</body>
</html>