MOOSE demonstration missions [skip ci]

This commit is contained in:
Applevangelist
2021-05-21 13:39:13 +00:00
parent 9e9c42bf79
commit 5fa61b81cc
1018 changed files with 0 additions and 493877 deletions

View File

@@ -1,139 +0,0 @@
Include.File( "Spawn" )
-- Tests Anapa: Spawn Basics
-- -------------------------
-- Spawning groups using Spawn function.
Spawn_Plane = SPAWN:New( "Spawn Plane" )
Group_Plane = Spawn_Plane:Spawn()
Spawn_Helicopter = SPAWN:New( "Spawn Helicopter" ):RandomizeRoute( 1, 1, 1000 )
Group_Helicopter = Spawn_Helicopter:Spawn()
Group_Helicopter2 = Spawn_Helicopter:Spawn()
Spawn_Ship = SPAWN:New( "Spawn Ship" ):RandomizeRoute( 0, 0, 2000 )
Group_Ship1 = Spawn_Ship:Spawn()
Group_Ship2 = Spawn_Ship:Spawn()
Spawn_Vehicle = SPAWN:New( "Spawn Vehicle" ):RandomizeRoute( 1, 0, 50 )
Group_Vehicle1 = Spawn_Vehicle:Spawn()
Group_Vehicle2 = Spawn_Vehicle:Spawn()
Group_Vehicle3 = Spawn_Vehicle:Spawn()
Group_Vehicle4 = Spawn_Vehicle:Spawn()
Group_Vehicle5 = Spawn_Vehicle:Spawn()
Group_Vehicle6 = Spawn_Vehicle:Spawn()
Group_Vehicle1:TaskRouteToZone( ZONE:New( "Landing Zone" ), true, 40, "Cone" )
-- Now land the spawned plane on to the Vinson, by copying the route of another object.
Route_Plane = GROUP:NewFromName( "Spawn Helicopter Route Copy" ):CopyRoute( 1, 0 )
Group_Plane:Route( Route_Plane )
--Route_Helicopter[#Route_Helicopter].linkUnit = Group_Ship1:GetDCSUnit(1)
--Route_Helicopter[#Route_Helicopter].helipadId = Group_Ship1:GetDCSUnit(1)
--Route_Helicopter[#Route_Helicopter].x = Group_Ship1:GetUnit(1):GetPointVec2().x
--Route_Helicopter[#Route_Helicopter].y = Group_Ship1:GetUnit(1):GetPointVec2().y
--env.info( Route_Helicopter[#Route_Helicopter].type .. " on " .. Group_Ship1:GetUnit(1):GetID() )
--Group_Helicopter:Route( Route_Helicopter )
-- Tests Batumi: Scheduled Spawning
-- --------------------------------
-- Unlimited spawning of groups, scheduled every 30 seconds ...
Spawn_Plane_Scheduled = SPAWN:New( "Spawn Plane Scheduled" ):SpawnScheduled( 30, 0.4 )
Spawn_Helicopter_Scheduled = SPAWN:New( "Spawn Helicopter Scheduled" ):SpawnScheduled( 30, 1 )
Spawn_Ship_Scheduled = SPAWN:New( "Spawn Ship Scheduled" ):SpawnScheduled( 30, 0.5 )
Spawn_Vehicle_Scheduled = SPAWN:New( "Spawn Vehicle Scheduled" ):SpawnScheduled( 30, 0.5 )
-- Tests Tbilisi: Limited Spawning
-- -------------------------------
-- Spawing one group, and respawning the same group when it lands ...
Spawn_Plane_Limited_Repeat = SPAWN:New( "Spawn Plane Limited Repeat" ):Limit( 1, 1 ):Repeat():Spawn()
Spawn_Plane_Limited_RepeatOnLanding = SPAWN:New( "Spawn Plane Limited RepeatOnLanding" ):Limit( 1, 1 ):Repeat():Spawn()
Spawn_Plane_Limited_RepeatOnEngineShutDown = SPAWN:New( "Spawn Plane Limited RepeatOnEngineShutDown" ):Limit( 1, 1 ):Repeat():Spawn()
Spawn_Helicopter_Limited_Repeat = SPAWN:New( "Spawn Helicopter Limited Repeat" ):Limit( 1, 1 ):Repeat():Spawn()
Spawn_Helicopter_Limited_RepeatOnLanding = SPAWN:New( "Spawn Helicopter Limited RepeatOnLanding" ):Limit( 1, 1 ):Repeat():Spawn()
Spawn_Helicopter_Limited_RepeatOnEngineShutDown = SPAWN:New( "Spawn Helicopter Limited RepeatOnEngineShutDown" ):Limit( 1, 1 ):Repeat():Spawn()
-- Tests Soganlug
-- --------------
-- Limited spawning of groups, scheduled every 30 seconds ...
Spawn_Plane_Limited_Scheduled = SPAWN:New( "Spawn Plane Limited Scheduled" ):Limit( 2, 10 ):SpawnScheduled( 30, 0 )
Spawn_Helicopter_Limited_Scheduled = SPAWN:New( "Spawn Helicopter Limited Scheduled" ):Limit( 2, 10 ):SpawnScheduled( 30, 0 )
Spawn_Ground_Limited_Scheduled = SPAWN:New( "Spawn Vehicle Limited Scheduled" ):Limit( 1, 20 ):SpawnScheduled( 90, 0 )
-- Tests Sukhumi
-- -------------
-- Limited spawning of groups, scheduled every seconds with route randomization.
Spawn_Plane_Limited_Scheduled_RandomizeRoute = SPAWN:New( "Spawn Plane Limited Scheduled RandomizeRoute" ):Limit( 2, 10 ):RandomizeRoute( 1, 1, 4000 ):SpawnScheduled( 30, 0 )
Spawn_Helicopter_Limited_Scheduled_RandomizeRoute = SPAWN:New( "Spawn Helicopter Limited Scheduled RandomizeRoute" ):Limit( 2, 10 ):RandomizeRoute( 1, 1, 4000 ):SpawnScheduled( 30, 0 )
Spawn_Vehicle_Limited_Scheduled_RandomizeRoute = SPAWN:New( "Spawn Vehicle Limited Scheduled RandomizeRoute" ):Limit( 10, 10 ):RandomizeRoute( 1, 1, 1000 ):SpawnScheduled( 1, 0 )
-- Tests Kutaisi
-- -------------
-- Tests the CleanUp functionality.
-- Limited spawning of groups, scheduled every 10 seconds, who are engaging into combat. Some helicopters may crash land on the ground.
-- Observe when helicopters land but are not dead and are out of the danger zone, that they get removed after a while (+/- 180 seconds) and ReSpawn.
Spawn_Helicopter_Scheduled_CleanUp = SPAWN:New( "Spawn Helicopter Scheduled CleanUp" ):Limit( 3, 100 ):RandomizeRoute( 1, 1, 1000 ):CleanUp( 180 ):SpawnScheduled( 10, 0 )
Spawn_Vehicle_Scheduled_CleanUp = SPAWN:New( "Spawn Vehicle Scheduled CleanUp" ):Limit( 3, 100 ):RandomizeRoute( 1, 1, 1000 ):SpawnScheduled( 10, 0 )
-- Maykop
-- ------
-- Creates arrays of groups ready to be spawned and dynamic spawning of groups from another group.
-- SpawnTestVisible creates an array of 200 groups, every 20 groups with 20 meters space in between, and will activate a group of the array every 10 seconds with a 0.2 time randomization.
SpawnTestVisible = SPAWN:New( "Spawn Vehicle Visible Scheduled" ):Limit( 200, 200 ):Array( 59, 20, 20, 10 ):SpawnScheduled( 10, 0.2 )
-- Spawn_Templates_Visible contains different templates...
Spawn_Templates_Visible = { "Spawn Vehicle Visible Template A",
"Spawn Vehicle Visible Template B",
"Spawn Vehicle Visible Template C",
"Spawn Vehicle Visible Template D",
"Spawn Vehicle Visible Template E",
"Spawn Vehicle Visible Template F",
"Spawn Vehicle Visible Template G",
"Spawn Vehicle Visible Template H",
"Spawn Vehicle Visible Template I",
"Spawn Vehicle Visible Template J"
}
-- Spawn_Vehicle_Visible_RandomizeTemplate_Scheduled creates an array of 40 vehicle groups, spread out by 20 groups each, with an 8 meter distance,
-- and chooses for each group from the templates specified in Spawn_Templates_Visible.
Spawn_Vehicle_Visible_RandomizeTemplate_Scheduled = SPAWN:New( "Spawn Vehicle Visible RandomizeTemplate Scheduled" )
:Limit( 80, 80 )
:RandomizeTemplate( Spawn_Templates_Visible )
:Array( 49, 20, 8, 8 )
:SpawnScheduled( 10, 0.2 )
-- Spawn_Infantry allows to spawn 10 Infantry groups.
Spawn_Infantry = SPAWN:New( "Spawn Infantry" )
:Limit( 10, 10 )
-- Spawn_Vehicle_Host reserves 10 vehicle groups, shown within an array arranged by 5 vehicles in a row with a distance of 8 meters, and schedules a vehicle each 10 seconds with a 20% variation.
Spawn_Vehicle_Host = SPAWN:New( "Spawn Vehicle Host" )
:Limit( 10, 10 )
:Array( 0, 5, 8, 8 )
:SpawnScheduled( 10, 0.2 )
-- Spawn_Vehicle_SpawnToZone allows to spawn 10 vehicle groups.
Spawn_Vehicle_SpawnToZone = SPAWN:New( "Spawn Vehicle SpawnToZone" )
:Limit( 10, 10 )
-- Spawn_Helicopter_SpawnToZone will fly to a location, hover, and spawn one vehicle on the ground, the helicopter will land
-- and the vehicle will drive to a random location within the defined zone.
-- For this, the following code is activated within the mission on waypoint 3:
--
-- local InfantryDropGroup = Spawn_Vehicle_SpawnToZone:SpawnFromUnit( GROUP:New( ... ):GetUnit(1) )
-- local InfantryDropRoute = InfantryDropGroup:CopyRoute( 1, 0 )
-- InfantryDropGroup:RouteToZone( ZONE:New( "Target Zone" ), true, 80 )
--
Spawn_Helicopter_SpawnToZone = SPAWN:New( "Spawn Helicopter SpawnToZone" )
:Limit( 10, 10 )
:SpawnScheduled( 60, 0.2 )

View File

@@ -1,22 +0,0 @@
-- Name: SPA-011 - Ground Ops - Simple Spawning
-- Author: FlightControl
-- Date Created: 10 Jan 2017
--
-- # Situation:
--
-- At Gudauta spawn a ground vehicle.
--
-- # Test cases:
--
-- 1. Observe that the ground vehicle is spawned.
-- Tests Gudauta
-- -------------
-- Spawn a gound vehicle...
Spawn_Vehicle_1 = SPAWN:New( "Spawn Vehicle 1" )
Spawn_Group_1 = Spawn_Vehicle_1:Spawn()

View File

@@ -1,139 +0,0 @@
Include.File( "Spawn" )
-- Tests Anapa: Spawn Basics
-- -------------------------
-- Spawning groups using Spawn function.
Spawn_Plane = SPAWN:New( "Spawn Plane" )
Group_Plane = Spawn_Plane:Spawn()
Spawn_Helicopter = SPAWN:New( "Spawn Helicopter" ):RandomizeRoute( 1, 1, 1000 )
Group_Helicopter = Spawn_Helicopter:Spawn()
Group_Helicopter2 = Spawn_Helicopter:Spawn()
Spawn_Ship = SPAWN:New( "Spawn Ship" ):RandomizeRoute( 0, 0, 2000 )
Group_Ship1 = Spawn_Ship:Spawn()
Group_Ship2 = Spawn_Ship:Spawn()
Spawn_Vehicle = SPAWN:New( "Spawn Vehicle" ):RandomizeRoute( 1, 0, 50 )
Group_Vehicle1 = Spawn_Vehicle:Spawn()
Group_Vehicle2 = Spawn_Vehicle:Spawn()
Group_Vehicle3 = Spawn_Vehicle:Spawn()
Group_Vehicle4 = Spawn_Vehicle:Spawn()
Group_Vehicle5 = Spawn_Vehicle:Spawn()
Group_Vehicle6 = Spawn_Vehicle:Spawn()
Group_Vehicle1:TaskRouteToZone( ZONE:New( "Landing Zone" ), true, 40, "Cone" )
-- Now land the spawned plane on to the Vinson, by copying the route of another object.
Route_Plane = GROUP:NewFromName( "Spawn Helicopter Route Copy" ):CopyRoute( 1, 0 )
Group_Plane:Route( Route_Plane )
--Route_Helicopter[#Route_Helicopter].linkUnit = Group_Ship1:GetDCSUnit(1)
--Route_Helicopter[#Route_Helicopter].helipadId = Group_Ship1:GetDCSUnit(1)
--Route_Helicopter[#Route_Helicopter].x = Group_Ship1:GetUnit(1):GetPointVec2().x
--Route_Helicopter[#Route_Helicopter].y = Group_Ship1:GetUnit(1):GetPointVec2().y
--env.info( Route_Helicopter[#Route_Helicopter].type .. " on " .. Group_Ship1:GetUnit(1):GetID() )
--Group_Helicopter:Route( Route_Helicopter )
-- Tests Batumi: Scheduled Spawning
-- --------------------------------
-- Unlimited spawning of groups, scheduled every 30 seconds ...
Spawn_Plane_Scheduled = SPAWN:New( "Spawn Plane Scheduled" ):SpawnScheduled( 30, 0.4 )
Spawn_Helicopter_Scheduled = SPAWN:New( "Spawn Helicopter Scheduled" ):SpawnScheduled( 30, 1 )
Spawn_Ship_Scheduled = SPAWN:New( "Spawn Ship Scheduled" ):SpawnScheduled( 30, 0.5 )
Spawn_Vehicle_Scheduled = SPAWN:New( "Spawn Vehicle Scheduled" ):SpawnScheduled( 30, 0.5 )
-- Tests Tbilisi: Limited Spawning
-- -------------------------------
-- Spawing one group, and respawning the same group when it lands ...
Spawn_Plane_Limited_Repeat = SPAWN:New( "Spawn Plane Limited Repeat" ):Limit( 1, 1 ):Repeat():Spawn()
Spawn_Plane_Limited_RepeatOnLanding = SPAWN:New( "Spawn Plane Limited RepeatOnLanding" ):Limit( 1, 1 ):Repeat():Spawn()
Spawn_Plane_Limited_RepeatOnEngineShutDown = SPAWN:New( "Spawn Plane Limited RepeatOnEngineShutDown" ):Limit( 1, 1 ):Repeat():Spawn()
Spawn_Helicopter_Limited_Repeat = SPAWN:New( "Spawn Helicopter Limited Repeat" ):Limit( 1, 1 ):Repeat():Spawn()
Spawn_Helicopter_Limited_RepeatOnLanding = SPAWN:New( "Spawn Helicopter Limited RepeatOnLanding" ):Limit( 1, 1 ):Repeat():Spawn()
Spawn_Helicopter_Limited_RepeatOnEngineShutDown = SPAWN:New( "Spawn Helicopter Limited RepeatOnEngineShutDown" ):Limit( 1, 1 ):Repeat():Spawn()
-- Tests Soganlug
-- --------------
-- Limited spawning of groups, scheduled every 30 seconds ...
Spawn_Plane_Limited_Scheduled = SPAWN:New( "Spawn Plane Limited Scheduled" ):Limit( 2, 10 ):SpawnScheduled( 30, 0 )
Spawn_Helicopter_Limited_Scheduled = SPAWN:New( "Spawn Helicopter Limited Scheduled" ):Limit( 2, 10 ):SpawnScheduled( 30, 0 )
Spawn_Ground_Limited_Scheduled = SPAWN:New( "Spawn Vehicle Limited Scheduled" ):Limit( 1, 20 ):SpawnScheduled( 90, 0 )
-- Tests Sukhumi
-- -------------
-- Limited spawning of groups, scheduled every seconds with route randomization.
Spawn_Plane_Limited_Scheduled_RandomizeRoute = SPAWN:New( "Spawn Plane Limited Scheduled RandomizeRoute" ):Limit( 2, 10 ):RandomizeRoute( 1, 1, 4000 ):SpawnScheduled( 30, 0 )
Spawn_Helicopter_Limited_Scheduled_RandomizeRoute = SPAWN:New( "Spawn Helicopter Limited Scheduled RandomizeRoute" ):Limit( 2, 10 ):RandomizeRoute( 1, 1, 4000 ):SpawnScheduled( 30, 0 )
Spawn_Vehicle_Limited_Scheduled_RandomizeRoute = SPAWN:New( "Spawn Vehicle Limited Scheduled RandomizeRoute" ):Limit( 10, 10 ):RandomizeRoute( 1, 1, 1000 ):SpawnScheduled( 1, 0 )
-- Tests Kutaisi
-- -------------
-- Tests the CleanUp functionality.
-- Limited spawning of groups, scheduled every 10 seconds, who are engaging into combat. Some helicopters may crash land on the ground.
-- Observe when helicopters land but are not dead and are out of the danger zone, that they get removed after a while (+/- 180 seconds) and ReSpawn.
Spawn_Helicopter_Scheduled_CleanUp = SPAWN:New( "Spawn Helicopter Scheduled CleanUp" ):Limit( 3, 100 ):RandomizeRoute( 1, 1, 1000 ):CleanUp( 180 ):SpawnScheduled( 10, 0 )
Spawn_Vehicle_Scheduled_CleanUp = SPAWN:New( "Spawn Vehicle Scheduled CleanUp" ):Limit( 3, 100 ):RandomizeRoute( 1, 1, 1000 ):SpawnScheduled( 10, 0 )
-- Maykop
-- ------
-- Creates arrays of groups ready to be spawned and dynamic spawning of groups from another group.
-- SpawnTestVisible creates an array of 200 groups, every 20 groups with 20 meters space in between, and will activate a group of the array every 10 seconds with a 0.2 time randomization.
SpawnTestVisible = SPAWN:New( "Spawn Vehicle Visible Scheduled" ):Limit( 200, 200 ):Array( 59, 20, 20, 10 ):SpawnScheduled( 10, 0.2 )
-- Spawn_Templates_Visible contains different templates...
Spawn_Templates_Visible = { "Spawn Vehicle Visible Template A",
"Spawn Vehicle Visible Template B",
"Spawn Vehicle Visible Template C",
"Spawn Vehicle Visible Template D",
"Spawn Vehicle Visible Template E",
"Spawn Vehicle Visible Template F",
"Spawn Vehicle Visible Template G",
"Spawn Vehicle Visible Template H",
"Spawn Vehicle Visible Template I",
"Spawn Vehicle Visible Template J"
}
-- Spawn_Vehicle_Visible_RandomizeTemplate_Scheduled creates an array of 40 vehicle groups, spread out by 20 groups each, with an 8 meter distance,
-- and chooses for each group from the templates specified in Spawn_Templates_Visible.
Spawn_Vehicle_Visible_RandomizeTemplate_Scheduled = SPAWN:New( "Spawn Vehicle Visible RandomizeTemplate Scheduled" )
:Limit( 80, 80 )
:RandomizeTemplate( Spawn_Templates_Visible )
:Array( 49, 20, 8, 8 )
:SpawnScheduled( 10, 0.2 )
-- Spawn_Infantry allows to spawn 10 Infantry groups.
Spawn_Infantry = SPAWN:New( "Spawn Infantry" )
:Limit( 10, 10 )
-- Spawn_Vehicle_Host reserves 10 vehicle groups, shown within an array arranged by 5 vehicles in a row with a distance of 8 meters, and schedules a vehicle each 10 seconds with a 20% variation.
Spawn_Vehicle_Host = SPAWN:New( "Spawn Vehicle Host" )
:Limit( 10, 10 )
:Array( 0, 5, 8, 8 )
:SpawnScheduled( 10, 0.2 )
-- Spawn_Vehicle_SpawnToZone allows to spawn 10 vehicle groups.
Spawn_Vehicle_SpawnToZone = SPAWN:New( "Spawn Vehicle SpawnToZone" )
:Limit( 10, 10 )
-- Spawn_Helicopter_SpawnToZone will fly to a location, hover, and spawn one vehicle on the ground, the helicopter will land
-- and the vehicle will drive to a random location within the defined zone.
-- For this, the following code is activated within the mission on waypoint 3:
--
-- local InfantryDropGroup = Spawn_Vehicle_SpawnToZone:SpawnFromUnit( GROUP:New( ... ):GetUnit(1) )
-- local InfantryDropRoute = InfantryDropGroup:CopyRoute( 1, 0 )
-- InfantryDropGroup:RouteToZone( ZONE:New( "Target Zone" ), true, 80 )
--
Spawn_Helicopter_SpawnToZone = SPAWN:New( "Spawn Helicopter SpawnToZone" )
:Limit( 10, 10 )
:SpawnScheduled( 60, 0.2 )

View File

@@ -1,26 +0,0 @@
-- Name: SPA-012 - Ground Ops - Multiple Spawns
-- Author: FlightControl
-- Date Created: 10 Jan 2017
--
-- # Situation:
--
-- At Gudauta spawn multiple ground vehicles.
--
-- # Test cases:
--
-- 1. Observe that the ground vehicles are spawned at the position declared within the mission editor.
-- Tests Gudauta
-- -------------
-- Spawn a gound vehicle...
Spawn_Vehicle_1 = SPAWN:New( "Spawn Vehicle 1" )
Spawn_Group_1 = Spawn_Vehicle_1:Spawn()
Spawn_Group_2 = Spawn_Vehicle_1:Spawn()
Spawn_Group_3 = Spawn_Vehicle_1:Spawn()
Spawn_Group_4 = Spawn_Vehicle_1:Spawn()
Spawn_Group_5 = Spawn_Vehicle_1:Spawn()

View File

@@ -1,139 +0,0 @@
Include.File( "Spawn" )
-- Tests Anapa: Spawn Basics
-- -------------------------
-- Spawning groups using Spawn function.
Spawn_Plane = SPAWN:New( "Spawn Plane" )
Group_Plane = Spawn_Plane:Spawn()
Spawn_Helicopter = SPAWN:New( "Spawn Helicopter" ):RandomizeRoute( 1, 1, 1000 )
Group_Helicopter = Spawn_Helicopter:Spawn()
Group_Helicopter2 = Spawn_Helicopter:Spawn()
Spawn_Ship = SPAWN:New( "Spawn Ship" ):RandomizeRoute( 0, 0, 2000 )
Group_Ship1 = Spawn_Ship:Spawn()
Group_Ship2 = Spawn_Ship:Spawn()
Spawn_Vehicle = SPAWN:New( "Spawn Vehicle" ):RandomizeRoute( 1, 0, 50 )
Group_Vehicle1 = Spawn_Vehicle:Spawn()
Group_Vehicle2 = Spawn_Vehicle:Spawn()
Group_Vehicle3 = Spawn_Vehicle:Spawn()
Group_Vehicle4 = Spawn_Vehicle:Spawn()
Group_Vehicle5 = Spawn_Vehicle:Spawn()
Group_Vehicle6 = Spawn_Vehicle:Spawn()
Group_Vehicle1:TaskRouteToZone( ZONE:New( "Landing Zone" ), true, 40, "Cone" )
-- Now land the spawned plane on to the Vinson, by copying the route of another object.
Route_Plane = GROUP:NewFromName( "Spawn Helicopter Route Copy" ):CopyRoute( 1, 0 )
Group_Plane:Route( Route_Plane )
--Route_Helicopter[#Route_Helicopter].linkUnit = Group_Ship1:GetDCSUnit(1)
--Route_Helicopter[#Route_Helicopter].helipadId = Group_Ship1:GetDCSUnit(1)
--Route_Helicopter[#Route_Helicopter].x = Group_Ship1:GetUnit(1):GetPointVec2().x
--Route_Helicopter[#Route_Helicopter].y = Group_Ship1:GetUnit(1):GetPointVec2().y
--env.info( Route_Helicopter[#Route_Helicopter].type .. " on " .. Group_Ship1:GetUnit(1):GetID() )
--Group_Helicopter:Route( Route_Helicopter )
-- Tests Batumi: Scheduled Spawning
-- --------------------------------
-- Unlimited spawning of groups, scheduled every 30 seconds ...
Spawn_Plane_Scheduled = SPAWN:New( "Spawn Plane Scheduled" ):SpawnScheduled( 30, 0.4 )
Spawn_Helicopter_Scheduled = SPAWN:New( "Spawn Helicopter Scheduled" ):SpawnScheduled( 30, 1 )
Spawn_Ship_Scheduled = SPAWN:New( "Spawn Ship Scheduled" ):SpawnScheduled( 30, 0.5 )
Spawn_Vehicle_Scheduled = SPAWN:New( "Spawn Vehicle Scheduled" ):SpawnScheduled( 30, 0.5 )
-- Tests Tbilisi: Limited Spawning
-- -------------------------------
-- Spawing one group, and respawning the same group when it lands ...
Spawn_Plane_Limited_Repeat = SPAWN:New( "Spawn Plane Limited Repeat" ):Limit( 1, 1 ):Repeat():Spawn()
Spawn_Plane_Limited_RepeatOnLanding = SPAWN:New( "Spawn Plane Limited RepeatOnLanding" ):Limit( 1, 1 ):Repeat():Spawn()
Spawn_Plane_Limited_RepeatOnEngineShutDown = SPAWN:New( "Spawn Plane Limited RepeatOnEngineShutDown" ):Limit( 1, 1 ):Repeat():Spawn()
Spawn_Helicopter_Limited_Repeat = SPAWN:New( "Spawn Helicopter Limited Repeat" ):Limit( 1, 1 ):Repeat():Spawn()
Spawn_Helicopter_Limited_RepeatOnLanding = SPAWN:New( "Spawn Helicopter Limited RepeatOnLanding" ):Limit( 1, 1 ):Repeat():Spawn()
Spawn_Helicopter_Limited_RepeatOnEngineShutDown = SPAWN:New( "Spawn Helicopter Limited RepeatOnEngineShutDown" ):Limit( 1, 1 ):Repeat():Spawn()
-- Tests Soganlug
-- --------------
-- Limited spawning of groups, scheduled every 30 seconds ...
Spawn_Plane_Limited_Scheduled = SPAWN:New( "Spawn Plane Limited Scheduled" ):Limit( 2, 10 ):SpawnScheduled( 30, 0 )
Spawn_Helicopter_Limited_Scheduled = SPAWN:New( "Spawn Helicopter Limited Scheduled" ):Limit( 2, 10 ):SpawnScheduled( 30, 0 )
Spawn_Ground_Limited_Scheduled = SPAWN:New( "Spawn Vehicle Limited Scheduled" ):Limit( 1, 20 ):SpawnScheduled( 90, 0 )
-- Tests Sukhumi
-- -------------
-- Limited spawning of groups, scheduled every seconds with route randomization.
Spawn_Plane_Limited_Scheduled_RandomizeRoute = SPAWN:New( "Spawn Plane Limited Scheduled RandomizeRoute" ):Limit( 2, 10 ):RandomizeRoute( 1, 1, 4000 ):SpawnScheduled( 30, 0 )
Spawn_Helicopter_Limited_Scheduled_RandomizeRoute = SPAWN:New( "Spawn Helicopter Limited Scheduled RandomizeRoute" ):Limit( 2, 10 ):RandomizeRoute( 1, 1, 4000 ):SpawnScheduled( 30, 0 )
Spawn_Vehicle_Limited_Scheduled_RandomizeRoute = SPAWN:New( "Spawn Vehicle Limited Scheduled RandomizeRoute" ):Limit( 10, 10 ):RandomizeRoute( 1, 1, 1000 ):SpawnScheduled( 1, 0 )
-- Tests Kutaisi
-- -------------
-- Tests the CleanUp functionality.
-- Limited spawning of groups, scheduled every 10 seconds, who are engaging into combat. Some helicopters may crash land on the ground.
-- Observe when helicopters land but are not dead and are out of the danger zone, that they get removed after a while (+/- 180 seconds) and ReSpawn.
Spawn_Helicopter_Scheduled_CleanUp = SPAWN:New( "Spawn Helicopter Scheduled CleanUp" ):Limit( 3, 100 ):RandomizeRoute( 1, 1, 1000 ):CleanUp( 180 ):SpawnScheduled( 10, 0 )
Spawn_Vehicle_Scheduled_CleanUp = SPAWN:New( "Spawn Vehicle Scheduled CleanUp" ):Limit( 3, 100 ):RandomizeRoute( 1, 1, 1000 ):SpawnScheduled( 10, 0 )
-- Maykop
-- ------
-- Creates arrays of groups ready to be spawned and dynamic spawning of groups from another group.
-- SpawnTestVisible creates an array of 200 groups, every 20 groups with 20 meters space in between, and will activate a group of the array every 10 seconds with a 0.2 time randomization.
SpawnTestVisible = SPAWN:New( "Spawn Vehicle Visible Scheduled" ):Limit( 200, 200 ):Array( 59, 20, 20, 10 ):SpawnScheduled( 10, 0.2 )
-- Spawn_Templates_Visible contains different templates...
Spawn_Templates_Visible = { "Spawn Vehicle Visible Template A",
"Spawn Vehicle Visible Template B",
"Spawn Vehicle Visible Template C",
"Spawn Vehicle Visible Template D",
"Spawn Vehicle Visible Template E",
"Spawn Vehicle Visible Template F",
"Spawn Vehicle Visible Template G",
"Spawn Vehicle Visible Template H",
"Spawn Vehicle Visible Template I",
"Spawn Vehicle Visible Template J"
}
-- Spawn_Vehicle_Visible_RandomizeTemplate_Scheduled creates an array of 40 vehicle groups, spread out by 20 groups each, with an 8 meter distance,
-- and chooses for each group from the templates specified in Spawn_Templates_Visible.
Spawn_Vehicle_Visible_RandomizeTemplate_Scheduled = SPAWN:New( "Spawn Vehicle Visible RandomizeTemplate Scheduled" )
:Limit( 80, 80 )
:RandomizeTemplate( Spawn_Templates_Visible )
:Array( 49, 20, 8, 8 )
:SpawnScheduled( 10, 0.2 )
-- Spawn_Infantry allows to spawn 10 Infantry groups.
Spawn_Infantry = SPAWN:New( "Spawn Infantry" )
:Limit( 10, 10 )
-- Spawn_Vehicle_Host reserves 10 vehicle groups, shown within an array arranged by 5 vehicles in a row with a distance of 8 meters, and schedules a vehicle each 10 seconds with a 20% variation.
Spawn_Vehicle_Host = SPAWN:New( "Spawn Vehicle Host" )
:Limit( 10, 10 )
:Array( 0, 5, 8, 8 )
:SpawnScheduled( 10, 0.2 )
-- Spawn_Vehicle_SpawnToZone allows to spawn 10 vehicle groups.
Spawn_Vehicle_SpawnToZone = SPAWN:New( "Spawn Vehicle SpawnToZone" )
:Limit( 10, 10 )
-- Spawn_Helicopter_SpawnToZone will fly to a location, hover, and spawn one vehicle on the ground, the helicopter will land
-- and the vehicle will drive to a random location within the defined zone.
-- For this, the following code is activated within the mission on waypoint 3:
--
-- local InfantryDropGroup = Spawn_Vehicle_SpawnToZone:SpawnFromUnit( GROUP:New( ... ):GetUnit(1) )
-- local InfantryDropRoute = InfantryDropGroup:CopyRoute( 1, 0 )
-- InfantryDropGroup:RouteToZone( ZONE:New( "Target Zone" ), true, 80 )
--
Spawn_Helicopter_SpawnToZone = SPAWN:New( "Spawn Helicopter SpawnToZone" )
:Limit( 10, 10 )
:SpawnScheduled( 60, 0.2 )

View File

@@ -1,22 +0,0 @@
-- Name: SPA-013 - Ground Ops - Scheduled Spawns
-- Author: FlightControl
-- Date Created: 10 Jan 2017
--
-- # Situation:
--
-- At Gudauta spawn multiple ground vehicles, in a scheduled fashion.
--
-- # Test cases:
--
-- 1. Observe that the ground vehicles are spawned at the position declared within the mission editor.
-- 2. The vehicles should spawn according the scheduler parameters.
-- Tests Gudauta
-- -------------
Spawn_Vehicle_1 = SPAWN:New( "Spawn Vehicle 1" ):SpawnScheduled( 10, 0.5 )

View File

@@ -1,139 +0,0 @@
Include.File( "Spawn" )
-- Tests Anapa: Spawn Basics
-- -------------------------
-- Spawning groups using Spawn function.
Spawn_Plane = SPAWN:New( "Spawn Plane" )
Group_Plane = Spawn_Plane:Spawn()
Spawn_Helicopter = SPAWN:New( "Spawn Helicopter" ):RandomizeRoute( 1, 1, 1000 )
Group_Helicopter = Spawn_Helicopter:Spawn()
Group_Helicopter2 = Spawn_Helicopter:Spawn()
Spawn_Ship = SPAWN:New( "Spawn Ship" ):RandomizeRoute( 0, 0, 2000 )
Group_Ship1 = Spawn_Ship:Spawn()
Group_Ship2 = Spawn_Ship:Spawn()
Spawn_Vehicle = SPAWN:New( "Spawn Vehicle" ):RandomizeRoute( 1, 0, 50 )
Group_Vehicle1 = Spawn_Vehicle:Spawn()
Group_Vehicle2 = Spawn_Vehicle:Spawn()
Group_Vehicle3 = Spawn_Vehicle:Spawn()
Group_Vehicle4 = Spawn_Vehicle:Spawn()
Group_Vehicle5 = Spawn_Vehicle:Spawn()
Group_Vehicle6 = Spawn_Vehicle:Spawn()
Group_Vehicle1:TaskRouteToZone( ZONE:New( "Landing Zone" ), true, 40, "Cone" )
-- Now land the spawned plane on to the Vinson, by copying the route of another object.
Route_Plane = GROUP:NewFromName( "Spawn Helicopter Route Copy" ):CopyRoute( 1, 0 )
Group_Plane:Route( Route_Plane )
--Route_Helicopter[#Route_Helicopter].linkUnit = Group_Ship1:GetDCSUnit(1)
--Route_Helicopter[#Route_Helicopter].helipadId = Group_Ship1:GetDCSUnit(1)
--Route_Helicopter[#Route_Helicopter].x = Group_Ship1:GetUnit(1):GetPointVec2().x
--Route_Helicopter[#Route_Helicopter].y = Group_Ship1:GetUnit(1):GetPointVec2().y
--env.info( Route_Helicopter[#Route_Helicopter].type .. " on " .. Group_Ship1:GetUnit(1):GetID() )
--Group_Helicopter:Route( Route_Helicopter )
-- Tests Batumi: Scheduled Spawning
-- --------------------------------
-- Unlimited spawning of groups, scheduled every 30 seconds ...
Spawn_Plane_Scheduled = SPAWN:New( "Spawn Plane Scheduled" ):SpawnScheduled( 30, 0.4 )
Spawn_Helicopter_Scheduled = SPAWN:New( "Spawn Helicopter Scheduled" ):SpawnScheduled( 30, 1 )
Spawn_Ship_Scheduled = SPAWN:New( "Spawn Ship Scheduled" ):SpawnScheduled( 30, 0.5 )
Spawn_Vehicle_Scheduled = SPAWN:New( "Spawn Vehicle Scheduled" ):SpawnScheduled( 30, 0.5 )
-- Tests Tbilisi: Limited Spawning
-- -------------------------------
-- Spawing one group, and respawning the same group when it lands ...
Spawn_Plane_Limited_Repeat = SPAWN:New( "Spawn Plane Limited Repeat" ):Limit( 1, 1 ):Repeat():Spawn()
Spawn_Plane_Limited_RepeatOnLanding = SPAWN:New( "Spawn Plane Limited RepeatOnLanding" ):Limit( 1, 1 ):Repeat():Spawn()
Spawn_Plane_Limited_RepeatOnEngineShutDown = SPAWN:New( "Spawn Plane Limited RepeatOnEngineShutDown" ):Limit( 1, 1 ):Repeat():Spawn()
Spawn_Helicopter_Limited_Repeat = SPAWN:New( "Spawn Helicopter Limited Repeat" ):Limit( 1, 1 ):Repeat():Spawn()
Spawn_Helicopter_Limited_RepeatOnLanding = SPAWN:New( "Spawn Helicopter Limited RepeatOnLanding" ):Limit( 1, 1 ):Repeat():Spawn()
Spawn_Helicopter_Limited_RepeatOnEngineShutDown = SPAWN:New( "Spawn Helicopter Limited RepeatOnEngineShutDown" ):Limit( 1, 1 ):Repeat():Spawn()
-- Tests Soganlug
-- --------------
-- Limited spawning of groups, scheduled every 30 seconds ...
Spawn_Plane_Limited_Scheduled = SPAWN:New( "Spawn Plane Limited Scheduled" ):Limit( 2, 10 ):SpawnScheduled( 30, 0 )
Spawn_Helicopter_Limited_Scheduled = SPAWN:New( "Spawn Helicopter Limited Scheduled" ):Limit( 2, 10 ):SpawnScheduled( 30, 0 )
Spawn_Ground_Limited_Scheduled = SPAWN:New( "Spawn Vehicle Limited Scheduled" ):Limit( 1, 20 ):SpawnScheduled( 90, 0 )
-- Tests Sukhumi
-- -------------
-- Limited spawning of groups, scheduled every seconds with route randomization.
Spawn_Plane_Limited_Scheduled_RandomizeRoute = SPAWN:New( "Spawn Plane Limited Scheduled RandomizeRoute" ):Limit( 2, 10 ):RandomizeRoute( 1, 1, 4000 ):SpawnScheduled( 30, 0 )
Spawn_Helicopter_Limited_Scheduled_RandomizeRoute = SPAWN:New( "Spawn Helicopter Limited Scheduled RandomizeRoute" ):Limit( 2, 10 ):RandomizeRoute( 1, 1, 4000 ):SpawnScheduled( 30, 0 )
Spawn_Vehicle_Limited_Scheduled_RandomizeRoute = SPAWN:New( "Spawn Vehicle Limited Scheduled RandomizeRoute" ):Limit( 10, 10 ):RandomizeRoute( 1, 1, 1000 ):SpawnScheduled( 1, 0 )
-- Tests Kutaisi
-- -------------
-- Tests the CleanUp functionality.
-- Limited spawning of groups, scheduled every 10 seconds, who are engaging into combat. Some helicopters may crash land on the ground.
-- Observe when helicopters land but are not dead and are out of the danger zone, that they get removed after a while (+/- 180 seconds) and ReSpawn.
Spawn_Helicopter_Scheduled_CleanUp = SPAWN:New( "Spawn Helicopter Scheduled CleanUp" ):Limit( 3, 100 ):RandomizeRoute( 1, 1, 1000 ):CleanUp( 180 ):SpawnScheduled( 10, 0 )
Spawn_Vehicle_Scheduled_CleanUp = SPAWN:New( "Spawn Vehicle Scheduled CleanUp" ):Limit( 3, 100 ):RandomizeRoute( 1, 1, 1000 ):SpawnScheduled( 10, 0 )
-- Maykop
-- ------
-- Creates arrays of groups ready to be spawned and dynamic spawning of groups from another group.
-- SpawnTestVisible creates an array of 200 groups, every 20 groups with 20 meters space in between, and will activate a group of the array every 10 seconds with a 0.2 time randomization.
SpawnTestVisible = SPAWN:New( "Spawn Vehicle Visible Scheduled" ):Limit( 200, 200 ):Array( 59, 20, 20, 10 ):SpawnScheduled( 10, 0.2 )
-- Spawn_Templates_Visible contains different templates...
Spawn_Templates_Visible = { "Spawn Vehicle Visible Template A",
"Spawn Vehicle Visible Template B",
"Spawn Vehicle Visible Template C",
"Spawn Vehicle Visible Template D",
"Spawn Vehicle Visible Template E",
"Spawn Vehicle Visible Template F",
"Spawn Vehicle Visible Template G",
"Spawn Vehicle Visible Template H",
"Spawn Vehicle Visible Template I",
"Spawn Vehicle Visible Template J"
}
-- Spawn_Vehicle_Visible_RandomizeTemplate_Scheduled creates an array of 40 vehicle groups, spread out by 20 groups each, with an 8 meter distance,
-- and chooses for each group from the templates specified in Spawn_Templates_Visible.
Spawn_Vehicle_Visible_RandomizeTemplate_Scheduled = SPAWN:New( "Spawn Vehicle Visible RandomizeTemplate Scheduled" )
:Limit( 80, 80 )
:RandomizeTemplate( Spawn_Templates_Visible )
:Array( 49, 20, 8, 8 )
:SpawnScheduled( 10, 0.2 )
-- Spawn_Infantry allows to spawn 10 Infantry groups.
Spawn_Infantry = SPAWN:New( "Spawn Infantry" )
:Limit( 10, 10 )
-- Spawn_Vehicle_Host reserves 10 vehicle groups, shown within an array arranged by 5 vehicles in a row with a distance of 8 meters, and schedules a vehicle each 10 seconds with a 20% variation.
Spawn_Vehicle_Host = SPAWN:New( "Spawn Vehicle Host" )
:Limit( 10, 10 )
:Array( 0, 5, 8, 8 )
:SpawnScheduled( 10, 0.2 )
-- Spawn_Vehicle_SpawnToZone allows to spawn 10 vehicle groups.
Spawn_Vehicle_SpawnToZone = SPAWN:New( "Spawn Vehicle SpawnToZone" )
:Limit( 10, 10 )
-- Spawn_Helicopter_SpawnToZone will fly to a location, hover, and spawn one vehicle on the ground, the helicopter will land
-- and the vehicle will drive to a random location within the defined zone.
-- For this, the following code is activated within the mission on waypoint 3:
--
-- local InfantryDropGroup = Spawn_Vehicle_SpawnToZone:SpawnFromUnit( GROUP:New( ... ):GetUnit(1) )
-- local InfantryDropRoute = InfantryDropGroup:CopyRoute( 1, 0 )
-- InfantryDropGroup:RouteToZone( ZONE:New( "Target Zone" ), true, 80 )
--
Spawn_Helicopter_SpawnToZone = SPAWN:New( "Spawn Helicopter SpawnToZone" )
:Limit( 10, 10 )
:SpawnScheduled( 60, 0.2 )

View File

@@ -1,21 +0,0 @@
-- Name: SPA-014 - Ground Ops - Scheduled Spawns Limited
-- Author: FlightControl
-- Date Created: 10 Jan 2017
--
-- # Situation:
--
-- At Gudauta spawn multiple ground vehicles, in a scheduled fashion.
--
-- # Test cases:
--
-- 1. Observe that the ground vehicles are spawned at the position declared within the mission editor.
-- 2. The vehicles should spawn according the scheduler parameters.
-- 3. There should not be more than 5 groups spawned.
-- Tests Gudauta
-- -------------
Spawn_Vehicle_1 = SPAWN:New( "Spawn Vehicle 1" ):InitLimit( 5, 0 ):SpawnScheduled( 5, .5 )

View File

@@ -1,139 +0,0 @@
Include.File( "Spawn" )
-- Tests Anapa: Spawn Basics
-- -------------------------
-- Spawning groups using Spawn function.
Spawn_Plane = SPAWN:New( "Spawn Plane" )
Group_Plane = Spawn_Plane:Spawn()
Spawn_Helicopter = SPAWN:New( "Spawn Helicopter" ):RandomizeRoute( 1, 1, 1000 )
Group_Helicopter = Spawn_Helicopter:Spawn()
Group_Helicopter2 = Spawn_Helicopter:Spawn()
Spawn_Ship = SPAWN:New( "Spawn Ship" ):RandomizeRoute( 0, 0, 2000 )
Group_Ship1 = Spawn_Ship:Spawn()
Group_Ship2 = Spawn_Ship:Spawn()
Spawn_Vehicle = SPAWN:New( "Spawn Vehicle" ):RandomizeRoute( 1, 0, 50 )
Group_Vehicle1 = Spawn_Vehicle:Spawn()
Group_Vehicle2 = Spawn_Vehicle:Spawn()
Group_Vehicle3 = Spawn_Vehicle:Spawn()
Group_Vehicle4 = Spawn_Vehicle:Spawn()
Group_Vehicle5 = Spawn_Vehicle:Spawn()
Group_Vehicle6 = Spawn_Vehicle:Spawn()
Group_Vehicle1:TaskRouteToZone( ZONE:New( "Landing Zone" ), true, 40, "Cone" )
-- Now land the spawned plane on to the Vinson, by copying the route of another object.
Route_Plane = GROUP:NewFromName( "Spawn Helicopter Route Copy" ):CopyRoute( 1, 0 )
Group_Plane:Route( Route_Plane )
--Route_Helicopter[#Route_Helicopter].linkUnit = Group_Ship1:GetDCSUnit(1)
--Route_Helicopter[#Route_Helicopter].helipadId = Group_Ship1:GetDCSUnit(1)
--Route_Helicopter[#Route_Helicopter].x = Group_Ship1:GetUnit(1):GetPointVec2().x
--Route_Helicopter[#Route_Helicopter].y = Group_Ship1:GetUnit(1):GetPointVec2().y
--env.info( Route_Helicopter[#Route_Helicopter].type .. " on " .. Group_Ship1:GetUnit(1):GetID() )
--Group_Helicopter:Route( Route_Helicopter )
-- Tests Batumi: Scheduled Spawning
-- --------------------------------
-- Unlimited spawning of groups, scheduled every 30 seconds ...
Spawn_Plane_Scheduled = SPAWN:New( "Spawn Plane Scheduled" ):SpawnScheduled( 30, 0.4 )
Spawn_Helicopter_Scheduled = SPAWN:New( "Spawn Helicopter Scheduled" ):SpawnScheduled( 30, 1 )
Spawn_Ship_Scheduled = SPAWN:New( "Spawn Ship Scheduled" ):SpawnScheduled( 30, 0.5 )
Spawn_Vehicle_Scheduled = SPAWN:New( "Spawn Vehicle Scheduled" ):SpawnScheduled( 30, 0.5 )
-- Tests Tbilisi: Limited Spawning
-- -------------------------------
-- Spawing one group, and respawning the same group when it lands ...
Spawn_Plane_Limited_Repeat = SPAWN:New( "Spawn Plane Limited Repeat" ):Limit( 1, 1 ):Repeat():Spawn()
Spawn_Plane_Limited_RepeatOnLanding = SPAWN:New( "Spawn Plane Limited RepeatOnLanding" ):Limit( 1, 1 ):Repeat():Spawn()
Spawn_Plane_Limited_RepeatOnEngineShutDown = SPAWN:New( "Spawn Plane Limited RepeatOnEngineShutDown" ):Limit( 1, 1 ):Repeat():Spawn()
Spawn_Helicopter_Limited_Repeat = SPAWN:New( "Spawn Helicopter Limited Repeat" ):Limit( 1, 1 ):Repeat():Spawn()
Spawn_Helicopter_Limited_RepeatOnLanding = SPAWN:New( "Spawn Helicopter Limited RepeatOnLanding" ):Limit( 1, 1 ):Repeat():Spawn()
Spawn_Helicopter_Limited_RepeatOnEngineShutDown = SPAWN:New( "Spawn Helicopter Limited RepeatOnEngineShutDown" ):Limit( 1, 1 ):Repeat():Spawn()
-- Tests Soganlug
-- --------------
-- Limited spawning of groups, scheduled every 30 seconds ...
Spawn_Plane_Limited_Scheduled = SPAWN:New( "Spawn Plane Limited Scheduled" ):Limit( 2, 10 ):SpawnScheduled( 30, 0 )
Spawn_Helicopter_Limited_Scheduled = SPAWN:New( "Spawn Helicopter Limited Scheduled" ):Limit( 2, 10 ):SpawnScheduled( 30, 0 )
Spawn_Ground_Limited_Scheduled = SPAWN:New( "Spawn Vehicle Limited Scheduled" ):Limit( 1, 20 ):SpawnScheduled( 90, 0 )
-- Tests Sukhumi
-- -------------
-- Limited spawning of groups, scheduled every seconds with route randomization.
Spawn_Plane_Limited_Scheduled_RandomizeRoute = SPAWN:New( "Spawn Plane Limited Scheduled RandomizeRoute" ):Limit( 2, 10 ):RandomizeRoute( 1, 1, 4000 ):SpawnScheduled( 30, 0 )
Spawn_Helicopter_Limited_Scheduled_RandomizeRoute = SPAWN:New( "Spawn Helicopter Limited Scheduled RandomizeRoute" ):Limit( 2, 10 ):RandomizeRoute( 1, 1, 4000 ):SpawnScheduled( 30, 0 )
Spawn_Vehicle_Limited_Scheduled_RandomizeRoute = SPAWN:New( "Spawn Vehicle Limited Scheduled RandomizeRoute" ):Limit( 10, 10 ):RandomizeRoute( 1, 1, 1000 ):SpawnScheduled( 1, 0 )
-- Tests Kutaisi
-- -------------
-- Tests the CleanUp functionality.
-- Limited spawning of groups, scheduled every 10 seconds, who are engaging into combat. Some helicopters may crash land on the ground.
-- Observe when helicopters land but are not dead and are out of the danger zone, that they get removed after a while (+/- 180 seconds) and ReSpawn.
Spawn_Helicopter_Scheduled_CleanUp = SPAWN:New( "Spawn Helicopter Scheduled CleanUp" ):Limit( 3, 100 ):RandomizeRoute( 1, 1, 1000 ):CleanUp( 180 ):SpawnScheduled( 10, 0 )
Spawn_Vehicle_Scheduled_CleanUp = SPAWN:New( "Spawn Vehicle Scheduled CleanUp" ):Limit( 3, 100 ):RandomizeRoute( 1, 1, 1000 ):SpawnScheduled( 10, 0 )
-- Maykop
-- ------
-- Creates arrays of groups ready to be spawned and dynamic spawning of groups from another group.
-- SpawnTestVisible creates an array of 200 groups, every 20 groups with 20 meters space in between, and will activate a group of the array every 10 seconds with a 0.2 time randomization.
SpawnTestVisible = SPAWN:New( "Spawn Vehicle Visible Scheduled" ):Limit( 200, 200 ):Array( 59, 20, 20, 10 ):SpawnScheduled( 10, 0.2 )
-- Spawn_Templates_Visible contains different templates...
Spawn_Templates_Visible = { "Spawn Vehicle Visible Template A",
"Spawn Vehicle Visible Template B",
"Spawn Vehicle Visible Template C",
"Spawn Vehicle Visible Template D",
"Spawn Vehicle Visible Template E",
"Spawn Vehicle Visible Template F",
"Spawn Vehicle Visible Template G",
"Spawn Vehicle Visible Template H",
"Spawn Vehicle Visible Template I",
"Spawn Vehicle Visible Template J"
}
-- Spawn_Vehicle_Visible_RandomizeTemplate_Scheduled creates an array of 40 vehicle groups, spread out by 20 groups each, with an 8 meter distance,
-- and chooses for each group from the templates specified in Spawn_Templates_Visible.
Spawn_Vehicle_Visible_RandomizeTemplate_Scheduled = SPAWN:New( "Spawn Vehicle Visible RandomizeTemplate Scheduled" )
:Limit( 80, 80 )
:RandomizeTemplate( Spawn_Templates_Visible )
:Array( 49, 20, 8, 8 )
:SpawnScheduled( 10, 0.2 )
-- Spawn_Infantry allows to spawn 10 Infantry groups.
Spawn_Infantry = SPAWN:New( "Spawn Infantry" )
:Limit( 10, 10 )
-- Spawn_Vehicle_Host reserves 10 vehicle groups, shown within an array arranged by 5 vehicles in a row with a distance of 8 meters, and schedules a vehicle each 10 seconds with a 20% variation.
Spawn_Vehicle_Host = SPAWN:New( "Spawn Vehicle Host" )
:Limit( 10, 10 )
:Array( 0, 5, 8, 8 )
:SpawnScheduled( 10, 0.2 )
-- Spawn_Vehicle_SpawnToZone allows to spawn 10 vehicle groups.
Spawn_Vehicle_SpawnToZone = SPAWN:New( "Spawn Vehicle SpawnToZone" )
:Limit( 10, 10 )
-- Spawn_Helicopter_SpawnToZone will fly to a location, hover, and spawn one vehicle on the ground, the helicopter will land
-- and the vehicle will drive to a random location within the defined zone.
-- For this, the following code is activated within the mission on waypoint 3:
--
-- local InfantryDropGroup = Spawn_Vehicle_SpawnToZone:SpawnFromUnit( GROUP:New( ... ):GetUnit(1) )
-- local InfantryDropRoute = InfantryDropGroup:CopyRoute( 1, 0 )
-- InfantryDropGroup:RouteToZone( ZONE:New( "Target Zone" ), true, 80 )
--
Spawn_Helicopter_SpawnToZone = SPAWN:New( "Spawn Helicopter SpawnToZone" )
:Limit( 10, 10 )
:SpawnScheduled( 60, 0.2 )

View File

@@ -1,27 +0,0 @@
-- Name: SPA-015 - Ground Ops - Randomize Route
-- Author: FlightControl
-- Date Created: 10 Jan 2017
--
-- # Situation:
--
-- At Gudauta spawn multiple ground vehicles, in a scheduled fashion.
--
-- # Test cases:
--
-- 1. Observe that the ground vehicles are spawned at the position declared within the mission editor.
-- 2. The vehicles should spawn according the scheduler parameters.
-- 3. There should not be more than 5 groups spawned.
-- 4. Observe that the route that the vehicles follow is randomized starting from point 1 till point 3.
-- Tests Gudauta
-- -------------
Spawn_Vehicle_1 = SPAWN:New( "Spawn Vehicle 1" )
:InitLimit( 10, 10 )
:InitRandomizeRoute( 1, 1, 200 ) -- Randomize route starting from point 1 till point 3, with a radius of 200 meters around each point.
:SpawnScheduled( 5, .5 )

View File

@@ -1,139 +0,0 @@
Include.File( "Spawn" )
-- Tests Anapa: Spawn Basics
-- -------------------------
-- Spawning groups using Spawn function.
Spawn_Plane = SPAWN:New( "Spawn Plane" )
Group_Plane = Spawn_Plane:Spawn()
Spawn_Helicopter = SPAWN:New( "Spawn Helicopter" ):RandomizeRoute( 1, 1, 1000 )
Group_Helicopter = Spawn_Helicopter:Spawn()
Group_Helicopter2 = Spawn_Helicopter:Spawn()
Spawn_Ship = SPAWN:New( "Spawn Ship" ):RandomizeRoute( 0, 0, 2000 )
Group_Ship1 = Spawn_Ship:Spawn()
Group_Ship2 = Spawn_Ship:Spawn()
Spawn_Vehicle = SPAWN:New( "Spawn Vehicle" ):RandomizeRoute( 1, 0, 50 )
Group_Vehicle1 = Spawn_Vehicle:Spawn()
Group_Vehicle2 = Spawn_Vehicle:Spawn()
Group_Vehicle3 = Spawn_Vehicle:Spawn()
Group_Vehicle4 = Spawn_Vehicle:Spawn()
Group_Vehicle5 = Spawn_Vehicle:Spawn()
Group_Vehicle6 = Spawn_Vehicle:Spawn()
Group_Vehicle1:TaskRouteToZone( ZONE:New( "Landing Zone" ), true, 40, "Cone" )
-- Now land the spawned plane on to the Vinson, by copying the route of another object.
Route_Plane = GROUP:NewFromName( "Spawn Helicopter Route Copy" ):CopyRoute( 1, 0 )
Group_Plane:Route( Route_Plane )
--Route_Helicopter[#Route_Helicopter].linkUnit = Group_Ship1:GetDCSUnit(1)
--Route_Helicopter[#Route_Helicopter].helipadId = Group_Ship1:GetDCSUnit(1)
--Route_Helicopter[#Route_Helicopter].x = Group_Ship1:GetUnit(1):GetPointVec2().x
--Route_Helicopter[#Route_Helicopter].y = Group_Ship1:GetUnit(1):GetPointVec2().y
--env.info( Route_Helicopter[#Route_Helicopter].type .. " on " .. Group_Ship1:GetUnit(1):GetID() )
--Group_Helicopter:Route( Route_Helicopter )
-- Tests Batumi: Scheduled Spawning
-- --------------------------------
-- Unlimited spawning of groups, scheduled every 30 seconds ...
Spawn_Plane_Scheduled = SPAWN:New( "Spawn Plane Scheduled" ):SpawnScheduled( 30, 0.4 )
Spawn_Helicopter_Scheduled = SPAWN:New( "Spawn Helicopter Scheduled" ):SpawnScheduled( 30, 1 )
Spawn_Ship_Scheduled = SPAWN:New( "Spawn Ship Scheduled" ):SpawnScheduled( 30, 0.5 )
Spawn_Vehicle_Scheduled = SPAWN:New( "Spawn Vehicle Scheduled" ):SpawnScheduled( 30, 0.5 )
-- Tests Tbilisi: Limited Spawning
-- -------------------------------
-- Spawing one group, and respawning the same group when it lands ...
Spawn_Plane_Limited_Repeat = SPAWN:New( "Spawn Plane Limited Repeat" ):Limit( 1, 1 ):Repeat():Spawn()
Spawn_Plane_Limited_RepeatOnLanding = SPAWN:New( "Spawn Plane Limited RepeatOnLanding" ):Limit( 1, 1 ):Repeat():Spawn()
Spawn_Plane_Limited_RepeatOnEngineShutDown = SPAWN:New( "Spawn Plane Limited RepeatOnEngineShutDown" ):Limit( 1, 1 ):Repeat():Spawn()
Spawn_Helicopter_Limited_Repeat = SPAWN:New( "Spawn Helicopter Limited Repeat" ):Limit( 1, 1 ):Repeat():Spawn()
Spawn_Helicopter_Limited_RepeatOnLanding = SPAWN:New( "Spawn Helicopter Limited RepeatOnLanding" ):Limit( 1, 1 ):Repeat():Spawn()
Spawn_Helicopter_Limited_RepeatOnEngineShutDown = SPAWN:New( "Spawn Helicopter Limited RepeatOnEngineShutDown" ):Limit( 1, 1 ):Repeat():Spawn()
-- Tests Soganlug
-- --------------
-- Limited spawning of groups, scheduled every 30 seconds ...
Spawn_Plane_Limited_Scheduled = SPAWN:New( "Spawn Plane Limited Scheduled" ):Limit( 2, 10 ):SpawnScheduled( 30, 0 )
Spawn_Helicopter_Limited_Scheduled = SPAWN:New( "Spawn Helicopter Limited Scheduled" ):Limit( 2, 10 ):SpawnScheduled( 30, 0 )
Spawn_Ground_Limited_Scheduled = SPAWN:New( "Spawn Vehicle Limited Scheduled" ):Limit( 1, 20 ):SpawnScheduled( 90, 0 )
-- Tests Sukhumi
-- -------------
-- Limited spawning of groups, scheduled every seconds with route randomization.
Spawn_Plane_Limited_Scheduled_RandomizeRoute = SPAWN:New( "Spawn Plane Limited Scheduled RandomizeRoute" ):Limit( 2, 10 ):RandomizeRoute( 1, 1, 4000 ):SpawnScheduled( 30, 0 )
Spawn_Helicopter_Limited_Scheduled_RandomizeRoute = SPAWN:New( "Spawn Helicopter Limited Scheduled RandomizeRoute" ):Limit( 2, 10 ):RandomizeRoute( 1, 1, 4000 ):SpawnScheduled( 30, 0 )
Spawn_Vehicle_Limited_Scheduled_RandomizeRoute = SPAWN:New( "Spawn Vehicle Limited Scheduled RandomizeRoute" ):Limit( 10, 10 ):RandomizeRoute( 1, 1, 1000 ):SpawnScheduled( 1, 0 )
-- Tests Kutaisi
-- -------------
-- Tests the CleanUp functionality.
-- Limited spawning of groups, scheduled every 10 seconds, who are engaging into combat. Some helicopters may crash land on the ground.
-- Observe when helicopters land but are not dead and are out of the danger zone, that they get removed after a while (+/- 180 seconds) and ReSpawn.
Spawn_Helicopter_Scheduled_CleanUp = SPAWN:New( "Spawn Helicopter Scheduled CleanUp" ):Limit( 3, 100 ):RandomizeRoute( 1, 1, 1000 ):CleanUp( 180 ):SpawnScheduled( 10, 0 )
Spawn_Vehicle_Scheduled_CleanUp = SPAWN:New( "Spawn Vehicle Scheduled CleanUp" ):Limit( 3, 100 ):RandomizeRoute( 1, 1, 1000 ):SpawnScheduled( 10, 0 )
-- Maykop
-- ------
-- Creates arrays of groups ready to be spawned and dynamic spawning of groups from another group.
-- SpawnTestVisible creates an array of 200 groups, every 20 groups with 20 meters space in between, and will activate a group of the array every 10 seconds with a 0.2 time randomization.
SpawnTestVisible = SPAWN:New( "Spawn Vehicle Visible Scheduled" ):Limit( 200, 200 ):Array( 59, 20, 20, 10 ):SpawnScheduled( 10, 0.2 )
-- Spawn_Templates_Visible contains different templates...
Spawn_Templates_Visible = { "Spawn Vehicle Visible Template A",
"Spawn Vehicle Visible Template B",
"Spawn Vehicle Visible Template C",
"Spawn Vehicle Visible Template D",
"Spawn Vehicle Visible Template E",
"Spawn Vehicle Visible Template F",
"Spawn Vehicle Visible Template G",
"Spawn Vehicle Visible Template H",
"Spawn Vehicle Visible Template I",
"Spawn Vehicle Visible Template J"
}
-- Spawn_Vehicle_Visible_RandomizeTemplate_Scheduled creates an array of 40 vehicle groups, spread out by 20 groups each, with an 8 meter distance,
-- and chooses for each group from the templates specified in Spawn_Templates_Visible.
Spawn_Vehicle_Visible_RandomizeTemplate_Scheduled = SPAWN:New( "Spawn Vehicle Visible RandomizeTemplate Scheduled" )
:Limit( 80, 80 )
:RandomizeTemplate( Spawn_Templates_Visible )
:Array( 49, 20, 8, 8 )
:SpawnScheduled( 10, 0.2 )
-- Spawn_Infantry allows to spawn 10 Infantry groups.
Spawn_Infantry = SPAWN:New( "Spawn Infantry" )
:Limit( 10, 10 )
-- Spawn_Vehicle_Host reserves 10 vehicle groups, shown within an array arranged by 5 vehicles in a row with a distance of 8 meters, and schedules a vehicle each 10 seconds with a 20% variation.
Spawn_Vehicle_Host = SPAWN:New( "Spawn Vehicle Host" )
:Limit( 10, 10 )
:Array( 0, 5, 8, 8 )
:SpawnScheduled( 10, 0.2 )
-- Spawn_Vehicle_SpawnToZone allows to spawn 10 vehicle groups.
Spawn_Vehicle_SpawnToZone = SPAWN:New( "Spawn Vehicle SpawnToZone" )
:Limit( 10, 10 )
-- Spawn_Helicopter_SpawnToZone will fly to a location, hover, and spawn one vehicle on the ground, the helicopter will land
-- and the vehicle will drive to a random location within the defined zone.
-- For this, the following code is activated within the mission on waypoint 3:
--
-- local InfantryDropGroup = Spawn_Vehicle_SpawnToZone:SpawnFromUnit( GROUP:New( ... ):GetUnit(1) )
-- local InfantryDropRoute = InfantryDropGroup:CopyRoute( 1, 0 )
-- InfantryDropGroup:RouteToZone( ZONE:New( "Target Zone" ), true, 80 )
--
Spawn_Helicopter_SpawnToZone = SPAWN:New( "Spawn Helicopter SpawnToZone" )
:Limit( 10, 10 )
:SpawnScheduled( 60, 0.2 )

View File

@@ -1,29 +0,0 @@
-- Name: SPA-016 - Ground Ops - Randomize Zones
-- Author: FlightControl
-- Date Created: 10 Jan 2017
--
-- # Situation:
--
-- At Gudauta spawn multiple ground vehicles, in a scheduled fashion.
--
-- # Test cases:
--
-- 1. Observe that the ground vehicles are spawned at the position declared within the mission editor.
-- 2. The vehicles should spawn according the scheduler parameters.
-- 3. There should not be more than 5 groups spawned.
-- 4. Observe that the route that the vehicles follow is randomized starting from point 1 till point 3.
-- 5. Observe that the position where the units are spawned, is randomized according the zones.
-- Tests Gudauta
-- -------------
-- Create a zone table of the 2 zones.
ZoneTable = { ZONE:New( "Zone1" ), ZONE:New( "Zone2" ) }
Spawn_Vehicle_1 = SPAWN:New( "Spawn Vehicle 1" )
:InitLimit( 10, 10 )
:InitRandomizeRoute( 1, 1, 200 )
:InitRandomizeZones( ZoneTable )
:SpawnScheduled( 5, .5 )

View File

@@ -1,31 +0,0 @@
-- Name: SPA-017 - Ground Ops - Set AI inactive while spawning
-- Author: FlightControl
-- Date Created: 24 Jan 2017
--
-- # Situation:
--
-- At Gudauta spawn multiple ground vehicles, in a scheduled fashion.
-- But set the AI inactive when spawning.
--
-- # Test cases:
--
-- 1. Observe that the ground vehicles are spawned at the position declared within the mission editor.
-- 2. The vehicles should spawn according the scheduler parameters.
-- 3. There should not be more than 5 groups spawned.
-- 4. Observe that the AI is inactivated, and thus, the vehicles aren't moving.
-- 5. Observe that the position where the units are spawned, is randomized in the zones perimeters.
-- Tests Gudauta
-- -------------
-- Create a zone table of the 2 zones.
ZoneTable = { ZONE:New( "Zone1" ), ZONE:New( "Zone2" ) }
Spawn_Vehicle_1 = SPAWN:New( "Spawn Vehicle 1" )
:InitLimit( 10, 10 )
:InitRandomizeRoute( 1, 1, 200 )
:InitRandomizeZones( ZoneTable )
:InitAIOnOff( false ) -- This will disable the AI. You can also use :InitAIOff(). Set AI On (for those groups with AI Off in the ME), with :InitAIOn().
:SpawnScheduled( 5, .5 )

View File

@@ -1,139 +0,0 @@
Include.File( "Spawn" )
-- Tests Anapa: Spawn Basics
-- -------------------------
-- Spawning groups using Spawn function.
Spawn_Plane = SPAWN:New( "Spawn Plane" )
Group_Plane = Spawn_Plane:Spawn()
Spawn_Helicopter = SPAWN:New( "Spawn Helicopter" ):RandomizeRoute( 1, 1, 1000 )
Group_Helicopter = Spawn_Helicopter:Spawn()
Group_Helicopter2 = Spawn_Helicopter:Spawn()
Spawn_Ship = SPAWN:New( "Spawn Ship" ):RandomizeRoute( 0, 0, 2000 )
Group_Ship1 = Spawn_Ship:Spawn()
Group_Ship2 = Spawn_Ship:Spawn()
Spawn_Vehicle = SPAWN:New( "Spawn Vehicle" ):RandomizeRoute( 1, 0, 50 )
Group_Vehicle1 = Spawn_Vehicle:Spawn()
Group_Vehicle2 = Spawn_Vehicle:Spawn()
Group_Vehicle3 = Spawn_Vehicle:Spawn()
Group_Vehicle4 = Spawn_Vehicle:Spawn()
Group_Vehicle5 = Spawn_Vehicle:Spawn()
Group_Vehicle6 = Spawn_Vehicle:Spawn()
Group_Vehicle1:TaskRouteToZone( ZONE:New( "Landing Zone" ), true, 40, "Cone" )
-- Now land the spawned plane on to the Vinson, by copying the route of another object.
Route_Plane = GROUP:NewFromName( "Spawn Helicopter Route Copy" ):CopyRoute( 1, 0 )
Group_Plane:Route( Route_Plane )
--Route_Helicopter[#Route_Helicopter].linkUnit = Group_Ship1:GetDCSUnit(1)
--Route_Helicopter[#Route_Helicopter].helipadId = Group_Ship1:GetDCSUnit(1)
--Route_Helicopter[#Route_Helicopter].x = Group_Ship1:GetUnit(1):GetPointVec2().x
--Route_Helicopter[#Route_Helicopter].y = Group_Ship1:GetUnit(1):GetPointVec2().y
--env.info( Route_Helicopter[#Route_Helicopter].type .. " on " .. Group_Ship1:GetUnit(1):GetID() )
--Group_Helicopter:Route( Route_Helicopter )
-- Tests Batumi: Scheduled Spawning
-- --------------------------------
-- Unlimited spawning of groups, scheduled every 30 seconds ...
Spawn_Plane_Scheduled = SPAWN:New( "Spawn Plane Scheduled" ):SpawnScheduled( 30, 0.4 )
Spawn_Helicopter_Scheduled = SPAWN:New( "Spawn Helicopter Scheduled" ):SpawnScheduled( 30, 1 )
Spawn_Ship_Scheduled = SPAWN:New( "Spawn Ship Scheduled" ):SpawnScheduled( 30, 0.5 )
Spawn_Vehicle_Scheduled = SPAWN:New( "Spawn Vehicle Scheduled" ):SpawnScheduled( 30, 0.5 )
-- Tests Tbilisi: Limited Spawning
-- -------------------------------
-- Spawing one group, and respawning the same group when it lands ...
Spawn_Plane_Limited_Repeat = SPAWN:New( "Spawn Plane Limited Repeat" ):Limit( 1, 1 ):Repeat():Spawn()
Spawn_Plane_Limited_RepeatOnLanding = SPAWN:New( "Spawn Plane Limited RepeatOnLanding" ):Limit( 1, 1 ):Repeat():Spawn()
Spawn_Plane_Limited_RepeatOnEngineShutDown = SPAWN:New( "Spawn Plane Limited RepeatOnEngineShutDown" ):Limit( 1, 1 ):Repeat():Spawn()
Spawn_Helicopter_Limited_Repeat = SPAWN:New( "Spawn Helicopter Limited Repeat" ):Limit( 1, 1 ):Repeat():Spawn()
Spawn_Helicopter_Limited_RepeatOnLanding = SPAWN:New( "Spawn Helicopter Limited RepeatOnLanding" ):Limit( 1, 1 ):Repeat():Spawn()
Spawn_Helicopter_Limited_RepeatOnEngineShutDown = SPAWN:New( "Spawn Helicopter Limited RepeatOnEngineShutDown" ):Limit( 1, 1 ):Repeat():Spawn()
-- Tests Soganlug
-- --------------
-- Limited spawning of groups, scheduled every 30 seconds ...
Spawn_Plane_Limited_Scheduled = SPAWN:New( "Spawn Plane Limited Scheduled" ):Limit( 2, 10 ):SpawnScheduled( 30, 0 )
Spawn_Helicopter_Limited_Scheduled = SPAWN:New( "Spawn Helicopter Limited Scheduled" ):Limit( 2, 10 ):SpawnScheduled( 30, 0 )
Spawn_Ground_Limited_Scheduled = SPAWN:New( "Spawn Vehicle Limited Scheduled" ):Limit( 1, 20 ):SpawnScheduled( 90, 0 )
-- Tests Sukhumi
-- -------------
-- Limited spawning of groups, scheduled every seconds with route randomization.
Spawn_Plane_Limited_Scheduled_RandomizeRoute = SPAWN:New( "Spawn Plane Limited Scheduled RandomizeRoute" ):Limit( 2, 10 ):RandomizeRoute( 1, 1, 4000 ):SpawnScheduled( 30, 0 )
Spawn_Helicopter_Limited_Scheduled_RandomizeRoute = SPAWN:New( "Spawn Helicopter Limited Scheduled RandomizeRoute" ):Limit( 2, 10 ):RandomizeRoute( 1, 1, 4000 ):SpawnScheduled( 30, 0 )
Spawn_Vehicle_Limited_Scheduled_RandomizeRoute = SPAWN:New( "Spawn Vehicle Limited Scheduled RandomizeRoute" ):Limit( 10, 10 ):RandomizeRoute( 1, 1, 1000 ):SpawnScheduled( 1, 0 )
-- Tests Kutaisi
-- -------------
-- Tests the CleanUp functionality.
-- Limited spawning of groups, scheduled every 10 seconds, who are engaging into combat. Some helicopters may crash land on the ground.
-- Observe when helicopters land but are not dead and are out of the danger zone, that they get removed after a while (+/- 180 seconds) and ReSpawn.
Spawn_Helicopter_Scheduled_CleanUp = SPAWN:New( "Spawn Helicopter Scheduled CleanUp" ):Limit( 3, 100 ):RandomizeRoute( 1, 1, 1000 ):CleanUp( 180 ):SpawnScheduled( 10, 0 )
Spawn_Vehicle_Scheduled_CleanUp = SPAWN:New( "Spawn Vehicle Scheduled CleanUp" ):Limit( 3, 100 ):RandomizeRoute( 1, 1, 1000 ):SpawnScheduled( 10, 0 )
-- Maykop
-- ------
-- Creates arrays of groups ready to be spawned and dynamic spawning of groups from another group.
-- SpawnTestVisible creates an array of 200 groups, every 20 groups with 20 meters space in between, and will activate a group of the array every 10 seconds with a 0.2 time randomization.
SpawnTestVisible = SPAWN:New( "Spawn Vehicle Visible Scheduled" ):Limit( 200, 200 ):Array( 59, 20, 20, 10 ):SpawnScheduled( 10, 0.2 )
-- Spawn_Templates_Visible contains different templates...
Spawn_Templates_Visible = { "Spawn Vehicle Visible Template A",
"Spawn Vehicle Visible Template B",
"Spawn Vehicle Visible Template C",
"Spawn Vehicle Visible Template D",
"Spawn Vehicle Visible Template E",
"Spawn Vehicle Visible Template F",
"Spawn Vehicle Visible Template G",
"Spawn Vehicle Visible Template H",
"Spawn Vehicle Visible Template I",
"Spawn Vehicle Visible Template J"
}
-- Spawn_Vehicle_Visible_RandomizeTemplate_Scheduled creates an array of 40 vehicle groups, spread out by 20 groups each, with an 8 meter distance,
-- and chooses for each group from the templates specified in Spawn_Templates_Visible.
Spawn_Vehicle_Visible_RandomizeTemplate_Scheduled = SPAWN:New( "Spawn Vehicle Visible RandomizeTemplate Scheduled" )
:Limit( 80, 80 )
:RandomizeTemplate( Spawn_Templates_Visible )
:Array( 49, 20, 8, 8 )
:SpawnScheduled( 10, 0.2 )
-- Spawn_Infantry allows to spawn 10 Infantry groups.
Spawn_Infantry = SPAWN:New( "Spawn Infantry" )
:Limit( 10, 10 )
-- Spawn_Vehicle_Host reserves 10 vehicle groups, shown within an array arranged by 5 vehicles in a row with a distance of 8 meters, and schedules a vehicle each 10 seconds with a 20% variation.
Spawn_Vehicle_Host = SPAWN:New( "Spawn Vehicle Host" )
:Limit( 10, 10 )
:Array( 0, 5, 8, 8 )
:SpawnScheduled( 10, 0.2 )
-- Spawn_Vehicle_SpawnToZone allows to spawn 10 vehicle groups.
Spawn_Vehicle_SpawnToZone = SPAWN:New( "Spawn Vehicle SpawnToZone" )
:Limit( 10, 10 )
-- Spawn_Helicopter_SpawnToZone will fly to a location, hover, and spawn one vehicle on the ground, the helicopter will land
-- and the vehicle will drive to a random location within the defined zone.
-- For this, the following code is activated within the mission on waypoint 3:
--
-- local InfantryDropGroup = Spawn_Vehicle_SpawnToZone:SpawnFromUnit( GROUP:New( ... ):GetUnit(1) )
-- local InfantryDropRoute = InfantryDropGroup:CopyRoute( 1, 0 )
-- InfantryDropGroup:RouteToZone( ZONE:New( "Target Zone" ), true, 80 )
--
Spawn_Helicopter_SpawnToZone = SPAWN:New( "Spawn Helicopter SpawnToZone" )
:Limit( 10, 10 )
:SpawnScheduled( 60, 0.2 )

View File

@@ -1,28 +0,0 @@
---
-- Name: SPA-018 - Ground Ops - Randomize Templates
-- Author: FlightControl
-- Date Created: 10 Jan 2017
--
-- # Situation:
--
-- At Gudauta spawn multiple ground vehicles, in a scheduled fashion.
--
-- # Test cases:
--
-- 1. Observe that the ground vehicles are spawned with randomized templates.
-- Tests Gudauta
-- -------------
-- Create a zone table of the 2 zones.
ZoneTable = { ZONE:New( "Zone1" ), ZONE:New( "Zone2" ) }
TemplateTable = { "A", "B", "C" }
Spawn_Vehicle_1 = SPAWN:New( "Spawn Vehicle 1" )
:InitLimit( 10, 10 )
:InitRandomizeRoute( 1, 1, 200 )
:InitRandomizeTemplate( TemplateTable )
--:InitRandomizeZones( ZoneTable )
:SpawnScheduled( 5, .5 )

View File

@@ -1,139 +0,0 @@
Include.File( "Spawn" )
-- Tests Anapa: Spawn Basics
-- -------------------------
-- Spawning groups using Spawn function.
Spawn_Plane = SPAWN:New( "Spawn Plane" )
Group_Plane = Spawn_Plane:Spawn()
Spawn_Helicopter = SPAWN:New( "Spawn Helicopter" ):RandomizeRoute( 1, 1, 1000 )
Group_Helicopter = Spawn_Helicopter:Spawn()
Group_Helicopter2 = Spawn_Helicopter:Spawn()
Spawn_Ship = SPAWN:New( "Spawn Ship" ):RandomizeRoute( 0, 0, 2000 )
Group_Ship1 = Spawn_Ship:Spawn()
Group_Ship2 = Spawn_Ship:Spawn()
Spawn_Vehicle = SPAWN:New( "Spawn Vehicle" ):RandomizeRoute( 1, 0, 50 )
Group_Vehicle1 = Spawn_Vehicle:Spawn()
Group_Vehicle2 = Spawn_Vehicle:Spawn()
Group_Vehicle3 = Spawn_Vehicle:Spawn()
Group_Vehicle4 = Spawn_Vehicle:Spawn()
Group_Vehicle5 = Spawn_Vehicle:Spawn()
Group_Vehicle6 = Spawn_Vehicle:Spawn()
Group_Vehicle1:TaskRouteToZone( ZONE:New( "Landing Zone" ), true, 40, "Cone" )
-- Now land the spawned plane on to the Vinson, by copying the route of another object.
Route_Plane = GROUP:NewFromName( "Spawn Helicopter Route Copy" ):CopyRoute( 1, 0 )
Group_Plane:Route( Route_Plane )
--Route_Helicopter[#Route_Helicopter].linkUnit = Group_Ship1:GetDCSUnit(1)
--Route_Helicopter[#Route_Helicopter].helipadId = Group_Ship1:GetDCSUnit(1)
--Route_Helicopter[#Route_Helicopter].x = Group_Ship1:GetUnit(1):GetPointVec2().x
--Route_Helicopter[#Route_Helicopter].y = Group_Ship1:GetUnit(1):GetPointVec2().y
--env.info( Route_Helicopter[#Route_Helicopter].type .. " on " .. Group_Ship1:GetUnit(1):GetID() )
--Group_Helicopter:Route( Route_Helicopter )
-- Tests Batumi: Scheduled Spawning
-- --------------------------------
-- Unlimited spawning of groups, scheduled every 30 seconds ...
Spawn_Plane_Scheduled = SPAWN:New( "Spawn Plane Scheduled" ):SpawnScheduled( 30, 0.4 )
Spawn_Helicopter_Scheduled = SPAWN:New( "Spawn Helicopter Scheduled" ):SpawnScheduled( 30, 1 )
Spawn_Ship_Scheduled = SPAWN:New( "Spawn Ship Scheduled" ):SpawnScheduled( 30, 0.5 )
Spawn_Vehicle_Scheduled = SPAWN:New( "Spawn Vehicle Scheduled" ):SpawnScheduled( 30, 0.5 )
-- Tests Tbilisi: Limited Spawning
-- -------------------------------
-- Spawing one group, and respawning the same group when it lands ...
Spawn_Plane_Limited_Repeat = SPAWN:New( "Spawn Plane Limited Repeat" ):Limit( 1, 1 ):Repeat():Spawn()
Spawn_Plane_Limited_RepeatOnLanding = SPAWN:New( "Spawn Plane Limited RepeatOnLanding" ):Limit( 1, 1 ):Repeat():Spawn()
Spawn_Plane_Limited_RepeatOnEngineShutDown = SPAWN:New( "Spawn Plane Limited RepeatOnEngineShutDown" ):Limit( 1, 1 ):Repeat():Spawn()
Spawn_Helicopter_Limited_Repeat = SPAWN:New( "Spawn Helicopter Limited Repeat" ):Limit( 1, 1 ):Repeat():Spawn()
Spawn_Helicopter_Limited_RepeatOnLanding = SPAWN:New( "Spawn Helicopter Limited RepeatOnLanding" ):Limit( 1, 1 ):Repeat():Spawn()
Spawn_Helicopter_Limited_RepeatOnEngineShutDown = SPAWN:New( "Spawn Helicopter Limited RepeatOnEngineShutDown" ):Limit( 1, 1 ):Repeat():Spawn()
-- Tests Soganlug
-- --------------
-- Limited spawning of groups, scheduled every 30 seconds ...
Spawn_Plane_Limited_Scheduled = SPAWN:New( "Spawn Plane Limited Scheduled" ):Limit( 2, 10 ):SpawnScheduled( 30, 0 )
Spawn_Helicopter_Limited_Scheduled = SPAWN:New( "Spawn Helicopter Limited Scheduled" ):Limit( 2, 10 ):SpawnScheduled( 30, 0 )
Spawn_Ground_Limited_Scheduled = SPAWN:New( "Spawn Vehicle Limited Scheduled" ):Limit( 1, 20 ):SpawnScheduled( 90, 0 )
-- Tests Sukhumi
-- -------------
-- Limited spawning of groups, scheduled every seconds with route randomization.
Spawn_Plane_Limited_Scheduled_RandomizeRoute = SPAWN:New( "Spawn Plane Limited Scheduled RandomizeRoute" ):Limit( 2, 10 ):RandomizeRoute( 1, 1, 4000 ):SpawnScheduled( 30, 0 )
Spawn_Helicopter_Limited_Scheduled_RandomizeRoute = SPAWN:New( "Spawn Helicopter Limited Scheduled RandomizeRoute" ):Limit( 2, 10 ):RandomizeRoute( 1, 1, 4000 ):SpawnScheduled( 30, 0 )
Spawn_Vehicle_Limited_Scheduled_RandomizeRoute = SPAWN:New( "Spawn Vehicle Limited Scheduled RandomizeRoute" ):Limit( 10, 10 ):RandomizeRoute( 1, 1, 1000 ):SpawnScheduled( 1, 0 )
-- Tests Kutaisi
-- -------------
-- Tests the CleanUp functionality.
-- Limited spawning of groups, scheduled every 10 seconds, who are engaging into combat. Some helicopters may crash land on the ground.
-- Observe when helicopters land but are not dead and are out of the danger zone, that they get removed after a while (+/- 180 seconds) and ReSpawn.
Spawn_Helicopter_Scheduled_CleanUp = SPAWN:New( "Spawn Helicopter Scheduled CleanUp" ):Limit( 3, 100 ):RandomizeRoute( 1, 1, 1000 ):CleanUp( 180 ):SpawnScheduled( 10, 0 )
Spawn_Vehicle_Scheduled_CleanUp = SPAWN:New( "Spawn Vehicle Scheduled CleanUp" ):Limit( 3, 100 ):RandomizeRoute( 1, 1, 1000 ):SpawnScheduled( 10, 0 )
-- Maykop
-- ------
-- Creates arrays of groups ready to be spawned and dynamic spawning of groups from another group.
-- SpawnTestVisible creates an array of 200 groups, every 20 groups with 20 meters space in between, and will activate a group of the array every 10 seconds with a 0.2 time randomization.
SpawnTestVisible = SPAWN:New( "Spawn Vehicle Visible Scheduled" ):Limit( 200, 200 ):Array( 59, 20, 20, 10 ):SpawnScheduled( 10, 0.2 )
-- Spawn_Templates_Visible contains different templates...
Spawn_Templates_Visible = { "Spawn Vehicle Visible Template A",
"Spawn Vehicle Visible Template B",
"Spawn Vehicle Visible Template C",
"Spawn Vehicle Visible Template D",
"Spawn Vehicle Visible Template E",
"Spawn Vehicle Visible Template F",
"Spawn Vehicle Visible Template G",
"Spawn Vehicle Visible Template H",
"Spawn Vehicle Visible Template I",
"Spawn Vehicle Visible Template J"
}
-- Spawn_Vehicle_Visible_RandomizeTemplate_Scheduled creates an array of 40 vehicle groups, spread out by 20 groups each, with an 8 meter distance,
-- and chooses for each group from the templates specified in Spawn_Templates_Visible.
Spawn_Vehicle_Visible_RandomizeTemplate_Scheduled = SPAWN:New( "Spawn Vehicle Visible RandomizeTemplate Scheduled" )
:Limit( 80, 80 )
:RandomizeTemplate( Spawn_Templates_Visible )
:Array( 49, 20, 8, 8 )
:SpawnScheduled( 10, 0.2 )
-- Spawn_Infantry allows to spawn 10 Infantry groups.
Spawn_Infantry = SPAWN:New( "Spawn Infantry" )
:Limit( 10, 10 )
-- Spawn_Vehicle_Host reserves 10 vehicle groups, shown within an array arranged by 5 vehicles in a row with a distance of 8 meters, and schedules a vehicle each 10 seconds with a 20% variation.
Spawn_Vehicle_Host = SPAWN:New( "Spawn Vehicle Host" )
:Limit( 10, 10 )
:Array( 0, 5, 8, 8 )
:SpawnScheduled( 10, 0.2 )
-- Spawn_Vehicle_SpawnToZone allows to spawn 10 vehicle groups.
Spawn_Vehicle_SpawnToZone = SPAWN:New( "Spawn Vehicle SpawnToZone" )
:Limit( 10, 10 )
-- Spawn_Helicopter_SpawnToZone will fly to a location, hover, and spawn one vehicle on the ground, the helicopter will land
-- and the vehicle will drive to a random location within the defined zone.
-- For this, the following code is activated within the mission on waypoint 3:
--
-- local InfantryDropGroup = Spawn_Vehicle_SpawnToZone:SpawnFromUnit( GROUP:New( ... ):GetUnit(1) )
-- local InfantryDropRoute = InfantryDropGroup:CopyRoute( 1, 0 )
-- InfantryDropGroup:RouteToZone( ZONE:New( "Target Zone" ), true, 80 )
--
Spawn_Helicopter_SpawnToZone = SPAWN:New( "Spawn Helicopter SpawnToZone" )
:Limit( 10, 10 )
:SpawnScheduled( 60, 0.2 )

View File

@@ -1,27 +0,0 @@
---
-- Name: SPA-019 - Ground Ops - Randomize Templates with Waypoints
-- Author: FlightControl
-- Date Created: 24 Feb 2017
--
-- # Situation:
--
-- At Gudauta spawn multiple ground vehicles, in a scheduled fashion.
--
-- # Test cases:
--
-- 1. Observe that the ground vehicles are spawned with randomized templates.
-- 2. Observe that the ground vehicles are spread around the spawning area and are not stacked upon each other.
-- Tests Gudauta
-- -------------
-- Create a zone table of the 2 zones.
ZoneTable = { ZONE:New( "Zone1" ), ZONE:New( "Zone2" ) }
TemplateTable = { "A", "B", "C" }
Spawn_Vehicle_1 = SPAWN:New( "Spawn Vehicle 1" )
:InitLimit( 10, 10 )
:InitRandomizeTemplate( TemplateTable )
:SpawnScheduled( 5, .5 )

View File

@@ -1,139 +0,0 @@
Include.File( "Spawn" )
-- Tests Anapa: Spawn Basics
-- -------------------------
-- Spawning groups using Spawn function.
Spawn_Plane = SPAWN:New( "Spawn Plane" )
Group_Plane = Spawn_Plane:Spawn()
Spawn_Helicopter = SPAWN:New( "Spawn Helicopter" ):RandomizeRoute( 1, 1, 1000 )
Group_Helicopter = Spawn_Helicopter:Spawn()
Group_Helicopter2 = Spawn_Helicopter:Spawn()
Spawn_Ship = SPAWN:New( "Spawn Ship" ):RandomizeRoute( 0, 0, 2000 )
Group_Ship1 = Spawn_Ship:Spawn()
Group_Ship2 = Spawn_Ship:Spawn()
Spawn_Vehicle = SPAWN:New( "Spawn Vehicle" ):RandomizeRoute( 1, 0, 50 )
Group_Vehicle1 = Spawn_Vehicle:Spawn()
Group_Vehicle2 = Spawn_Vehicle:Spawn()
Group_Vehicle3 = Spawn_Vehicle:Spawn()
Group_Vehicle4 = Spawn_Vehicle:Spawn()
Group_Vehicle5 = Spawn_Vehicle:Spawn()
Group_Vehicle6 = Spawn_Vehicle:Spawn()
Group_Vehicle1:TaskRouteToZone( ZONE:New( "Landing Zone" ), true, 40, "Cone" )
-- Now land the spawned plane on to the Vinson, by copying the route of another object.
Route_Plane = GROUP:NewFromName( "Spawn Helicopter Route Copy" ):CopyRoute( 1, 0 )
Group_Plane:Route( Route_Plane )
--Route_Helicopter[#Route_Helicopter].linkUnit = Group_Ship1:GetDCSUnit(1)
--Route_Helicopter[#Route_Helicopter].helipadId = Group_Ship1:GetDCSUnit(1)
--Route_Helicopter[#Route_Helicopter].x = Group_Ship1:GetUnit(1):GetPointVec2().x
--Route_Helicopter[#Route_Helicopter].y = Group_Ship1:GetUnit(1):GetPointVec2().y
--env.info( Route_Helicopter[#Route_Helicopter].type .. " on " .. Group_Ship1:GetUnit(1):GetID() )
--Group_Helicopter:Route( Route_Helicopter )
-- Tests Batumi: Scheduled Spawning
-- --------------------------------
-- Unlimited spawning of groups, scheduled every 30 seconds ...
Spawn_Plane_Scheduled = SPAWN:New( "Spawn Plane Scheduled" ):SpawnScheduled( 30, 0.4 )
Spawn_Helicopter_Scheduled = SPAWN:New( "Spawn Helicopter Scheduled" ):SpawnScheduled( 30, 1 )
Spawn_Ship_Scheduled = SPAWN:New( "Spawn Ship Scheduled" ):SpawnScheduled( 30, 0.5 )
Spawn_Vehicle_Scheduled = SPAWN:New( "Spawn Vehicle Scheduled" ):SpawnScheduled( 30, 0.5 )
-- Tests Tbilisi: Limited Spawning
-- -------------------------------
-- Spawing one group, and respawning the same group when it lands ...
Spawn_Plane_Limited_Repeat = SPAWN:New( "Spawn Plane Limited Repeat" ):Limit( 1, 1 ):Repeat():Spawn()
Spawn_Plane_Limited_RepeatOnLanding = SPAWN:New( "Spawn Plane Limited RepeatOnLanding" ):Limit( 1, 1 ):Repeat():Spawn()
Spawn_Plane_Limited_RepeatOnEngineShutDown = SPAWN:New( "Spawn Plane Limited RepeatOnEngineShutDown" ):Limit( 1, 1 ):Repeat():Spawn()
Spawn_Helicopter_Limited_Repeat = SPAWN:New( "Spawn Helicopter Limited Repeat" ):Limit( 1, 1 ):Repeat():Spawn()
Spawn_Helicopter_Limited_RepeatOnLanding = SPAWN:New( "Spawn Helicopter Limited RepeatOnLanding" ):Limit( 1, 1 ):Repeat():Spawn()
Spawn_Helicopter_Limited_RepeatOnEngineShutDown = SPAWN:New( "Spawn Helicopter Limited RepeatOnEngineShutDown" ):Limit( 1, 1 ):Repeat():Spawn()
-- Tests Soganlug
-- --------------
-- Limited spawning of groups, scheduled every 30 seconds ...
Spawn_Plane_Limited_Scheduled = SPAWN:New( "Spawn Plane Limited Scheduled" ):Limit( 2, 10 ):SpawnScheduled( 30, 0 )
Spawn_Helicopter_Limited_Scheduled = SPAWN:New( "Spawn Helicopter Limited Scheduled" ):Limit( 2, 10 ):SpawnScheduled( 30, 0 )
Spawn_Ground_Limited_Scheduled = SPAWN:New( "Spawn Vehicle Limited Scheduled" ):Limit( 1, 20 ):SpawnScheduled( 90, 0 )
-- Tests Sukhumi
-- -------------
-- Limited spawning of groups, scheduled every seconds with route randomization.
Spawn_Plane_Limited_Scheduled_RandomizeRoute = SPAWN:New( "Spawn Plane Limited Scheduled RandomizeRoute" ):Limit( 2, 10 ):RandomizeRoute( 1, 1, 4000 ):SpawnScheduled( 30, 0 )
Spawn_Helicopter_Limited_Scheduled_RandomizeRoute = SPAWN:New( "Spawn Helicopter Limited Scheduled RandomizeRoute" ):Limit( 2, 10 ):RandomizeRoute( 1, 1, 4000 ):SpawnScheduled( 30, 0 )
Spawn_Vehicle_Limited_Scheduled_RandomizeRoute = SPAWN:New( "Spawn Vehicle Limited Scheduled RandomizeRoute" ):Limit( 10, 10 ):RandomizeRoute( 1, 1, 1000 ):SpawnScheduled( 1, 0 )
-- Tests Kutaisi
-- -------------
-- Tests the CleanUp functionality.
-- Limited spawning of groups, scheduled every 10 seconds, who are engaging into combat. Some helicopters may crash land on the ground.
-- Observe when helicopters land but are not dead and are out of the danger zone, that they get removed after a while (+/- 180 seconds) and ReSpawn.
Spawn_Helicopter_Scheduled_CleanUp = SPAWN:New( "Spawn Helicopter Scheduled CleanUp" ):Limit( 3, 100 ):RandomizeRoute( 1, 1, 1000 ):CleanUp( 180 ):SpawnScheduled( 10, 0 )
Spawn_Vehicle_Scheduled_CleanUp = SPAWN:New( "Spawn Vehicle Scheduled CleanUp" ):Limit( 3, 100 ):RandomizeRoute( 1, 1, 1000 ):SpawnScheduled( 10, 0 )
-- Maykop
-- ------
-- Creates arrays of groups ready to be spawned and dynamic spawning of groups from another group.
-- SpawnTestVisible creates an array of 200 groups, every 20 groups with 20 meters space in between, and will activate a group of the array every 10 seconds with a 0.2 time randomization.
SpawnTestVisible = SPAWN:New( "Spawn Vehicle Visible Scheduled" ):Limit( 200, 200 ):Array( 59, 20, 20, 10 ):SpawnScheduled( 10, 0.2 )
-- Spawn_Templates_Visible contains different templates...
Spawn_Templates_Visible = { "Spawn Vehicle Visible Template A",
"Spawn Vehicle Visible Template B",
"Spawn Vehicle Visible Template C",
"Spawn Vehicle Visible Template D",
"Spawn Vehicle Visible Template E",
"Spawn Vehicle Visible Template F",
"Spawn Vehicle Visible Template G",
"Spawn Vehicle Visible Template H",
"Spawn Vehicle Visible Template I",
"Spawn Vehicle Visible Template J"
}
-- Spawn_Vehicle_Visible_RandomizeTemplate_Scheduled creates an array of 40 vehicle groups, spread out by 20 groups each, with an 8 meter distance,
-- and chooses for each group from the templates specified in Spawn_Templates_Visible.
Spawn_Vehicle_Visible_RandomizeTemplate_Scheduled = SPAWN:New( "Spawn Vehicle Visible RandomizeTemplate Scheduled" )
:Limit( 80, 80 )
:RandomizeTemplate( Spawn_Templates_Visible )
:Array( 49, 20, 8, 8 )
:SpawnScheduled( 10, 0.2 )
-- Spawn_Infantry allows to spawn 10 Infantry groups.
Spawn_Infantry = SPAWN:New( "Spawn Infantry" )
:Limit( 10, 10 )
-- Spawn_Vehicle_Host reserves 10 vehicle groups, shown within an array arranged by 5 vehicles in a row with a distance of 8 meters, and schedules a vehicle each 10 seconds with a 20% variation.
Spawn_Vehicle_Host = SPAWN:New( "Spawn Vehicle Host" )
:Limit( 10, 10 )
:Array( 0, 5, 8, 8 )
:SpawnScheduled( 10, 0.2 )
-- Spawn_Vehicle_SpawnToZone allows to spawn 10 vehicle groups.
Spawn_Vehicle_SpawnToZone = SPAWN:New( "Spawn Vehicle SpawnToZone" )
:Limit( 10, 10 )
-- Spawn_Helicopter_SpawnToZone will fly to a location, hover, and spawn one vehicle on the ground, the helicopter will land
-- and the vehicle will drive to a random location within the defined zone.
-- For this, the following code is activated within the mission on waypoint 3:
--
-- local InfantryDropGroup = Spawn_Vehicle_SpawnToZone:SpawnFromUnit( GROUP:New( ... ):GetUnit(1) )
-- local InfantryDropRoute = InfantryDropGroup:CopyRoute( 1, 0 )
-- InfantryDropGroup:RouteToZone( ZONE:New( "Target Zone" ), true, 80 )
--
Spawn_Helicopter_SpawnToZone = SPAWN:New( "Spawn Helicopter SpawnToZone" )
:Limit( 10, 10 )
:SpawnScheduled( 60, 0.2 )

View File

@@ -1,29 +0,0 @@
---
-- Name: SPA-020 - Ground Ops - Randomize Templates in Random Zones without Waypoints
-- Author: FlightControl
-- Date Created: 24 Feb 2017
--
-- # Situation:
--
-- At Gudauta spawn multiple ground vehicles, in a scheduled fashion.
--
-- # Test cases:
--
-- 1. Observe that the ground vehicles are spawned with randomized templates.
-- 2. Observe that the ground vehicles are spread around the spawning area and are not stacked upon each other.
-- 3. Observe that the ground vehicles are spread over the random zones, and that the initial templates formations are kept.
-- Tests Gudauta
-- -------------
-- Create a zone table of the 2 zones.
ZoneTable = { ZONE:New( "Zone1" ), ZONE:New( "Zone2" ) }
TemplateTable = { "A", "B", "C" }
Spawn_Vehicle_1 = SPAWN:New( "Spawn Vehicle 1" )
:InitLimit( 100, 10 )
:InitRandomizeTemplate( TemplateTable )
:InitRandomizeZones( ZoneTable )
:SpawnScheduled( 5, .5 )

View File

@@ -1,139 +0,0 @@
Include.File( "Spawn" )
-- Tests Anapa: Spawn Basics
-- -------------------------
-- Spawning groups using Spawn function.
Spawn_Plane = SPAWN:New( "Spawn Plane" )
Group_Plane = Spawn_Plane:Spawn()
Spawn_Helicopter = SPAWN:New( "Spawn Helicopter" ):RandomizeRoute( 1, 1, 1000 )
Group_Helicopter = Spawn_Helicopter:Spawn()
Group_Helicopter2 = Spawn_Helicopter:Spawn()
Spawn_Ship = SPAWN:New( "Spawn Ship" ):RandomizeRoute( 0, 0, 2000 )
Group_Ship1 = Spawn_Ship:Spawn()
Group_Ship2 = Spawn_Ship:Spawn()
Spawn_Vehicle = SPAWN:New( "Spawn Vehicle" ):RandomizeRoute( 1, 0, 50 )
Group_Vehicle1 = Spawn_Vehicle:Spawn()
Group_Vehicle2 = Spawn_Vehicle:Spawn()
Group_Vehicle3 = Spawn_Vehicle:Spawn()
Group_Vehicle4 = Spawn_Vehicle:Spawn()
Group_Vehicle5 = Spawn_Vehicle:Spawn()
Group_Vehicle6 = Spawn_Vehicle:Spawn()
Group_Vehicle1:TaskRouteToZone( ZONE:New( "Landing Zone" ), true, 40, "Cone" )
-- Now land the spawned plane on to the Vinson, by copying the route of another object.
Route_Plane = GROUP:NewFromName( "Spawn Helicopter Route Copy" ):CopyRoute( 1, 0 )
Group_Plane:Route( Route_Plane )
--Route_Helicopter[#Route_Helicopter].linkUnit = Group_Ship1:GetDCSUnit(1)
--Route_Helicopter[#Route_Helicopter].helipadId = Group_Ship1:GetDCSUnit(1)
--Route_Helicopter[#Route_Helicopter].x = Group_Ship1:GetUnit(1):GetPointVec2().x
--Route_Helicopter[#Route_Helicopter].y = Group_Ship1:GetUnit(1):GetPointVec2().y
--env.info( Route_Helicopter[#Route_Helicopter].type .. " on " .. Group_Ship1:GetUnit(1):GetID() )
--Group_Helicopter:Route( Route_Helicopter )
-- Tests Batumi: Scheduled Spawning
-- --------------------------------
-- Unlimited spawning of groups, scheduled every 30 seconds ...
Spawn_Plane_Scheduled = SPAWN:New( "Spawn Plane Scheduled" ):SpawnScheduled( 30, 0.4 )
Spawn_Helicopter_Scheduled = SPAWN:New( "Spawn Helicopter Scheduled" ):SpawnScheduled( 30, 1 )
Spawn_Ship_Scheduled = SPAWN:New( "Spawn Ship Scheduled" ):SpawnScheduled( 30, 0.5 )
Spawn_Vehicle_Scheduled = SPAWN:New( "Spawn Vehicle Scheduled" ):SpawnScheduled( 30, 0.5 )
-- Tests Tbilisi: Limited Spawning
-- -------------------------------
-- Spawing one group, and respawning the same group when it lands ...
Spawn_Plane_Limited_Repeat = SPAWN:New( "Spawn Plane Limited Repeat" ):Limit( 1, 1 ):Repeat():Spawn()
Spawn_Plane_Limited_RepeatOnLanding = SPAWN:New( "Spawn Plane Limited RepeatOnLanding" ):Limit( 1, 1 ):Repeat():Spawn()
Spawn_Plane_Limited_RepeatOnEngineShutDown = SPAWN:New( "Spawn Plane Limited RepeatOnEngineShutDown" ):Limit( 1, 1 ):Repeat():Spawn()
Spawn_Helicopter_Limited_Repeat = SPAWN:New( "Spawn Helicopter Limited Repeat" ):Limit( 1, 1 ):Repeat():Spawn()
Spawn_Helicopter_Limited_RepeatOnLanding = SPAWN:New( "Spawn Helicopter Limited RepeatOnLanding" ):Limit( 1, 1 ):Repeat():Spawn()
Spawn_Helicopter_Limited_RepeatOnEngineShutDown = SPAWN:New( "Spawn Helicopter Limited RepeatOnEngineShutDown" ):Limit( 1, 1 ):Repeat():Spawn()
-- Tests Soganlug
-- --------------
-- Limited spawning of groups, scheduled every 30 seconds ...
Spawn_Plane_Limited_Scheduled = SPAWN:New( "Spawn Plane Limited Scheduled" ):Limit( 2, 10 ):SpawnScheduled( 30, 0 )
Spawn_Helicopter_Limited_Scheduled = SPAWN:New( "Spawn Helicopter Limited Scheduled" ):Limit( 2, 10 ):SpawnScheduled( 30, 0 )
Spawn_Ground_Limited_Scheduled = SPAWN:New( "Spawn Vehicle Limited Scheduled" ):Limit( 1, 20 ):SpawnScheduled( 90, 0 )
-- Tests Sukhumi
-- -------------
-- Limited spawning of groups, scheduled every seconds with route randomization.
Spawn_Plane_Limited_Scheduled_RandomizeRoute = SPAWN:New( "Spawn Plane Limited Scheduled RandomizeRoute" ):Limit( 2, 10 ):RandomizeRoute( 1, 1, 4000 ):SpawnScheduled( 30, 0 )
Spawn_Helicopter_Limited_Scheduled_RandomizeRoute = SPAWN:New( "Spawn Helicopter Limited Scheduled RandomizeRoute" ):Limit( 2, 10 ):RandomizeRoute( 1, 1, 4000 ):SpawnScheduled( 30, 0 )
Spawn_Vehicle_Limited_Scheduled_RandomizeRoute = SPAWN:New( "Spawn Vehicle Limited Scheduled RandomizeRoute" ):Limit( 10, 10 ):RandomizeRoute( 1, 1, 1000 ):SpawnScheduled( 1, 0 )
-- Tests Kutaisi
-- -------------
-- Tests the CleanUp functionality.
-- Limited spawning of groups, scheduled every 10 seconds, who are engaging into combat. Some helicopters may crash land on the ground.
-- Observe when helicopters land but are not dead and are out of the danger zone, that they get removed after a while (+/- 180 seconds) and ReSpawn.
Spawn_Helicopter_Scheduled_CleanUp = SPAWN:New( "Spawn Helicopter Scheduled CleanUp" ):Limit( 3, 100 ):RandomizeRoute( 1, 1, 1000 ):CleanUp( 180 ):SpawnScheduled( 10, 0 )
Spawn_Vehicle_Scheduled_CleanUp = SPAWN:New( "Spawn Vehicle Scheduled CleanUp" ):Limit( 3, 100 ):RandomizeRoute( 1, 1, 1000 ):SpawnScheduled( 10, 0 )
-- Maykop
-- ------
-- Creates arrays of groups ready to be spawned and dynamic spawning of groups from another group.
-- SpawnTestVisible creates an array of 200 groups, every 20 groups with 20 meters space in between, and will activate a group of the array every 10 seconds with a 0.2 time randomization.
SpawnTestVisible = SPAWN:New( "Spawn Vehicle Visible Scheduled" ):Limit( 200, 200 ):Array( 59, 20, 20, 10 ):SpawnScheduled( 10, 0.2 )
-- Spawn_Templates_Visible contains different templates...
Spawn_Templates_Visible = { "Spawn Vehicle Visible Template A",
"Spawn Vehicle Visible Template B",
"Spawn Vehicle Visible Template C",
"Spawn Vehicle Visible Template D",
"Spawn Vehicle Visible Template E",
"Spawn Vehicle Visible Template F",
"Spawn Vehicle Visible Template G",
"Spawn Vehicle Visible Template H",
"Spawn Vehicle Visible Template I",
"Spawn Vehicle Visible Template J"
}
-- Spawn_Vehicle_Visible_RandomizeTemplate_Scheduled creates an array of 40 vehicle groups, spread out by 20 groups each, with an 8 meter distance,
-- and chooses for each group from the templates specified in Spawn_Templates_Visible.
Spawn_Vehicle_Visible_RandomizeTemplate_Scheduled = SPAWN:New( "Spawn Vehicle Visible RandomizeTemplate Scheduled" )
:Limit( 80, 80 )
:RandomizeTemplate( Spawn_Templates_Visible )
:Array( 49, 20, 8, 8 )
:SpawnScheduled( 10, 0.2 )
-- Spawn_Infantry allows to spawn 10 Infantry groups.
Spawn_Infantry = SPAWN:New( "Spawn Infantry" )
:Limit( 10, 10 )
-- Spawn_Vehicle_Host reserves 10 vehicle groups, shown within an array arranged by 5 vehicles in a row with a distance of 8 meters, and schedules a vehicle each 10 seconds with a 20% variation.
Spawn_Vehicle_Host = SPAWN:New( "Spawn Vehicle Host" )
:Limit( 10, 10 )
:Array( 0, 5, 8, 8 )
:SpawnScheduled( 10, 0.2 )
-- Spawn_Vehicle_SpawnToZone allows to spawn 10 vehicle groups.
Spawn_Vehicle_SpawnToZone = SPAWN:New( "Spawn Vehicle SpawnToZone" )
:Limit( 10, 10 )
-- Spawn_Helicopter_SpawnToZone will fly to a location, hover, and spawn one vehicle on the ground, the helicopter will land
-- and the vehicle will drive to a random location within the defined zone.
-- For this, the following code is activated within the mission on waypoint 3:
--
-- local InfantryDropGroup = Spawn_Vehicle_SpawnToZone:SpawnFromUnit( GROUP:New( ... ):GetUnit(1) )
-- local InfantryDropRoute = InfantryDropGroup:CopyRoute( 1, 0 )
-- InfantryDropGroup:RouteToZone( ZONE:New( "Target Zone" ), true, 80 )
--
Spawn_Helicopter_SpawnToZone = SPAWN:New( "Spawn Helicopter SpawnToZone" )
:Limit( 10, 10 )
:SpawnScheduled( 60, 0.2 )

View File

@@ -1,27 +0,0 @@
---
-- Name: SPA-021 - Ground Ops - Scheduled Spawns Limited Keep Unit Names
-- Author: FlightControl
-- Date Created: 14 Mar 2017
--
-- # Situation:
--
-- At Gudauta spawn multiple ground vehicles, in a scheduled fashion.
--
-- # Test cases:
--
-- 1. Observe that the ground vehicles are spawned at the position declared within the mission editor.
-- 2. The vehicles should spawn according the scheduler parameters.
-- 3. There should not be more than 5 groups spawned.
-- 4. Observe the unit names, they should have the name as defined within the ME.
-- Tests Gudauta
-- -------------
Spawn_Vehicle_1 = SPAWN
:New( "Spawn Vehicle 1" )
:InitKeepUnitNames()
:InitLimit( 5, 10 )
:SpawnScheduled( 5, .5 )

View File

@@ -1,139 +0,0 @@
Include.File( "Spawn" )
-- Tests Anapa: Spawn Basics
-- -------------------------
-- Spawning groups using Spawn function.
Spawn_Plane = SPAWN:New( "Spawn Plane" )
Group_Plane = Spawn_Plane:Spawn()
Spawn_Helicopter = SPAWN:New( "Spawn Helicopter" ):RandomizeRoute( 1, 1, 1000 )
Group_Helicopter = Spawn_Helicopter:Spawn()
Group_Helicopter2 = Spawn_Helicopter:Spawn()
Spawn_Ship = SPAWN:New( "Spawn Ship" ):RandomizeRoute( 0, 0, 2000 )
Group_Ship1 = Spawn_Ship:Spawn()
Group_Ship2 = Spawn_Ship:Spawn()
Spawn_Vehicle = SPAWN:New( "Spawn Vehicle" ):RandomizeRoute( 1, 0, 50 )
Group_Vehicle1 = Spawn_Vehicle:Spawn()
Group_Vehicle2 = Spawn_Vehicle:Spawn()
Group_Vehicle3 = Spawn_Vehicle:Spawn()
Group_Vehicle4 = Spawn_Vehicle:Spawn()
Group_Vehicle5 = Spawn_Vehicle:Spawn()
Group_Vehicle6 = Spawn_Vehicle:Spawn()
Group_Vehicle1:TaskRouteToZone( ZONE:New( "Landing Zone" ), true, 40, "Cone" )
-- Now land the spawned plane on to the Vinson, by copying the route of another object.
Route_Plane = GROUP:NewFromName( "Spawn Helicopter Route Copy" ):CopyRoute( 1, 0 )
Group_Plane:Route( Route_Plane )
--Route_Helicopter[#Route_Helicopter].linkUnit = Group_Ship1:GetDCSUnit(1)
--Route_Helicopter[#Route_Helicopter].helipadId = Group_Ship1:GetDCSUnit(1)
--Route_Helicopter[#Route_Helicopter].x = Group_Ship1:GetUnit(1):GetPointVec2().x
--Route_Helicopter[#Route_Helicopter].y = Group_Ship1:GetUnit(1):GetPointVec2().y
--env.info( Route_Helicopter[#Route_Helicopter].type .. " on " .. Group_Ship1:GetUnit(1):GetID() )
--Group_Helicopter:Route( Route_Helicopter )
-- Tests Batumi: Scheduled Spawning
-- --------------------------------
-- Unlimited spawning of groups, scheduled every 30 seconds ...
Spawn_Plane_Scheduled = SPAWN:New( "Spawn Plane Scheduled" ):SpawnScheduled( 30, 0.4 )
Spawn_Helicopter_Scheduled = SPAWN:New( "Spawn Helicopter Scheduled" ):SpawnScheduled( 30, 1 )
Spawn_Ship_Scheduled = SPAWN:New( "Spawn Ship Scheduled" ):SpawnScheduled( 30, 0.5 )
Spawn_Vehicle_Scheduled = SPAWN:New( "Spawn Vehicle Scheduled" ):SpawnScheduled( 30, 0.5 )
-- Tests Tbilisi: Limited Spawning
-- -------------------------------
-- Spawing one group, and respawning the same group when it lands ...
Spawn_Plane_Limited_Repeat = SPAWN:New( "Spawn Plane Limited Repeat" ):Limit( 1, 1 ):Repeat():Spawn()
Spawn_Plane_Limited_RepeatOnLanding = SPAWN:New( "Spawn Plane Limited RepeatOnLanding" ):Limit( 1, 1 ):Repeat():Spawn()
Spawn_Plane_Limited_RepeatOnEngineShutDown = SPAWN:New( "Spawn Plane Limited RepeatOnEngineShutDown" ):Limit( 1, 1 ):Repeat():Spawn()
Spawn_Helicopter_Limited_Repeat = SPAWN:New( "Spawn Helicopter Limited Repeat" ):Limit( 1, 1 ):Repeat():Spawn()
Spawn_Helicopter_Limited_RepeatOnLanding = SPAWN:New( "Spawn Helicopter Limited RepeatOnLanding" ):Limit( 1, 1 ):Repeat():Spawn()
Spawn_Helicopter_Limited_RepeatOnEngineShutDown = SPAWN:New( "Spawn Helicopter Limited RepeatOnEngineShutDown" ):Limit( 1, 1 ):Repeat():Spawn()
-- Tests Soganlug
-- --------------
-- Limited spawning of groups, scheduled every 30 seconds ...
Spawn_Plane_Limited_Scheduled = SPAWN:New( "Spawn Plane Limited Scheduled" ):Limit( 2, 10 ):SpawnScheduled( 30, 0 )
Spawn_Helicopter_Limited_Scheduled = SPAWN:New( "Spawn Helicopter Limited Scheduled" ):Limit( 2, 10 ):SpawnScheduled( 30, 0 )
Spawn_Ground_Limited_Scheduled = SPAWN:New( "Spawn Vehicle Limited Scheduled" ):Limit( 1, 20 ):SpawnScheduled( 90, 0 )
-- Tests Sukhumi
-- -------------
-- Limited spawning of groups, scheduled every seconds with route randomization.
Spawn_Plane_Limited_Scheduled_RandomizeRoute = SPAWN:New( "Spawn Plane Limited Scheduled RandomizeRoute" ):Limit( 2, 10 ):RandomizeRoute( 1, 1, 4000 ):SpawnScheduled( 30, 0 )
Spawn_Helicopter_Limited_Scheduled_RandomizeRoute = SPAWN:New( "Spawn Helicopter Limited Scheduled RandomizeRoute" ):Limit( 2, 10 ):RandomizeRoute( 1, 1, 4000 ):SpawnScheduled( 30, 0 )
Spawn_Vehicle_Limited_Scheduled_RandomizeRoute = SPAWN:New( "Spawn Vehicle Limited Scheduled RandomizeRoute" ):Limit( 10, 10 ):RandomizeRoute( 1, 1, 1000 ):SpawnScheduled( 1, 0 )
-- Tests Kutaisi
-- -------------
-- Tests the CleanUp functionality.
-- Limited spawning of groups, scheduled every 10 seconds, who are engaging into combat. Some helicopters may crash land on the ground.
-- Observe when helicopters land but are not dead and are out of the danger zone, that they get removed after a while (+/- 180 seconds) and ReSpawn.
Spawn_Helicopter_Scheduled_CleanUp = SPAWN:New( "Spawn Helicopter Scheduled CleanUp" ):Limit( 3, 100 ):RandomizeRoute( 1, 1, 1000 ):CleanUp( 180 ):SpawnScheduled( 10, 0 )
Spawn_Vehicle_Scheduled_CleanUp = SPAWN:New( "Spawn Vehicle Scheduled CleanUp" ):Limit( 3, 100 ):RandomizeRoute( 1, 1, 1000 ):SpawnScheduled( 10, 0 )
-- Maykop
-- ------
-- Creates arrays of groups ready to be spawned and dynamic spawning of groups from another group.
-- SpawnTestVisible creates an array of 200 groups, every 20 groups with 20 meters space in between, and will activate a group of the array every 10 seconds with a 0.2 time randomization.
SpawnTestVisible = SPAWN:New( "Spawn Vehicle Visible Scheduled" ):Limit( 200, 200 ):Array( 59, 20, 20, 10 ):SpawnScheduled( 10, 0.2 )
-- Spawn_Templates_Visible contains different templates...
Spawn_Templates_Visible = { "Spawn Vehicle Visible Template A",
"Spawn Vehicle Visible Template B",
"Spawn Vehicle Visible Template C",
"Spawn Vehicle Visible Template D",
"Spawn Vehicle Visible Template E",
"Spawn Vehicle Visible Template F",
"Spawn Vehicle Visible Template G",
"Spawn Vehicle Visible Template H",
"Spawn Vehicle Visible Template I",
"Spawn Vehicle Visible Template J"
}
-- Spawn_Vehicle_Visible_RandomizeTemplate_Scheduled creates an array of 40 vehicle groups, spread out by 20 groups each, with an 8 meter distance,
-- and chooses for each group from the templates specified in Spawn_Templates_Visible.
Spawn_Vehicle_Visible_RandomizeTemplate_Scheduled = SPAWN:New( "Spawn Vehicle Visible RandomizeTemplate Scheduled" )
:Limit( 80, 80 )
:RandomizeTemplate( Spawn_Templates_Visible )
:Array( 49, 20, 8, 8 )
:SpawnScheduled( 10, 0.2 )
-- Spawn_Infantry allows to spawn 10 Infantry groups.
Spawn_Infantry = SPAWN:New( "Spawn Infantry" )
:Limit( 10, 10 )
-- Spawn_Vehicle_Host reserves 10 vehicle groups, shown within an array arranged by 5 vehicles in a row with a distance of 8 meters, and schedules a vehicle each 10 seconds with a 20% variation.
Spawn_Vehicle_Host = SPAWN:New( "Spawn Vehicle Host" )
:Limit( 10, 10 )
:Array( 0, 5, 8, 8 )
:SpawnScheduled( 10, 0.2 )
-- Spawn_Vehicle_SpawnToZone allows to spawn 10 vehicle groups.
Spawn_Vehicle_SpawnToZone = SPAWN:New( "Spawn Vehicle SpawnToZone" )
:Limit( 10, 10 )
-- Spawn_Helicopter_SpawnToZone will fly to a location, hover, and spawn one vehicle on the ground, the helicopter will land
-- and the vehicle will drive to a random location within the defined zone.
-- For this, the following code is activated within the mission on waypoint 3:
--
-- local InfantryDropGroup = Spawn_Vehicle_SpawnToZone:SpawnFromUnit( GROUP:New( ... ):GetUnit(1) )
-- local InfantryDropRoute = InfantryDropGroup:CopyRoute( 1, 0 )
-- InfantryDropGroup:RouteToZone( ZONE:New( "Target Zone" ), true, 80 )
--
Spawn_Helicopter_SpawnToZone = SPAWN:New( "Spawn Helicopter SpawnToZone" )
:Limit( 10, 10 )
:SpawnScheduled( 60, 0.2 )

View File

@@ -1,23 +0,0 @@
-- Name: SPA-022 - Ground Ops - Scheduled Spawns Limited with long interval
-- Author: FlightControl
-- Date Created: 18 Mar 2017
--
-- # Situation:
--
-- At Gudauta spawn multiple ground vehicles, in a scheduled fashion.
-- The vehicle should respawn when killed.
--
-- # Test cases:
--
-- 1. Observe that the ground vehicles are spawned at the position declared within the mission editor.
-- 2. The vehicles should spawn according the scheduler parameters.
-- Tests Gudauta
-- -------------
Spawn_Vehicle_1 = SPAWN:New( "Spawn Vehicle 1" ):InitLimit( 1, 0 ):SpawnScheduled( 30, .5 )

View File

@@ -1,139 +0,0 @@
Include.File( "Spawn" )
-- Tests Anapa: Spawn Basics
-- -------------------------
-- Spawning groups using Spawn function.
Spawn_Plane = SPAWN:New( "Spawn Plane" )
Group_Plane = Spawn_Plane:Spawn()
Spawn_Helicopter = SPAWN:New( "Spawn Helicopter" ):RandomizeRoute( 1, 1, 1000 )
Group_Helicopter = Spawn_Helicopter:Spawn()
Group_Helicopter2 = Spawn_Helicopter:Spawn()
Spawn_Ship = SPAWN:New( "Spawn Ship" ):RandomizeRoute( 0, 0, 2000 )
Group_Ship1 = Spawn_Ship:Spawn()
Group_Ship2 = Spawn_Ship:Spawn()
Spawn_Vehicle = SPAWN:New( "Spawn Vehicle" ):RandomizeRoute( 1, 0, 50 )
Group_Vehicle1 = Spawn_Vehicle:Spawn()
Group_Vehicle2 = Spawn_Vehicle:Spawn()
Group_Vehicle3 = Spawn_Vehicle:Spawn()
Group_Vehicle4 = Spawn_Vehicle:Spawn()
Group_Vehicle5 = Spawn_Vehicle:Spawn()
Group_Vehicle6 = Spawn_Vehicle:Spawn()
Group_Vehicle1:TaskRouteToZone( ZONE:New( "Landing Zone" ), true, 40, "Cone" )
-- Now land the spawned plane on to the Vinson, by copying the route of another object.
Route_Plane = GROUP:NewFromName( "Spawn Helicopter Route Copy" ):CopyRoute( 1, 0 )
Group_Plane:Route( Route_Plane )
--Route_Helicopter[#Route_Helicopter].linkUnit = Group_Ship1:GetDCSUnit(1)
--Route_Helicopter[#Route_Helicopter].helipadId = Group_Ship1:GetDCSUnit(1)
--Route_Helicopter[#Route_Helicopter].x = Group_Ship1:GetUnit(1):GetPointVec2().x
--Route_Helicopter[#Route_Helicopter].y = Group_Ship1:GetUnit(1):GetPointVec2().y
--env.info( Route_Helicopter[#Route_Helicopter].type .. " on " .. Group_Ship1:GetUnit(1):GetID() )
--Group_Helicopter:Route( Route_Helicopter )
-- Tests Batumi: Scheduled Spawning
-- --------------------------------
-- Unlimited spawning of groups, scheduled every 30 seconds ...
Spawn_Plane_Scheduled = SPAWN:New( "Spawn Plane Scheduled" ):SpawnScheduled( 30, 0.4 )
Spawn_Helicopter_Scheduled = SPAWN:New( "Spawn Helicopter Scheduled" ):SpawnScheduled( 30, 1 )
Spawn_Ship_Scheduled = SPAWN:New( "Spawn Ship Scheduled" ):SpawnScheduled( 30, 0.5 )
Spawn_Vehicle_Scheduled = SPAWN:New( "Spawn Vehicle Scheduled" ):SpawnScheduled( 30, 0.5 )
-- Tests Tbilisi: Limited Spawning
-- -------------------------------
-- Spawing one group, and respawning the same group when it lands ...
Spawn_Plane_Limited_Repeat = SPAWN:New( "Spawn Plane Limited Repeat" ):Limit( 1, 1 ):Repeat():Spawn()
Spawn_Plane_Limited_RepeatOnLanding = SPAWN:New( "Spawn Plane Limited RepeatOnLanding" ):Limit( 1, 1 ):Repeat():Spawn()
Spawn_Plane_Limited_RepeatOnEngineShutDown = SPAWN:New( "Spawn Plane Limited RepeatOnEngineShutDown" ):Limit( 1, 1 ):Repeat():Spawn()
Spawn_Helicopter_Limited_Repeat = SPAWN:New( "Spawn Helicopter Limited Repeat" ):Limit( 1, 1 ):Repeat():Spawn()
Spawn_Helicopter_Limited_RepeatOnLanding = SPAWN:New( "Spawn Helicopter Limited RepeatOnLanding" ):Limit( 1, 1 ):Repeat():Spawn()
Spawn_Helicopter_Limited_RepeatOnEngineShutDown = SPAWN:New( "Spawn Helicopter Limited RepeatOnEngineShutDown" ):Limit( 1, 1 ):Repeat():Spawn()
-- Tests Soganlug
-- --------------
-- Limited spawning of groups, scheduled every 30 seconds ...
Spawn_Plane_Limited_Scheduled = SPAWN:New( "Spawn Plane Limited Scheduled" ):Limit( 2, 10 ):SpawnScheduled( 30, 0 )
Spawn_Helicopter_Limited_Scheduled = SPAWN:New( "Spawn Helicopter Limited Scheduled" ):Limit( 2, 10 ):SpawnScheduled( 30, 0 )
Spawn_Ground_Limited_Scheduled = SPAWN:New( "Spawn Vehicle Limited Scheduled" ):Limit( 1, 20 ):SpawnScheduled( 90, 0 )
-- Tests Sukhumi
-- -------------
-- Limited spawning of groups, scheduled every seconds with route randomization.
Spawn_Plane_Limited_Scheduled_RandomizeRoute = SPAWN:New( "Spawn Plane Limited Scheduled RandomizeRoute" ):Limit( 2, 10 ):RandomizeRoute( 1, 1, 4000 ):SpawnScheduled( 30, 0 )
Spawn_Helicopter_Limited_Scheduled_RandomizeRoute = SPAWN:New( "Spawn Helicopter Limited Scheduled RandomizeRoute" ):Limit( 2, 10 ):RandomizeRoute( 1, 1, 4000 ):SpawnScheduled( 30, 0 )
Spawn_Vehicle_Limited_Scheduled_RandomizeRoute = SPAWN:New( "Spawn Vehicle Limited Scheduled RandomizeRoute" ):Limit( 10, 10 ):RandomizeRoute( 1, 1, 1000 ):SpawnScheduled( 1, 0 )
-- Tests Kutaisi
-- -------------
-- Tests the CleanUp functionality.
-- Limited spawning of groups, scheduled every 10 seconds, who are engaging into combat. Some helicopters may crash land on the ground.
-- Observe when helicopters land but are not dead and are out of the danger zone, that they get removed after a while (+/- 180 seconds) and ReSpawn.
Spawn_Helicopter_Scheduled_CleanUp = SPAWN:New( "Spawn Helicopter Scheduled CleanUp" ):Limit( 3, 100 ):RandomizeRoute( 1, 1, 1000 ):CleanUp( 180 ):SpawnScheduled( 10, 0 )
Spawn_Vehicle_Scheduled_CleanUp = SPAWN:New( "Spawn Vehicle Scheduled CleanUp" ):Limit( 3, 100 ):RandomizeRoute( 1, 1, 1000 ):SpawnScheduled( 10, 0 )
-- Maykop
-- ------
-- Creates arrays of groups ready to be spawned and dynamic spawning of groups from another group.
-- SpawnTestVisible creates an array of 200 groups, every 20 groups with 20 meters space in between, and will activate a group of the array every 10 seconds with a 0.2 time randomization.
SpawnTestVisible = SPAWN:New( "Spawn Vehicle Visible Scheduled" ):Limit( 200, 200 ):Array( 59, 20, 20, 10 ):SpawnScheduled( 10, 0.2 )
-- Spawn_Templates_Visible contains different templates...
Spawn_Templates_Visible = { "Spawn Vehicle Visible Template A",
"Spawn Vehicle Visible Template B",
"Spawn Vehicle Visible Template C",
"Spawn Vehicle Visible Template D",
"Spawn Vehicle Visible Template E",
"Spawn Vehicle Visible Template F",
"Spawn Vehicle Visible Template G",
"Spawn Vehicle Visible Template H",
"Spawn Vehicle Visible Template I",
"Spawn Vehicle Visible Template J"
}
-- Spawn_Vehicle_Visible_RandomizeTemplate_Scheduled creates an array of 40 vehicle groups, spread out by 20 groups each, with an 8 meter distance,
-- and chooses for each group from the templates specified in Spawn_Templates_Visible.
Spawn_Vehicle_Visible_RandomizeTemplate_Scheduled = SPAWN:New( "Spawn Vehicle Visible RandomizeTemplate Scheduled" )
:Limit( 80, 80 )
:RandomizeTemplate( Spawn_Templates_Visible )
:Array( 49, 20, 8, 8 )
:SpawnScheduled( 10, 0.2 )
-- Spawn_Infantry allows to spawn 10 Infantry groups.
Spawn_Infantry = SPAWN:New( "Spawn Infantry" )
:Limit( 10, 10 )
-- Spawn_Vehicle_Host reserves 10 vehicle groups, shown within an array arranged by 5 vehicles in a row with a distance of 8 meters, and schedules a vehicle each 10 seconds with a 20% variation.
Spawn_Vehicle_Host = SPAWN:New( "Spawn Vehicle Host" )
:Limit( 10, 10 )
:Array( 0, 5, 8, 8 )
:SpawnScheduled( 10, 0.2 )
-- Spawn_Vehicle_SpawnToZone allows to spawn 10 vehicle groups.
Spawn_Vehicle_SpawnToZone = SPAWN:New( "Spawn Vehicle SpawnToZone" )
:Limit( 10, 10 )
-- Spawn_Helicopter_SpawnToZone will fly to a location, hover, and spawn one vehicle on the ground, the helicopter will land
-- and the vehicle will drive to a random location within the defined zone.
-- For this, the following code is activated within the mission on waypoint 3:
--
-- local InfantryDropGroup = Spawn_Vehicle_SpawnToZone:SpawnFromUnit( GROUP:New( ... ):GetUnit(1) )
-- local InfantryDropRoute = InfantryDropGroup:CopyRoute( 1, 0 )
-- InfantryDropGroup:RouteToZone( ZONE:New( "Target Zone" ), true, 80 )
--
Spawn_Helicopter_SpawnToZone = SPAWN:New( "Spawn Helicopter SpawnToZone" )
:Limit( 10, 10 )
:SpawnScheduled( 60, 0.2 )

View File

@@ -1,26 +0,0 @@
---
-- Name: SPA-023 - Ground Ops - SpawnStart and SpawnStop
-- Author: FlightControl
-- Date Created: 10 Jan 2017
--
-- # Situation:
--
-- At Gudauta spawn multiple ground vehicles, in a scheduled fashion.
-- The schedule is immediately stopped and started.
--
-- # Test cases:
--
-- 1. Observe that the ground vehicles are spawned at the position declared within the mission editor.
-- 2. The vehicles should spawn according the scheduler parameters.
-- Tests Gudauta
-- -------------
Spawn_Vehicle = SPAWN:New( "Spawn Vehicle 1" ):SpawnScheduled( 10, 0.5 ):SpawnScheduleStop()
Spawn_Vehicle:SpawnScheduleStart()

View File

@@ -1,139 +0,0 @@
Include.File( "Spawn" )
-- Tests Anapa: Spawn Basics
-- -------------------------
-- Spawning groups using Spawn function.
Spawn_Plane = SPAWN:New( "Spawn Plane" )
Group_Plane = Spawn_Plane:Spawn()
Spawn_Helicopter = SPAWN:New( "Spawn Helicopter" ):RandomizeRoute( 1, 1, 1000 )
Group_Helicopter = Spawn_Helicopter:Spawn()
Group_Helicopter2 = Spawn_Helicopter:Spawn()
Spawn_Ship = SPAWN:New( "Spawn Ship" ):RandomizeRoute( 0, 0, 2000 )
Group_Ship1 = Spawn_Ship:Spawn()
Group_Ship2 = Spawn_Ship:Spawn()
Spawn_Vehicle = SPAWN:New( "Spawn Vehicle" ):RandomizeRoute( 1, 0, 50 )
Group_Vehicle1 = Spawn_Vehicle:Spawn()
Group_Vehicle2 = Spawn_Vehicle:Spawn()
Group_Vehicle3 = Spawn_Vehicle:Spawn()
Group_Vehicle4 = Spawn_Vehicle:Spawn()
Group_Vehicle5 = Spawn_Vehicle:Spawn()
Group_Vehicle6 = Spawn_Vehicle:Spawn()
Group_Vehicle1:TaskRouteToZone( ZONE:New( "Landing Zone" ), true, 40, "Cone" )
-- Now land the spawned plane on to the Vinson, by copying the route of another object.
Route_Plane = GROUP:NewFromName( "Spawn Helicopter Route Copy" ):CopyRoute( 1, 0 )
Group_Plane:Route( Route_Plane )
--Route_Helicopter[#Route_Helicopter].linkUnit = Group_Ship1:GetDCSUnit(1)
--Route_Helicopter[#Route_Helicopter].helipadId = Group_Ship1:GetDCSUnit(1)
--Route_Helicopter[#Route_Helicopter].x = Group_Ship1:GetUnit(1):GetPointVec2().x
--Route_Helicopter[#Route_Helicopter].y = Group_Ship1:GetUnit(1):GetPointVec2().y
--env.info( Route_Helicopter[#Route_Helicopter].type .. " on " .. Group_Ship1:GetUnit(1):GetID() )
--Group_Helicopter:Route( Route_Helicopter )
-- Tests Batumi: Scheduled Spawning
-- --------------------------------
-- Unlimited spawning of groups, scheduled every 30 seconds ...
Spawn_Plane_Scheduled = SPAWN:New( "Spawn Plane Scheduled" ):SpawnScheduled( 30, 0.4 )
Spawn_Helicopter_Scheduled = SPAWN:New( "Spawn Helicopter Scheduled" ):SpawnScheduled( 30, 1 )
Spawn_Ship_Scheduled = SPAWN:New( "Spawn Ship Scheduled" ):SpawnScheduled( 30, 0.5 )
Spawn_Vehicle_Scheduled = SPAWN:New( "Spawn Vehicle Scheduled" ):SpawnScheduled( 30, 0.5 )
-- Tests Tbilisi: Limited Spawning
-- -------------------------------
-- Spawing one group, and respawning the same group when it lands ...
Spawn_Plane_Limited_Repeat = SPAWN:New( "Spawn Plane Limited Repeat" ):Limit( 1, 1 ):Repeat():Spawn()
Spawn_Plane_Limited_RepeatOnLanding = SPAWN:New( "Spawn Plane Limited RepeatOnLanding" ):Limit( 1, 1 ):Repeat():Spawn()
Spawn_Plane_Limited_RepeatOnEngineShutDown = SPAWN:New( "Spawn Plane Limited RepeatOnEngineShutDown" ):Limit( 1, 1 ):Repeat():Spawn()
Spawn_Helicopter_Limited_Repeat = SPAWN:New( "Spawn Helicopter Limited Repeat" ):Limit( 1, 1 ):Repeat():Spawn()
Spawn_Helicopter_Limited_RepeatOnLanding = SPAWN:New( "Spawn Helicopter Limited RepeatOnLanding" ):Limit( 1, 1 ):Repeat():Spawn()
Spawn_Helicopter_Limited_RepeatOnEngineShutDown = SPAWN:New( "Spawn Helicopter Limited RepeatOnEngineShutDown" ):Limit( 1, 1 ):Repeat():Spawn()
-- Tests Soganlug
-- --------------
-- Limited spawning of groups, scheduled every 30 seconds ...
Spawn_Plane_Limited_Scheduled = SPAWN:New( "Spawn Plane Limited Scheduled" ):Limit( 2, 10 ):SpawnScheduled( 30, 0 )
Spawn_Helicopter_Limited_Scheduled = SPAWN:New( "Spawn Helicopter Limited Scheduled" ):Limit( 2, 10 ):SpawnScheduled( 30, 0 )
Spawn_Ground_Limited_Scheduled = SPAWN:New( "Spawn Vehicle Limited Scheduled" ):Limit( 1, 20 ):SpawnScheduled( 90, 0 )
-- Tests Sukhumi
-- -------------
-- Limited spawning of groups, scheduled every seconds with route randomization.
Spawn_Plane_Limited_Scheduled_RandomizeRoute = SPAWN:New( "Spawn Plane Limited Scheduled RandomizeRoute" ):Limit( 2, 10 ):RandomizeRoute( 1, 1, 4000 ):SpawnScheduled( 30, 0 )
Spawn_Helicopter_Limited_Scheduled_RandomizeRoute = SPAWN:New( "Spawn Helicopter Limited Scheduled RandomizeRoute" ):Limit( 2, 10 ):RandomizeRoute( 1, 1, 4000 ):SpawnScheduled( 30, 0 )
Spawn_Vehicle_Limited_Scheduled_RandomizeRoute = SPAWN:New( "Spawn Vehicle Limited Scheduled RandomizeRoute" ):Limit( 10, 10 ):RandomizeRoute( 1, 1, 1000 ):SpawnScheduled( 1, 0 )
-- Tests Kutaisi
-- -------------
-- Tests the CleanUp functionality.
-- Limited spawning of groups, scheduled every 10 seconds, who are engaging into combat. Some helicopters may crash land on the ground.
-- Observe when helicopters land but are not dead and are out of the danger zone, that they get removed after a while (+/- 180 seconds) and ReSpawn.
Spawn_Helicopter_Scheduled_CleanUp = SPAWN:New( "Spawn Helicopter Scheduled CleanUp" ):Limit( 3, 100 ):RandomizeRoute( 1, 1, 1000 ):CleanUp( 180 ):SpawnScheduled( 10, 0 )
Spawn_Vehicle_Scheduled_CleanUp = SPAWN:New( "Spawn Vehicle Scheduled CleanUp" ):Limit( 3, 100 ):RandomizeRoute( 1, 1, 1000 ):SpawnScheduled( 10, 0 )
-- Maykop
-- ------
-- Creates arrays of groups ready to be spawned and dynamic spawning of groups from another group.
-- SpawnTestVisible creates an array of 200 groups, every 20 groups with 20 meters space in between, and will activate a group of the array every 10 seconds with a 0.2 time randomization.
SpawnTestVisible = SPAWN:New( "Spawn Vehicle Visible Scheduled" ):Limit( 200, 200 ):Array( 59, 20, 20, 10 ):SpawnScheduled( 10, 0.2 )
-- Spawn_Templates_Visible contains different templates...
Spawn_Templates_Visible = { "Spawn Vehicle Visible Template A",
"Spawn Vehicle Visible Template B",
"Spawn Vehicle Visible Template C",
"Spawn Vehicle Visible Template D",
"Spawn Vehicle Visible Template E",
"Spawn Vehicle Visible Template F",
"Spawn Vehicle Visible Template G",
"Spawn Vehicle Visible Template H",
"Spawn Vehicle Visible Template I",
"Spawn Vehicle Visible Template J"
}
-- Spawn_Vehicle_Visible_RandomizeTemplate_Scheduled creates an array of 40 vehicle groups, spread out by 20 groups each, with an 8 meter distance,
-- and chooses for each group from the templates specified in Spawn_Templates_Visible.
Spawn_Vehicle_Visible_RandomizeTemplate_Scheduled = SPAWN:New( "Spawn Vehicle Visible RandomizeTemplate Scheduled" )
:Limit( 80, 80 )
:RandomizeTemplate( Spawn_Templates_Visible )
:Array( 49, 20, 8, 8 )
:SpawnScheduled( 10, 0.2 )
-- Spawn_Infantry allows to spawn 10 Infantry groups.
Spawn_Infantry = SPAWN:New( "Spawn Infantry" )
:Limit( 10, 10 )
-- Spawn_Vehicle_Host reserves 10 vehicle groups, shown within an array arranged by 5 vehicles in a row with a distance of 8 meters, and schedules a vehicle each 10 seconds with a 20% variation.
Spawn_Vehicle_Host = SPAWN:New( "Spawn Vehicle Host" )
:Limit( 10, 10 )
:Array( 0, 5, 8, 8 )
:SpawnScheduled( 10, 0.2 )
-- Spawn_Vehicle_SpawnToZone allows to spawn 10 vehicle groups.
Spawn_Vehicle_SpawnToZone = SPAWN:New( "Spawn Vehicle SpawnToZone" )
:Limit( 10, 10 )
-- Spawn_Helicopter_SpawnToZone will fly to a location, hover, and spawn one vehicle on the ground, the helicopter will land
-- and the vehicle will drive to a random location within the defined zone.
-- For this, the following code is activated within the mission on waypoint 3:
--
-- local InfantryDropGroup = Spawn_Vehicle_SpawnToZone:SpawnFromUnit( GROUP:New( ... ):GetUnit(1) )
-- local InfantryDropRoute = InfantryDropGroup:CopyRoute( 1, 0 )
-- InfantryDropGroup:RouteToZone( ZONE:New( "Target Zone" ), true, 80 )
--
Spawn_Helicopter_SpawnToZone = SPAWN:New( "Spawn Helicopter SpawnToZone" )
:Limit( 10, 10 )
:SpawnScheduled( 60, 0.2 )

View File

@@ -1,27 +0,0 @@
---
-- Name: SPA-024 - Ground Ops - Arrays
-- Author: FlightControl
-- Date Created: 19 Jul 2017
--
-- # Situation:
--
-- At Gudauta spawn multiple ground vehicles, in an array.
--
-- # Test cases:
--
-- 1. Observe that the ground vehicles are spawned at the position declared within the mission editor.
-- 2. The vehicles should spawn according the array parameters.
-- Tests Gudauta
-- -------------
Spawn_Vehicle = SPAWN
:New( "Spawn Vehicles" )
:InitLimit( 12, 60 )
:InitArray( 90, 10, 10, 10 )

View File

@@ -1,139 +0,0 @@
Include.File( "Spawn" )
-- Tests Anapa: Spawn Basics
-- -------------------------
-- Spawning groups using Spawn function.
Spawn_Plane = SPAWN:New( "Spawn Plane" )
Group_Plane = Spawn_Plane:Spawn()
Spawn_Helicopter = SPAWN:New( "Spawn Helicopter" ):RandomizeRoute( 1, 1, 1000 )
Group_Helicopter = Spawn_Helicopter:Spawn()
Group_Helicopter2 = Spawn_Helicopter:Spawn()
Spawn_Ship = SPAWN:New( "Spawn Ship" ):RandomizeRoute( 0, 0, 2000 )
Group_Ship1 = Spawn_Ship:Spawn()
Group_Ship2 = Spawn_Ship:Spawn()
Spawn_Vehicle = SPAWN:New( "Spawn Vehicle" ):RandomizeRoute( 1, 0, 50 )
Group_Vehicle1 = Spawn_Vehicle:Spawn()
Group_Vehicle2 = Spawn_Vehicle:Spawn()
Group_Vehicle3 = Spawn_Vehicle:Spawn()
Group_Vehicle4 = Spawn_Vehicle:Spawn()
Group_Vehicle5 = Spawn_Vehicle:Spawn()
Group_Vehicle6 = Spawn_Vehicle:Spawn()
Group_Vehicle1:TaskRouteToZone( ZONE:New( "Landing Zone" ), true, 40, "Cone" )
-- Now land the spawned plane on to the Vinson, by copying the route of another object.
Route_Plane = GROUP:NewFromName( "Spawn Helicopter Route Copy" ):CopyRoute( 1, 0 )
Group_Plane:Route( Route_Plane )
--Route_Helicopter[#Route_Helicopter].linkUnit = Group_Ship1:GetDCSUnit(1)
--Route_Helicopter[#Route_Helicopter].helipadId = Group_Ship1:GetDCSUnit(1)
--Route_Helicopter[#Route_Helicopter].x = Group_Ship1:GetUnit(1):GetPointVec2().x
--Route_Helicopter[#Route_Helicopter].y = Group_Ship1:GetUnit(1):GetPointVec2().y
--env.info( Route_Helicopter[#Route_Helicopter].type .. " on " .. Group_Ship1:GetUnit(1):GetID() )
--Group_Helicopter:Route( Route_Helicopter )
-- Tests Batumi: Scheduled Spawning
-- --------------------------------
-- Unlimited spawning of groups, scheduled every 30 seconds ...
Spawn_Plane_Scheduled = SPAWN:New( "Spawn Plane Scheduled" ):SpawnScheduled( 30, 0.4 )
Spawn_Helicopter_Scheduled = SPAWN:New( "Spawn Helicopter Scheduled" ):SpawnScheduled( 30, 1 )
Spawn_Ship_Scheduled = SPAWN:New( "Spawn Ship Scheduled" ):SpawnScheduled( 30, 0.5 )
Spawn_Vehicle_Scheduled = SPAWN:New( "Spawn Vehicle Scheduled" ):SpawnScheduled( 30, 0.5 )
-- Tests Tbilisi: Limited Spawning
-- -------------------------------
-- Spawing one group, and respawning the same group when it lands ...
Spawn_Plane_Limited_Repeat = SPAWN:New( "Spawn Plane Limited Repeat" ):Limit( 1, 1 ):Repeat():Spawn()
Spawn_Plane_Limited_RepeatOnLanding = SPAWN:New( "Spawn Plane Limited RepeatOnLanding" ):Limit( 1, 1 ):Repeat():Spawn()
Spawn_Plane_Limited_RepeatOnEngineShutDown = SPAWN:New( "Spawn Plane Limited RepeatOnEngineShutDown" ):Limit( 1, 1 ):Repeat():Spawn()
Spawn_Helicopter_Limited_Repeat = SPAWN:New( "Spawn Helicopter Limited Repeat" ):Limit( 1, 1 ):Repeat():Spawn()
Spawn_Helicopter_Limited_RepeatOnLanding = SPAWN:New( "Spawn Helicopter Limited RepeatOnLanding" ):Limit( 1, 1 ):Repeat():Spawn()
Spawn_Helicopter_Limited_RepeatOnEngineShutDown = SPAWN:New( "Spawn Helicopter Limited RepeatOnEngineShutDown" ):Limit( 1, 1 ):Repeat():Spawn()
-- Tests Soganlug
-- --------------
-- Limited spawning of groups, scheduled every 30 seconds ...
Spawn_Plane_Limited_Scheduled = SPAWN:New( "Spawn Plane Limited Scheduled" ):Limit( 2, 10 ):SpawnScheduled( 30, 0 )
Spawn_Helicopter_Limited_Scheduled = SPAWN:New( "Spawn Helicopter Limited Scheduled" ):Limit( 2, 10 ):SpawnScheduled( 30, 0 )
Spawn_Ground_Limited_Scheduled = SPAWN:New( "Spawn Vehicle Limited Scheduled" ):Limit( 1, 20 ):SpawnScheduled( 90, 0 )
-- Tests Sukhumi
-- -------------
-- Limited spawning of groups, scheduled every seconds with route randomization.
Spawn_Plane_Limited_Scheduled_RandomizeRoute = SPAWN:New( "Spawn Plane Limited Scheduled RandomizeRoute" ):Limit( 2, 10 ):RandomizeRoute( 1, 1, 4000 ):SpawnScheduled( 30, 0 )
Spawn_Helicopter_Limited_Scheduled_RandomizeRoute = SPAWN:New( "Spawn Helicopter Limited Scheduled RandomizeRoute" ):Limit( 2, 10 ):RandomizeRoute( 1, 1, 4000 ):SpawnScheduled( 30, 0 )
Spawn_Vehicle_Limited_Scheduled_RandomizeRoute = SPAWN:New( "Spawn Vehicle Limited Scheduled RandomizeRoute" ):Limit( 10, 10 ):RandomizeRoute( 1, 1, 1000 ):SpawnScheduled( 1, 0 )
-- Tests Kutaisi
-- -------------
-- Tests the CleanUp functionality.
-- Limited spawning of groups, scheduled every 10 seconds, who are engaging into combat. Some helicopters may crash land on the ground.
-- Observe when helicopters land but are not dead and are out of the danger zone, that they get removed after a while (+/- 180 seconds) and ReSpawn.
Spawn_Helicopter_Scheduled_CleanUp = SPAWN:New( "Spawn Helicopter Scheduled CleanUp" ):Limit( 3, 100 ):RandomizeRoute( 1, 1, 1000 ):CleanUp( 180 ):SpawnScheduled( 10, 0 )
Spawn_Vehicle_Scheduled_CleanUp = SPAWN:New( "Spawn Vehicle Scheduled CleanUp" ):Limit( 3, 100 ):RandomizeRoute( 1, 1, 1000 ):SpawnScheduled( 10, 0 )
-- Maykop
-- ------
-- Creates arrays of groups ready to be spawned and dynamic spawning of groups from another group.
-- SpawnTestVisible creates an array of 200 groups, every 20 groups with 20 meters space in between, and will activate a group of the array every 10 seconds with a 0.2 time randomization.
SpawnTestVisible = SPAWN:New( "Spawn Vehicle Visible Scheduled" ):Limit( 200, 200 ):Array( 59, 20, 20, 10 ):SpawnScheduled( 10, 0.2 )
-- Spawn_Templates_Visible contains different templates...
Spawn_Templates_Visible = { "Spawn Vehicle Visible Template A",
"Spawn Vehicle Visible Template B",
"Spawn Vehicle Visible Template C",
"Spawn Vehicle Visible Template D",
"Spawn Vehicle Visible Template E",
"Spawn Vehicle Visible Template F",
"Spawn Vehicle Visible Template G",
"Spawn Vehicle Visible Template H",
"Spawn Vehicle Visible Template I",
"Spawn Vehicle Visible Template J"
}
-- Spawn_Vehicle_Visible_RandomizeTemplate_Scheduled creates an array of 40 vehicle groups, spread out by 20 groups each, with an 8 meter distance,
-- and chooses for each group from the templates specified in Spawn_Templates_Visible.
Spawn_Vehicle_Visible_RandomizeTemplate_Scheduled = SPAWN:New( "Spawn Vehicle Visible RandomizeTemplate Scheduled" )
:Limit( 80, 80 )
:RandomizeTemplate( Spawn_Templates_Visible )
:Array( 49, 20, 8, 8 )
:SpawnScheduled( 10, 0.2 )
-- Spawn_Infantry allows to spawn 10 Infantry groups.
Spawn_Infantry = SPAWN:New( "Spawn Infantry" )
:Limit( 10, 10 )
-- Spawn_Vehicle_Host reserves 10 vehicle groups, shown within an array arranged by 5 vehicles in a row with a distance of 8 meters, and schedules a vehicle each 10 seconds with a 20% variation.
Spawn_Vehicle_Host = SPAWN:New( "Spawn Vehicle Host" )
:Limit( 10, 10 )
:Array( 0, 5, 8, 8 )
:SpawnScheduled( 10, 0.2 )
-- Spawn_Vehicle_SpawnToZone allows to spawn 10 vehicle groups.
Spawn_Vehicle_SpawnToZone = SPAWN:New( "Spawn Vehicle SpawnToZone" )
:Limit( 10, 10 )
-- Spawn_Helicopter_SpawnToZone will fly to a location, hover, and spawn one vehicle on the ground, the helicopter will land
-- and the vehicle will drive to a random location within the defined zone.
-- For this, the following code is activated within the mission on waypoint 3:
--
-- local InfantryDropGroup = Spawn_Vehicle_SpawnToZone:SpawnFromUnit( GROUP:New( ... ):GetUnit(1) )
-- local InfantryDropRoute = InfantryDropGroup:CopyRoute( 1, 0 )
-- InfantryDropGroup:RouteToZone( ZONE:New( "Target Zone" ), true, 80 )
--
Spawn_Helicopter_SpawnToZone = SPAWN:New( "Spawn Helicopter SpawnToZone" )
:Limit( 10, 10 )
:SpawnScheduled( 60, 0.2 )

View File

@@ -1,27 +0,0 @@
---
-- Name: SPA-024 - Ground Ops - Arrays
-- Author: FlightControl
-- Date Created: 19 Jul 2017
--
-- # Situation:
--
-- At Gudauta spawn multiple ground vehicles, in an array.
--
-- # Test cases:
--
-- 1. Observe that the ground vehicles are spawned at the position declared within the mission editor.
-- 2. The vehicles should spawn according the array parameters.
-- Tests Gudauta
-- -------------
Spawn_Vehicle = SPAWN
:New( "Spawn Vehicles" )
:InitLimit( 12, 60 )
:InitArray( 90, 10, 10, 10 )

View File

@@ -1,139 +0,0 @@
Include.File( "Spawn" )
-- Tests Anapa: Spawn Basics
-- -------------------------
-- Spawning groups using Spawn function.
Spawn_Plane = SPAWN:New( "Spawn Plane" )
Group_Plane = Spawn_Plane:Spawn()
Spawn_Helicopter = SPAWN:New( "Spawn Helicopter" ):RandomizeRoute( 1, 1, 1000 )
Group_Helicopter = Spawn_Helicopter:Spawn()
Group_Helicopter2 = Spawn_Helicopter:Spawn()
Spawn_Ship = SPAWN:New( "Spawn Ship" ):RandomizeRoute( 0, 0, 2000 )
Group_Ship1 = Spawn_Ship:Spawn()
Group_Ship2 = Spawn_Ship:Spawn()
Spawn_Vehicle = SPAWN:New( "Spawn Vehicle" ):RandomizeRoute( 1, 0, 50 )
Group_Vehicle1 = Spawn_Vehicle:Spawn()
Group_Vehicle2 = Spawn_Vehicle:Spawn()
Group_Vehicle3 = Spawn_Vehicle:Spawn()
Group_Vehicle4 = Spawn_Vehicle:Spawn()
Group_Vehicle5 = Spawn_Vehicle:Spawn()
Group_Vehicle6 = Spawn_Vehicle:Spawn()
Group_Vehicle1:TaskRouteToZone( ZONE:New( "Landing Zone" ), true, 40, "Cone" )
-- Now land the spawned plane on to the Vinson, by copying the route of another object.
Route_Plane = GROUP:NewFromName( "Spawn Helicopter Route Copy" ):CopyRoute( 1, 0 )
Group_Plane:Route( Route_Plane )
--Route_Helicopter[#Route_Helicopter].linkUnit = Group_Ship1:GetDCSUnit(1)
--Route_Helicopter[#Route_Helicopter].helipadId = Group_Ship1:GetDCSUnit(1)
--Route_Helicopter[#Route_Helicopter].x = Group_Ship1:GetUnit(1):GetPointVec2().x
--Route_Helicopter[#Route_Helicopter].y = Group_Ship1:GetUnit(1):GetPointVec2().y
--env.info( Route_Helicopter[#Route_Helicopter].type .. " on " .. Group_Ship1:GetUnit(1):GetID() )
--Group_Helicopter:Route( Route_Helicopter )
-- Tests Batumi: Scheduled Spawning
-- --------------------------------
-- Unlimited spawning of groups, scheduled every 30 seconds ...
Spawn_Plane_Scheduled = SPAWN:New( "Spawn Plane Scheduled" ):SpawnScheduled( 30, 0.4 )
Spawn_Helicopter_Scheduled = SPAWN:New( "Spawn Helicopter Scheduled" ):SpawnScheduled( 30, 1 )
Spawn_Ship_Scheduled = SPAWN:New( "Spawn Ship Scheduled" ):SpawnScheduled( 30, 0.5 )
Spawn_Vehicle_Scheduled = SPAWN:New( "Spawn Vehicle Scheduled" ):SpawnScheduled( 30, 0.5 )
-- Tests Tbilisi: Limited Spawning
-- -------------------------------
-- Spawing one group, and respawning the same group when it lands ...
Spawn_Plane_Limited_Repeat = SPAWN:New( "Spawn Plane Limited Repeat" ):Limit( 1, 1 ):Repeat():Spawn()
Spawn_Plane_Limited_RepeatOnLanding = SPAWN:New( "Spawn Plane Limited RepeatOnLanding" ):Limit( 1, 1 ):Repeat():Spawn()
Spawn_Plane_Limited_RepeatOnEngineShutDown = SPAWN:New( "Spawn Plane Limited RepeatOnEngineShutDown" ):Limit( 1, 1 ):Repeat():Spawn()
Spawn_Helicopter_Limited_Repeat = SPAWN:New( "Spawn Helicopter Limited Repeat" ):Limit( 1, 1 ):Repeat():Spawn()
Spawn_Helicopter_Limited_RepeatOnLanding = SPAWN:New( "Spawn Helicopter Limited RepeatOnLanding" ):Limit( 1, 1 ):Repeat():Spawn()
Spawn_Helicopter_Limited_RepeatOnEngineShutDown = SPAWN:New( "Spawn Helicopter Limited RepeatOnEngineShutDown" ):Limit( 1, 1 ):Repeat():Spawn()
-- Tests Soganlug
-- --------------
-- Limited spawning of groups, scheduled every 30 seconds ...
Spawn_Plane_Limited_Scheduled = SPAWN:New( "Spawn Plane Limited Scheduled" ):Limit( 2, 10 ):SpawnScheduled( 30, 0 )
Spawn_Helicopter_Limited_Scheduled = SPAWN:New( "Spawn Helicopter Limited Scheduled" ):Limit( 2, 10 ):SpawnScheduled( 30, 0 )
Spawn_Ground_Limited_Scheduled = SPAWN:New( "Spawn Vehicle Limited Scheduled" ):Limit( 1, 20 ):SpawnScheduled( 90, 0 )
-- Tests Sukhumi
-- -------------
-- Limited spawning of groups, scheduled every seconds with route randomization.
Spawn_Plane_Limited_Scheduled_RandomizeRoute = SPAWN:New( "Spawn Plane Limited Scheduled RandomizeRoute" ):Limit( 2, 10 ):RandomizeRoute( 1, 1, 4000 ):SpawnScheduled( 30, 0 )
Spawn_Helicopter_Limited_Scheduled_RandomizeRoute = SPAWN:New( "Spawn Helicopter Limited Scheduled RandomizeRoute" ):Limit( 2, 10 ):RandomizeRoute( 1, 1, 4000 ):SpawnScheduled( 30, 0 )
Spawn_Vehicle_Limited_Scheduled_RandomizeRoute = SPAWN:New( "Spawn Vehicle Limited Scheduled RandomizeRoute" ):Limit( 10, 10 ):RandomizeRoute( 1, 1, 1000 ):SpawnScheduled( 1, 0 )
-- Tests Kutaisi
-- -------------
-- Tests the CleanUp functionality.
-- Limited spawning of groups, scheduled every 10 seconds, who are engaging into combat. Some helicopters may crash land on the ground.
-- Observe when helicopters land but are not dead and are out of the danger zone, that they get removed after a while (+/- 180 seconds) and ReSpawn.
Spawn_Helicopter_Scheduled_CleanUp = SPAWN:New( "Spawn Helicopter Scheduled CleanUp" ):Limit( 3, 100 ):RandomizeRoute( 1, 1, 1000 ):CleanUp( 180 ):SpawnScheduled( 10, 0 )
Spawn_Vehicle_Scheduled_CleanUp = SPAWN:New( "Spawn Vehicle Scheduled CleanUp" ):Limit( 3, 100 ):RandomizeRoute( 1, 1, 1000 ):SpawnScheduled( 10, 0 )
-- Maykop
-- ------
-- Creates arrays of groups ready to be spawned and dynamic spawning of groups from another group.
-- SpawnTestVisible creates an array of 200 groups, every 20 groups with 20 meters space in between, and will activate a group of the array every 10 seconds with a 0.2 time randomization.
SpawnTestVisible = SPAWN:New( "Spawn Vehicle Visible Scheduled" ):Limit( 200, 200 ):Array( 59, 20, 20, 10 ):SpawnScheduled( 10, 0.2 )
-- Spawn_Templates_Visible contains different templates...
Spawn_Templates_Visible = { "Spawn Vehicle Visible Template A",
"Spawn Vehicle Visible Template B",
"Spawn Vehicle Visible Template C",
"Spawn Vehicle Visible Template D",
"Spawn Vehicle Visible Template E",
"Spawn Vehicle Visible Template F",
"Spawn Vehicle Visible Template G",
"Spawn Vehicle Visible Template H",
"Spawn Vehicle Visible Template I",
"Spawn Vehicle Visible Template J"
}
-- Spawn_Vehicle_Visible_RandomizeTemplate_Scheduled creates an array of 40 vehicle groups, spread out by 20 groups each, with an 8 meter distance,
-- and chooses for each group from the templates specified in Spawn_Templates_Visible.
Spawn_Vehicle_Visible_RandomizeTemplate_Scheduled = SPAWN:New( "Spawn Vehicle Visible RandomizeTemplate Scheduled" )
:Limit( 80, 80 )
:RandomizeTemplate( Spawn_Templates_Visible )
:Array( 49, 20, 8, 8 )
:SpawnScheduled( 10, 0.2 )
-- Spawn_Infantry allows to spawn 10 Infantry groups.
Spawn_Infantry = SPAWN:New( "Spawn Infantry" )
:Limit( 10, 10 )
-- Spawn_Vehicle_Host reserves 10 vehicle groups, shown within an array arranged by 5 vehicles in a row with a distance of 8 meters, and schedules a vehicle each 10 seconds with a 20% variation.
Spawn_Vehicle_Host = SPAWN:New( "Spawn Vehicle Host" )
:Limit( 10, 10 )
:Array( 0, 5, 8, 8 )
:SpawnScheduled( 10, 0.2 )
-- Spawn_Vehicle_SpawnToZone allows to spawn 10 vehicle groups.
Spawn_Vehicle_SpawnToZone = SPAWN:New( "Spawn Vehicle SpawnToZone" )
:Limit( 10, 10 )
-- Spawn_Helicopter_SpawnToZone will fly to a location, hover, and spawn one vehicle on the ground, the helicopter will land
-- and the vehicle will drive to a random location within the defined zone.
-- For this, the following code is activated within the mission on waypoint 3:
--
-- local InfantryDropGroup = Spawn_Vehicle_SpawnToZone:SpawnFromUnit( GROUP:New( ... ):GetUnit(1) )
-- local InfantryDropRoute = InfantryDropGroup:CopyRoute( 1, 0 )
-- InfantryDropGroup:RouteToZone( ZONE:New( "Target Zone" ), true, 80 )
--
Spawn_Helicopter_SpawnToZone = SPAWN:New( "Spawn Helicopter SpawnToZone" )
:Limit( 10, 10 )
:SpawnScheduled( 60, 0.2 )

View File

@@ -1,22 +0,0 @@
-- Name: SPA-025 - Ground Ops - Spawn Hidden
-- Author: FlightControl
-- Date Created: 06 Sep 2017
--
-- # Situation:
--
-- At Gudauta spawn a ground vehicle, hidden
--
-- # Test cases:
--
-- 1. Observe that the ground vehicle is spawned and his hidden.
-- Tests Gudauta
-- -------------
-- Spawn a gound vehicle...
Spawn_Vehicle_1 = SPAWN:New( "Spawn Vehicle 1" )
Spawn_Group_1 = Spawn_Vehicle_1:Spawn()

View File

@@ -1,139 +0,0 @@
Include.File( "Spawn" )
-- Tests Anapa: Spawn Basics
-- -------------------------
-- Spawning groups using Spawn function.
Spawn_Plane = SPAWN:New( "Spawn Plane" )
Group_Plane = Spawn_Plane:Spawn()
Spawn_Helicopter = SPAWN:New( "Spawn Helicopter" ):RandomizeRoute( 1, 1, 1000 )
Group_Helicopter = Spawn_Helicopter:Spawn()
Group_Helicopter2 = Spawn_Helicopter:Spawn()
Spawn_Ship = SPAWN:New( "Spawn Ship" ):RandomizeRoute( 0, 0, 2000 )
Group_Ship1 = Spawn_Ship:Spawn()
Group_Ship2 = Spawn_Ship:Spawn()
Spawn_Vehicle = SPAWN:New( "Spawn Vehicle" ):RandomizeRoute( 1, 0, 50 )
Group_Vehicle1 = Spawn_Vehicle:Spawn()
Group_Vehicle2 = Spawn_Vehicle:Spawn()
Group_Vehicle3 = Spawn_Vehicle:Spawn()
Group_Vehicle4 = Spawn_Vehicle:Spawn()
Group_Vehicle5 = Spawn_Vehicle:Spawn()
Group_Vehicle6 = Spawn_Vehicle:Spawn()
Group_Vehicle1:TaskRouteToZone( ZONE:New( "Landing Zone" ), true, 40, "Cone" )
-- Now land the spawned plane on to the Vinson, by copying the route of another object.
Route_Plane = GROUP:NewFromName( "Spawn Helicopter Route Copy" ):CopyRoute( 1, 0 )
Group_Plane:Route( Route_Plane )
--Route_Helicopter[#Route_Helicopter].linkUnit = Group_Ship1:GetDCSUnit(1)
--Route_Helicopter[#Route_Helicopter].helipadId = Group_Ship1:GetDCSUnit(1)
--Route_Helicopter[#Route_Helicopter].x = Group_Ship1:GetUnit(1):GetPointVec2().x
--Route_Helicopter[#Route_Helicopter].y = Group_Ship1:GetUnit(1):GetPointVec2().y
--env.info( Route_Helicopter[#Route_Helicopter].type .. " on " .. Group_Ship1:GetUnit(1):GetID() )
--Group_Helicopter:Route( Route_Helicopter )
-- Tests Batumi: Scheduled Spawning
-- --------------------------------
-- Unlimited spawning of groups, scheduled every 30 seconds ...
Spawn_Plane_Scheduled = SPAWN:New( "Spawn Plane Scheduled" ):SpawnScheduled( 30, 0.4 )
Spawn_Helicopter_Scheduled = SPAWN:New( "Spawn Helicopter Scheduled" ):SpawnScheduled( 30, 1 )
Spawn_Ship_Scheduled = SPAWN:New( "Spawn Ship Scheduled" ):SpawnScheduled( 30, 0.5 )
Spawn_Vehicle_Scheduled = SPAWN:New( "Spawn Vehicle Scheduled" ):SpawnScheduled( 30, 0.5 )
-- Tests Tbilisi: Limited Spawning
-- -------------------------------
-- Spawing one group, and respawning the same group when it lands ...
Spawn_Plane_Limited_Repeat = SPAWN:New( "Spawn Plane Limited Repeat" ):Limit( 1, 1 ):Repeat():Spawn()
Spawn_Plane_Limited_RepeatOnLanding = SPAWN:New( "Spawn Plane Limited RepeatOnLanding" ):Limit( 1, 1 ):Repeat():Spawn()
Spawn_Plane_Limited_RepeatOnEngineShutDown = SPAWN:New( "Spawn Plane Limited RepeatOnEngineShutDown" ):Limit( 1, 1 ):Repeat():Spawn()
Spawn_Helicopter_Limited_Repeat = SPAWN:New( "Spawn Helicopter Limited Repeat" ):Limit( 1, 1 ):Repeat():Spawn()
Spawn_Helicopter_Limited_RepeatOnLanding = SPAWN:New( "Spawn Helicopter Limited RepeatOnLanding" ):Limit( 1, 1 ):Repeat():Spawn()
Spawn_Helicopter_Limited_RepeatOnEngineShutDown = SPAWN:New( "Spawn Helicopter Limited RepeatOnEngineShutDown" ):Limit( 1, 1 ):Repeat():Spawn()
-- Tests Soganlug
-- --------------
-- Limited spawning of groups, scheduled every 30 seconds ...
Spawn_Plane_Limited_Scheduled = SPAWN:New( "Spawn Plane Limited Scheduled" ):Limit( 2, 10 ):SpawnScheduled( 30, 0 )
Spawn_Helicopter_Limited_Scheduled = SPAWN:New( "Spawn Helicopter Limited Scheduled" ):Limit( 2, 10 ):SpawnScheduled( 30, 0 )
Spawn_Ground_Limited_Scheduled = SPAWN:New( "Spawn Vehicle Limited Scheduled" ):Limit( 1, 20 ):SpawnScheduled( 90, 0 )
-- Tests Sukhumi
-- -------------
-- Limited spawning of groups, scheduled every seconds with route randomization.
Spawn_Plane_Limited_Scheduled_RandomizeRoute = SPAWN:New( "Spawn Plane Limited Scheduled RandomizeRoute" ):Limit( 2, 10 ):RandomizeRoute( 1, 1, 4000 ):SpawnScheduled( 30, 0 )
Spawn_Helicopter_Limited_Scheduled_RandomizeRoute = SPAWN:New( "Spawn Helicopter Limited Scheduled RandomizeRoute" ):Limit( 2, 10 ):RandomizeRoute( 1, 1, 4000 ):SpawnScheduled( 30, 0 )
Spawn_Vehicle_Limited_Scheduled_RandomizeRoute = SPAWN:New( "Spawn Vehicle Limited Scheduled RandomizeRoute" ):Limit( 10, 10 ):RandomizeRoute( 1, 1, 1000 ):SpawnScheduled( 1, 0 )
-- Tests Kutaisi
-- -------------
-- Tests the CleanUp functionality.
-- Limited spawning of groups, scheduled every 10 seconds, who are engaging into combat. Some helicopters may crash land on the ground.
-- Observe when helicopters land but are not dead and are out of the danger zone, that they get removed after a while (+/- 180 seconds) and ReSpawn.
Spawn_Helicopter_Scheduled_CleanUp = SPAWN:New( "Spawn Helicopter Scheduled CleanUp" ):Limit( 3, 100 ):RandomizeRoute( 1, 1, 1000 ):CleanUp( 180 ):SpawnScheduled( 10, 0 )
Spawn_Vehicle_Scheduled_CleanUp = SPAWN:New( "Spawn Vehicle Scheduled CleanUp" ):Limit( 3, 100 ):RandomizeRoute( 1, 1, 1000 ):SpawnScheduled( 10, 0 )
-- Maykop
-- ------
-- Creates arrays of groups ready to be spawned and dynamic spawning of groups from another group.
-- SpawnTestVisible creates an array of 200 groups, every 20 groups with 20 meters space in between, and will activate a group of the array every 10 seconds with a 0.2 time randomization.
SpawnTestVisible = SPAWN:New( "Spawn Vehicle Visible Scheduled" ):Limit( 200, 200 ):Array( 59, 20, 20, 10 ):SpawnScheduled( 10, 0.2 )
-- Spawn_Templates_Visible contains different templates...
Spawn_Templates_Visible = { "Spawn Vehicle Visible Template A",
"Spawn Vehicle Visible Template B",
"Spawn Vehicle Visible Template C",
"Spawn Vehicle Visible Template D",
"Spawn Vehicle Visible Template E",
"Spawn Vehicle Visible Template F",
"Spawn Vehicle Visible Template G",
"Spawn Vehicle Visible Template H",
"Spawn Vehicle Visible Template I",
"Spawn Vehicle Visible Template J"
}
-- Spawn_Vehicle_Visible_RandomizeTemplate_Scheduled creates an array of 40 vehicle groups, spread out by 20 groups each, with an 8 meter distance,
-- and chooses for each group from the templates specified in Spawn_Templates_Visible.
Spawn_Vehicle_Visible_RandomizeTemplate_Scheduled = SPAWN:New( "Spawn Vehicle Visible RandomizeTemplate Scheduled" )
:Limit( 80, 80 )
:RandomizeTemplate( Spawn_Templates_Visible )
:Array( 49, 20, 8, 8 )
:SpawnScheduled( 10, 0.2 )
-- Spawn_Infantry allows to spawn 10 Infantry groups.
Spawn_Infantry = SPAWN:New( "Spawn Infantry" )
:Limit( 10, 10 )
-- Spawn_Vehicle_Host reserves 10 vehicle groups, shown within an array arranged by 5 vehicles in a row with a distance of 8 meters, and schedules a vehicle each 10 seconds with a 20% variation.
Spawn_Vehicle_Host = SPAWN:New( "Spawn Vehicle Host" )
:Limit( 10, 10 )
:Array( 0, 5, 8, 8 )
:SpawnScheduled( 10, 0.2 )
-- Spawn_Vehicle_SpawnToZone allows to spawn 10 vehicle groups.
Spawn_Vehicle_SpawnToZone = SPAWN:New( "Spawn Vehicle SpawnToZone" )
:Limit( 10, 10 )
-- Spawn_Helicopter_SpawnToZone will fly to a location, hover, and spawn one vehicle on the ground, the helicopter will land
-- and the vehicle will drive to a random location within the defined zone.
-- For this, the following code is activated within the mission on waypoint 3:
--
-- local InfantryDropGroup = Spawn_Vehicle_SpawnToZone:SpawnFromUnit( GROUP:New( ... ):GetUnit(1) )
-- local InfantryDropRoute = InfantryDropGroup:CopyRoute( 1, 0 )
-- InfantryDropGroup:RouteToZone( ZONE:New( "Target Zone" ), true, 80 )
--
Spawn_Helicopter_SpawnToZone = SPAWN:New( "Spawn Helicopter SpawnToZone" )
:Limit( 10, 10 )
:SpawnScheduled( 60, 0.2 )

View File

@@ -1,26 +0,0 @@
-- Name: SPA-026 - Ground Ops - Spawn RandomizeTemplate Hidden
-- Author: FlightControl
-- Date Created: 06 Sep 2017
--
-- # Situation:
--
-- At Gudauta spawn a ground vehicle, hidden, based on a randomized template.
--
-- # Test cases:
--
-- 1. Observe that a random ground vehicle is spawned and his hidden.
-- Tests Gudauta
-- -------------
-- Spawn a gound vehicle...
Templates = { "A", "B" }
Spawn_Vehicle_1 = SPAWN:New( "Vehicle" )
Spawn_Vehicle_1:InitRandomizeTemplate( Templates )
Spawn_Group_1 = Spawn_Vehicle_1:Spawn()

View File

@@ -1,139 +0,0 @@
Include.File( "Spawn" )
-- Tests Anapa: Spawn Basics
-- -------------------------
-- Spawning groups using Spawn function.
Spawn_Plane = SPAWN:New( "Spawn Plane" )
Group_Plane = Spawn_Plane:Spawn()
Spawn_Helicopter = SPAWN:New( "Spawn Helicopter" ):RandomizeRoute( 1, 1, 1000 )
Group_Helicopter = Spawn_Helicopter:Spawn()
Group_Helicopter2 = Spawn_Helicopter:Spawn()
Spawn_Ship = SPAWN:New( "Spawn Ship" ):RandomizeRoute( 0, 0, 2000 )
Group_Ship1 = Spawn_Ship:Spawn()
Group_Ship2 = Spawn_Ship:Spawn()
Spawn_Vehicle = SPAWN:New( "Spawn Vehicle" ):RandomizeRoute( 1, 0, 50 )
Group_Vehicle1 = Spawn_Vehicle:Spawn()
Group_Vehicle2 = Spawn_Vehicle:Spawn()
Group_Vehicle3 = Spawn_Vehicle:Spawn()
Group_Vehicle4 = Spawn_Vehicle:Spawn()
Group_Vehicle5 = Spawn_Vehicle:Spawn()
Group_Vehicle6 = Spawn_Vehicle:Spawn()
Group_Vehicle1:TaskRouteToZone( ZONE:New( "Landing Zone" ), true, 40, "Cone" )
-- Now land the spawned plane on to the Vinson, by copying the route of another object.
Route_Plane = GROUP:NewFromName( "Spawn Helicopter Route Copy" ):CopyRoute( 1, 0 )
Group_Plane:Route( Route_Plane )
--Route_Helicopter[#Route_Helicopter].linkUnit = Group_Ship1:GetDCSUnit(1)
--Route_Helicopter[#Route_Helicopter].helipadId = Group_Ship1:GetDCSUnit(1)
--Route_Helicopter[#Route_Helicopter].x = Group_Ship1:GetUnit(1):GetPointVec2().x
--Route_Helicopter[#Route_Helicopter].y = Group_Ship1:GetUnit(1):GetPointVec2().y
--env.info( Route_Helicopter[#Route_Helicopter].type .. " on " .. Group_Ship1:GetUnit(1):GetID() )
--Group_Helicopter:Route( Route_Helicopter )
-- Tests Batumi: Scheduled Spawning
-- --------------------------------
-- Unlimited spawning of groups, scheduled every 30 seconds ...
Spawn_Plane_Scheduled = SPAWN:New( "Spawn Plane Scheduled" ):SpawnScheduled( 30, 0.4 )
Spawn_Helicopter_Scheduled = SPAWN:New( "Spawn Helicopter Scheduled" ):SpawnScheduled( 30, 1 )
Spawn_Ship_Scheduled = SPAWN:New( "Spawn Ship Scheduled" ):SpawnScheduled( 30, 0.5 )
Spawn_Vehicle_Scheduled = SPAWN:New( "Spawn Vehicle Scheduled" ):SpawnScheduled( 30, 0.5 )
-- Tests Tbilisi: Limited Spawning
-- -------------------------------
-- Spawing one group, and respawning the same group when it lands ...
Spawn_Plane_Limited_Repeat = SPAWN:New( "Spawn Plane Limited Repeat" ):Limit( 1, 1 ):Repeat():Spawn()
Spawn_Plane_Limited_RepeatOnLanding = SPAWN:New( "Spawn Plane Limited RepeatOnLanding" ):Limit( 1, 1 ):Repeat():Spawn()
Spawn_Plane_Limited_RepeatOnEngineShutDown = SPAWN:New( "Spawn Plane Limited RepeatOnEngineShutDown" ):Limit( 1, 1 ):Repeat():Spawn()
Spawn_Helicopter_Limited_Repeat = SPAWN:New( "Spawn Helicopter Limited Repeat" ):Limit( 1, 1 ):Repeat():Spawn()
Spawn_Helicopter_Limited_RepeatOnLanding = SPAWN:New( "Spawn Helicopter Limited RepeatOnLanding" ):Limit( 1, 1 ):Repeat():Spawn()
Spawn_Helicopter_Limited_RepeatOnEngineShutDown = SPAWN:New( "Spawn Helicopter Limited RepeatOnEngineShutDown" ):Limit( 1, 1 ):Repeat():Spawn()
-- Tests Soganlug
-- --------------
-- Limited spawning of groups, scheduled every 30 seconds ...
Spawn_Plane_Limited_Scheduled = SPAWN:New( "Spawn Plane Limited Scheduled" ):Limit( 2, 10 ):SpawnScheduled( 30, 0 )
Spawn_Helicopter_Limited_Scheduled = SPAWN:New( "Spawn Helicopter Limited Scheduled" ):Limit( 2, 10 ):SpawnScheduled( 30, 0 )
Spawn_Ground_Limited_Scheduled = SPAWN:New( "Spawn Vehicle Limited Scheduled" ):Limit( 1, 20 ):SpawnScheduled( 90, 0 )
-- Tests Sukhumi
-- -------------
-- Limited spawning of groups, scheduled every seconds with route randomization.
Spawn_Plane_Limited_Scheduled_RandomizeRoute = SPAWN:New( "Spawn Plane Limited Scheduled RandomizeRoute" ):Limit( 2, 10 ):RandomizeRoute( 1, 1, 4000 ):SpawnScheduled( 30, 0 )
Spawn_Helicopter_Limited_Scheduled_RandomizeRoute = SPAWN:New( "Spawn Helicopter Limited Scheduled RandomizeRoute" ):Limit( 2, 10 ):RandomizeRoute( 1, 1, 4000 ):SpawnScheduled( 30, 0 )
Spawn_Vehicle_Limited_Scheduled_RandomizeRoute = SPAWN:New( "Spawn Vehicle Limited Scheduled RandomizeRoute" ):Limit( 10, 10 ):RandomizeRoute( 1, 1, 1000 ):SpawnScheduled( 1, 0 )
-- Tests Kutaisi
-- -------------
-- Tests the CleanUp functionality.
-- Limited spawning of groups, scheduled every 10 seconds, who are engaging into combat. Some helicopters may crash land on the ground.
-- Observe when helicopters land but are not dead and are out of the danger zone, that they get removed after a while (+/- 180 seconds) and ReSpawn.
Spawn_Helicopter_Scheduled_CleanUp = SPAWN:New( "Spawn Helicopter Scheduled CleanUp" ):Limit( 3, 100 ):RandomizeRoute( 1, 1, 1000 ):CleanUp( 180 ):SpawnScheduled( 10, 0 )
Spawn_Vehicle_Scheduled_CleanUp = SPAWN:New( "Spawn Vehicle Scheduled CleanUp" ):Limit( 3, 100 ):RandomizeRoute( 1, 1, 1000 ):SpawnScheduled( 10, 0 )
-- Maykop
-- ------
-- Creates arrays of groups ready to be spawned and dynamic spawning of groups from another group.
-- SpawnTestVisible creates an array of 200 groups, every 20 groups with 20 meters space in between, and will activate a group of the array every 10 seconds with a 0.2 time randomization.
SpawnTestVisible = SPAWN:New( "Spawn Vehicle Visible Scheduled" ):Limit( 200, 200 ):Array( 59, 20, 20, 10 ):SpawnScheduled( 10, 0.2 )
-- Spawn_Templates_Visible contains different templates...
Spawn_Templates_Visible = { "Spawn Vehicle Visible Template A",
"Spawn Vehicle Visible Template B",
"Spawn Vehicle Visible Template C",
"Spawn Vehicle Visible Template D",
"Spawn Vehicle Visible Template E",
"Spawn Vehicle Visible Template F",
"Spawn Vehicle Visible Template G",
"Spawn Vehicle Visible Template H",
"Spawn Vehicle Visible Template I",
"Spawn Vehicle Visible Template J"
}
-- Spawn_Vehicle_Visible_RandomizeTemplate_Scheduled creates an array of 40 vehicle groups, spread out by 20 groups each, with an 8 meter distance,
-- and chooses for each group from the templates specified in Spawn_Templates_Visible.
Spawn_Vehicle_Visible_RandomizeTemplate_Scheduled = SPAWN:New( "Spawn Vehicle Visible RandomizeTemplate Scheduled" )
:Limit( 80, 80 )
:RandomizeTemplate( Spawn_Templates_Visible )
:Array( 49, 20, 8, 8 )
:SpawnScheduled( 10, 0.2 )
-- Spawn_Infantry allows to spawn 10 Infantry groups.
Spawn_Infantry = SPAWN:New( "Spawn Infantry" )
:Limit( 10, 10 )
-- Spawn_Vehicle_Host reserves 10 vehicle groups, shown within an array arranged by 5 vehicles in a row with a distance of 8 meters, and schedules a vehicle each 10 seconds with a 20% variation.
Spawn_Vehicle_Host = SPAWN:New( "Spawn Vehicle Host" )
:Limit( 10, 10 )
:Array( 0, 5, 8, 8 )
:SpawnScheduled( 10, 0.2 )
-- Spawn_Vehicle_SpawnToZone allows to spawn 10 vehicle groups.
Spawn_Vehicle_SpawnToZone = SPAWN:New( "Spawn Vehicle SpawnToZone" )
:Limit( 10, 10 )
-- Spawn_Helicopter_SpawnToZone will fly to a location, hover, and spawn one vehicle on the ground, the helicopter will land
-- and the vehicle will drive to a random location within the defined zone.
-- For this, the following code is activated within the mission on waypoint 3:
--
-- local InfantryDropGroup = Spawn_Vehicle_SpawnToZone:SpawnFromUnit( GROUP:New( ... ):GetUnit(1) )
-- local InfantryDropRoute = InfantryDropGroup:CopyRoute( 1, 0 )
-- InfantryDropGroup:RouteToZone( ZONE:New( "Target Zone" ), true, 80 )
--
Spawn_Helicopter_SpawnToZone = SPAWN:New( "Spawn Helicopter SpawnToZone" )
:Limit( 10, 10 )
:SpawnScheduled( 60, 0.2 )

View File

@@ -1,25 +0,0 @@
-- Name: SPA-027 - Ground Ops - Respawning After Destroy
-- Author: FlightControl
-- Date Created: 10 Dec 2017
--
-- At Gudauta spawns ground vehicle, in a scheduled fashion.
-- There can only be a maximum of 2 grond vehicles alive.
-- When a ground vehicle is destroyed, a new one needs to be spawned at a different location in the zone.
-- Until that one is also destroyed.
--
-- Red is attacking the spawned blue vehicles.
-- Once blue is destroyed, a new blue needs to spawn.
-- Until all 10 blue vehicles are spawned.
-- The position of blue is randomized in the zone.
-- Blue has ROE hold weapons.
--
BlueVehicleSpawn = SPAWN
:New( "Tank" )
:InitLimit( 2, 10 )
:InitRandomizePosition( true, 200, 50 )
:SpawnScheduled( 5, .5 )

View File

@@ -1,8 +0,0 @@
-- Tests Kutaisi
-- -------------
-- Tests the CleanUp functionality.
-- Limited spawning of groups, scheduled every 10 seconds, who are engaging into combat. Some helicopters may crash land on the ground.
-- Observe when helicopters land but are not dead and are out of the danger zone, that they get removed after a while (+/- 180 seconds) and ReSpawn.
Spawn_Helicopter_Scheduled_CleanUp = SPAWN:New( "Spawn Helicopter Scheduled CleanUp" ):InitLimit( 3, 100 ):InitRandomizeRoute( 1, 1, 1000 ):InitCleanUp( 60 ):SpawnScheduled( 10, 0 )
Spawn_Vehicle_Scheduled_CleanUp = SPAWN:New( "Spawn Vehicle Scheduled CleanUp" ):InitLimit( 3, 100 ):InitRandomizeRoute( 1, 1, 1000 ):SpawnScheduled( 10, 0 )

View File

@@ -1,139 +0,0 @@
Include.File( "Spawn" )
-- Tests Anapa: Spawn Basics
-- -------------------------
-- Spawning groups using Spawn function.
Spawn_Plane = SPAWN:New( "Spawn Plane" )
Group_Plane = Spawn_Plane:Spawn()
Spawn_Helicopter = SPAWN:New( "Spawn Helicopter" ):RandomizeRoute( 1, 1, 1000 )
Group_Helicopter = Spawn_Helicopter:Spawn()
Group_Helicopter2 = Spawn_Helicopter:Spawn()
Spawn_Ship = SPAWN:New( "Spawn Ship" ):RandomizeRoute( 0, 0, 2000 )
Group_Ship1 = Spawn_Ship:Spawn()
Group_Ship2 = Spawn_Ship:Spawn()
Spawn_Vehicle = SPAWN:New( "Spawn Vehicle" ):RandomizeRoute( 1, 0, 50 )
Group_Vehicle1 = Spawn_Vehicle:Spawn()
Group_Vehicle2 = Spawn_Vehicle:Spawn()
Group_Vehicle3 = Spawn_Vehicle:Spawn()
Group_Vehicle4 = Spawn_Vehicle:Spawn()
Group_Vehicle5 = Spawn_Vehicle:Spawn()
Group_Vehicle6 = Spawn_Vehicle:Spawn()
Group_Vehicle1:TaskRouteToZone( ZONE:New( "Landing Zone" ), true, 40, "Cone" )
-- Now land the spawned plane on to the Vinson, by copying the route of another object.
Route_Plane = GROUP:NewFromName( "Spawn Helicopter Route Copy" ):CopyRoute( 1, 0 )
Group_Plane:Route( Route_Plane )
--Route_Helicopter[#Route_Helicopter].linkUnit = Group_Ship1:GetDCSUnit(1)
--Route_Helicopter[#Route_Helicopter].helipadId = Group_Ship1:GetDCSUnit(1)
--Route_Helicopter[#Route_Helicopter].x = Group_Ship1:GetUnit(1):GetPointVec2().x
--Route_Helicopter[#Route_Helicopter].y = Group_Ship1:GetUnit(1):GetPointVec2().y
--env.info( Route_Helicopter[#Route_Helicopter].type .. " on " .. Group_Ship1:GetUnit(1):GetID() )
--Group_Helicopter:Route( Route_Helicopter )
-- Tests Batumi: Scheduled Spawning
-- --------------------------------
-- Unlimited spawning of groups, scheduled every 30 seconds ...
Spawn_Plane_Scheduled = SPAWN:New( "Spawn Plane Scheduled" ):SpawnScheduled( 30, 0.4 )
Spawn_Helicopter_Scheduled = SPAWN:New( "Spawn Helicopter Scheduled" ):SpawnScheduled( 30, 1 )
Spawn_Ship_Scheduled = SPAWN:New( "Spawn Ship Scheduled" ):SpawnScheduled( 30, 0.5 )
Spawn_Vehicle_Scheduled = SPAWN:New( "Spawn Vehicle Scheduled" ):SpawnScheduled( 30, 0.5 )
-- Tests Tbilisi: Limited Spawning
-- -------------------------------
-- Spawing one group, and respawning the same group when it lands ...
Spawn_Plane_Limited_Repeat = SPAWN:New( "Spawn Plane Limited Repeat" ):Limit( 1, 1 ):Repeat():Spawn()
Spawn_Plane_Limited_RepeatOnLanding = SPAWN:New( "Spawn Plane Limited RepeatOnLanding" ):Limit( 1, 1 ):Repeat():Spawn()
Spawn_Plane_Limited_RepeatOnEngineShutDown = SPAWN:New( "Spawn Plane Limited RepeatOnEngineShutDown" ):Limit( 1, 1 ):Repeat():Spawn()
Spawn_Helicopter_Limited_Repeat = SPAWN:New( "Spawn Helicopter Limited Repeat" ):Limit( 1, 1 ):Repeat():Spawn()
Spawn_Helicopter_Limited_RepeatOnLanding = SPAWN:New( "Spawn Helicopter Limited RepeatOnLanding" ):Limit( 1, 1 ):Repeat():Spawn()
Spawn_Helicopter_Limited_RepeatOnEngineShutDown = SPAWN:New( "Spawn Helicopter Limited RepeatOnEngineShutDown" ):Limit( 1, 1 ):Repeat():Spawn()
-- Tests Soganlug
-- --------------
-- Limited spawning of groups, scheduled every 30 seconds ...
Spawn_Plane_Limited_Scheduled = SPAWN:New( "Spawn Plane Limited Scheduled" ):Limit( 2, 10 ):SpawnScheduled( 30, 0 )
Spawn_Helicopter_Limited_Scheduled = SPAWN:New( "Spawn Helicopter Limited Scheduled" ):Limit( 2, 10 ):SpawnScheduled( 30, 0 )
Spawn_Ground_Limited_Scheduled = SPAWN:New( "Spawn Vehicle Limited Scheduled" ):Limit( 1, 20 ):SpawnScheduled( 90, 0 )
-- Tests Sukhumi
-- -------------
-- Limited spawning of groups, scheduled every seconds with route randomization.
Spawn_Plane_Limited_Scheduled_RandomizeRoute = SPAWN:New( "Spawn Plane Limited Scheduled RandomizeRoute" ):Limit( 2, 10 ):RandomizeRoute( 1, 1, 4000 ):SpawnScheduled( 30, 0 )
Spawn_Helicopter_Limited_Scheduled_RandomizeRoute = SPAWN:New( "Spawn Helicopter Limited Scheduled RandomizeRoute" ):Limit( 2, 10 ):RandomizeRoute( 1, 1, 4000 ):SpawnScheduled( 30, 0 )
Spawn_Vehicle_Limited_Scheduled_RandomizeRoute = SPAWN:New( "Spawn Vehicle Limited Scheduled RandomizeRoute" ):Limit( 10, 10 ):RandomizeRoute( 1, 1, 1000 ):SpawnScheduled( 1, 0 )
-- Tests Kutaisi
-- -------------
-- Tests the CleanUp functionality.
-- Limited spawning of groups, scheduled every 10 seconds, who are engaging into combat. Some helicopters may crash land on the ground.
-- Observe when helicopters land but are not dead and are out of the danger zone, that they get removed after a while (+/- 180 seconds) and ReSpawn.
Spawn_Helicopter_Scheduled_CleanUp = SPAWN:New( "Spawn Helicopter Scheduled CleanUp" ):Limit( 3, 100 ):RandomizeRoute( 1, 1, 1000 ):CleanUp( 180 ):SpawnScheduled( 10, 0 )
Spawn_Vehicle_Scheduled_CleanUp = SPAWN:New( "Spawn Vehicle Scheduled CleanUp" ):Limit( 3, 100 ):RandomizeRoute( 1, 1, 1000 ):SpawnScheduled( 10, 0 )
-- Maykop
-- ------
-- Creates arrays of groups ready to be spawned and dynamic spawning of groups from another group.
-- SpawnTestVisible creates an array of 200 groups, every 20 groups with 20 meters space in between, and will activate a group of the array every 10 seconds with a 0.2 time randomization.
SpawnTestVisible = SPAWN:New( "Spawn Vehicle Visible Scheduled" ):Limit( 200, 200 ):Array( 59, 20, 20, 10 ):SpawnScheduled( 10, 0.2 )
-- Spawn_Templates_Visible contains different templates...
Spawn_Templates_Visible = { "Spawn Vehicle Visible Template A",
"Spawn Vehicle Visible Template B",
"Spawn Vehicle Visible Template C",
"Spawn Vehicle Visible Template D",
"Spawn Vehicle Visible Template E",
"Spawn Vehicle Visible Template F",
"Spawn Vehicle Visible Template G",
"Spawn Vehicle Visible Template H",
"Spawn Vehicle Visible Template I",
"Spawn Vehicle Visible Template J"
}
-- Spawn_Vehicle_Visible_RandomizeTemplate_Scheduled creates an array of 40 vehicle groups, spread out by 20 groups each, with an 8 meter distance,
-- and chooses for each group from the templates specified in Spawn_Templates_Visible.
Spawn_Vehicle_Visible_RandomizeTemplate_Scheduled = SPAWN:New( "Spawn Vehicle Visible RandomizeTemplate Scheduled" )
:Limit( 80, 80 )
:RandomizeTemplate( Spawn_Templates_Visible )
:Array( 49, 20, 8, 8 )
:SpawnScheduled( 10, 0.2 )
-- Spawn_Infantry allows to spawn 10 Infantry groups.
Spawn_Infantry = SPAWN:New( "Spawn Infantry" )
:Limit( 10, 10 )
-- Spawn_Vehicle_Host reserves 10 vehicle groups, shown within an array arranged by 5 vehicles in a row with a distance of 8 meters, and schedules a vehicle each 10 seconds with a 20% variation.
Spawn_Vehicle_Host = SPAWN:New( "Spawn Vehicle Host" )
:Limit( 10, 10 )
:Array( 0, 5, 8, 8 )
:SpawnScheduled( 10, 0.2 )
-- Spawn_Vehicle_SpawnToZone allows to spawn 10 vehicle groups.
Spawn_Vehicle_SpawnToZone = SPAWN:New( "Spawn Vehicle SpawnToZone" )
:Limit( 10, 10 )
-- Spawn_Helicopter_SpawnToZone will fly to a location, hover, and spawn one vehicle on the ground, the helicopter will land
-- and the vehicle will drive to a random location within the defined zone.
-- For this, the following code is activated within the mission on waypoint 3:
--
-- local InfantryDropGroup = Spawn_Vehicle_SpawnToZone:SpawnFromUnit( GROUP:New( ... ):GetUnit(1) )
-- local InfantryDropRoute = InfantryDropGroup:CopyRoute( 1, 0 )
-- InfantryDropGroup:RouteToZone( ZONE:New( "Target Zone" ), true, 80 )
--
Spawn_Helicopter_SpawnToZone = SPAWN:New( "Spawn Helicopter SpawnToZone" )
:Limit( 10, 10 )
:SpawnScheduled( 60, 0.2 )

View File

@@ -1,17 +0,0 @@
---
-- Tests Gudauta
-- -------------
-- Limited scheduled spawning of groups...
Spawn_Plane_Limited_Scheduled = SPAWN:New( "Spawn Plane Limited Scheduled" ):InitLimit( 4, 20 ):SpawnScheduled( 30, 0 )
Spawn_Helicopter_Limited_Scheduled = SPAWN:New( "Spawn Helicopter Limited Scheduled" ):InitLimit( 4, 20 ):SpawnScheduled( 30, 0 )
Spawn_Ground_Limited_Scheduled = SPAWN:New( "Spawn Vehicle Limited Scheduled" ):InitLimit( 4, 20 ):SpawnScheduled( 90, 0 )
---
-- Tests Sukhumi
-- -------------
-- Limited scheduled spawning of groups with destruction...
Spawn_Plane_Limited_Scheduled_RandomizeRoute = SPAWN:New( "Spawn Plane Limited Scheduled Destroy" ):InitLimit( 4, 20 ):SpawnScheduled( 10, 0 )
Spawn_Helicopter_Limited_Scheduled_RandomizeRoute = SPAWN:New( "Spawn Helicopter Limited Scheduled Destroy" ):InitLimit( 4, 20 ):SpawnScheduled( 10, 0 )
Spawn_Vehicle_Limited_Scheduled_RandomizeRoute = SPAWN:New( "Spawn Vehicle Limited Scheduled Destroy" ):InitLimit( 4, 20 ):SpawnScheduled( 10, 0 )

View File

@@ -1,17 +0,0 @@
---
-- Tests Gudauta
-- -------------
-- Limited scheduled spawning of groups...
Spawn_Plane_Limited_Scheduled = SPAWN:New( "Spawn Plane Limited Scheduled" ):InitLimit( 4, 20 ):SpawnScheduled( 30, 0 )
Spawn_Helicopter_Limited_Scheduled = SPAWN:New( "Spawn Helicopter Limited Scheduled" ):InitLimit( 4, 20 ):SpawnScheduled( 30, 0 )
Spawn_Ground_Limited_Scheduled = SPAWN:New( "Spawn Vehicle Limited Scheduled" ):InitLimit( 4, 20 ):SpawnScheduled( 90, 0 )
---
-- Tests Sukhumi
-- -------------
-- Limited scheduled spawning of groups with destruction...
Spawn_Plane_Limited_Scheduled_RandomizeRoute = SPAWN:New( "Spawn Plane Limited Scheduled Destroy" ):InitLimit( 4, 20 ):SpawnScheduled( 10, 0 )
Spawn_Helicopter_Limited_Scheduled_RandomizeRoute = SPAWN:New( "Spawn Helicopter Limited Scheduled Destroy" ):InitLimit( 4, 20 ):SpawnScheduled( 10, 0 )
Spawn_Vehicle_Limited_Scheduled_RandomizeRoute = SPAWN:New( "Spawn Vehicle Limited Scheduled Destroy" ):InitLimit( 4, 20 ):SpawnScheduled( 10, 0 )

View File

@@ -1,35 +0,0 @@
---
-- Name: SPA-120 - Air Ops - Scheduled Spawns with Repeat on Landing with Limit
-- Author: FlightControl
-- Date Created: 05 Feb 2017
--
-- # Situation:
--
-- One airplane and one helicopter will be spawned.
-- Only one airplane and one helicopter can be alive at the same time.
-- Upon landing, the airplane and helicopter will respawn at Kutaisi.
--
-- # Test cases:
--
-- 1. Observe the spawning of the airplane and helicopter
-- 2. There should not be more airplanes alive than there are set by InitLimit.
-- 3. Upon landing, the planes should respawn.
-- 5. The plane should respawn itself when the air unit has parked at the ramp or has landed.
do
-- Declare SPAWN objects
Spawn_Plane = SPAWN:New("Plane"):InitLimit( 2, 0 )
-- Choose repeat functionality
-- Repeat on ... (when landed on the airport)
Spawn_Plane:InitRepeatOnEngineShutDown()
-- Now SPAWN the GROUPs
Spawn_Plane:SpawnScheduled(30,0)
-- Now run the mission and observe the behaviour.
end

View File

@@ -1,51 +0,0 @@
---
-- Name: SPA-121 - Air Ops - Scheduled Spawns with Repeat on Landing with Limit
-- Author: FlightControl
-- Date Created: 05 Feb 2017
--
-- # Situation:
--
-- Multiple airplanes will be spawned at a scheduled interval.
-- There is a limit on how many airplanes can be alive at the same time.
-- Upon landing, the airplanes will respawn at Kutaisi.
--
-- # Test cases:
--
-- 1. Observe the spawning of the airplanes
-- 2. There should not be more airplanes alive than there are set by InitLimit.
-- 3. Upon landing, the planes should respawn.
-- 4. The KA-50 and the C-101EB should respawn itself directly when landed.
-- 5. the MI-8MTV2 and the A-10C should respawn itself when the air unit has parked at the ramp.
do
-- Declare SPAWN objects
Spawn_KA_50 = SPAWN:New("KA-50"):InitLimit( 2, 10 )
Spawn_MI_8MTV2 = SPAWN:New("MI-8MTV2"):InitLimit( 2, 10 )
Spawn_C_101EB = SPAWN:New("C-101EB"):InitLimit( 2, 10 )
Spawn_A_10C = SPAWN:New("A-10C")
:InitLimit( 2, 10 )
-- Choose repeat functionality
-- Repeat on landing
Spawn_KA_50:InitRepeatOnLanding()
Spawn_KA_50:InitDelayOff()
Spawn_C_101EB:InitRepeatOnLanding()
Spawn_C_101EB:InitDelayOff()
-- Repeat on enging shutdown (when landed on the airport)
Spawn_MI_8MTV2:InitRepeatOnEngineShutDown()
Spawn_A_10C:InitRepeatOnEngineShutDown()
-- Now SPAWN the GROUPs
Spawn_KA_50:SpawnScheduled(180,0)
Spawn_C_101EB:SpawnScheduled(180,0)
Spawn_MI_8MTV2:SpawnScheduled(180,0)
Spawn_A_10C:SpawnScheduled(180,0)
-- Now run the mission and observe the behaviour.
end

View File

@@ -1,47 +0,0 @@
---
-- Name: SPA-122 - Air Ops - OnLand test for Scheduled Spawns
-- Author: FlightControl
-- Date Created: 21 Mar 2017
--
-- # Situation:
--
-- An airplane is spawned at a scheduled interval.
-- There is a limit on how many airplanes can be alive at the same time.
-- Upon landing, the airplane will respawn in the air.
--
-- # Test cases:
--
-- 1. Observe the spawning of the airplanes
-- 2. There should not be more airplanes alive than there are set by InitLimit.
-- 3. Upon landing, the planes should respawn.
-- 4. The KA-50 and the C-101EB should respawn itself directly when landed.
-- 5. the MI-8MTV2 and the A-10C should respawn itself when the air unit has parked at the ramp.
do
-- Declare SPAWN objects
Spawn_KA_50 = SPAWN:New("KA-50"):InitLimit( 1, 0 )
Spawn_MI_8MTV2 = SPAWN:New("MI-8MTV2"):InitLimit( 1, 0 )
Spawn_C_101EB = SPAWN:New("C-101EB"):InitLimit( 1, 0 )
Spawn_A_10C = SPAWN:New("A-10C"):InitLimit( 1, 0 )
-- Choose repeat functionality
-- Repeat on landing
Spawn_KA_50:InitRepeatOnLanding()
Spawn_C_101EB:InitRepeatOnLanding()
-- Repeat on enging shutdown (when landed on the airport)
Spawn_MI_8MTV2:InitRepeatOnEngineShutDown()
Spawn_A_10C:InitRepeatOnEngineShutDown()
-- Now SPAWN the GROUPs
Spawn_KA_50:SpawnScheduled(30,0)
Spawn_C_101EB:SpawnScheduled(30,0)
Spawn_MI_8MTV2:SpawnScheduled(30,0)
Spawn_A_10C:SpawnScheduled(30,0)
-- Now run the mission and observe the behaviour.
end

View File

@@ -1,28 +0,0 @@
---
-- Name: SPA-123 - Air Ops - Repeat on Landing and InitCleanUp
-- Author: FlightControl
-- Date Created: 15 Sep 2018
--
-- # Situation:
--
-- Helicpters spawn and are lightly shot until the crash land, but don't really destroy.
-- The should be respawned after a while.
-- No performance overhead should be noticed.
do
-- Declare SPAWN objects
Spawn_KA_50 = SPAWN:New("KA-50"):InitLimit( 2, 10 )
:InitLimit( 2, 0 )
-- Choose repeat functionality
-- Repeat on landing
Spawn_KA_50:InitRepeatOnLanding()
Spawn_KA_50:InitDelayOff()
Spawn_KA_50:InitCleanUp( 300 )
Spawn_KA_50:SpawnScheduled( 180, 0.2 )
-- Now run the mission and observe the behaviour.
end

View File

@@ -1,52 +0,0 @@
----------------------------------------------------------------------
--SPA-124 - Air Ops - Scheduled Spawns with OnSpawnGroup() Escort Task
----------------------------------------------------------------------
--//////////////////////////////////
--////////////Tankers and awacs v1
--//////////////////////////////////
--////////// By Targs35 /////////////
--//////////////// from 62nd Air Wing, Brisbane server..
--///////////////////////////////////
------- With thanks to the guys at MOOSE and in particular Pikes, Nolove, Delta99 and Wingthor
-- Funky Frank is the man..
-----////////////////////////////////
--/////////// Spawn Tanker and Escorts ///
do
local PointVec1 = POINT_VEC3:New( -100, 20, 80 ) -- This is a Vec3 class - defines the position of the escorts relative to the escorted group
local PointVec2 = POINT_VEC3:New( -100, 20, 150 ) -- This is a Vec3 class - defines the position of the escorts relative to the escorted group
--Create Spawn Groups, use the OnSpawnGroup() function to spawn two escorts and task them
local Tanker_Texaco = SPAWN
:New("Tanker_Texaco_Droge")
:InitLimit( 1, 2 ) -- group with one unit, spawn 1 *alive* units max
:InitCleanUp( 240 )
:OnSpawnGroup(function (tanker) -- tanker contains the GROUP object when the tanker spawns
local Escort_Texaco_1 = SPAWN
:New("Escort_Texaco_F14 001")
:InitLimit( 1, 2 )
:InitCleanUp( 240 )
:OnSpawnGroup(function (spawndgroup) -- spawndgrp contains the GROUP object when the escort spawns
local FollowDCSTask1 = spawndgroup:TaskFollow( tanker, PointVec1 ) -- create task
spawndgroup:SetTask( FollowDCSTask1, 1 ) -- push task on the GROUP
end
)
:SpawnScheduled( 60, 0.5 )
local Escort_Texaco_2 = SPAWN
:New("Escort_Texaco_F14 002")
:InitLimit( 1, 2 )
:InitCleanUp( 240 )
:OnSpawnGroup(function (spawndgroup) -- spawndgrp contains the GROUP object when the escort spawns
local FollowDCSTask2 = spawndgroup:TaskFollow( tanker, PointVec2 )
spawndgroup:SetTask( FollowDCSTask2, 1 )
end
)
:SpawnScheduled( 60, 0.5 )
end
)
:SpawnScheduled( 60, 0.5 )
end

View File

@@ -1,47 +0,0 @@
---
-- Name: SPA-130 - Uncontrolled Spawning
-- Author: FlightControl
-- Date Created: 04 Feb 2017
--
-- # Situation:
--
-- A plane will be spawned Uncontrolled and later one will be spawned Controlled.
-- Only the Controlled plane will move, the other will remain idle at the parking spot.
--
-- # Test cases:
--
-- 1. Observe the spawning of the UnControlled Plane.
-- 2. Observe the spawning of the Controlled Plane.
-- Create the SPAWN object looking for the group (template) "Plane".
SpawnPlane = SPAWN:New( "Plane" )
-- Set the spawn mode to UnControlled.
SpawnPlane:InitUnControlled( true )
-- Spawn the UnControlled Group
UnControlledPlane = SpawnPlane:Spawn()
-- Set the spawn mode back to Controlled.
SpawnPlane:InitUnControlled( false )
ControlledPlane = SpawnPlane:Spawn()
-- Now, let's create a menu option at a player slot plane...
-- We can only create the menu option if the player has joined the slot ...
PlayerPlane = CLIENT:FindByName( "PlayerPlane", "Select Menu item to activate UnControlled plane" )
PlayerPlane:Alive(
function( Client, SpawnPlane )
--- @param Functional.Spawn#SPAWN SpawnPlane
local function ActivatePlane( SpawnPlane )
SpawnPlane:InitUnControlled( false )
SpawnPlane:ReSpawn( 1 )
end
local Menu = MENU_CLIENT_COMMAND:New( Client, "Select to activate UnControlled plane", nil, ActivatePlane, SpawnPlane )
end
, SpawnPlane
)

View File

@@ -1,11 +0,0 @@
-- Name: SPA-131 - Air Ops - SpawnAtAirbase
-- Author: FlightControl
-- Date Created: 14 Sep 2017
--
Spawn_Plane = SPAWN:New( "Plane" )
Spawn_Plane:SpawnAtAirbase( AIRBASE:FindByName( AIRBASE.Nevada.Groom_Lake_AFB ), SPAWN.Takeoff.Cold )
Spawn_Plane:SpawnAtAirbase( AIRBASE:FindByName( AIRBASE.Nevada.Groom_Lake_AFB ), SPAWN.Takeoff.Hot )
Spawn_Plane:SpawnAtAirbase( AIRBASE:FindByName( AIRBASE.Nevada.Groom_Lake_AFB ), SPAWN.Takeoff.Runway )

View File

@@ -1,19 +0,0 @@
---
-- Name: SPA-140 - Spawn Client Slots
-- Author: FlightControl
-- Date Created: 30 Aug 2017
--
-- # Situation:
--
-- A plane will be spawned Uncontrolled and later one will be spawned Controlled.
-- Only the Controlled plane will move, the other will remain idle at the parking spot.
--
-- # Test cases:
--
-- Create the SPAWN object looking for the group (template) "Plane".
SpawnPlane = SPAWN:New( "Plane" )
-- Spawn the UnControlled Group
UnControlledPlane = SpawnPlane:SpawnClientAtAirbase( AIRBASE:FindByName( AIRBASE.Caucasus.Kutaisi ) )

View File

@@ -1,139 +0,0 @@
Include.File( "Spawn" )
-- Tests Anapa: Spawn Basics
-- -------------------------
-- Spawning groups using Spawn function.
Spawn_Plane = SPAWN:New( "Spawn Plane" )
Group_Plane = Spawn_Plane:Spawn()
Spawn_Helicopter = SPAWN:New( "Spawn Helicopter" ):RandomizeRoute( 1, 1, 1000 )
Group_Helicopter = Spawn_Helicopter:Spawn()
Group_Helicopter2 = Spawn_Helicopter:Spawn()
Spawn_Ship = SPAWN:New( "Spawn Ship" ):RandomizeRoute( 0, 0, 2000 )
Group_Ship1 = Spawn_Ship:Spawn()
Group_Ship2 = Spawn_Ship:Spawn()
Spawn_Vehicle = SPAWN:New( "Spawn Vehicle" ):RandomizeRoute( 1, 0, 50 )
Group_Vehicle1 = Spawn_Vehicle:Spawn()
Group_Vehicle2 = Spawn_Vehicle:Spawn()
Group_Vehicle3 = Spawn_Vehicle:Spawn()
Group_Vehicle4 = Spawn_Vehicle:Spawn()
Group_Vehicle5 = Spawn_Vehicle:Spawn()
Group_Vehicle6 = Spawn_Vehicle:Spawn()
Group_Vehicle1:TaskRouteToZone( ZONE:New( "Landing Zone" ), true, 40, "Cone" )
-- Now land the spawned plane on to the Vinson, by copying the route of another object.
Route_Plane = GROUP:NewFromName( "Spawn Helicopter Route Copy" ):CopyRoute( 1, 0 )
Group_Plane:Route( Route_Plane )
--Route_Helicopter[#Route_Helicopter].linkUnit = Group_Ship1:GetDCSUnit(1)
--Route_Helicopter[#Route_Helicopter].helipadId = Group_Ship1:GetDCSUnit(1)
--Route_Helicopter[#Route_Helicopter].x = Group_Ship1:GetUnit(1):GetPointVec2().x
--Route_Helicopter[#Route_Helicopter].y = Group_Ship1:GetUnit(1):GetPointVec2().y
--env.info( Route_Helicopter[#Route_Helicopter].type .. " on " .. Group_Ship1:GetUnit(1):GetID() )
--Group_Helicopter:Route( Route_Helicopter )
-- Tests Batumi: Scheduled Spawning
-- --------------------------------
-- Unlimited spawning of groups, scheduled every 30 seconds ...
Spawn_Plane_Scheduled = SPAWN:New( "Spawn Plane Scheduled" ):SpawnScheduled( 30, 0.4 )
Spawn_Helicopter_Scheduled = SPAWN:New( "Spawn Helicopter Scheduled" ):SpawnScheduled( 30, 1 )
Spawn_Ship_Scheduled = SPAWN:New( "Spawn Ship Scheduled" ):SpawnScheduled( 30, 0.5 )
Spawn_Vehicle_Scheduled = SPAWN:New( "Spawn Vehicle Scheduled" ):SpawnScheduled( 30, 0.5 )
-- Tests Tbilisi: Limited Spawning
-- -------------------------------
-- Spawing one group, and respawning the same group when it lands ...
Spawn_Plane_Limited_Repeat = SPAWN:New( "Spawn Plane Limited Repeat" ):Limit( 1, 1 ):Repeat():Spawn()
Spawn_Plane_Limited_RepeatOnLanding = SPAWN:New( "Spawn Plane Limited RepeatOnLanding" ):Limit( 1, 1 ):Repeat():Spawn()
Spawn_Plane_Limited_RepeatOnEngineShutDown = SPAWN:New( "Spawn Plane Limited RepeatOnEngineShutDown" ):Limit( 1, 1 ):Repeat():Spawn()
Spawn_Helicopter_Limited_Repeat = SPAWN:New( "Spawn Helicopter Limited Repeat" ):Limit( 1, 1 ):Repeat():Spawn()
Spawn_Helicopter_Limited_RepeatOnLanding = SPAWN:New( "Spawn Helicopter Limited RepeatOnLanding" ):Limit( 1, 1 ):Repeat():Spawn()
Spawn_Helicopter_Limited_RepeatOnEngineShutDown = SPAWN:New( "Spawn Helicopter Limited RepeatOnEngineShutDown" ):Limit( 1, 1 ):Repeat():Spawn()
-- Tests Soganlug
-- --------------
-- Limited spawning of groups, scheduled every 30 seconds ...
Spawn_Plane_Limited_Scheduled = SPAWN:New( "Spawn Plane Limited Scheduled" ):Limit( 2, 10 ):SpawnScheduled( 30, 0 )
Spawn_Helicopter_Limited_Scheduled = SPAWN:New( "Spawn Helicopter Limited Scheduled" ):Limit( 2, 10 ):SpawnScheduled( 30, 0 )
Spawn_Ground_Limited_Scheduled = SPAWN:New( "Spawn Vehicle Limited Scheduled" ):Limit( 1, 20 ):SpawnScheduled( 90, 0 )
-- Tests Sukhumi
-- -------------
-- Limited spawning of groups, scheduled every seconds with route randomization.
Spawn_Plane_Limited_Scheduled_RandomizeRoute = SPAWN:New( "Spawn Plane Limited Scheduled RandomizeRoute" ):Limit( 2, 10 ):RandomizeRoute( 1, 1, 4000 ):SpawnScheduled( 30, 0 )
Spawn_Helicopter_Limited_Scheduled_RandomizeRoute = SPAWN:New( "Spawn Helicopter Limited Scheduled RandomizeRoute" ):Limit( 2, 10 ):RandomizeRoute( 1, 1, 4000 ):SpawnScheduled( 30, 0 )
Spawn_Vehicle_Limited_Scheduled_RandomizeRoute = SPAWN:New( "Spawn Vehicle Limited Scheduled RandomizeRoute" ):Limit( 10, 10 ):RandomizeRoute( 1, 1, 1000 ):SpawnScheduled( 1, 0 )
-- Tests Kutaisi
-- -------------
-- Tests the CleanUp functionality.
-- Limited spawning of groups, scheduled every 10 seconds, who are engaging into combat. Some helicopters may crash land on the ground.
-- Observe when helicopters land but are not dead and are out of the danger zone, that they get removed after a while (+/- 180 seconds) and ReSpawn.
Spawn_Helicopter_Scheduled_CleanUp = SPAWN:New( "Spawn Helicopter Scheduled CleanUp" ):Limit( 3, 100 ):RandomizeRoute( 1, 1, 1000 ):CleanUp( 180 ):SpawnScheduled( 10, 0 )
Spawn_Vehicle_Scheduled_CleanUp = SPAWN:New( "Spawn Vehicle Scheduled CleanUp" ):Limit( 3, 100 ):RandomizeRoute( 1, 1, 1000 ):SpawnScheduled( 10, 0 )
-- Maykop
-- ------
-- Creates arrays of groups ready to be spawned and dynamic spawning of groups from another group.
-- SpawnTestVisible creates an array of 200 groups, every 20 groups with 20 meters space in between, and will activate a group of the array every 10 seconds with a 0.2 time randomization.
SpawnTestVisible = SPAWN:New( "Spawn Vehicle Visible Scheduled" ):Limit( 200, 200 ):Array( 59, 20, 20, 10 ):SpawnScheduled( 10, 0.2 )
-- Spawn_Templates_Visible contains different templates...
Spawn_Templates_Visible = { "Spawn Vehicle Visible Template A",
"Spawn Vehicle Visible Template B",
"Spawn Vehicle Visible Template C",
"Spawn Vehicle Visible Template D",
"Spawn Vehicle Visible Template E",
"Spawn Vehicle Visible Template F",
"Spawn Vehicle Visible Template G",
"Spawn Vehicle Visible Template H",
"Spawn Vehicle Visible Template I",
"Spawn Vehicle Visible Template J"
}
-- Spawn_Vehicle_Visible_RandomizeTemplate_Scheduled creates an array of 40 vehicle groups, spread out by 20 groups each, with an 8 meter distance,
-- and chooses for each group from the templates specified in Spawn_Templates_Visible.
Spawn_Vehicle_Visible_RandomizeTemplate_Scheduled = SPAWN:New( "Spawn Vehicle Visible RandomizeTemplate Scheduled" )
:Limit( 80, 80 )
:RandomizeTemplate( Spawn_Templates_Visible )
:Array( 49, 20, 8, 8 )
:SpawnScheduled( 10, 0.2 )
-- Spawn_Infantry allows to spawn 10 Infantry groups.
Spawn_Infantry = SPAWN:New( "Spawn Infantry" )
:Limit( 10, 10 )
-- Spawn_Vehicle_Host reserves 10 vehicle groups, shown within an array arranged by 5 vehicles in a row with a distance of 8 meters, and schedules a vehicle each 10 seconds with a 20% variation.
Spawn_Vehicle_Host = SPAWN:New( "Spawn Vehicle Host" )
:Limit( 10, 10 )
:Array( 0, 5, 8, 8 )
:SpawnScheduled( 10, 0.2 )
-- Spawn_Vehicle_SpawnToZone allows to spawn 10 vehicle groups.
Spawn_Vehicle_SpawnToZone = SPAWN:New( "Spawn Vehicle SpawnToZone" )
:Limit( 10, 10 )
-- Spawn_Helicopter_SpawnToZone will fly to a location, hover, and spawn one vehicle on the ground, the helicopter will land
-- and the vehicle will drive to a random location within the defined zone.
-- For this, the following code is activated within the mission on waypoint 3:
--
-- local InfantryDropGroup = Spawn_Vehicle_SpawnToZone:SpawnFromUnit( GROUP:New( ... ):GetUnit(1) )
-- local InfantryDropRoute = InfantryDropGroup:CopyRoute( 1, 0 )
-- InfantryDropGroup:RouteToZone( ZONE:New( "Target Zone" ), true, 80 )
--
Spawn_Helicopter_SpawnToZone = SPAWN:New( "Spawn Helicopter SpawnToZone" )
:Limit( 10, 10 )
:SpawnScheduled( 60, 0.2 )

View File

@@ -1,11 +0,0 @@
---
-- Tests Gudauta
-- --------------
-- Limited and scheduled spawning of groups, with RandomizeTemplate ...
Templates = { "Template1", "Template2", "Template3", "Template4" }
Spawn_Ground1 = SPAWN:New( "Spawn Vehicle1" ):InitLimit( 4, 20 ):InitRandomizeTemplate(Templates):SpawnScheduled( 15, 0 )
Spawn_Ground2 = SPAWN:New( "Spawn Vehicle2" ):InitLimit( 4, 20 ):InitRandomizeTemplate(Templates):SpawnScheduled( 15, 0 )

View File

@@ -1,11 +0,0 @@
---
-- Tests Gudauta
-- --------------
-- Limited and scheduled spawning of groups, with RandomizeTemplate ...
Templates = { "Template1", "Template2", "Template3", "Template4" }
Spawn_Ground1 = SPAWN:New( "Spawn Vehicle1" ):InitLimit( 4, 20 ):InitRandomizeTemplate(Templates):SpawnScheduled( 15, 0 )
Spawn_Ground2 = SPAWN:New( "Spawn Vehicle2" ):InitLimit( 4, 20 ):InitRandomizeTemplate(Templates):SpawnScheduled( 15, 0 )

View File

@@ -1,51 +0,0 @@
-- This test will create 3 different zones of different types.
-- 100 groups of 1 unit will be spawned.
-- The test is about testing the zone randomization, and the place where the units are created.
local Iterations = 100
local Iteration = 1
-- The PolygonGroup route defines zone 1
local ZonePolygonGroup = GROUP:FindByName( "ZonePolygon" )
-- The ZoneUnit defines zone 4.
local ZoneUnit = UNIT:FindByName( "ZoneUnit" )
-- The ZoneGroup defines zone 5
local ZoneGroup = GROUP:FindByName( "ZoneGroup" )
-- This is the array that models the different zones types.
-- The selection of the zones is done by taking into account the probability of the zone.
-- The zone probabibility is 0 = 0%, 1 = 100%
-- The default value of the probability is 1.
-- Note that the SetZoneProbability is a method, that returns the self object of the zone,
-- allowing to use the method within the zone array declaration!
local SpawnZones = {
ZONE_POLYGON:New( "Zone 1", ZonePolygonGroup ):SetZoneProbability( 0.8 ),
ZONE_RADIUS:New( "Zone 2", ZONE:New( "GroundZone2" ):GetVec2(), 5000 ):SetZoneProbability( 0.2 ),
ZONE:New( "GroundZone3" ):SetZoneProbability( 0.2 ),
ZONE_UNIT:New( "Zone 4", ZoneUnit, 5000 ):SetZoneProbability( 0.6 ),
ZONE_GROUP:New( "Zone 5", ZoneGroup, 5000 ):SetZoneProbability( 0.4 ),
}
HeightLimit = 500
SpawnGrounds = SPAWN
:New("Ground")
:InitLimit( 100, 100 )
-- This method will randomize the selection of the zones for each spawned Group during initialization,
-- taking into account the probability factors.
-- When you explore the code behind this method, you'll see that the GetZoneMaybe() method is used to select "maybe" the zone.
:InitRandomizeZones( SpawnZones )
--- Spawns these groups slowly.
SCHEDULER:New( nil,
function( Interation, Iterations )
do
-- Spawn Ground
SpawnGrounds:Spawn()
end
end, {}, 0, 1, 0
)

View File

@@ -1,51 +0,0 @@
-- This test will create 3 different zones of different types.
-- 100 groups of 1 unit will be spawned.
-- The test is about testing the zone randomization, and the place where the units are created.
local Iterations = 100
local Iteration = 1
-- The PolygonGroup route defines zone 1
local ZonePolygonGroup = GROUP:FindByName( "ZonePolygon" )
-- The ZoneUnit defines zone 4.
local ZoneUnit = UNIT:FindByName( "ZoneUnit" )
-- The ZoneGroup defines zone 5
local ZoneGroup = GROUP:FindByName( "ZoneGroup" )
-- This is the array that models the different zones types.
-- The selection of the zones is done by taking into account the probability of the zone.
-- The zone probabibility is 0 = 0%, 1 = 100%
-- The default value of the probability is 1.
-- Note that the SetZoneProbability is a method, that returns the self object of the zone,
-- allowing to use the method within the zone array declaration!
local SpawnZones = {
ZONE_POLYGON:New( "Zone 1", ZonePolygonGroup ):SetZoneProbability( 0.8 ),
ZONE_RADIUS:New( "Zone 2", ZONE:New( "GroundZone2" ):GetVec2(), 5000 ):SetZoneProbability( 0.2 ),
ZONE:New( "GroundZone3" ):SetZoneProbability( 0.2 ),
ZONE_UNIT:New( "Zone 4", ZoneUnit, 5000 ):SetZoneProbability( 0.6 ),
ZONE_GROUP:New( "Zone 5", ZoneGroup, 5000 ):SetZoneProbability( 0.4 ),
}
HeightLimit = 500
SpawnGrounds = SPAWN
:New("Ground")
:InitLimit( 100, 100 )
-- This method will randomize the selection of the zones for each spawned Group during initialization,
-- taking into account the probability factors.
-- When you explore the code behind this method, you'll see that the GetZoneMaybe() method is used to select "maybe" the zone.
:InitRandomizeZones( SpawnZones )
--- Spawns these groups slowly.
SCHEDULER:New( nil,
function( Interation, Iterations )
do
-- Spawn Ground
SpawnGrounds:Spawn()
end
end, {}, 0, 1, 0
)

View File

@@ -1,52 +0,0 @@
local Iterations = 10
local Iteration = 1
GroundStatics = { "GroundStatic1", "GroundStatic2", "GroundStatic3" }
AirplaneStatics = { "AirplaneStatic1", "AirplaneStatic2", "AirplaneStatic3" }
HelicopterStatics = { "HelicopterStatic1", "HelicopterStatic2", "HelicopterStatic3" }
ShipStatics = { "ShipStatic1", "ShipStatic2", "ShipStatic3" }
HeightLimit = 500
SpawnGrounds = SPAWN:New("Ground"):InitLimit( 20, 10 ):InitRandomizeUnits( true, 500, 100 )
SpawnAirplanes = SPAWN:New("Airplane"):InitLimit( 20, 10 ):InitRandomizeUnits( true, 500, 100 )
SpawnHelicopters = SPAWN:New("Helicopter"):InitLimit( 20, 10 ):InitRandomizeUnits( true, 500, 100 )
SpawnShips = SPAWN:New("Ship"):InitLimit( 20, 10 ):InitRandomizeUnits( true, 500, 100 )
--- Spawns these groups slowly.
SCHEDULER:New( nil,
function( Interation, Iterations )
do
-- Spawn Ground
local StaticName = GroundStatics[ math.random( 1, 3 ) ]
local SpawnStatic = STATIC:FindByName( StaticName )
SpawnGrounds:SpawnFromUnit( SpawnStatic )
end
do
-- Spawn Airplanes
local StaticName = AirplaneStatics[ math.random( 1, 3 ) ]
local SpawnStatic = STATIC:FindByName( StaticName )
SpawnAirplanes:SpawnFromUnit( SpawnStatic )
SpawnAirplanes:SpawnFromUnit( SpawnStatic, 2000, 4000 )
end
do
-- Spawn Helicopters
local StaticName = HelicopterStatics[ math.random( 1, 3 ) ]
local SpawnStatic = STATIC:FindByName( StaticName )
SpawnHelicopters:SpawnFromUnit( SpawnStatic )
SpawnHelicopters:SpawnFromUnit( SpawnStatic, 200, 500 ) -- Spawn between 200 and 500 meters.
end
do
-- Spawn Ships
local StaticName = ShipStatics[ math.random( 1, 3 ) ]
local SpawnStatic = STATIC:FindByName( StaticName )
SpawnShips:SpawnFromUnit( SpawnStatic )
end
end, {}, 0, 15, 0.5
)

View File

@@ -1,50 +0,0 @@
local Iterations = 10
local Iteration = 1
GroundUnits = { "GroundUnit1", "GroundUnit2", "GroundUnit3" }
AirplaneUnits = { "AirplaneUnit1", "AirplaneUnit2", "AirplaneUnit3" }
HelicopterUnits = { "HelicopterUnit1", "HelicopterUnit2", "HelicopterUnit3" }
ShipUnits = { "ShipUnit1", "ShipUnit2", "ShipUnit3" }
HeightLimit = 500
SpawnGrounds = SPAWN:New("Ground"):InitLimit( 20, 10 ):InitRandomizeUnits( true, 10, 3 )
SpawnAirplanes = SPAWN:New("Airplane"):InitLimit( 20, 10 )
SpawnHelicopters = SPAWN:New("Helicopter"):InitLimit( 20, 10 )
SpawnShips = SPAWN:New("Ship"):InitLimit( 20, 10 )
--- Spawns these groups slowly.
SCHEDULER:New( nil,
function( Interation, Iterations )
do
-- Spawn Ground
local UnitName = GroundUnits[ math.random( 1, 3 ) ]
local SpawnUnit = UNIT:FindByName( UnitName )
SpawnGrounds:SpawnFromUnit( SpawnUnit )
end
do
-- Spawn Airplanes
local UnitName = AirplaneUnits[ math.random( 1, 3 ) ]
local SpawnUnit = UNIT:FindByName( UnitName )
SpawnAirplanes:SpawnFromUnit( SpawnUnit )
end
do
-- Spawn Helicopters
local UnitName = HelicopterUnits[ math.random( 1, 3 ) ]
local SpawnUnit = UNIT:FindByName( UnitName )
SpawnHelicopters:SpawnFromUnit( SpawnUnit )
end
do
-- Spawn Ships
local UnitName = ShipUnits[ math.random( 1, 3 ) ]
local SpawnUnit = UNIT:FindByName( UnitName )
SpawnShips:SpawnFromUnit( SpawnUnit )
end
end, {}, 0, 15, 0.5
)

View File

@@ -1,52 +0,0 @@
local Iterations = 10
local Iteration = 1
GroundUnits = { "GroundUnit1", "GroundUnit2", "GroundUnit3" }
AirplaneUnits = { "AirplaneUnit1", "AirplaneUnit2", "AirplaneUnit3" }
HelicopterUnits = { "HelicopterUnit1", "HelicopterUnit2", "HelicopterUnit3" }
ShipUnits = { "ShipUnit1", "ShipUnit2", "ShipUnit3" }
HeightLimit = 500
SpawnGrounds = SPAWN:New("Ground"):InitLimit( 20, 10 ):InitRandomizeUnits( true, 10, 3 )
SpawnAirplanes = SPAWN:New("Airplane"):InitLimit( 20, 10 )
SpawnHelicopters = SPAWN:New("Helicopter"):InitLimit( 20, 10 )
SpawnShips = SPAWN:New("Ship"):InitLimit( 20, 10 )
--- Spawns these groups slowly.
SCHEDULER:New( nil,
function( Interation, Iterations )
do
-- Spawn Ground
local UnitName = GroundUnits[ math.random( 1, 3 ) ]
local SpawnUnit = UNIT:FindByName( UnitName )
SpawnGrounds:SpawnFromUnit( SpawnUnit )
end
do
-- Spawn Airplanes
local UnitName = AirplaneUnits[ math.random( 1, 3 ) ]
local SpawnUnit = UNIT:FindByName( UnitName )
SpawnAirplanes:SpawnFromUnit( SpawnUnit )
SpawnAirplanes:SpawnFromUnit( SpawnUnit, 200, 500 )
end
do
-- Spawn Helicopters
local UnitName = HelicopterUnits[ math.random( 1, 3 ) ]
local SpawnUnit = UNIT:FindByName( UnitName )
SpawnHelicopters:SpawnFromUnit( SpawnUnit )
SpawnHelicopters:SpawnFromUnit( SpawnUnit, 500, 2000 )
end
do
-- Spawn Ships
local UnitName = ShipUnits[ math.random( 1, 3 ) ]
local SpawnUnit = UNIT:FindByName( UnitName )
SpawnShips:SpawnFromUnit( SpawnUnit )
end
end, {}, 0, 15, 0.5
)

View File

@@ -1,59 +0,0 @@
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 )
SpawnRandomizeGrounds = SPAWN:New("GroundRandomize"):InitLimit( 20, 10 ):InitRandomizeUnits( true, 500, 100 )
SpawnAirplanes = SPAWN:New("Airplane"):InitLimit( 20, 10 )
SpawnHelicopters = SPAWN:New("Helicopter"):InitLimit( 20, 10 )
SpawnShips = SPAWN:New("Ship"):InitLimit( 20, 10 )
--- 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:SpawnFromVec2( SpawnVec3:GetVec2() )
end
do
-- Spawn Ground Randomize
local ZoneName = GroundRandomizeZones[ math.random( 1, 3 ) ]
local SpawnVec3 = POINT_VEC3:NewFromVec3( ZONE:New( ZoneName ):GetVec3() )
SpawnRandomizeGrounds:SpawnFromVec2( SpawnVec3:GetVec2() )
end
do
-- Spawn Airplanes
local ZoneName = AirplaneZones[ math.random( 1, 3 ) ]
local SpawnVec3 = POINT_VEC3:NewFromVec3( ZONE:New( ZoneName ):GetVec3() )
SpawnAirplanes:SpawnFromVec2( SpawnVec3:GetVec2() )
end
do
-- Spawn Helicopters
local ZoneName = HelicopterZones[ math.random( 1, 3 ) ]
local SpawnVec3 = POINT_VEC3:NewFromVec3( ZONE:New( ZoneName ):GetVec3() )
SpawnHelicopters:SpawnFromVec2( SpawnVec3:GetVec2() )
end
do
-- Spawn Ships
local ZoneName = ShipZones[ math.random( 1, 3 ) ]
local SpawnVec3 = POINT_VEC3:NewFromVec3( ZONE:New( ZoneName ):GetVec3() )
SpawnShips:SpawnFromVec2( SpawnVec3:GetVec2() )
end
end, {}, 0, 15, 0.5
)

View File

@@ -1,61 +0,0 @@
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 )
SpawnRandomizeGrounds = SPAWN:New("GroundRandomize"):InitLimit( 20, 10 ):InitRandomizeUnits( true, 500, 100 )
SpawnAirplanes = SPAWN:New("Airplane"):InitLimit( 20, 10 )
SpawnHelicopters = SPAWN:New("Helicopter"):InitLimit( 20, 10 )
SpawnShips = SPAWN:New("Ship"):InitLimit( 20, 10 )
--- 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:SpawnFromVec2( SpawnVec3:GetVec2() )
end
do
-- Spawn Ground Randomize
local ZoneName = GroundRandomizeZones[ math.random( 1, 3 ) ]
local SpawnVec3 = POINT_VEC3:NewFromVec3( ZONE:New( ZoneName ):GetVec3() )
SpawnRandomizeGrounds:SpawnFromVec2( SpawnVec3:GetVec2() )
end
do
-- Spawn Airplanes
local ZoneName = AirplaneZones[ math.random( 1, 3 ) ]
local SpawnVec3 = POINT_VEC3:NewFromVec3( ZONE:New( ZoneName ):GetVec3() )
SpawnAirplanes:SpawnFromVec2( SpawnVec3:GetVec2() )
SpawnAirplanes:SpawnFromVec2( SpawnVec3:GetVec2(), 200, 500 )
end
do
-- Spawn Helicopters
local ZoneName = HelicopterZones[ math.random( 1, 3 ) ]
local SpawnVec3 = POINT_VEC3:NewFromVec3( ZONE:New( ZoneName ):GetVec3() )
SpawnHelicopters:SpawnFromVec2( SpawnVec3:GetVec2() )
SpawnHelicopters:SpawnFromVec2( SpawnVec3:GetVec2(), 2000, 4000 )
end
do
-- Spawn Ships
local ZoneName = ShipZones[ math.random( 1, 3 ) ]
local SpawnVec3 = POINT_VEC3:NewFromVec3( ZONE:New( ZoneName ):GetVec3() )
SpawnShips:SpawnFromVec2( SpawnVec3:GetVec2() )
end
end, {}, 0, 15, 0.5
)

View File

@@ -1,59 +0,0 @@
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 )
SpawnRandomizeGrounds = SPAWN:New("GroundRandomize"):InitLimit( 20, 10 ):InitRandomizeUnits( true, 500, 100 )
SpawnAirplanes = SPAWN:New("Airplane"):InitLimit( 20, 10 )
SpawnHelicopters = SPAWN:New("Helicopter"):InitLimit( 20, 10 )
SpawnShips = SPAWN:New("Ship"):InitLimit( 20, 10 )
--- 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
)

View File

@@ -1,59 +0,0 @@
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 )
SpawnRandomizeGrounds = SPAWN:New("GroundRandomize"):InitLimit( 20, 10 ):InitRandomizeUnits( true, 500, 100 )
SpawnAirplanes = SPAWN:New("Airplane"):InitLimit( 20, 10 )
SpawnHelicopters = SPAWN:New("Helicopter"):InitLimit( 20, 10 )
SpawnShips = SPAWN:New("Ship"):InitLimit( 20, 10 )
--- 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
)

View File

@@ -1,73 +0,0 @@
---
-- 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
)

View File

@@ -1,73 +0,0 @@
---
-- 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
)