Dynamic spawning of Groups and Units.
| SPAWN:New (SpawnTemplatePrefix) |
Creates the main object to spawn a Group defined in the DCS ME. |
| SPAWN:NewWithAlias (SpawnTemplatePrefix) |
Creates the main object to spawn a Group defined in the DCS ME. |
| SPAWN:Limit (SpawnMaxGroupsAlive, SpawnMaxGroups) |
Limits the Maximum amount of Units to be alive, and the maximum amount of Groups to be SPAWNed within the DCS World run-time environment. |
| SPAWN:RandomizeRoute (SpawnStartPoint, SpawnEndPoint, SpawnRadius) |
Randomizes a defined route of the Template Group in the ME when the Group is Spawned. |
| SPAWN:RandomizeTemplate (SpawnTemplatePrefixTable) |
This function is rather complicated to understand. |
| SPAWN:Repeat () |
When a Group got SPAWNed, it has a life within the DCSRTE. |
| SPAWN:RepeatOnLanding () |
Same as the @{Repeat) method. |
| SPAWN:RepeatOnEngineShutDown () |
Same as the @{Repeat) method, but now the Group will respawn after its engines have shut down. |
| SPAWN:SpawnArray (SpawnZone, SpawnAngle, SpawnFormation, SpawnWidth, SpawnDeltaX, SpawnDeltaY) |
Makes the Groups visible before start (like a batallion). |
| SPAWN:Spawn () |
Will SPAWN a Group whenever you want to do this. |
| SPAWN:ReSpawn (SpawnGroupName) |
Will Re-SPAWN a Group based on a given GroupName. |
| SPAWN:SpawnWithIndex (SpawnIndex) |
Will SPAWN a Group with a specified index number whenever you want to do this. |
| SPAWN:SpawnScheduled (SpawnTime, SpawnTimeVariation) |
SPAWNs a new Group within varying time intervals. |
| SPAWN:ScheduleStart () |
Will start the SPAWNing timers. |
| SPAWN:ScheduleStop () |
Will stop the scheduled SPAWNing activity. |
| SPAWN:UnControlled () |
Will SPAWN a Group whenever you want to do this, but for AIR Groups only to be applied, and will SPAWN the Group in Uncontrolled mode... |
| SPAWN:SpawnFromUnit (HostUnit) |
Will SPAWN a Group from a Hosting UNIT. |
| SPAWN:SpawnInZone (The) |
Will spawn a Group within a given ZONE. |
| SPAWN:SpawnGroupName (SpawnIndex) |
Will return the SpawnGroupName either with with a specific count number or without any count. |
-
SPAWN:New (SpawnTemplatePrefix)
-
Creates the main object to spawn a Group defined in the DCS ME.
Spawned Groups and Units will follow the following naming convention within the DCS World run-time environment:
Groups will have the name SpawnTemplatePrefix#ggg, where ggg is a counter from 0 to 999 for each new spawned Group.
Units will have the name SpawnTemplatePrefix#ggg-uu, where uu is a counter from 0 to 99 for each new spawned Unit belonging to that Group.
Parameters:
- SpawnTemplatePrefix
string
is the name of the Group in the ME that defines the Template. That Group must have the flag "Late Activation" set. Note that this SpawnTemplatePrefix name should not contain any # character.
Returns:
SPAWN
Usage:
Spawn_BE_KA50 = SPAWN:New( 'BE KA-50@RAMP-Ground Defense' )
-
SPAWN:NewWithAlias (SpawnTemplatePrefix)
-
Creates the main object to spawn a Group defined in the DCS ME.
Spawned Groups and Units will follow the following naming convention within the DCS World run-time environment:
Groups will have the name SpawnTemplatePrefix#ggg, where ggg is a counter from 0 to 999 for each new spawned Group.
Units will have the name SpawnTemplatePrefix#ggg-uu, where uu is a counter from 0 to 99 for each new spawned Unit belonging to that Group.
Parameters:
- SpawnTemplatePrefix
string
is the name of the Group in the ME that defines the Template. That Group must have the flag "Late Activation" set. Note that this SpawnTemplatePrefix name should not contain any # character.
Returns:
SPAWN
Usage:
Spawn_BE_KA50 = SPAWN:New( 'BE KA-50@RAMP-Ground Defense' )
-
SPAWN:Limit (SpawnMaxGroupsAlive, SpawnMaxGroups)
-
Limits the Maximum amount of Units to be alive, and the maximum amount of Groups to be SPAWNed within the DCS World run-time environment.
Note that this method is exceptionally important to balance the amount of Units alive within the DCSRTE and 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 function should be used...
Parameters:
- SpawnMaxGroupsAlive
number
is the Maximum amount of Units to be alive. When there are more Units alive in the DCSRTE of SpawnTemplatePrefix, then no new SPAWN will happen of the Group, until some of these Units will be destroyed.
- SpawnMaxGroups
number
is the Maximum amount of Groups that can be SPAWNed from SpawnTemplatePrefix. When there are more Groups alive in the DCSRTE of SpawnTemplatePrefix, then no more 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 expresses no Group count limits.
Returns:
SPAWN
Usage:
Spawn_BE_KA50 = SPAWN:New( 'BE KA-50@RAMP-Ground Defense' ):Limit( 2, 24 )
-
SPAWN:RandomizeRoute (SpawnStartPoint, SpawnEndPoint, SpawnRadius)
-
Randomizes a defined route of the Template Group in the ME when the Group is Spawned. This is very useful to define extra variation in the DCS World run-time environment of the behaviour of Groups like Ground Units, Ships, Planes, Helicopters.
Parameters:
- SpawnStartPoint
number
is the waypoint where the randomization begins. Note that the StartPoint = 0 equals the point where the Group is Spawned. This parameter is useful to avoid randomization to start from the first waypoint, but a bit further down the route...
- SpawnEndPoint
number
is the waypoint where the randomization ends. this parameter is useful to avoid randomization to end at a waypoint earlier than the last waypoint on the route.
- SpawnRadius
number
is the radius in meters, that defines the concentric circle in which the randomization of the new waypoint will take place, with the original waypoint located in the middle...
Returns:
SPAWN
Usage:
Spawn_BE_KA50 = SPAWN:New( 'BE KA-50@RAMP-Ground Defense' ):RandomizeRoute( 2, 2, 2000 )
-
SPAWN:RandomizeTemplate (SpawnTemplatePrefixTable)
-
This function is rather complicated to understand. But I'll try to explain...
This function becomes useful when you need to SPAWN random types of Groups defined within the ME, but they all need to follow the same Template route and have the same SpawnTemplatePrefix name, then this method becomes very useful.
Parameters:
- SpawnTemplatePrefixTable
table{string,...}
is a table with the names of the Groups defined within the ME (with late activatio on), from which on a new SPAWN of SpawnTemplatePrefix (the main Group name), a NEW Group will be choosen as the Group to be SPAWNed.
In other words, this method randomizes between a defined set of Groups the Group to be SPAWNed for each new SPAWN.
Returns:
SPAWN
Usage:
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' ):Limit( 12, 150 ):Schedule( 200, 0.4 ):RandomizeTemplate( Spawn_US_Platoon ):RandomizeRoute( 3, 3, 2000 )
Spawn_US_Platoon_Middle = SPAWN:New( 'US Tank Platoon Middle' ):Limit( 12, 150 ):Schedule( 200, 0.4 ):RandomizeTemplate( Spawn_US_Platoon ):RandomizeRoute( 3, 3, 2000 )
Spawn_US_Platoon_Right = SPAWN:New( 'US Tank Platoon Right' ):Limit( 12, 150 ):Schedule( 200, 0.4 ):RandomizeTemplate( Spawn_US_Platoon ):RandomizeRoute( 3, 3, 2000 )
-
SPAWN:Repeat ()
-
When a Group got SPAWNed, it has a life within the DCSRTE. For planes and helicopters, when these Units 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 DCSRTE.
This function is used to Re-Spawn automatically (so no extra call is needed anymore) the same Group after it 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 ReSpawn at the original airbase where it took off. So ensure that the paths for Groups that ReSpawn, always return to the original airbase.
Returns:
SPAWN
Usage:
SpawnRU_SU34 = SPAWN:New( 'TF1 RU Su-34 Krymsk@AI - Attack Ships' ):Schedule( 2, 3, 1800, 0.4 ):SpawnUncontrolled():RandomizeRoute( 1, 1, 3000 ):RepeatOnEngineShutDown()
-
SPAWN:RepeatOnLanding ()
-
Same as the @{Repeat) method.
Returns:
SPAWN
See also:
-
SPAWN:RepeatOnEngineShutDown ()
-
Same as the @{Repeat) method, but now the Group will respawn after its engines have shut down.
Returns:
SPAWN
See also:
-
SPAWN:SpawnArray (SpawnZone, SpawnAngle, SpawnFormation, SpawnWidth, SpawnDeltaX, SpawnDeltaY)
-
Makes the Groups visible before start (like a batallion).
Parameters:
- SpawnZone
number
A ZONE where the group will be positioned. The X and Y coordinates of the zone define the start position.
- SpawnAngle
number
The angle in degrees how the Groups and each Unit of the Group will be positioned.
- SpawnFormation
number
The formation of the Units within the Group.
- SpawnWidth
number
The amount of Groups that will be positioned on the X axis.
- SpawnDeltaX
number
The space between each Group on the X-axis.
- SpawnDeltaY
number
The space between each Group on the Y-axis.
Returns:
SPAWN
Usage:
Spawn_BE_Ground = SPAWN:New( 'BE Ground' ):Limit( 2, 24 ):Visible( ZONE:New( "Start" ), 90, "Diamond", 10, 100, 50 )
-
SPAWN:Spawn ()
-
Will SPAWN a Group whenever you want to do this.
Note that the configuration with the above functions will apply when calling this method: Maxima, Randomization of routes, Scheduler, ...
Uses DATABASE global object defined in MOOSE.
Returns:
SPAWN
-
SPAWN:ReSpawn (SpawnGroupName)
-
Will Re-SPAWN a Group based on a given GroupName. The GroupName must be a group that is already alive within the DCSRTE and should have a Group Template defined in the ME (with Late Activation flag on).
Note that the configuration with the above functions will apply when calling this method: Maxima, Randomization of routes, Scheduler, ...
Parameters:
Returns:
SPAWN
Uses _Database global object defined in MOOSE.
-
SPAWN:SpawnWithIndex (SpawnIndex)
-
Will SPAWN a Group with a specified index number whenever you want to do this.
Note that the configuration with the above functions will apply when calling this method: Maxima, Randomization of routes, Scheduler, ...
Uses DATABASE global object defined in MOOSE.
Parameters:
Returns:
GROUP
The GROUP that was spawned. You can use this group for further actions.
-
SPAWN:SpawnScheduled (SpawnTime, SpawnTimeVariation)
-
SPAWNs a new Group within varying time intervals. This is useful if you want to have continuity within your missions of certain (AI) Groups to be present (alive) within your missions.
Parameters:
- SpawnTime
number
is the time interval defined in seconds between each new SPAWN of new Groups.
- SpawnTimeVariation
number
is the variation to be applied on the defined time interval between each new SPAWN. The variation is defined as a value between 0 and 1, which expresses the %-tage of variation to be applied as the low and high time interval boundaries. Between these boundaries a new time interval will be applied. See usage.
Returns:
SPAWN
Usage:
Spawn_BE_KA50 = SPAWN:New( 'BE KA-50@RAMP-Ground Defense' ):Schedule( 600, 0.5 )
-
SPAWN:ScheduleStart ()
-
Will start the SPAWNing timers.
This function is called automatically when ??? is called.
-
SPAWN:ScheduleStop ()
-
Will stop the scheduled SPAWNing activity.
-
SPAWN:UnControlled ()
-
Will SPAWN a Group whenever you want to do this, but for AIR Groups only to be applied, and will SPAWN the Group in Uncontrolled mode...
This will be similar to the Uncontrolled flag setting in the ME.
Returns:
SPAWN
-
SPAWN:SpawnFromUnit (HostUnit)
-
Will SPAWN a Group from a Hosting UNIT. This function 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.
Parameters:
- HostUnit
UNIT
is the AIR unit or GROUND unit dropping or unloading the Spawn group.
Returns:
-
GROUP
Spawned.
-
nil
when nothing was spawned.
-
SPAWN:SpawnInZone (The)
-
Will spawn a Group within a given ZONE.
Parameters:
- The
ZONE
ZONE where the Group is to be SPAWNed.
Returns:
-
GROUP
that was spawned.
-
nil
when nothing as spawned.
-
SPAWN:SpawnGroupName (SpawnIndex)
-
Will return the SpawnGroupName either with with a specific count number or without any count.
Parameters:
- SpawnIndex
number
is the number of the Group that is to be SPAWNed.
Returns:
string
SpawnGroupName