mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2025-08-15 10:47:21 +00:00
SPAWN: Added InitRandomizePosition API
-- SPAWN:InitRandomizePosition( RandomizePosition, OuterRadius, InnerRadius ) added. -- SPA-350 test missions -- Documentation Update -- testing.
This commit is contained in:
parent
8c8e95d8fb
commit
a0100d0980
@ -51,6 +51,7 @@
|
||||
-- * @{#SPAWN.InitUnControlled}(): Spawn plane groups uncontrolled.
|
||||
-- * @{#SPAWN.InitArray}(): Make groups visible before they are actually activated, and order these groups like a batallion in an array.
|
||||
-- * @{#SPAWN.InitRepeat}(): Re-spawn groups when they land at the home base. Similar methods are @{#SPAWN.InitRepeatOnLanding} and @{#SPAWN.InitRepeatOnEngineShutDown}.
|
||||
-- * @{#SPAWN.InitRandomizePosition}(): Randomizes the position of @{Group}s that are spawned within a **radius band**, given an Outer and Inner radius, from the point that the spawn happens.
|
||||
-- * @{#SPAWN.InitRandomizeUnits}(): Randomizes the @{Unit}s in the @{Group} that is spawned within a **radius band**, given an Outer and Inner radius.
|
||||
-- * @{#SPAWN.InitRandomizeZones}(): Randomizes the spawning between a predefined list of @{Zone}s that are declared using this function. Each zone can be given a probability factor.
|
||||
-- * @{#SPAWN.InitAIOn}(): Turns the AI On when spawning the new @{Group} object.
|
||||
@ -118,7 +119,8 @@
|
||||
--
|
||||
-- Hereby the change log:
|
||||
--
|
||||
-- 2017-03-14: SPAWN:**InitKeepUnitNames()** added.
|
||||
-- 2017-03-14: SPAWN:**InitKeepUnitNames()** added.
|
||||
-- 2017-03-14: SPAWN:**InitRandomizePosition( RandomizePosition, OuterRadious, InnerRadius )** added.
|
||||
--
|
||||
-- 2017-02-04: SPAWN:InitUnControlled( **UnControlled** ) replaces SPAWN:InitUnControlled().
|
||||
--
|
||||
@ -351,6 +353,27 @@ function SPAWN:InitRandomizeRoute( SpawnStartPoint, SpawnEndPoint, SpawnRadius,
|
||||
return self
|
||||
end
|
||||
|
||||
--- Randomizes the position of @{Group}s that are spawned within a **radius band**, given an Outer and Inner radius, from the point that the spawn happens.
|
||||
-- @param #SPAWN self
|
||||
-- @param #boolean RandomizePosition If true, SPAWN will perform the randomization of the @{Group}s position between a given outer and inner radius.
|
||||
-- @param Dcs.DCSTypes#Distance OuterRadius (optional) The outer radius in meters where the new group will be spawned.
|
||||
-- @param Dcs.DCSTypes#Distance InnerRadius (optional) The inner radius in meters where the new group will NOT be spawned.
|
||||
-- @return #SPAWN
|
||||
function SPAWN:InitRandomizePosition( RandomizePosition, OuterRadius, InnerRadius )
|
||||
self:F( { self.SpawnTemplatePrefix, RandomizePosition, OuterRadius, InnerRadius } )
|
||||
|
||||
self.SpawnRandomizePosition = RandomizePosition or false
|
||||
self.SpawnRandomizePositionOuterRadius = OuterRadius or 0
|
||||
self.SpawnRandomizePositionInnerRadius = InnerRadius or 0
|
||||
|
||||
for GroupID = 1, self.SpawnMaxGroups do
|
||||
self:_RandomizeRoute( GroupID )
|
||||
end
|
||||
|
||||
return self
|
||||
end
|
||||
|
||||
|
||||
--- Randomizes the UNITs that are spawned within a radius band given an Outer and Inner radius.
|
||||
-- @param #SPAWN self
|
||||
-- @param #boolean RandomizeUnits If true, SPAWN will perform the randomization of the @{UNIT}s position within the group between a given outer and inner radius.
|
||||
@ -667,6 +690,20 @@ function SPAWN:SpawnWithIndex( SpawnIndex )
|
||||
|
||||
local PointVec3 = POINT_VEC3:New( SpawnTemplate.route.points[1].x, SpawnTemplate.route.points[1].alt, SpawnTemplate.route.points[1].y )
|
||||
self:T( { "Current point of ", self.SpawnTemplatePrefix, PointVec3 } )
|
||||
|
||||
-- If RandomizePosition, then Randomize the formation in the zone band, keeping the template.
|
||||
if self.SpawnRandomizePosition then
|
||||
local RandomVec2 = PointVec3:GetRandomVec2InRadius( self.SpawnRandomizePositionOuterRadius, self.SpawnRandomizePositionInnerRadius )
|
||||
local CurrentX = SpawnTemplate.units[1].x
|
||||
local CurrentY = SpawnTemplate.units[1].y
|
||||
SpawnTemplate.x = RandomVec2.x
|
||||
SpawnTemplate.y = RandomVec2.y
|
||||
for UnitID = 1, #SpawnTemplate.units do
|
||||
SpawnTemplate.units[UnitID].x = SpawnTemplate.units[UnitID].x + ( RandomVec2.x - CurrentX )
|
||||
SpawnTemplate.units[UnitID].y = SpawnTemplate.units[UnitID].y + ( RandomVec2.y - CurrentY )
|
||||
self:T( 'SpawnTemplate.units['..UnitID..'].x = ' .. SpawnTemplate.units[UnitID].x .. ', SpawnTemplate.units['..UnitID..'].y = ' .. SpawnTemplate.units[UnitID].y )
|
||||
end
|
||||
end
|
||||
|
||||
-- If RandomizeUnits, then Randomize the formation at the start point.
|
||||
if self.SpawnRandomizeUnits then
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
env.info( '*** MOOSE STATIC INCLUDE START *** ' )
|
||||
env.info( 'Moose Generation Timestamp: 20170314_0643' )
|
||||
env.info( 'Moose Generation Timestamp: 20170314_0908' )
|
||||
local base = _G
|
||||
|
||||
Include = {}
|
||||
@ -20351,6 +20351,7 @@ end
|
||||
-- * @{#SPAWN.InitUnControlled}(): Spawn plane groups uncontrolled.
|
||||
-- * @{#SPAWN.InitArray}(): Make groups visible before they are actually activated, and order these groups like a batallion in an array.
|
||||
-- * @{#SPAWN.InitRepeat}(): Re-spawn groups when they land at the home base. Similar methods are @{#SPAWN.InitRepeatOnLanding} and @{#SPAWN.InitRepeatOnEngineShutDown}.
|
||||
-- * @{#SPAWN.InitRandomizePosition}(): Randomizes the position of @{Group}s that are spawned within a **radius band**, given an Outer and Inner radius, from the point that the spawn happens.
|
||||
-- * @{#SPAWN.InitRandomizeUnits}(): Randomizes the @{Unit}s in the @{Group} that is spawned within a **radius band**, given an Outer and Inner radius.
|
||||
-- * @{#SPAWN.InitRandomizeZones}(): Randomizes the spawning between a predefined list of @{Zone}s that are declared using this function. Each zone can be given a probability factor.
|
||||
-- * @{#SPAWN.InitAIOn}(): Turns the AI On when spawning the new @{Group} object.
|
||||
@ -20418,7 +20419,8 @@ end
|
||||
--
|
||||
-- Hereby the change log:
|
||||
--
|
||||
-- 2017-03-14: SPAWN:**InitKeepUnitNames()** added.
|
||||
-- 2017-03-14: SPAWN:**InitKeepUnitNames()** added.
|
||||
-- 2017-03-14: SPAWN:**InitRandomizePosition( RandomizePosition, OuterRadious, InnerRadius )** added.
|
||||
--
|
||||
-- 2017-02-04: SPAWN:InitUnControlled( **UnControlled** ) replaces SPAWN:InitUnControlled().
|
||||
--
|
||||
@ -20651,6 +20653,27 @@ function SPAWN:InitRandomizeRoute( SpawnStartPoint, SpawnEndPoint, SpawnRadius,
|
||||
return self
|
||||
end
|
||||
|
||||
--- Randomizes the position of @{Group}s that are spawned within a **radius band**, given an Outer and Inner radius, from the point that the spawn happens.
|
||||
-- @param #SPAWN self
|
||||
-- @param #boolean RandomizePosition If true, SPAWN will perform the randomization of the @{Group}s position between a given outer and inner radius.
|
||||
-- @param Dcs.DCSTypes#Distance OuterRadius (optional) The outer radius in meters where the new group will be spawned.
|
||||
-- @param Dcs.DCSTypes#Distance InnerRadius (optional) The inner radius in meters where the new group will NOT be spawned.
|
||||
-- @return #SPAWN
|
||||
function SPAWN:InitRandomizePosition( RandomizePosition, OuterRadius, InnerRadius )
|
||||
self:F( { self.SpawnTemplatePrefix, RandomizePosition, OuterRadius, InnerRadius } )
|
||||
|
||||
self.SpawnRandomizePosition = RandomizePosition or false
|
||||
self.SpawnRandomizePositionOuterRadius = OuterRadius or 0
|
||||
self.SpawnRandomizePositionInnerRadius = InnerRadius or 0
|
||||
|
||||
for GroupID = 1, self.SpawnMaxGroups do
|
||||
self:_RandomizeRoute( GroupID )
|
||||
end
|
||||
|
||||
return self
|
||||
end
|
||||
|
||||
|
||||
--- Randomizes the UNITs that are spawned within a radius band given an Outer and Inner radius.
|
||||
-- @param #SPAWN self
|
||||
-- @param #boolean RandomizeUnits If true, SPAWN will perform the randomization of the @{UNIT}s position within the group between a given outer and inner radius.
|
||||
@ -20967,6 +20990,20 @@ function SPAWN:SpawnWithIndex( SpawnIndex )
|
||||
|
||||
local PointVec3 = POINT_VEC3:New( SpawnTemplate.route.points[1].x, SpawnTemplate.route.points[1].alt, SpawnTemplate.route.points[1].y )
|
||||
self:T( { "Current point of ", self.SpawnTemplatePrefix, PointVec3 } )
|
||||
|
||||
-- If RandomizePosition, then Randomize the formation in the zone band, keeping the template.
|
||||
if self.SpawnRandomizePosition then
|
||||
local RandomVec2 = PointVec3:GetRandomVec2InRadius( self.SpawnRandomizePositionOuterRadius, self.SpawnRandomizePositionInnerRadius )
|
||||
local CurrentX = SpawnTemplate.units[1].x
|
||||
local CurrentY = SpawnTemplate.units[1].y
|
||||
SpawnTemplate.x = RandomVec2.x
|
||||
SpawnTemplate.y = RandomVec2.y
|
||||
for UnitID = 1, #SpawnTemplate.units do
|
||||
SpawnTemplate.units[UnitID].x = SpawnTemplate.units[UnitID].x + ( RandomVec2.x - CurrentX )
|
||||
SpawnTemplate.units[UnitID].y = SpawnTemplate.units[UnitID].y + ( RandomVec2.y - CurrentY )
|
||||
self:T( 'SpawnTemplate.units['..UnitID..'].x = ' .. SpawnTemplate.units[UnitID].x .. ', SpawnTemplate.units['..UnitID..'].y = ' .. SpawnTemplate.units[UnitID].y )
|
||||
end
|
||||
end
|
||||
|
||||
-- If RandomizeUnits, then Randomize the formation at the start point.
|
||||
if self.SpawnRandomizeUnits then
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
env.info( '*** MOOSE STATIC INCLUDE START *** ' )
|
||||
env.info( 'Moose Generation Timestamp: 20170314_0643' )
|
||||
env.info( 'Moose Generation Timestamp: 20170314_0908' )
|
||||
local base = _G
|
||||
|
||||
Include = {}
|
||||
@ -20351,6 +20351,7 @@ end
|
||||
-- * @{#SPAWN.InitUnControlled}(): Spawn plane groups uncontrolled.
|
||||
-- * @{#SPAWN.InitArray}(): Make groups visible before they are actually activated, and order these groups like a batallion in an array.
|
||||
-- * @{#SPAWN.InitRepeat}(): Re-spawn groups when they land at the home base. Similar methods are @{#SPAWN.InitRepeatOnLanding} and @{#SPAWN.InitRepeatOnEngineShutDown}.
|
||||
-- * @{#SPAWN.InitRandomizePosition}(): Randomizes the position of @{Group}s that are spawned within a **radius band**, given an Outer and Inner radius, from the point that the spawn happens.
|
||||
-- * @{#SPAWN.InitRandomizeUnits}(): Randomizes the @{Unit}s in the @{Group} that is spawned within a **radius band**, given an Outer and Inner radius.
|
||||
-- * @{#SPAWN.InitRandomizeZones}(): Randomizes the spawning between a predefined list of @{Zone}s that are declared using this function. Each zone can be given a probability factor.
|
||||
-- * @{#SPAWN.InitAIOn}(): Turns the AI On when spawning the new @{Group} object.
|
||||
@ -20418,7 +20419,8 @@ end
|
||||
--
|
||||
-- Hereby the change log:
|
||||
--
|
||||
-- 2017-03-14: SPAWN:**InitKeepUnitNames()** added.
|
||||
-- 2017-03-14: SPAWN:**InitKeepUnitNames()** added.
|
||||
-- 2017-03-14: SPAWN:**InitRandomizePosition( RandomizePosition, OuterRadious, InnerRadius )** added.
|
||||
--
|
||||
-- 2017-02-04: SPAWN:InitUnControlled( **UnControlled** ) replaces SPAWN:InitUnControlled().
|
||||
--
|
||||
@ -20651,6 +20653,27 @@ function SPAWN:InitRandomizeRoute( SpawnStartPoint, SpawnEndPoint, SpawnRadius,
|
||||
return self
|
||||
end
|
||||
|
||||
--- Randomizes the position of @{Group}s that are spawned within a **radius band**, given an Outer and Inner radius, from the point that the spawn happens.
|
||||
-- @param #SPAWN self
|
||||
-- @param #boolean RandomizePosition If true, SPAWN will perform the randomization of the @{Group}s position between a given outer and inner radius.
|
||||
-- @param Dcs.DCSTypes#Distance OuterRadius (optional) The outer radius in meters where the new group will be spawned.
|
||||
-- @param Dcs.DCSTypes#Distance InnerRadius (optional) The inner radius in meters where the new group will NOT be spawned.
|
||||
-- @return #SPAWN
|
||||
function SPAWN:InitRandomizePosition( RandomizePosition, OuterRadius, InnerRadius )
|
||||
self:F( { self.SpawnTemplatePrefix, RandomizePosition, OuterRadius, InnerRadius } )
|
||||
|
||||
self.SpawnRandomizePosition = RandomizePosition or false
|
||||
self.SpawnRandomizePositionOuterRadius = OuterRadius or 0
|
||||
self.SpawnRandomizePositionInnerRadius = InnerRadius or 0
|
||||
|
||||
for GroupID = 1, self.SpawnMaxGroups do
|
||||
self:_RandomizeRoute( GroupID )
|
||||
end
|
||||
|
||||
return self
|
||||
end
|
||||
|
||||
|
||||
--- Randomizes the UNITs that are spawned within a radius band given an Outer and Inner radius.
|
||||
-- @param #SPAWN self
|
||||
-- @param #boolean RandomizeUnits If true, SPAWN will perform the randomization of the @{UNIT}s position within the group between a given outer and inner radius.
|
||||
@ -20967,6 +20990,20 @@ function SPAWN:SpawnWithIndex( SpawnIndex )
|
||||
|
||||
local PointVec3 = POINT_VEC3:New( SpawnTemplate.route.points[1].x, SpawnTemplate.route.points[1].alt, SpawnTemplate.route.points[1].y )
|
||||
self:T( { "Current point of ", self.SpawnTemplatePrefix, PointVec3 } )
|
||||
|
||||
-- If RandomizePosition, then Randomize the formation in the zone band, keeping the template.
|
||||
if self.SpawnRandomizePosition then
|
||||
local RandomVec2 = PointVec3:GetRandomVec2InRadius( self.SpawnRandomizePositionOuterRadius, self.SpawnRandomizePositionInnerRadius )
|
||||
local CurrentX = SpawnTemplate.units[1].x
|
||||
local CurrentY = SpawnTemplate.units[1].y
|
||||
SpawnTemplate.x = RandomVec2.x
|
||||
SpawnTemplate.y = RandomVec2.y
|
||||
for UnitID = 1, #SpawnTemplate.units do
|
||||
SpawnTemplate.units[UnitID].x = SpawnTemplate.units[UnitID].x + ( RandomVec2.x - CurrentX )
|
||||
SpawnTemplate.units[UnitID].y = SpawnTemplate.units[UnitID].y + ( RandomVec2.y - CurrentY )
|
||||
self:T( 'SpawnTemplate.units['..UnitID..'].x = ' .. SpawnTemplate.units[UnitID].x .. ', SpawnTemplate.units['..UnitID..'].y = ' .. SpawnTemplate.units[UnitID].y )
|
||||
end
|
||||
end
|
||||
|
||||
-- If RandomizeUnits, then Randomize the formation at the start point.
|
||||
if self.SpawnRandomizeUnits then
|
||||
|
||||
@ -0,0 +1,73 @@
|
||||
---
|
||||
-- Name: SPA-350 - Spawn at Vec3 position RandomzePosition
|
||||
-- Author: FlightControl
|
||||
-- Date Created: 14 Mar 2017
|
||||
--
|
||||
-- # Situation:
|
||||
--
|
||||
-- Ground troops, Airplanes, Helicopters and Ships are spawning from Vec3 points.
|
||||
-- The API InitRandomizePosition is tested here, ensure that groups are replaced within a 900 to 1000 zone band at random positions.
|
||||
--
|
||||
-- # Test cases:
|
||||
--
|
||||
-- 1. Observe the random positioning of the groups. There should be no scattering of units.
|
||||
--
|
||||
|
||||
local Iterations = 10
|
||||
local Iteration = 1
|
||||
|
||||
GroundZones = { "GroundZone1", "GroundZone2", "GroundZone3" }
|
||||
GroundRandomizeZones = { "GroundRandomizeZone1", "GroundRandomizeZone2", "GroundRandomizeZone3" }
|
||||
AirplaneZones = { "AirplaneZone1", "AirplaneZone2", "AirplaneZone3" }
|
||||
HelicopterZones = { "HelicopterZone1", "HelicopterZone2", "HelicopterZone3" }
|
||||
ShipZones = { "ShipZone1", "ShipZone2", "ShipZone3" }
|
||||
|
||||
HeightLimit = 500
|
||||
|
||||
SpawnGrounds = SPAWN:New("Ground"):InitLimit( 20, 10 ):InitRandomizePosition( true , 1000, 900 )
|
||||
SpawnRandomizeGrounds = SPAWN:New("GroundRandomize"):InitLimit( 20, 10 ):InitRandomizePosition( true , 1000, 900 )
|
||||
SpawnAirplanes = SPAWN:New("Airplane"):InitLimit( 20, 10 ):InitRandomizePosition( true , 1000, 900 )
|
||||
SpawnHelicopters = SPAWN:New("Helicopter"):InitLimit( 20, 10 ):InitRandomizePosition( true , 1000, 900 )
|
||||
SpawnShips = SPAWN:New("Ship"):InitLimit( 20, 10 ):InitRandomizePosition( true , 1000, 900 )
|
||||
|
||||
--- Spawns these groups slowly.
|
||||
SCHEDULER:New( nil,
|
||||
|
||||
function( Interation, Iterations )
|
||||
do
|
||||
-- Spawn Ground
|
||||
local ZoneName = GroundZones[ math.random( 1, 3 ) ]
|
||||
local SpawnVec3 = POINT_VEC3:NewFromVec3( ZONE:New( ZoneName ):GetVec3() )
|
||||
SpawnGrounds:SpawnFromVec3( SpawnVec3:GetVec3() )
|
||||
end
|
||||
|
||||
do
|
||||
-- Spawn Ground Randomize
|
||||
local ZoneName = GroundRandomizeZones[ math.random( 1, 3 ) ]
|
||||
local SpawnVec3 = POINT_VEC3:NewFromVec3( ZONE:New( ZoneName ):GetVec3() )
|
||||
SpawnRandomizeGrounds:SpawnFromVec3( SpawnVec3:GetVec3() )
|
||||
end
|
||||
|
||||
do
|
||||
-- Spawn Airplanes
|
||||
local ZoneName = AirplaneZones[ math.random( 1, 3 ) ]
|
||||
local SpawnVec3 = POINT_VEC3:NewFromVec3( ZONE:New( ZoneName ):GetVec3() )
|
||||
SpawnAirplanes:SpawnFromVec3( SpawnVec3:GetVec3() )
|
||||
end
|
||||
|
||||
do
|
||||
-- Spawn Helicopters
|
||||
local ZoneName = HelicopterZones[ math.random( 1, 3 ) ]
|
||||
local SpawnVec3 = POINT_VEC3:NewFromVec3( ZONE:New( ZoneName ):GetVec3() )
|
||||
SpawnHelicopters:SpawnFromVec3( SpawnVec3:GetVec3() )
|
||||
end
|
||||
|
||||
do
|
||||
-- Spawn Ships
|
||||
local ZoneName = ShipZones[ math.random( 1, 3 ) ]
|
||||
local SpawnVec3 = POINT_VEC3:NewFromVec3( ZONE:New( ZoneName ):GetVec3() )
|
||||
SpawnShips:SpawnFromVec3( SpawnVec3:GetVec3() )
|
||||
end
|
||||
|
||||
end, {}, 0, 15, 0.5
|
||||
)
|
||||
Binary file not shown.
@ -2425,7 +2425,6 @@ The UNIT carrying the package.</p>
|
||||
<dl class="function">
|
||||
<dt>
|
||||
|
||||
<em></em>
|
||||
<a id="#(AI_CARGO_UNIT).CargoCarrier" >
|
||||
<strong>AI_CARGO_UNIT.CargoCarrier</strong>
|
||||
</a>
|
||||
|
||||
@ -1346,6 +1346,7 @@ The new calculated POINT_VEC2.</p>
|
||||
<dl class="function">
|
||||
<dt>
|
||||
|
||||
<em></em>
|
||||
<a id="#(POINT_VEC2).z" >
|
||||
<strong>POINT_VEC2.z</strong>
|
||||
</a>
|
||||
|
||||
@ -134,6 +134,7 @@ So in principle, the group list will contain all parameters and configurations a
|
||||
<li><a href="##(SPAWN).InitUnControlled">SPAWN.InitUnControlled</a>(): Spawn plane groups uncontrolled.</li>
|
||||
<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>
|
||||
<li><a href="##(SPAWN).InitRepeat">SPAWN.InitRepeat</a>(): Re-spawn groups when they land at the home base. Similar methods are <a href="##(SPAWN).InitRepeatOnLanding">SPAWN.InitRepeatOnLanding</a> and <a href="##(SPAWN).InitRepeatOnEngineShutDown">SPAWN.InitRepeatOnEngineShutDown</a>.</li>
|
||||
<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>
|
||||
<li><a href="##(SPAWN).InitAIOn">SPAWN.InitAIOn</a>(): Turns the AI On when spawning the new <a href="Group.html">Group</a> object.</li>
|
||||
@ -208,7 +209,8 @@ A coding example is provided at the description of the <a href="##(SPAWN).OnSpaw
|
||||
|
||||
<p>Hereby the change log:</p>
|
||||
|
||||
<p>2017-03-14: SPAWN:<strong>InitKeepUnitNames()</strong> added.</p>
|
||||
<p>2017-03-14: SPAWN:<strong>InitKeepUnitNames()</strong> added. <br/>
|
||||
2017-03-14: SPAWN:<strong>InitRandomizePosition( RandomizePosition, OuterRadious, InnerRadius )</strong> added.</p>
|
||||
|
||||
<p>2017-02-04: SPAWN:InitUnControlled( <strong>UnControlled</strong> ) replaces SPAWN:InitUnControlled().</p>
|
||||
|
||||
@ -371,6 +373,12 @@ and any spaces before and after the resulting name are removed.</p>
|
||||
<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>
|
||||
@ -611,6 +619,24 @@ and any spaces before and after the resulting name are removed.</p>
|
||||
<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>
|
||||
@ -1328,6 +1354,45 @@ self</p>
|
||||
-- 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">
|
||||
@ -2258,9 +2323,6 @@ when nothing was spawned.</p>
|
||||
|
||||
|
||||
|
||||
|
||||
<p> Overwrite unit names by default with group name.</p>
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
<dl class="function">
|
||||
@ -2275,6 +2337,9 @@ when nothing was spawned.</p>
|
||||
|
||||
|
||||
|
||||
|
||||
<p> By default, no InitLimit</p>
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
<dl class="function">
|
||||
@ -2310,7 +2375,7 @@ when nothing was spawned.</p>
|
||||
<dl class="function">
|
||||
<dt>
|
||||
|
||||
<em></em>
|
||||
<em>#number</em>
|
||||
<a id="#(SPAWN).SpawnMaxGroups" >
|
||||
<strong>SPAWN.SpawnMaxGroups</strong>
|
||||
</a>
|
||||
@ -2327,7 +2392,7 @@ when nothing was spawned.</p>
|
||||
<dl class="function">
|
||||
<dt>
|
||||
|
||||
<em></em>
|
||||
<em>#number</em>
|
||||
<a id="#(SPAWN).SpawnMaxUnitsAlive" >
|
||||
<strong>SPAWN.SpawnMaxUnitsAlive</strong>
|
||||
</a>
|
||||
@ -2369,6 +2434,45 @@ when nothing was spawned.</p>
|
||||
|
||||
<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">
|
||||
@ -2606,7 +2710,7 @@ Spawn_BE_KA50 = SPAWN:New( 'BE KA-50@RAMP-Ground Defense' ):Schedule( 600, 0.5 )
|
||||
<dl class="function">
|
||||
<dt>
|
||||
|
||||
<em>#boolean</em>
|
||||
<em></em>
|
||||
<a id="#(SPAWN).SpawnUnControlled" >
|
||||
<strong>SPAWN.SpawnUnControlled</strong>
|
||||
</a>
|
||||
@ -2630,7 +2734,7 @@ Spawn_BE_KA50 = SPAWN:New( 'BE KA-50@RAMP-Ground Defense' ):Schedule( 600, 0.5 )
|
||||
|
||||
|
||||
|
||||
<p> Flag that indicates if all the Groups of the SpawnGroup need to be visible when Spawned.</p>
|
||||
<p> When the first Spawn executes, all the Groups need to be made visible before start.</p>
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user