From 966a374f9864be5144fa3918a1b919b4cf0b3d0d Mon Sep 17 00:00:00 2001 From: funkyfranky Date: Mon, 1 Jan 2024 22:48:35 +0000 Subject: [PATCH] Updated Moose.lua --- .../PAT-001 - Switching Patrol Zones.lua | 160 ++++----- .../SCH-000 - Simple Scheduling.lua | 66 ++-- .../SCH-001 - Simple Object Scheduling.lua | 66 ++-- .../SCH-100 - Simple Repeat Scheduling.lua | 46 +-- .../SCH-110 - Object Repeat Scheduling.lua | 88 ++--- ...imple Repeat Scheduling Stop and Start.lua | 80 ++--- .../SCH-300 - GC Simple Object Scheduling.lua | 118 +++---- .../SCH-310 - GC Object Repeat Scheduling.lua | 160 ++++----- .../SET-001 - Airbase Sets.lua | 30 +- ... - Test SET_GROUP object against ZONE.lua | 68 ++-- ...-103 - Test if GROUP object is in ZONE.lua | 48 +-- ...t SET_GROUP players added and deleted.lua | 34 +- .../SET-201 - Client Sets.lua | 6 +- .../SET-101 - Group Sets.lua | 324 +++++++++--------- .../SET-101 - Group Sets.lua | 324 +++++++++--------- .../SET-GRP-300 - FilterActive Scenario 1.lua | 16 +- .../SET-GRP-300 - FilterActive Scenario 2.lua | 16 +- .../SET-UNT-100 - Unit Sets.lua | 14 +- .../SET-UNT-110 - FilterOnce Ground.lua | 24 +- .../SET-UNT-120 - FilterOnce Scenario 3.lua | 30 +- .../SET-UNT-300 - FilterActive Scenario 1.lua | 16 +- ...SPA-011 - Ground Ops - Simple Spawning.lua | 44 +-- ...SPA-012 - Ground Ops - Multiple Spawns.lua | 52 +-- ...PA-013 - Ground Ops - Scheduled Spawns.lua | 44 +-- ... Ground Ops - Scheduled Spawns Limited.lua | 42 +-- ...SPA-015 - Ground Ops - Randomize Route.lua | 54 +-- ...SPA-016 - Ground Ops - Randomize Zones.lua | 58 ++-- ...d Ops - Set AI inactive while spawning.lua | 62 ++-- ...018 - Ground Ops - Randomize Templates.lua | 56 +-- ... Randomize Templates without Waypoints.lua | 54 +-- ...s - Randomize Templates in Zones no WP.lua | 58 ++-- ...heduled Spawns Limited Keep Unit Names.lua | 54 +-- ...uled Spawns Limited with long interval.lua | 46 +-- ... Ground Ops - SpawnStart and SpawnStop.lua | 52 +-- .../SPA-024 - Ground Ops - Arrays.lua | 54 +-- .../SPA-024 - Ground Ops - Arrays.lua | 54 +-- .../SPA-025 - Ground Ops - Spawn Hidden.lua | 44 +-- ...d Ops - Spawn RandomizeTemplate Hidden.lua | 52 +-- ... Ground Ops - Respawning After Destroy.lua | 50 +-- ...copters with CleanUp of Inactive Units.lua | 16 +- .../SPA-110 - Limit Spawning.lua | 34 +- ...pawn with Repeat on Landing with Limit.lua | 70 ++-- ...awns with Repeat on Landing with Limit.lua | 102 +++--- ...Ops - OnLand test for Scheduled Spawns.lua | 94 ++--- ...ps - Repeat on Landing and InitCleanUp.lua | 56 +-- .../SPA-130 - Uncontrolled Spawning.lua | 92 ++--- ...31 - Air Ops - Nevada - SpawnAtAirbase.lua | 22 +- .../SPA-200 - Randomize Unit Types.lua | 22 +- .../SPA-220 - Randomize Zones.lua | 102 +++--- .../SPA-310 - Spawn at Static position.lua | 104 +++--- .../SPA-320 - Spawn at Unit position.lua | 104 +++--- .../SPA-330 - Spawn at Vec2 position.lua | 122 +++---- .../SPA-340 - Spawn at Vec3 position.lua | 118 +++---- ...awn at Vec3 position RandomizePosition.lua | 146 ++++---- ...pawn at Vec3 position RandomzePosition.lua | 146 ++++---- .../SPS - 010 - Simple Spawning.lua | 62 ++-- .../SPS - 050 - Spawn FARPs.lua | 122 +++---- .../ZON-100 - Normal Zone.lua | 64 ++-- .../ZON-101 - Normal Zone - Random Point.lua | 86 ++--- .../ZON-102 - Normal Zone Boundary.lua | 64 ++-- ... - Test SET_GROUP object against ZONE.lua | 68 ++-- ...-103 - Test if GROUP object is in ZONE.lua | 48 +-- .../ZON-110 - ZONE declared in ME.lua | 68 ++-- ...N-190 - Return SCENERY objects in Zone.lua | 42 +-- .../ZON-200 - Group Zone.lua | 70 ++-- .../ZON-201 - Group Zone - Random Point.lua | 86 ++--- .../ZON-300 - Unit Zone.lua | 70 ++-- .../ZON-301 - Unit Zone - Random Point.lua | 86 ++--- .../ZON-400 - Radius Zone.lua | 64 ++-- .../ZON-401 - Radius Zone - Random Point.lua | 96 +++--- .../ZON-500 - Polygon Zone.lua | 66 ++-- .../ZON-501 - Polygon Zone - Random Point.lua | 86 ++--- .../ZON-502 - Polygon Zone Boundary.lua | 66 ++-- .../ZON-510 - ZONE_POLYGON declared in ME.lua | 64 ++-- .../RAT-001 - Basic/RAT-001 - Basic.lua | 34 +- .../RAT-002 - Fixed Departure.lua | 44 +-- .../RAT-003 - Fixed Destination.lua | 44 +-- ...-004 - Fixed Departure and Destination.lua | 48 +-- .../RAT-005 - Restricted Coalition.lua | 92 ++--- .../RAT-006 - Continue Journey.lua | 48 +-- .../RAT-007 - Commute/RAT-007 - Commute.lua | 60 ++-- .../RAT-008 - Spawn in Air.lua | 104 +++--- .../RAT-009 - Set Cruise Altitude.lua | 92 ++--- .../RAT-010 - Helo FARP and Ship.lua | 132 +++---- .../RAT-011 - Carrier Ops.lua | 84 ++--- ...10 - Traffic at McCarran International.lua | 152 ++++---- .../RAT-011 - Traffic at Nellis AFB.lua | 200 +++++------ .../RAT-020 - WWII Scenario.lua | 168 ++++----- .../SCO-100 - Scoring Demo.lua | 76 ++-- .../SCO-101 - Scoring Client to Client.lua | 42 +-- .../SCO-200 - Telemetry.lua | 82 ++--- ... - Scoring Multi Player Demo Mission 1.lua | 278 +++++++-------- .../SEV-001 - SEAD Evasion.lua | 20 +- .../WHS-010 - Self Request.lua | 78 ++--- ...WHS-020 - Self Propelled Ground Troops.lua | 60 ++-- .../WHS-030 - Self Propelled Airborne.lua | 58 ++-- .../WHS-160 - Resupply/WHS-016 - Resupply.lua | 206 +++++------ .../WHS-170 - Resupply/WHS-016 - Resupply.lua | 206 +++++------ .../RAD-000 - Transmission from Static.lua | 36 +- ...-001 - Transmission from UNIT or GROUP.lua | 48 +-- ...RAD-002 - Transmission Tips and Tricks.lua | 180 +++++----- .../RAD-010 - Beacons/RAD-010 - Beacons.lua | 42 +-- .../RAD-100 - Speech/RAD-100 - Speech.lua | 36 +- .../TSK-300 - A2A - SWEEP.lua | 60 ++-- .../TAD-A2A-000 - AREAS - Detection test.lua | 146 ++++---- .../TAD-A2A-010 - AREAS - Intercept Task.lua | 72 ++-- .../TAD-A2A-020 - AREAS - Sweep Task.lua | 94 ++--- .../TSK-010 - Task Modelling - SEAD.lua | 54 +-- .../TSK-A2A-200 - BAI/TSK-100 - A2G - BAI.lua | 54 +-- .../TSK-101 - A2G - BAI - WWII Mode.lua | 58 ++-- .../TAD-A2G-000 - AREAS - Detection test.lua | 102 +++--- .../TAD-A2G-001 - AREAS - Destroy Test.lua | 104 +++--- ...AD-A2G-002 - AREAS - Task Success Test.lua | 132 +++---- ...0 - AREAS - Split SEAD to BAI and SEAD.lua | 100 +++--- ...1 - AREAS - Split SEAD to CAS and SEAD.lua | 100 +++--- ...A2G-020 - AREAS - Remain BAI as Player.lua | 104 +++--- ...TAD-A2G-021 - AREAS - Remain BAI as AI.lua | 104 +++--- ...-090 - AREAS - WWII - Reference Points.lua | 68 ++-- .../TAD-A2G-100 - TYPES - Detection test.lua | 102 +++--- ...- A2G Task Dispatching DETECTION_TYPES.lua | 70 ++-- ... Task Dispatching per TYPE and SCORING.lua | 126 +++---- .../TAD-A2G-200 - UNITS - Detection Test.lua | 102 +++--- ...- A2G Task Dispatching DETECTION_UNITS.lua | 98 +++--- ...00 - A2G Task Dispatching with SCORING.lua | 126 +++---- ...k Dispatching #1 for AREAS and SCORING.lua | 128 +++---- ...Task Dispatching per AREAS and SCORING.lua | 128 +++---- .../TAD-A2G-001 - AREAS - Destroy Test.lua | 104 +++--- .../TSK-CGO-000 - Boarding Test.lua | 156 ++++----- ...ound - Respawn on CargoGroup Destroyed.lua | 156 ++++----- ... - 1 APC - 2 Tasks - 2 Cargo - 2 Zones.lua | 138 ++++---- ...o - 1 Helo - 1 Task - 1 Cargo - 1 Zone.lua | 110 +++--- ... - 1 Helo - 1 Task - 1 Cargo - 2 Zones.lua | 112 +++--- ...o - 1 Helo - 1 Task - 2 Cargo - 1 Zone.lua | 128 +++---- ... - 1 Helo - 1 Task - 2 Cargo - 2 Zones.lua | 130 +++---- ... - 1 Helo - 2 Task - 2 Cargo - 2 Zones.lua | 154 ++++----- .../TAD-CAP-000 - Capture Zone Test.lua | 234 ++++++------- .../TAD-CGO-000 - CSAR Test.lua | 68 ++-- .../TAD-CGO-001 - Transport Test.lua | 100 +++--- .../TAD-CGO-002 - Transport Test - Crate.lua | 80 ++--- ... - Transport Test - Infantry and Crate.lua | 98 +++--- ...ransport Test - Infantry and Slingload.lua | 100 +++--- ...O-005 - Transport Test - Various Cargo.lua | 102 +++--- ...06 - Transport Test - Multiple Clients.lua | 76 ++-- ...D-CGO-007 - Transport Test - Cargo Fun.lua | 106 +++--- ... Test - PickedUp and Deployed Handling.lua | 132 +++---- ...09 - Transport Test - Respawning Cargo.lua | 164 ++++----- ...010 - Transport Test - Register Cargos.lua | 168 ++++----- .../TAD-CGO-011 - CSAR - Zone.lua | 72 ++-- .../TAD-CGO-012 - CSAR - Maximum.lua | 72 ++-- ...ransport - Pickup and deploy from roof.lua | 68 ++-- 150 files changed, 6601 insertions(+), 6601 deletions(-) diff --git a/AI/AI_Patrol/PAT-001 - Switching Patrol Zones/PAT-001 - Switching Patrol Zones.lua b/AI/AI_Patrol/PAT-001 - Switching Patrol Zones/PAT-001 - Switching Patrol Zones.lua index cd25ae5576..e460ba8d40 100644 --- a/AI/AI_Patrol/PAT-001 - Switching Patrol Zones/PAT-001 - Switching Patrol Zones.lua +++ b/AI/AI_Patrol/PAT-001 - Switching Patrol Zones/PAT-001 - Switching Patrol Zones.lua @@ -1,80 +1,80 @@ --- This test mission models the behaviour of the AI_PATROL_ZONE class. --- --- It creates a 2 AI_PATROL_ZONE objects with the name Patrol1 and Patrol2. --- Patrol1 will govern a GROUP object to patrol the zone defined by PatrolZone1, within 3000 meters and 6000 meters, within a speed of 400 and 600 km/h. --- When the GROUP object that is assigned to Patrol has fuel below 20%, the GROUP object will orbit for 60 secondes, before returning to base. --- --- Patrol2 will goven a GROUP object to patrol the zone defined by PatrolZone2, within 600 meters and 1000 meters, within a speed of 300 and 400 km/h. --- When the GROUP object that is assigned to Patrol has fuel below 20%, the GROUP object will orbit for 0 secondes, before returning to base. --- --- The Patrol1 and Patrol2 object have 2 state transition functions defined, which customize the default behaviour of the RTB state. --- When Patrol1 goes RTB, it will create a new GROUP object, that will be assigned to Patrol2. --- When Patrol2 goes RTB, it will create a new GROUP object, that will be assgined to Patrol1. --- --- In this way, the Patrol1 and Patrol2 objects are fluctuating the patrol pattern from PatrolZone1 and PatrolZone2 :-) - - -PatrolZoneGroup1 = GROUP:FindByName( "Patrol Zone 1" ) -PatrolZone1 = ZONE_POLYGON:New( "Patrol Zone 1", PatrolZoneGroup1 ) - -PatrolZoneGroup2 = GROUP:FindByName( "Patrol Zone 2" ) -PatrolZone2 = ZONE_POLYGON:New( "Patrol Zone 2", PatrolZoneGroup2 ) - -PatrolSpawn = SPAWN:New( "Patrol Group" ) -PatrolGroup = PatrolSpawn:Spawn() - -Patrol1 = AI_PATROL_ZONE:New( PatrolZone1, 3000, 6000, 400, 600 ) -Patrol1:ManageFuel( 0.2, 60 ) -Patrol1:SetControllable( PatrolGroup ) -Patrol1:__Start( 5 ) - -Patrol2 = AI_PATROL_ZONE:New( PatrolZone2, 600, 1000, 300, 400 ) -Patrol2:ManageFuel( 0.2, 0 ) - ---- State transition function for the PROCESS\_PATROLZONE **Patrol1** object --- @param #AI_PATROL_ZONE self --- @param Wrapper.Group#GROUP AIGroup --- @return #boolean If false is returned, then the OnAfter state transition function will not be called. -function Patrol1:OnLeaveRTB( AIGroup ) - AIGroup:MessageToRed( "Returning to base", 20 ) -end - ---- State transition function for the PROCESS\_PATROLZONE **Patrol1** object --- @param Process_PatrolCore.Zone#AI_PATROL_ZONE self --- @param Wrapper.Group#GROUP AIGroup -function Patrol1:OnAfterRTB( AIGroup ) - local NewGroup = PatrolSpawn:Spawn() - Patrol2:SetControllable( NewGroup ) - Patrol2:__Start( 1 ) -end - ---- State transition function for the PROCESS\_PATROLZONE **Patrol1** object --- @param Process_PatrolCore.Zone#AI_PATROL_ZONE self --- @param Wrapper.Group#GROUP AIGroup -function Patrol1:OnEnterPatrol( AIGroup ) - AIGroup:MessageToRed( "Patrolling in zone " .. PatrolZone1:GetName() , 20 ) -end - ---- State transition function for the PROCESS\_PATROLZONE **Patrol2** object --- @param #AI_PATROL_ZONE self --- @param Wrapper.Group#GROUP AIGroup --- @return #boolean If false is returned, then the OnEnter state transition function will not be called. -function Patrol2:OnBeforeRTB( AIGroup ) - AIGroup:MessageToRed( "Returning to base", 20 ) -end - ---- State transition function for the PROCESS\_PATROLZONE **Patrol2** object --- @param Process_PatrolCore.Zone#AI_PATROL_ZONE self --- @param Wrapper.Group#GROUP AIGroup -function Patrol2:OnEnterRTB( AIGroup ) - local NewGroup = PatrolSpawn:Spawn() - Patrol1:SetControllable( NewGroup ) - Patrol1:__Start( 1 ) -end - ---- State transition function for the PROCESS\_PATROLZONE **Patrol2** object --- @param Process_PatrolCore.Zone#AI_PATROL_ZONE self --- @param Wrapper.Group#GROUP AIGroup -function Patrol2:OnEnterPatrol( AIGroup ) - AIGroup:MessageToRed( "Patrolling in zone " .. PatrolZone2:GetName() , 20 ) -end +-- This test mission models the behaviour of the AI_PATROL_ZONE class. +-- +-- It creates a 2 AI_PATROL_ZONE objects with the name Patrol1 and Patrol2. +-- Patrol1 will govern a GROUP object to patrol the zone defined by PatrolZone1, within 3000 meters and 6000 meters, within a speed of 400 and 600 km/h. +-- When the GROUP object that is assigned to Patrol has fuel below 20%, the GROUP object will orbit for 60 secondes, before returning to base. +-- +-- Patrol2 will goven a GROUP object to patrol the zone defined by PatrolZone2, within 600 meters and 1000 meters, within a speed of 300 and 400 km/h. +-- When the GROUP object that is assigned to Patrol has fuel below 20%, the GROUP object will orbit for 0 secondes, before returning to base. +-- +-- The Patrol1 and Patrol2 object have 2 state transition functions defined, which customize the default behaviour of the RTB state. +-- When Patrol1 goes RTB, it will create a new GROUP object, that will be assigned to Patrol2. +-- When Patrol2 goes RTB, it will create a new GROUP object, that will be assgined to Patrol1. +-- +-- In this way, the Patrol1 and Patrol2 objects are fluctuating the patrol pattern from PatrolZone1 and PatrolZone2 :-) + + +PatrolZoneGroup1 = GROUP:FindByName( "Patrol Zone 1" ) +PatrolZone1 = ZONE_POLYGON:New( "Patrol Zone 1", PatrolZoneGroup1 ) + +PatrolZoneGroup2 = GROUP:FindByName( "Patrol Zone 2" ) +PatrolZone2 = ZONE_POLYGON:New( "Patrol Zone 2", PatrolZoneGroup2 ) + +PatrolSpawn = SPAWN:New( "Patrol Group" ) +PatrolGroup = PatrolSpawn:Spawn() + +Patrol1 = AI_PATROL_ZONE:New( PatrolZone1, 3000, 6000, 400, 600 ) +Patrol1:ManageFuel( 0.2, 60 ) +Patrol1:SetControllable( PatrolGroup ) +Patrol1:__Start( 5 ) + +Patrol2 = AI_PATROL_ZONE:New( PatrolZone2, 600, 1000, 300, 400 ) +Patrol2:ManageFuel( 0.2, 0 ) + +--- State transition function for the PROCESS\_PATROLZONE **Patrol1** object +-- @param #AI_PATROL_ZONE self +-- @param Wrapper.Group#GROUP AIGroup +-- @return #boolean If false is returned, then the OnAfter state transition function will not be called. +function Patrol1:OnLeaveRTB( AIGroup ) + AIGroup:MessageToRed( "Returning to base", 20 ) +end + +--- State transition function for the PROCESS\_PATROLZONE **Patrol1** object +-- @param Process_PatrolCore.Zone#AI_PATROL_ZONE self +-- @param Wrapper.Group#GROUP AIGroup +function Patrol1:OnAfterRTB( AIGroup ) + local NewGroup = PatrolSpawn:Spawn() + Patrol2:SetControllable( NewGroup ) + Patrol2:__Start( 1 ) +end + +--- State transition function for the PROCESS\_PATROLZONE **Patrol1** object +-- @param Process_PatrolCore.Zone#AI_PATROL_ZONE self +-- @param Wrapper.Group#GROUP AIGroup +function Patrol1:OnEnterPatrol( AIGroup ) + AIGroup:MessageToRed( "Patrolling in zone " .. PatrolZone1:GetName() , 20 ) +end + +--- State transition function for the PROCESS\_PATROLZONE **Patrol2** object +-- @param #AI_PATROL_ZONE self +-- @param Wrapper.Group#GROUP AIGroup +-- @return #boolean If false is returned, then the OnEnter state transition function will not be called. +function Patrol2:OnBeforeRTB( AIGroup ) + AIGroup:MessageToRed( "Returning to base", 20 ) +end + +--- State transition function for the PROCESS\_PATROLZONE **Patrol2** object +-- @param Process_PatrolCore.Zone#AI_PATROL_ZONE self +-- @param Wrapper.Group#GROUP AIGroup +function Patrol2:OnEnterRTB( AIGroup ) + local NewGroup = PatrolSpawn:Spawn() + Patrol1:SetControllable( NewGroup ) + Patrol1:__Start( 1 ) +end + +--- State transition function for the PROCESS\_PATROLZONE **Patrol2** object +-- @param Process_PatrolCore.Zone#AI_PATROL_ZONE self +-- @param Wrapper.Group#GROUP AIGroup +function Patrol2:OnEnterPatrol( AIGroup ) + AIGroup:MessageToRed( "Patrolling in zone " .. PatrolZone2:GetName() , 20 ) +end diff --git a/Core/Scheduler/SCH-000 - Simple Scheduling/SCH-000 - Simple Scheduling.lua b/Core/Scheduler/SCH-000 - Simple Scheduling/SCH-000 - Simple Scheduling.lua index be50637aa0..4220dc0947 100644 --- a/Core/Scheduler/SCH-000 - Simple Scheduling/SCH-000 - Simple Scheduling.lua +++ b/Core/Scheduler/SCH-000 - Simple Scheduling/SCH-000 - Simple Scheduling.lua @@ -1,33 +1,33 @@ ---- Simple function scheduling --- --- === --- --- Author: FlightControl --- Date Created: 12 Dec 2016 --- --- # Situation --- Uses the Tracing functions from BASE within the DCS.log file. Check the DCS.log file for the results. --- Create a new SCHEDULER object. --- Check the DCS.log. --- --- # Test cases: --- --- 1. The log should contain a "Hello World" line that is fired off 10 seconds after mission start. --- --- --- # Status: TESTED - 12 Dec 2016 - -local TestScheduler = SCHEDULER:New( nil, - function() - BASE:E( "Hello World 1") - end, {}, 1 - ) - -SCHEDULER:New( nil, - function() - BASE:E( "Hello World 2") - end, {}, 2 - ) - -collectgarbage() - +--- Simple function scheduling +-- +-- === +-- +-- Author: FlightControl +-- Date Created: 12 Dec 2016 +-- +-- # Situation +-- Uses the Tracing functions from BASE within the DCS.log file. Check the DCS.log file for the results. +-- Create a new SCHEDULER object. +-- Check the DCS.log. +-- +-- # Test cases: +-- +-- 1. The log should contain a "Hello World" line that is fired off 10 seconds after mission start. +-- +-- +-- # Status: TESTED - 12 Dec 2016 + +local TestScheduler = SCHEDULER:New( nil, + function() + BASE:E( "Hello World 1") + end, {}, 1 + ) + +SCHEDULER:New( nil, + function() + BASE:E( "Hello World 2") + end, {}, 2 + ) + +collectgarbage() + diff --git a/Core/Scheduler/SCH-001 - Simple Object Scheduling/SCH-001 - Simple Object Scheduling.lua b/Core/Scheduler/SCH-001 - Simple Object Scheduling/SCH-001 - Simple Object Scheduling.lua index e759b7017e..421eb9a220 100644 --- a/Core/Scheduler/SCH-001 - Simple Object Scheduling/SCH-001 - Simple Object Scheduling.lua +++ b/Core/Scheduler/SCH-001 - Simple Object Scheduling/SCH-001 - Simple Object Scheduling.lua @@ -1,34 +1,34 @@ ---- Simple Object Scheduling --- --- === --- --- Author: FlightControl --- Date Created: 12 Dec 2016 --- --- # Situation --- Uses the Tracing functions from BASE within the DCS.log file. Check the DCS.log file for the results. --- Create a new SCHEDULER object. --- Check the DCS.log. --- --- # Test cases: --- --- 1. Tracing of a scheduler in an Object. --- The log should contain a "Hello World" line of the object, that is fired off 1 seconds after mission start. --- --- # Status: TESTED - 12 Dec 2016 - -local TEST_BASE = { - ClassName = "TEST_BASE", - } - -function TEST_BASE:New( Message ) - self = BASE:Inherit( self, BASE:New() ) - - local TestScheduler = SCHEDULER:New( self, - function( Object, Message ) - Object:E( Message ) - end, { Message }, 1 - ) -end - +--- Simple Object Scheduling +-- +-- === +-- +-- Author: FlightControl +-- Date Created: 12 Dec 2016 +-- +-- # Situation +-- Uses the Tracing functions from BASE within the DCS.log file. Check the DCS.log file for the results. +-- Create a new SCHEDULER object. +-- Check the DCS.log. +-- +-- # Test cases: +-- +-- 1. Tracing of a scheduler in an Object. +-- The log should contain a "Hello World" line of the object, that is fired off 1 seconds after mission start. +-- +-- # Status: TESTED - 12 Dec 2016 + +local TEST_BASE = { + ClassName = "TEST_BASE", + } + +function TEST_BASE:New( Message ) + self = BASE:Inherit( self, BASE:New() ) + + local TestScheduler = SCHEDULER:New( self, + function( Object, Message ) + Object:E( Message ) + end, { Message }, 1 + ) +end + local Test = TEST_BASE:New( "Hello World" ) \ No newline at end of file diff --git a/Core/Scheduler/SCH-100 - Simple Repeat Scheduling/SCH-100 - Simple Repeat Scheduling.lua b/Core/Scheduler/SCH-100 - Simple Repeat Scheduling/SCH-100 - Simple Repeat Scheduling.lua index 4e1c84183c..f36fdb29eb 100644 --- a/Core/Scheduler/SCH-100 - Simple Repeat Scheduling/SCH-100 - Simple Repeat Scheduling.lua +++ b/Core/Scheduler/SCH-100 - Simple Repeat Scheduling/SCH-100 - Simple Repeat Scheduling.lua @@ -1,24 +1,24 @@ ---- Simple repeat scheduling of a function. --- --- === --- --- Author: FlightControl --- Date Created: 13 Dec 2016 --- --- # Situation --- Uses the Tracing functions from BASE within the DCS.log file. Check the DCS.log file for the results. --- Create a new SCHEDULER object. --- Check the DCS.log. --- --- # Test cases: --- --- 1. The log should contain "Hello World Repeat" lines that is fired off 1 second after mission start and is repeated every 1 seconds. --- --- --- # Status: TESTED - 13 Dec 2016 - -local TestScheduler = SCHEDULER:New( nil, - function() - BASE:E( "Hello World Repeat") - end, {}, 1, 1 +--- Simple repeat scheduling of a function. +-- +-- === +-- +-- Author: FlightControl +-- Date Created: 13 Dec 2016 +-- +-- # Situation +-- Uses the Tracing functions from BASE within the DCS.log file. Check the DCS.log file for the results. +-- Create a new SCHEDULER object. +-- Check the DCS.log. +-- +-- # Test cases: +-- +-- 1. The log should contain "Hello World Repeat" lines that is fired off 1 second after mission start and is repeated every 1 seconds. +-- +-- +-- # Status: TESTED - 13 Dec 2016 + +local TestScheduler = SCHEDULER:New( nil, + function() + BASE:E( "Hello World Repeat") + end, {}, 1, 1 ) \ No newline at end of file diff --git a/Core/Scheduler/SCH-110 - Object Repeat Scheduling/SCH-110 - Object Repeat Scheduling.lua b/Core/Scheduler/SCH-110 - Object Repeat Scheduling/SCH-110 - Object Repeat Scheduling.lua index 67f721125b..185b25927a 100644 --- a/Core/Scheduler/SCH-110 - Object Repeat Scheduling/SCH-110 - Object Repeat Scheduling.lua +++ b/Core/Scheduler/SCH-110 - Object Repeat Scheduling/SCH-110 - Object Repeat Scheduling.lua @@ -1,44 +1,44 @@ ---- Object Repeat Scheduling. --- --- === --- --- Author: FlightControl --- Date Created: 13 Dec 2016 --- --- # Situation --- Uses the Tracing functions from BASE within the DCS.log file. Check the DCS.log file for the results. --- Create a new SCHEDULER object. --- Check the DCS.log. --- --- Three Test objects are created. --- --- # Test cases: --- --- 1. Object Test1 should start after 1 seconds showing every second "Hello World Repeat 1". --- 2. Object Test2 should start after 2 seconds showing every 2 seconds "Hello World Repeat 2" and stop after one minute. --- 3. Object Test3 should start after 10 seconds showing with a 10 seconds randomized interval of 10 seconds "Hello World Repeat 3" and stop after one minute. --- --- # Status: TESTED - 13 Dec 2016 - -local TEST_BASE = { - ClassName = "TEST_BASE", - } - -function TEST_BASE:New( Message, Start, Repeat, Randomize, Stop ) - self = BASE:Inherit( self, BASE:New() ) - - self.TestScheduler = SCHEDULER:New( self, - function( Object, Message ) - Object:E( Message ) - end, { Message }, Start, Repeat, Randomize, Stop - ) - return self -end - -do -local Test1 = TEST_BASE:New( "Hello World Repeat 1", 1, 1 ) -end - -local Test2 = TEST_BASE:New( "Hello World Repeat 2", 2, 2, 0, 60 ) - -local Test3 = TEST_BASE:New( "Hello World Repeat 3", 10, 10, 1.0, 60 ) +--- Object Repeat Scheduling. +-- +-- === +-- +-- Author: FlightControl +-- Date Created: 13 Dec 2016 +-- +-- # Situation +-- Uses the Tracing functions from BASE within the DCS.log file. Check the DCS.log file for the results. +-- Create a new SCHEDULER object. +-- Check the DCS.log. +-- +-- Three Test objects are created. +-- +-- # Test cases: +-- +-- 1. Object Test1 should start after 1 seconds showing every second "Hello World Repeat 1". +-- 2. Object Test2 should start after 2 seconds showing every 2 seconds "Hello World Repeat 2" and stop after one minute. +-- 3. Object Test3 should start after 10 seconds showing with a 10 seconds randomized interval of 10 seconds "Hello World Repeat 3" and stop after one minute. +-- +-- # Status: TESTED - 13 Dec 2016 + +local TEST_BASE = { + ClassName = "TEST_BASE", + } + +function TEST_BASE:New( Message, Start, Repeat, Randomize, Stop ) + self = BASE:Inherit( self, BASE:New() ) + + self.TestScheduler = SCHEDULER:New( self, + function( Object, Message ) + Object:E( Message ) + end, { Message }, Start, Repeat, Randomize, Stop + ) + return self +end + +do +local Test1 = TEST_BASE:New( "Hello World Repeat 1", 1, 1 ) +end + +local Test2 = TEST_BASE:New( "Hello World Repeat 2", 2, 2, 0, 60 ) + +local Test3 = TEST_BASE:New( "Hello World Repeat 3", 10, 10, 1.0, 60 ) diff --git a/Core/Scheduler/SCH-200 - Simple Repeat Scheduling Stop and Start/SCH-200 - Simple Repeat Scheduling Stop and Start.lua b/Core/Scheduler/SCH-200 - Simple Repeat Scheduling Stop and Start/SCH-200 - Simple Repeat Scheduling Stop and Start.lua index 107ba46d1c..06b3a86000 100644 --- a/Core/Scheduler/SCH-200 - Simple Repeat Scheduling Stop and Start/SCH-200 - Simple Repeat Scheduling Stop and Start.lua +++ b/Core/Scheduler/SCH-200 - Simple Repeat Scheduling Stop and Start/SCH-200 - Simple Repeat Scheduling Stop and Start.lua @@ -1,41 +1,41 @@ ---- Simple repeat scheduling of a function. --- --- === --- --- Author: FlightControl --- Date Created: 14 Dec 2016 --- --- # Situation --- Uses the Tracing functions from BASE within the DCS.log file. Check the DCS.log file for the results. --- Create a new SCHEDULER object. --- Check the DCS.log. --- --- Start a schedule called TestScheduler. TestScheduler will repeat the words "Hello World Repeat" every second in the log. --- After 10 seconds, TestScheduler will stop the scheduler. --- After 20 seconds, TestScheduler will restart the scheduler. --- --- # Test cases: --- --- 1. Check that the "Hello World Repeat" lines are consistent with the scheduling timing. They should stop showing after 10 seconds, and restart after 20 seconds. --- --- --- # Status: TESTED - 14 Dec 2016 - -local TestScheduler = SCHEDULER:New( nil, - function() - BASE:E( timer.getTime() .. " - Hello World Repeat") - end, {}, 1, 1 - ) - -SCHEDULER:New( nil, - function() - TestScheduler:Stop() - end, {}, 10 - ) - -SCHEDULER:New( nil, - function() - TestScheduler:Start() - end, {}, 20 - ) +--- Simple repeat scheduling of a function. +-- +-- === +-- +-- Author: FlightControl +-- Date Created: 14 Dec 2016 +-- +-- # Situation +-- Uses the Tracing functions from BASE within the DCS.log file. Check the DCS.log file for the results. +-- Create a new SCHEDULER object. +-- Check the DCS.log. +-- +-- Start a schedule called TestScheduler. TestScheduler will repeat the words "Hello World Repeat" every second in the log. +-- After 10 seconds, TestScheduler will stop the scheduler. +-- After 20 seconds, TestScheduler will restart the scheduler. +-- +-- # Test cases: +-- +-- 1. Check that the "Hello World Repeat" lines are consistent with the scheduling timing. They should stop showing after 10 seconds, and restart after 20 seconds. +-- +-- +-- # Status: TESTED - 14 Dec 2016 + +local TestScheduler = SCHEDULER:New( nil, + function() + BASE:E( timer.getTime() .. " - Hello World Repeat") + end, {}, 1, 1 + ) + +SCHEDULER:New( nil, + function() + TestScheduler:Stop() + end, {}, 10 + ) + +SCHEDULER:New( nil, + function() + TestScheduler:Start() + end, {}, 20 + ) \ No newline at end of file diff --git a/Core/Scheduler/SCH-300 - GC Simple Object Scheduling/SCH-300 - GC Simple Object Scheduling.lua b/Core/Scheduler/SCH-300 - GC Simple Object Scheduling/SCH-300 - GC Simple Object Scheduling.lua index f5e5dab2d3..5d6dc7f83f 100644 --- a/Core/Scheduler/SCH-300 - GC Simple Object Scheduling/SCH-300 - GC Simple Object Scheduling.lua +++ b/Core/Scheduler/SCH-300 - GC Simple Object Scheduling/SCH-300 - GC Simple Object Scheduling.lua @@ -1,60 +1,60 @@ ---- No Object Scheduling because of garbage collect and Object nillification. --- --- === --- --- Author: FlightControl --- Date Created: 12 Dec 2016 --- --- # Situation --- Uses the Tracing functions from BASE within the DCS.log file. Check the DCS.log file for the results. --- Create a new SCHEDULER object. --- Check the DCS.log. --- --- A Test object is created. --- It is nillified directly after the Schedule has been planned. --- There should be no schedule fired. --- The Test object should be garbage collected! --- --- THIS IS A VERY IMPORTANT TEST! --- --- # Test cases: --- --- 1. No schedule should be fired! The destructors of the Test object should be shown. --- 2. Commend the nillification of the Test object in the source, and test again. --- The schedule should now be fired and Hello World should be logged through the Test object. --- --- # Status: STARTED - 12 Dec 2016 - -local TEST_BASE = { - ClassName = "TEST_BASE", - } - -function TEST_BASE:New( Message ) - self = BASE:Inherit( self, BASE:New() ) - - self.TestScheduler = SCHEDULER:New( self, - function( Object, Message ) - Object:E( Message ) - end, { Message }, 1 - ) - return self -end - -do -local Test1 = TEST_BASE:New( "Hello World Test 1" ) -Test1 = nil -BASE:E( Test1 ) -end - -local Test2 = TEST_BASE:New( "Hello World Test 2" ) -BASE:E( Test2 ) - -local Test3 = TEST_BASE:New( "Hello World Test 3" ) -Test3 = nil -BASE:E( Test3 ) - -collectgarbage() - -BASE:E( "Collect Garbage executed." ) -BASE:E( "You should only see a Hello Worlld message for Test 2!" ) +--- No Object Scheduling because of garbage collect and Object nillification. +-- +-- === +-- +-- Author: FlightControl +-- Date Created: 12 Dec 2016 +-- +-- # Situation +-- Uses the Tracing functions from BASE within the DCS.log file. Check the DCS.log file for the results. +-- Create a new SCHEDULER object. +-- Check the DCS.log. +-- +-- A Test object is created. +-- It is nillified directly after the Schedule has been planned. +-- There should be no schedule fired. +-- The Test object should be garbage collected! +-- +-- THIS IS A VERY IMPORTANT TEST! +-- +-- # Test cases: +-- +-- 1. No schedule should be fired! The destructors of the Test object should be shown. +-- 2. Commend the nillification of the Test object in the source, and test again. +-- The schedule should now be fired and Hello World should be logged through the Test object. +-- +-- # Status: STARTED - 12 Dec 2016 + +local TEST_BASE = { + ClassName = "TEST_BASE", + } + +function TEST_BASE:New( Message ) + self = BASE:Inherit( self, BASE:New() ) + + self.TestScheduler = SCHEDULER:New( self, + function( Object, Message ) + Object:E( Message ) + end, { Message }, 1 + ) + return self +end + +do +local Test1 = TEST_BASE:New( "Hello World Test 1" ) +Test1 = nil +BASE:E( Test1 ) +end + +local Test2 = TEST_BASE:New( "Hello World Test 2" ) +BASE:E( Test2 ) + +local Test3 = TEST_BASE:New( "Hello World Test 3" ) +Test3 = nil +BASE:E( Test3 ) + +collectgarbage() + +BASE:E( "Collect Garbage executed." ) +BASE:E( "You should only see a Hello Worlld message for Test 2!" ) BASE:E( "Check if Test 1 and Test 3 are garbage collected!" ) \ No newline at end of file diff --git a/Core/Scheduler/SCH-310 - GC Object Repeat Scheduling/SCH-310 - GC Object Repeat Scheduling.lua b/Core/Scheduler/SCH-310 - GC Object Repeat Scheduling/SCH-310 - GC Object Repeat Scheduling.lua index 54faeb6024..8c3e243a5b 100644 --- a/Core/Scheduler/SCH-310 - GC Object Repeat Scheduling/SCH-310 - GC Object Repeat Scheduling.lua +++ b/Core/Scheduler/SCH-310 - GC Object Repeat Scheduling/SCH-310 - GC Object Repeat Scheduling.lua @@ -1,80 +1,80 @@ ---- Object Repeat Scheduling. --- --- === --- --- Author: FlightControl --- Date Created: 13 Dec 2016 --- --- # Situation --- Three objects Test1, Test2, Test 3 are created with schedule a function. --- After 15 seconds, Test1 is nillified and Garbage Collect is done. --- After 30 seconds, Test2 is nillified and Garbage Collect is done. --- After 45 seconds, Test3 is nillified and Garbage Collect is done. --- Uses the Tracing functions from BASE within the DCS.log file. Check the DCS.log file for the results. --- Create a new SCHEDULER object. --- Check the DCS.log. --- --- --- Three Test objects are created. --- --- # Test cases: --- --- 1. Object Test1 should start after 1 seconds showing every second "Hello World Repeat 1". --- 2. Object Test2 should start after 2 seconds showing every 2 seconds "Hello World Repeat 2" and stop after one minute. --- 3. Object Test3 should start after 10 seconds showing with a 10 seconds randomized interval of 10 seconds "Hello World Repeat 3" and stop after one minute. --- 4. After 15 seconds, Test1 should stop working. No "Hello World Repeat 1" may be shown after 15 seconds. --- 5. After 30 seconds, Test2 should stop working. No "Hello World Repeat 2" may be shown after 30 seconds. --- 6. After 45 seconds, Test3 should stop working. No "Hello World Repeat 3" may be shown after 45 seconds. --- --- # Status: TESTED - 13 Dec 2016 - -local TEST_BASE = { - ClassName = "TEST_BASE", - } - -function TEST_BASE:New( Message, Start, Repeat, Randomize, Stop ) - self = BASE:Inherit( self, BASE:New() ) - - self.TestScheduler = SCHEDULER:New( self, - function( Object, Message ) - Object:E( Message ) - end, { Message }, Start, Repeat, Randomize, Stop - ) - return self -end - -do -local Test1 = TEST_BASE:New( "Hello World Repeat 1", 1, 1 ) - --- Nillify Test1 after 15 seconds and garbage collect. -local Nil1 = SCHEDULER:New( nil, - function() - BASE:E( "Nillify Test1 and Garbage Collect" ) - Test1 = nil - collectgarbage() - end, {}, 15 ) - -end - -local Test2 = TEST_BASE:New( "Hello World Repeat 2", 2, 2, 0, 60 ) - - -local Test3 = TEST_BASE:New( "Hello World Repeat 3", 10, 10, 1.0, 60 ) - --- Nillify Test2 after 30 seconds and garbage collect. -local Nil2 = SCHEDULER:New( nil, - function() - BASE:E( "Nillify Test2 and Garbage Collect" ) - Test2 = nil - collectgarbage() - end, {}, 30 ) - --- Nillify Test3 after 45 seconds and garbage collect. -local Nil3 = SCHEDULER:New( nil, - function() - BASE:E( "Nillify Test3 and Garbage Collect" ) - Test3 = nil - collectgarbage() - end, {}, 45 ) - -collectgarbage() +--- Object Repeat Scheduling. +-- +-- === +-- +-- Author: FlightControl +-- Date Created: 13 Dec 2016 +-- +-- # Situation +-- Three objects Test1, Test2, Test 3 are created with schedule a function. +-- After 15 seconds, Test1 is nillified and Garbage Collect is done. +-- After 30 seconds, Test2 is nillified and Garbage Collect is done. +-- After 45 seconds, Test3 is nillified and Garbage Collect is done. +-- Uses the Tracing functions from BASE within the DCS.log file. Check the DCS.log file for the results. +-- Create a new SCHEDULER object. +-- Check the DCS.log. +-- +-- +-- Three Test objects are created. +-- +-- # Test cases: +-- +-- 1. Object Test1 should start after 1 seconds showing every second "Hello World Repeat 1". +-- 2. Object Test2 should start after 2 seconds showing every 2 seconds "Hello World Repeat 2" and stop after one minute. +-- 3. Object Test3 should start after 10 seconds showing with a 10 seconds randomized interval of 10 seconds "Hello World Repeat 3" and stop after one minute. +-- 4. After 15 seconds, Test1 should stop working. No "Hello World Repeat 1" may be shown after 15 seconds. +-- 5. After 30 seconds, Test2 should stop working. No "Hello World Repeat 2" may be shown after 30 seconds. +-- 6. After 45 seconds, Test3 should stop working. No "Hello World Repeat 3" may be shown after 45 seconds. +-- +-- # Status: TESTED - 13 Dec 2016 + +local TEST_BASE = { + ClassName = "TEST_BASE", + } + +function TEST_BASE:New( Message, Start, Repeat, Randomize, Stop ) + self = BASE:Inherit( self, BASE:New() ) + + self.TestScheduler = SCHEDULER:New( self, + function( Object, Message ) + Object:E( Message ) + end, { Message }, Start, Repeat, Randomize, Stop + ) + return self +end + +do +local Test1 = TEST_BASE:New( "Hello World Repeat 1", 1, 1 ) + +-- Nillify Test1 after 15 seconds and garbage collect. +local Nil1 = SCHEDULER:New( nil, + function() + BASE:E( "Nillify Test1 and Garbage Collect" ) + Test1 = nil + collectgarbage() + end, {}, 15 ) + +end + +local Test2 = TEST_BASE:New( "Hello World Repeat 2", 2, 2, 0, 60 ) + + +local Test3 = TEST_BASE:New( "Hello World Repeat 3", 10, 10, 1.0, 60 ) + +-- Nillify Test2 after 30 seconds and garbage collect. +local Nil2 = SCHEDULER:New( nil, + function() + BASE:E( "Nillify Test2 and Garbage Collect" ) + Test2 = nil + collectgarbage() + end, {}, 30 ) + +-- Nillify Test3 after 45 seconds and garbage collect. +local Nil3 = SCHEDULER:New( nil, + function() + BASE:E( "Nillify Test3 and Garbage Collect" ) + Test3 = nil + collectgarbage() + end, {}, 45 ) + +collectgarbage() diff --git a/Core/Set/SET-001 - Airbase Sets/SET-001 - Airbase Sets.lua b/Core/Set/SET-001 - Airbase Sets/SET-001 - Airbase Sets.lua index e53f6d9367..0d80a560d9 100644 --- a/Core/Set/SET-001 - Airbase Sets/SET-001 - Airbase Sets.lua +++ b/Core/Set/SET-001 - Airbase Sets/SET-001 - Airbase Sets.lua @@ -1,16 +1,16 @@ - -BlueAirbaseSet = SET_AIRBASE:New():FilterCoalitions("blue"):FilterStart() - -RedAirbaseSet = SET_AIRBASE:New():FilterCoalitions("red"):FilterStart() - -RedAirbaseHelipadSet = SET_AIRBASE:New():FilterCoalitions("red"):FilterCategories("helipad"):FilterStart() - -BlueAirbaseShipSet = SET_AIRBASE:New():FilterCoalitions("blue"):FilterCategories("ship"):FilterStart() - -BlueAirbaseSet:Flush() - -RedAirbaseSet:Flush() - -RedAirbaseHelipadSet:Flush() - + +BlueAirbaseSet = SET_AIRBASE:New():FilterCoalitions("blue"):FilterStart() + +RedAirbaseSet = SET_AIRBASE:New():FilterCoalitions("red"):FilterStart() + +RedAirbaseHelipadSet = SET_AIRBASE:New():FilterCoalitions("red"):FilterCategories("helipad"):FilterStart() + +BlueAirbaseShipSet = SET_AIRBASE:New():FilterCoalitions("blue"):FilterCategories("ship"):FilterStart() + +BlueAirbaseSet:Flush() + +RedAirbaseSet:Flush() + +RedAirbaseHelipadSet:Flush() + BlueAirbaseShipSet:Flush() \ No newline at end of file diff --git a/Core/Set/SET-102 - Test SET_GROUP object against ZONE/SET-102 - Test SET_GROUP object against ZONE.lua b/Core/Set/SET-102 - Test SET_GROUP object against ZONE/SET-102 - Test SET_GROUP object against ZONE.lua index 98700a4be3..db60dc57a0 100644 --- a/Core/Set/SET-102 - Test SET_GROUP object against ZONE/SET-102 - Test SET_GROUP object against ZONE.lua +++ b/Core/Set/SET-102 - Test SET_GROUP object against ZONE/SET-102 - Test SET_GROUP object against ZONE.lua @@ -1,34 +1,34 @@ ---- --- Name: SET-102 - Test SET_GROUP object against ZONE --- Author: FlightControl --- Date Created: 31 Mar 2017 --- --- # Situation: --- --- A ZONE has been defined, and the SET_GROUP object is checked against the zone. --- --- # Test cases: --- --- 1. Observe the zone perimeter, and place the SET_GROUP object in or out of the zone. --- 2. Observe the results of the functions. - - -SetGroupObject = SET_GROUP:New():FilterCoalitions("blue"):FilterPrefixes("Group Object"):FilterStart() - -Zone = ZONE:New( "Zone" ) - -SetGroupObject:ForEachGroupCompletelyInZone( Zone, - function( GroupObject ) - GroupObject:E( { GroupObject:GetName(), "I am completely in Zone" } ) - end ) - -SetGroupObject:ForEachGroupPartlyInZone( Zone, - function( GroupObject ) - GroupObject:E( { GroupObject:GetName(), "I am partially in Zone" } ) - end ) - -SetGroupObject:ForEachGroupNotInZone( Zone, - function( GroupObject ) - GroupObject:E( { GroupObject:GetName(), "I am not in Zone" } ) - end ) - +--- +-- Name: SET-102 - Test SET_GROUP object against ZONE +-- Author: FlightControl +-- Date Created: 31 Mar 2017 +-- +-- # Situation: +-- +-- A ZONE has been defined, and the SET_GROUP object is checked against the zone. +-- +-- # Test cases: +-- +-- 1. Observe the zone perimeter, and place the SET_GROUP object in or out of the zone. +-- 2. Observe the results of the functions. + + +SetGroupObject = SET_GROUP:New():FilterCoalitions("blue"):FilterPrefixes("Group Object"):FilterStart() + +Zone = ZONE:New( "Zone" ) + +SetGroupObject:ForEachGroupCompletelyInZone( Zone, + function( GroupObject ) + GroupObject:E( { GroupObject:GetName(), "I am completely in Zone" } ) + end ) + +SetGroupObject:ForEachGroupPartlyInZone( Zone, + function( GroupObject ) + GroupObject:E( { GroupObject:GetName(), "I am partially in Zone" } ) + end ) + +SetGroupObject:ForEachGroupNotInZone( Zone, + function( GroupObject ) + GroupObject:E( { GroupObject:GetName(), "I am not in Zone" } ) + end ) + diff --git a/Core/Set/SET-102 - Test SET_GROUP object against ZONE/ZON-103 - Test if GROUP object is in ZONE.lua b/Core/Set/SET-102 - Test SET_GROUP object against ZONE/ZON-103 - Test if GROUP object is in ZONE.lua index 1a893154b1..8271df5e89 100644 --- a/Core/Set/SET-102 - Test SET_GROUP object against ZONE/ZON-103 - Test if GROUP object is in ZONE.lua +++ b/Core/Set/SET-102 - Test SET_GROUP object against ZONE/ZON-103 - Test if GROUP object is in ZONE.lua @@ -1,24 +1,24 @@ ---- --- Name: ZON-103 - Test if GROUP object is in ZONE --- Author: FlightControl --- Date Created: 31 Mar 2017 --- --- # Situation: --- --- A ZONE has been defined, and it is checked if a GROUP object is within the zone. --- --- # Test cases: --- --- 1. Observe the zone perimeter, and place the GROUP object in or out of the zone. --- 2. Observe the results of the functions. - - -GroupObject = GROUP:FindByName( "Group Object" ) - -Zone = ZONE:New( "Zone" ) - - -Zone:E( { "Group is completely in Zone:", GroupObject:IsCompletelyInZone( Zone ) } ) -Zone:E( { "Group is partially in Zone:", GroupObject:IsPartlyInZone( Zone ) } ) -Zone:E( { "Group is not in Zone:", GroupObject:IsNotInZone( Zone ) } ) - +--- +-- Name: ZON-103 - Test if GROUP object is in ZONE +-- Author: FlightControl +-- Date Created: 31 Mar 2017 +-- +-- # Situation: +-- +-- A ZONE has been defined, and it is checked if a GROUP object is within the zone. +-- +-- # Test cases: +-- +-- 1. Observe the zone perimeter, and place the GROUP object in or out of the zone. +-- 2. Observe the results of the functions. + + +GroupObject = GROUP:FindByName( "Group Object" ) + +Zone = ZONE:New( "Zone" ) + + +Zone:E( { "Group is completely in Zone:", GroupObject:IsCompletelyInZone( Zone ) } ) +Zone:E( { "Group is partially in Zone:", GroupObject:IsPartlyInZone( Zone ) } ) +Zone:E( { "Group is not in Zone:", GroupObject:IsNotInZone( Zone ) } ) + diff --git a/Core/Set/SET-103 - Test SET_GROUP players added and deleted/SET-103 - Test SET_GROUP players added and deleted.lua b/Core/Set/SET-103 - Test SET_GROUP players added and deleted/SET-103 - Test SET_GROUP players added and deleted.lua index 985aee42b8..e699343f45 100644 --- a/Core/Set/SET-103 - Test SET_GROUP players added and deleted/SET-103 - Test SET_GROUP players added and deleted.lua +++ b/Core/Set/SET-103 - Test SET_GROUP players added and deleted/SET-103 - Test SET_GROUP players added and deleted.lua @@ -1,17 +1,17 @@ ---- --- Name: SET-103 - Test SET_GROUP players added and deleted --- Author: FlightControl --- Date Created: 31 Mar 2017 --- --- # Situation: --- --- Multiple groups of ground vehicles have been defined. --- There are collected in a SET_GROUP. --- A human player is jumping into the seat on one of these vehicles of the SET_GROUP. --- --- # Test cases: --- --- 1. Observe the player added and deleted from the SET_GROUP depending on the behaviour. - - -SetGroupObject = SET_GROUP:New():FilterCoalitions("blue"):FilterPrefixes("Group Object"):FilterStart() +--- +-- Name: SET-103 - Test SET_GROUP players added and deleted +-- Author: FlightControl +-- Date Created: 31 Mar 2017 +-- +-- # Situation: +-- +-- Multiple groups of ground vehicles have been defined. +-- There are collected in a SET_GROUP. +-- A human player is jumping into the seat on one of these vehicles of the SET_GROUP. +-- +-- # Test cases: +-- +-- 1. Observe the player added and deleted from the SET_GROUP depending on the behaviour. + + +SetGroupObject = SET_GROUP:New():FilterCoalitions("blue"):FilterPrefixes("Group Object"):FilterStart() diff --git a/Core/Set/SET-201 - Client Sets/SET-201 - Client Sets.lua b/Core/Set/SET-201 - Client Sets/SET-201 - Client Sets.lua index af79af84f2..8cb55e3ecf 100644 --- a/Core/Set/SET-201 - Client Sets/SET-201 - Client Sets.lua +++ b/Core/Set/SET-201 - Client Sets/SET-201 - Client Sets.lua @@ -1,3 +1,3 @@ - -SetClient = SET_CLIENT:New():FilterCoalitions("blue"):FilterCategories("plane"):FilterCountries("USA"):FilterStart() - + +SetClient = SET_CLIENT:New():FilterCoalitions("blue"):FilterCategories("plane"):FilterCountries("USA"):FilterStart() + diff --git a/Core/Set/SET-GRP/SET-GRP-000 - Add and Remove/SET-101 - Group Sets.lua b/Core/Set/SET-GRP/SET-GRP-000 - Add and Remove/SET-101 - Group Sets.lua index 6321134071..ba7685e8e3 100644 --- a/Core/Set/SET-GRP/SET-GRP-000 - Add and Remove/SET-101 - Group Sets.lua +++ b/Core/Set/SET-GRP/SET-GRP-000 - Add and Remove/SET-101 - Group Sets.lua @@ -1,163 +1,163 @@ - - - - -SetVehicles = SET_GROUP:New() - -SetVehicles:AddGroupsByName( { "Vehicle A", "Vehicle B", "Vehicle C" } ) - -SetVehicles:ForEachGroup( - --- @param Wrapper.Group#GROUP MooseGroup - function( MooseGroup ) - for UnitId, UnitData in pairs( MooseGroup:GetUnits() ) do - local UnitAction = UnitData -- Wrapper.Unit#UNIT - UnitAction:SmokeGreen() - end - end -) - - - -SetBluePlanesGroup = SET_GROUP:New() - :FilterCoalitions( "blue" ) - :FilterCategories( "plane" ) - :FilterStart() - -SetNorthKoreaGroup = SET_GROUP:New() - :FilterCountries( "RUSSIA" ) - :FilterStart() - -SetSAMGroup = SET_GROUP:New() - :FilterPrefixes( "SAM" ) - :FilterStart() - :SetIteratorIntervals( 5, 10 ) - -SetGroundGroup = SET_GROUP:New() - :FilterCategories( "ground" ) - :FilterStart() - -SetGroundGroup:Flush() - -SpawnUS_Plane = SPAWN:New( 'Spawn Test USA Plane') -GroupUS_Plane = SpawnUS_Plane:Spawn() - -SpawnUS_Vehicle = SPAWN:New( 'Spawn Test USA Vehicle') -GroupUS_Vehicle = SpawnUS_Vehicle:Spawn() - -SpawnUS_Ship = SPAWN:New( 'Spawn Test USA Ship') -GroupUS_Ship = SpawnUS_Ship:Spawn() - -SpawnRU_Vehicle = SPAWN:New( 'Spawn Test RUSSIA Vehicle') -GroupRU_Vehicle = SpawnRU_Vehicle:Spawn() - -SpawnRU_Ship = SPAWN:New( 'Spawn Test RUSSIA Ship') -GroupRU_Ship = SpawnRU_Ship:Spawn() - -SpawnM2A2_AttackVehicle = SPAWN:New( 'Spawn Test M2A2 Attack Vehicle' ):InitRandomizeUnits( true, 10, 4 ) -SpawnSAM_AttackVehicle = SPAWN:New( 'Spawn Test SAM Attack Vehicle' ):InitRandomizeUnits( true, 10, 4 ) - -for i = 1, 30 do - GroupM2A2_AttackVehicle = SpawnM2A2_AttackVehicle:SpawnInZone( ZONE:New("Spawn Zone") ) - GroupSAM_AttackVehicle = SpawnSAM_AttackVehicle:SpawnInZone( ZONE:New("Spawn Zone") ) -end - -SetVehicleCompletely = SET_GROUP:New() - :FilterPrefixes( "Spawn Vehicle Zone Completely" ) - :FilterStart() - -SetVehiclePartly = SET_GROUP:New() - :FilterPrefixes( "Spawn Vehicle Zone Partly" ) - :FilterStart() - -SetVehicleNot = SET_GROUP:New() - :FilterPrefixes( "Spawn Vehicle Zone Not" ) - :FilterStart() - -Spawn_Vehicle_Zone_Completely = SPAWN:New( 'Spawn Vehicle Zone Completely' ):InitRandomizeUnits( true, 10, 4) -Spawn_Vehicle_Zone_Partly = SPAWN:New( 'Spawn Vehicle Zone Partly' ):InitRandomizeUnits( true, 10, 4 ) -Spawn_Vehicle_Zone_Not = SPAWN:New( 'Spawn Vehicle Zone Not' ):InitRandomizeUnits( true, 10, 4 ) -for i = 1, 30 do - Spawn_Vehicle_Zone_Completely:SpawnInZone( ZONE:New("Spawn Zone Completely") ) - Spawn_Vehicle_Zone_Partly:SpawnInZone( ZONE:New("Spawn Zone Partly") ) - Spawn_Vehicle_Zone_Not:SpawnInZone( ZONE:New("Spawn Zone Not") ) -end - ---DBBlue:TraceDatabase() ---SCHEDULER:New( DBBluePlanes, DBBluePlanes.Flush, { }, 1 ) ---SCHEDULER:New( DBRedVehicles, DBRedVehicles.Flush, { }, 1 ) ---SCHEDULER:New( DBShips, DBShips.Flush, { }, 1 ) ---SCHEDULER:New( DBBelgium, DBBelgium.Flush, { }, 1 ) ---SCHEDULER:New( DBNorthKorea, DBNorthKorea.Flush, { }, 1 ) ---SCHEDULER:New( DBKA50Vinson, DBKA50Vinson.Flush, { }, 1 ) --- ---SCHEDULER:New( DBBluePlanesGroup, DBBluePlanesGroup.Flush, { }, 1 ) ---SCHEDULER:New( DBNorthKoreaGroup, DBNorthKoreaGroup.Flush, { }, 1 ) - -SetBluePlanesGroup:ForEachGroup( - --- @param Wrapper.Group#GROUP MooseGroup - function( MooseGroup ) - for UnitId, UnitData in pairs( MooseGroup:GetUnits() ) do - local UnitAction = UnitData -- Wrapper.Unit#UNIT - UnitAction:SmokeBlue() - end - end -) - -SetNorthKoreaGroup:ForEachGroup( - --- @param Wrapper.Group#GROUP MooseGroup - function( MooseGroup ) - for UnitId, UnitData in pairs( MooseGroup:GetUnits() ) do - local UnitAction = UnitData -- Wrapper.Unit#UNIT - UnitAction:SmokeRed() - end - end -) - -SetSAMGroup:ForEachGroup( - --- @param Wrapper.Group#GROUP MooseGroup - function( MooseGroup ) - for UnitId, UnitData in pairs( MooseGroup:GetUnits() ) do - local UnitAction = UnitData -- Wrapper.Unit#UNIT - UnitAction:SmokeOrange() - end - end -) - -GroupZoneCompletely = GROUP:FindByName( "Zone Completely" ) -GroupZonePartly = GROUP:FindByName( "Zone Partly" ) -GroupZoneNot = GROUP:FindByName( "Zone Not" ) - -ZoneCompletely = ZONE_POLYGON:New( "Zone Completely", GroupZoneCompletely ):SmokeZone( SMOKECOLOR.White ) -ZonePartly = ZONE_POLYGON:New( "Zone Partly", GroupZonePartly ):SmokeZone( SMOKECOLOR.White ) -ZoneNot = ZONE_POLYGON:New( "Zone Not", GroupZoneNot ):SmokeZone( SMOKECOLOR.White ) - -SetVehicleCompletely:ForEachGroupCompletelyInZone( ZoneCompletely, - --- @param Wrapper.Group#GROUP MooseGroup - function( MooseGroup ) - for UnitId, UnitData in pairs( MooseGroup:GetUnits() ) do - local UnitAction = UnitData -- Wrapper.Unit#UNIT - UnitAction:SmokeBlue() - end - end -) - -SetVehiclePartly:ForEachGroupPartlyInZone( ZonePartly, - --- @param Wrapper.Group#GROUP MooseGroup - function( MooseGroup ) - for UnitId, UnitData in pairs( MooseGroup:GetUnits() ) do - local UnitAction = UnitData -- Wrapper.Unit#UNIT - UnitAction:SmokeBlue() - end - end -) - -SetVehicleNot:ForEachGroupNotInZone( ZoneNot, - --- @param Wrapper.Group#GROUP MooseGroup - function( MooseGroup ) - for UnitId, UnitData in pairs( MooseGroup:GetUnits() ) do - local UnitAction = UnitData -- Wrapper.Unit#UNIT - UnitAction:SmokeBlue() - end - end -) + + + + +SetVehicles = SET_GROUP:New() + +SetVehicles:AddGroupsByName( { "Vehicle A", "Vehicle B", "Vehicle C" } ) + +SetVehicles:ForEachGroup( + --- @param Wrapper.Group#GROUP MooseGroup + function( MooseGroup ) + for UnitId, UnitData in pairs( MooseGroup:GetUnits() ) do + local UnitAction = UnitData -- Wrapper.Unit#UNIT + UnitAction:SmokeGreen() + end + end +) + + + +SetBluePlanesGroup = SET_GROUP:New() + :FilterCoalitions( "blue" ) + :FilterCategories( "plane" ) + :FilterStart() + +SetNorthKoreaGroup = SET_GROUP:New() + :FilterCountries( "RUSSIA" ) + :FilterStart() + +SetSAMGroup = SET_GROUP:New() + :FilterPrefixes( "SAM" ) + :FilterStart() + :SetIteratorIntervals( 5, 10 ) + +SetGroundGroup = SET_GROUP:New() + :FilterCategories( "ground" ) + :FilterStart() + +SetGroundGroup:Flush() + +SpawnUS_Plane = SPAWN:New( 'Spawn Test USA Plane') +GroupUS_Plane = SpawnUS_Plane:Spawn() + +SpawnUS_Vehicle = SPAWN:New( 'Spawn Test USA Vehicle') +GroupUS_Vehicle = SpawnUS_Vehicle:Spawn() + +SpawnUS_Ship = SPAWN:New( 'Spawn Test USA Ship') +GroupUS_Ship = SpawnUS_Ship:Spawn() + +SpawnRU_Vehicle = SPAWN:New( 'Spawn Test RUSSIA Vehicle') +GroupRU_Vehicle = SpawnRU_Vehicle:Spawn() + +SpawnRU_Ship = SPAWN:New( 'Spawn Test RUSSIA Ship') +GroupRU_Ship = SpawnRU_Ship:Spawn() + +SpawnM2A2_AttackVehicle = SPAWN:New( 'Spawn Test M2A2 Attack Vehicle' ):InitRandomizeUnits( true, 10, 4 ) +SpawnSAM_AttackVehicle = SPAWN:New( 'Spawn Test SAM Attack Vehicle' ):InitRandomizeUnits( true, 10, 4 ) + +for i = 1, 30 do + GroupM2A2_AttackVehicle = SpawnM2A2_AttackVehicle:SpawnInZone( ZONE:New("Spawn Zone") ) + GroupSAM_AttackVehicle = SpawnSAM_AttackVehicle:SpawnInZone( ZONE:New("Spawn Zone") ) +end + +SetVehicleCompletely = SET_GROUP:New() + :FilterPrefixes( "Spawn Vehicle Zone Completely" ) + :FilterStart() + +SetVehiclePartly = SET_GROUP:New() + :FilterPrefixes( "Spawn Vehicle Zone Partly" ) + :FilterStart() + +SetVehicleNot = SET_GROUP:New() + :FilterPrefixes( "Spawn Vehicle Zone Not" ) + :FilterStart() + +Spawn_Vehicle_Zone_Completely = SPAWN:New( 'Spawn Vehicle Zone Completely' ):InitRandomizeUnits( true, 10, 4) +Spawn_Vehicle_Zone_Partly = SPAWN:New( 'Spawn Vehicle Zone Partly' ):InitRandomizeUnits( true, 10, 4 ) +Spawn_Vehicle_Zone_Not = SPAWN:New( 'Spawn Vehicle Zone Not' ):InitRandomizeUnits( true, 10, 4 ) +for i = 1, 30 do + Spawn_Vehicle_Zone_Completely:SpawnInZone( ZONE:New("Spawn Zone Completely") ) + Spawn_Vehicle_Zone_Partly:SpawnInZone( ZONE:New("Spawn Zone Partly") ) + Spawn_Vehicle_Zone_Not:SpawnInZone( ZONE:New("Spawn Zone Not") ) +end + +--DBBlue:TraceDatabase() +--SCHEDULER:New( DBBluePlanes, DBBluePlanes.Flush, { }, 1 ) +--SCHEDULER:New( DBRedVehicles, DBRedVehicles.Flush, { }, 1 ) +--SCHEDULER:New( DBShips, DBShips.Flush, { }, 1 ) +--SCHEDULER:New( DBBelgium, DBBelgium.Flush, { }, 1 ) +--SCHEDULER:New( DBNorthKorea, DBNorthKorea.Flush, { }, 1 ) +--SCHEDULER:New( DBKA50Vinson, DBKA50Vinson.Flush, { }, 1 ) +-- +--SCHEDULER:New( DBBluePlanesGroup, DBBluePlanesGroup.Flush, { }, 1 ) +--SCHEDULER:New( DBNorthKoreaGroup, DBNorthKoreaGroup.Flush, { }, 1 ) + +SetBluePlanesGroup:ForEachGroup( + --- @param Wrapper.Group#GROUP MooseGroup + function( MooseGroup ) + for UnitId, UnitData in pairs( MooseGroup:GetUnits() ) do + local UnitAction = UnitData -- Wrapper.Unit#UNIT + UnitAction:SmokeBlue() + end + end +) + +SetNorthKoreaGroup:ForEachGroup( + --- @param Wrapper.Group#GROUP MooseGroup + function( MooseGroup ) + for UnitId, UnitData in pairs( MooseGroup:GetUnits() ) do + local UnitAction = UnitData -- Wrapper.Unit#UNIT + UnitAction:SmokeRed() + end + end +) + +SetSAMGroup:ForEachGroup( + --- @param Wrapper.Group#GROUP MooseGroup + function( MooseGroup ) + for UnitId, UnitData in pairs( MooseGroup:GetUnits() ) do + local UnitAction = UnitData -- Wrapper.Unit#UNIT + UnitAction:SmokeOrange() + end + end +) + +GroupZoneCompletely = GROUP:FindByName( "Zone Completely" ) +GroupZonePartly = GROUP:FindByName( "Zone Partly" ) +GroupZoneNot = GROUP:FindByName( "Zone Not" ) + +ZoneCompletely = ZONE_POLYGON:New( "Zone Completely", GroupZoneCompletely ):SmokeZone( SMOKECOLOR.White ) +ZonePartly = ZONE_POLYGON:New( "Zone Partly", GroupZonePartly ):SmokeZone( SMOKECOLOR.White ) +ZoneNot = ZONE_POLYGON:New( "Zone Not", GroupZoneNot ):SmokeZone( SMOKECOLOR.White ) + +SetVehicleCompletely:ForEachGroupCompletelyInZone( ZoneCompletely, + --- @param Wrapper.Group#GROUP MooseGroup + function( MooseGroup ) + for UnitId, UnitData in pairs( MooseGroup:GetUnits() ) do + local UnitAction = UnitData -- Wrapper.Unit#UNIT + UnitAction:SmokeBlue() + end + end +) + +SetVehiclePartly:ForEachGroupPartlyInZone( ZonePartly, + --- @param Wrapper.Group#GROUP MooseGroup + function( MooseGroup ) + for UnitId, UnitData in pairs( MooseGroup:GetUnits() ) do + local UnitAction = UnitData -- Wrapper.Unit#UNIT + UnitAction:SmokeBlue() + end + end +) + +SetVehicleNot:ForEachGroupNotInZone( ZoneNot, + --- @param Wrapper.Group#GROUP MooseGroup + function( MooseGroup ) + for UnitId, UnitData in pairs( MooseGroup:GetUnits() ) do + local UnitAction = UnitData -- Wrapper.Unit#UNIT + UnitAction:SmokeBlue() + end + end +) \ No newline at end of file diff --git a/Core/Set/SET-GRP/SET-GRP-101 - Group Sets/SET-101 - Group Sets.lua b/Core/Set/SET-GRP/SET-GRP-101 - Group Sets/SET-101 - Group Sets.lua index 6321134071..ba7685e8e3 100644 --- a/Core/Set/SET-GRP/SET-GRP-101 - Group Sets/SET-101 - Group Sets.lua +++ b/Core/Set/SET-GRP/SET-GRP-101 - Group Sets/SET-101 - Group Sets.lua @@ -1,163 +1,163 @@ - - - - -SetVehicles = SET_GROUP:New() - -SetVehicles:AddGroupsByName( { "Vehicle A", "Vehicle B", "Vehicle C" } ) - -SetVehicles:ForEachGroup( - --- @param Wrapper.Group#GROUP MooseGroup - function( MooseGroup ) - for UnitId, UnitData in pairs( MooseGroup:GetUnits() ) do - local UnitAction = UnitData -- Wrapper.Unit#UNIT - UnitAction:SmokeGreen() - end - end -) - - - -SetBluePlanesGroup = SET_GROUP:New() - :FilterCoalitions( "blue" ) - :FilterCategories( "plane" ) - :FilterStart() - -SetNorthKoreaGroup = SET_GROUP:New() - :FilterCountries( "RUSSIA" ) - :FilterStart() - -SetSAMGroup = SET_GROUP:New() - :FilterPrefixes( "SAM" ) - :FilterStart() - :SetIteratorIntervals( 5, 10 ) - -SetGroundGroup = SET_GROUP:New() - :FilterCategories( "ground" ) - :FilterStart() - -SetGroundGroup:Flush() - -SpawnUS_Plane = SPAWN:New( 'Spawn Test USA Plane') -GroupUS_Plane = SpawnUS_Plane:Spawn() - -SpawnUS_Vehicle = SPAWN:New( 'Spawn Test USA Vehicle') -GroupUS_Vehicle = SpawnUS_Vehicle:Spawn() - -SpawnUS_Ship = SPAWN:New( 'Spawn Test USA Ship') -GroupUS_Ship = SpawnUS_Ship:Spawn() - -SpawnRU_Vehicle = SPAWN:New( 'Spawn Test RUSSIA Vehicle') -GroupRU_Vehicle = SpawnRU_Vehicle:Spawn() - -SpawnRU_Ship = SPAWN:New( 'Spawn Test RUSSIA Ship') -GroupRU_Ship = SpawnRU_Ship:Spawn() - -SpawnM2A2_AttackVehicle = SPAWN:New( 'Spawn Test M2A2 Attack Vehicle' ):InitRandomizeUnits( true, 10, 4 ) -SpawnSAM_AttackVehicle = SPAWN:New( 'Spawn Test SAM Attack Vehicle' ):InitRandomizeUnits( true, 10, 4 ) - -for i = 1, 30 do - GroupM2A2_AttackVehicle = SpawnM2A2_AttackVehicle:SpawnInZone( ZONE:New("Spawn Zone") ) - GroupSAM_AttackVehicle = SpawnSAM_AttackVehicle:SpawnInZone( ZONE:New("Spawn Zone") ) -end - -SetVehicleCompletely = SET_GROUP:New() - :FilterPrefixes( "Spawn Vehicle Zone Completely" ) - :FilterStart() - -SetVehiclePartly = SET_GROUP:New() - :FilterPrefixes( "Spawn Vehicle Zone Partly" ) - :FilterStart() - -SetVehicleNot = SET_GROUP:New() - :FilterPrefixes( "Spawn Vehicle Zone Not" ) - :FilterStart() - -Spawn_Vehicle_Zone_Completely = SPAWN:New( 'Spawn Vehicle Zone Completely' ):InitRandomizeUnits( true, 10, 4) -Spawn_Vehicle_Zone_Partly = SPAWN:New( 'Spawn Vehicle Zone Partly' ):InitRandomizeUnits( true, 10, 4 ) -Spawn_Vehicle_Zone_Not = SPAWN:New( 'Spawn Vehicle Zone Not' ):InitRandomizeUnits( true, 10, 4 ) -for i = 1, 30 do - Spawn_Vehicle_Zone_Completely:SpawnInZone( ZONE:New("Spawn Zone Completely") ) - Spawn_Vehicle_Zone_Partly:SpawnInZone( ZONE:New("Spawn Zone Partly") ) - Spawn_Vehicle_Zone_Not:SpawnInZone( ZONE:New("Spawn Zone Not") ) -end - ---DBBlue:TraceDatabase() ---SCHEDULER:New( DBBluePlanes, DBBluePlanes.Flush, { }, 1 ) ---SCHEDULER:New( DBRedVehicles, DBRedVehicles.Flush, { }, 1 ) ---SCHEDULER:New( DBShips, DBShips.Flush, { }, 1 ) ---SCHEDULER:New( DBBelgium, DBBelgium.Flush, { }, 1 ) ---SCHEDULER:New( DBNorthKorea, DBNorthKorea.Flush, { }, 1 ) ---SCHEDULER:New( DBKA50Vinson, DBKA50Vinson.Flush, { }, 1 ) --- ---SCHEDULER:New( DBBluePlanesGroup, DBBluePlanesGroup.Flush, { }, 1 ) ---SCHEDULER:New( DBNorthKoreaGroup, DBNorthKoreaGroup.Flush, { }, 1 ) - -SetBluePlanesGroup:ForEachGroup( - --- @param Wrapper.Group#GROUP MooseGroup - function( MooseGroup ) - for UnitId, UnitData in pairs( MooseGroup:GetUnits() ) do - local UnitAction = UnitData -- Wrapper.Unit#UNIT - UnitAction:SmokeBlue() - end - end -) - -SetNorthKoreaGroup:ForEachGroup( - --- @param Wrapper.Group#GROUP MooseGroup - function( MooseGroup ) - for UnitId, UnitData in pairs( MooseGroup:GetUnits() ) do - local UnitAction = UnitData -- Wrapper.Unit#UNIT - UnitAction:SmokeRed() - end - end -) - -SetSAMGroup:ForEachGroup( - --- @param Wrapper.Group#GROUP MooseGroup - function( MooseGroup ) - for UnitId, UnitData in pairs( MooseGroup:GetUnits() ) do - local UnitAction = UnitData -- Wrapper.Unit#UNIT - UnitAction:SmokeOrange() - end - end -) - -GroupZoneCompletely = GROUP:FindByName( "Zone Completely" ) -GroupZonePartly = GROUP:FindByName( "Zone Partly" ) -GroupZoneNot = GROUP:FindByName( "Zone Not" ) - -ZoneCompletely = ZONE_POLYGON:New( "Zone Completely", GroupZoneCompletely ):SmokeZone( SMOKECOLOR.White ) -ZonePartly = ZONE_POLYGON:New( "Zone Partly", GroupZonePartly ):SmokeZone( SMOKECOLOR.White ) -ZoneNot = ZONE_POLYGON:New( "Zone Not", GroupZoneNot ):SmokeZone( SMOKECOLOR.White ) - -SetVehicleCompletely:ForEachGroupCompletelyInZone( ZoneCompletely, - --- @param Wrapper.Group#GROUP MooseGroup - function( MooseGroup ) - for UnitId, UnitData in pairs( MooseGroup:GetUnits() ) do - local UnitAction = UnitData -- Wrapper.Unit#UNIT - UnitAction:SmokeBlue() - end - end -) - -SetVehiclePartly:ForEachGroupPartlyInZone( ZonePartly, - --- @param Wrapper.Group#GROUP MooseGroup - function( MooseGroup ) - for UnitId, UnitData in pairs( MooseGroup:GetUnits() ) do - local UnitAction = UnitData -- Wrapper.Unit#UNIT - UnitAction:SmokeBlue() - end - end -) - -SetVehicleNot:ForEachGroupNotInZone( ZoneNot, - --- @param Wrapper.Group#GROUP MooseGroup - function( MooseGroup ) - for UnitId, UnitData in pairs( MooseGroup:GetUnits() ) do - local UnitAction = UnitData -- Wrapper.Unit#UNIT - UnitAction:SmokeBlue() - end - end -) + + + + +SetVehicles = SET_GROUP:New() + +SetVehicles:AddGroupsByName( { "Vehicle A", "Vehicle B", "Vehicle C" } ) + +SetVehicles:ForEachGroup( + --- @param Wrapper.Group#GROUP MooseGroup + function( MooseGroup ) + for UnitId, UnitData in pairs( MooseGroup:GetUnits() ) do + local UnitAction = UnitData -- Wrapper.Unit#UNIT + UnitAction:SmokeGreen() + end + end +) + + + +SetBluePlanesGroup = SET_GROUP:New() + :FilterCoalitions( "blue" ) + :FilterCategories( "plane" ) + :FilterStart() + +SetNorthKoreaGroup = SET_GROUP:New() + :FilterCountries( "RUSSIA" ) + :FilterStart() + +SetSAMGroup = SET_GROUP:New() + :FilterPrefixes( "SAM" ) + :FilterStart() + :SetIteratorIntervals( 5, 10 ) + +SetGroundGroup = SET_GROUP:New() + :FilterCategories( "ground" ) + :FilterStart() + +SetGroundGroup:Flush() + +SpawnUS_Plane = SPAWN:New( 'Spawn Test USA Plane') +GroupUS_Plane = SpawnUS_Plane:Spawn() + +SpawnUS_Vehicle = SPAWN:New( 'Spawn Test USA Vehicle') +GroupUS_Vehicle = SpawnUS_Vehicle:Spawn() + +SpawnUS_Ship = SPAWN:New( 'Spawn Test USA Ship') +GroupUS_Ship = SpawnUS_Ship:Spawn() + +SpawnRU_Vehicle = SPAWN:New( 'Spawn Test RUSSIA Vehicle') +GroupRU_Vehicle = SpawnRU_Vehicle:Spawn() + +SpawnRU_Ship = SPAWN:New( 'Spawn Test RUSSIA Ship') +GroupRU_Ship = SpawnRU_Ship:Spawn() + +SpawnM2A2_AttackVehicle = SPAWN:New( 'Spawn Test M2A2 Attack Vehicle' ):InitRandomizeUnits( true, 10, 4 ) +SpawnSAM_AttackVehicle = SPAWN:New( 'Spawn Test SAM Attack Vehicle' ):InitRandomizeUnits( true, 10, 4 ) + +for i = 1, 30 do + GroupM2A2_AttackVehicle = SpawnM2A2_AttackVehicle:SpawnInZone( ZONE:New("Spawn Zone") ) + GroupSAM_AttackVehicle = SpawnSAM_AttackVehicle:SpawnInZone( ZONE:New("Spawn Zone") ) +end + +SetVehicleCompletely = SET_GROUP:New() + :FilterPrefixes( "Spawn Vehicle Zone Completely" ) + :FilterStart() + +SetVehiclePartly = SET_GROUP:New() + :FilterPrefixes( "Spawn Vehicle Zone Partly" ) + :FilterStart() + +SetVehicleNot = SET_GROUP:New() + :FilterPrefixes( "Spawn Vehicle Zone Not" ) + :FilterStart() + +Spawn_Vehicle_Zone_Completely = SPAWN:New( 'Spawn Vehicle Zone Completely' ):InitRandomizeUnits( true, 10, 4) +Spawn_Vehicle_Zone_Partly = SPAWN:New( 'Spawn Vehicle Zone Partly' ):InitRandomizeUnits( true, 10, 4 ) +Spawn_Vehicle_Zone_Not = SPAWN:New( 'Spawn Vehicle Zone Not' ):InitRandomizeUnits( true, 10, 4 ) +for i = 1, 30 do + Spawn_Vehicle_Zone_Completely:SpawnInZone( ZONE:New("Spawn Zone Completely") ) + Spawn_Vehicle_Zone_Partly:SpawnInZone( ZONE:New("Spawn Zone Partly") ) + Spawn_Vehicle_Zone_Not:SpawnInZone( ZONE:New("Spawn Zone Not") ) +end + +--DBBlue:TraceDatabase() +--SCHEDULER:New( DBBluePlanes, DBBluePlanes.Flush, { }, 1 ) +--SCHEDULER:New( DBRedVehicles, DBRedVehicles.Flush, { }, 1 ) +--SCHEDULER:New( DBShips, DBShips.Flush, { }, 1 ) +--SCHEDULER:New( DBBelgium, DBBelgium.Flush, { }, 1 ) +--SCHEDULER:New( DBNorthKorea, DBNorthKorea.Flush, { }, 1 ) +--SCHEDULER:New( DBKA50Vinson, DBKA50Vinson.Flush, { }, 1 ) +-- +--SCHEDULER:New( DBBluePlanesGroup, DBBluePlanesGroup.Flush, { }, 1 ) +--SCHEDULER:New( DBNorthKoreaGroup, DBNorthKoreaGroup.Flush, { }, 1 ) + +SetBluePlanesGroup:ForEachGroup( + --- @param Wrapper.Group#GROUP MooseGroup + function( MooseGroup ) + for UnitId, UnitData in pairs( MooseGroup:GetUnits() ) do + local UnitAction = UnitData -- Wrapper.Unit#UNIT + UnitAction:SmokeBlue() + end + end +) + +SetNorthKoreaGroup:ForEachGroup( + --- @param Wrapper.Group#GROUP MooseGroup + function( MooseGroup ) + for UnitId, UnitData in pairs( MooseGroup:GetUnits() ) do + local UnitAction = UnitData -- Wrapper.Unit#UNIT + UnitAction:SmokeRed() + end + end +) + +SetSAMGroup:ForEachGroup( + --- @param Wrapper.Group#GROUP MooseGroup + function( MooseGroup ) + for UnitId, UnitData in pairs( MooseGroup:GetUnits() ) do + local UnitAction = UnitData -- Wrapper.Unit#UNIT + UnitAction:SmokeOrange() + end + end +) + +GroupZoneCompletely = GROUP:FindByName( "Zone Completely" ) +GroupZonePartly = GROUP:FindByName( "Zone Partly" ) +GroupZoneNot = GROUP:FindByName( "Zone Not" ) + +ZoneCompletely = ZONE_POLYGON:New( "Zone Completely", GroupZoneCompletely ):SmokeZone( SMOKECOLOR.White ) +ZonePartly = ZONE_POLYGON:New( "Zone Partly", GroupZonePartly ):SmokeZone( SMOKECOLOR.White ) +ZoneNot = ZONE_POLYGON:New( "Zone Not", GroupZoneNot ):SmokeZone( SMOKECOLOR.White ) + +SetVehicleCompletely:ForEachGroupCompletelyInZone( ZoneCompletely, + --- @param Wrapper.Group#GROUP MooseGroup + function( MooseGroup ) + for UnitId, UnitData in pairs( MooseGroup:GetUnits() ) do + local UnitAction = UnitData -- Wrapper.Unit#UNIT + UnitAction:SmokeBlue() + end + end +) + +SetVehiclePartly:ForEachGroupPartlyInZone( ZonePartly, + --- @param Wrapper.Group#GROUP MooseGroup + function( MooseGroup ) + for UnitId, UnitData in pairs( MooseGroup:GetUnits() ) do + local UnitAction = UnitData -- Wrapper.Unit#UNIT + UnitAction:SmokeBlue() + end + end +) + +SetVehicleNot:ForEachGroupNotInZone( ZoneNot, + --- @param Wrapper.Group#GROUP MooseGroup + function( MooseGroup ) + for UnitId, UnitData in pairs( MooseGroup:GetUnits() ) do + local UnitAction = UnitData -- Wrapper.Unit#UNIT + UnitAction:SmokeBlue() + end + end +) \ No newline at end of file diff --git a/Core/Set/SET-GRP/SET-GRP-300 - FilterActive Scenario 1/SET-GRP-300 - FilterActive Scenario 1.lua b/Core/Set/SET-GRP/SET-GRP-300 - FilterActive Scenario 1/SET-GRP-300 - FilterActive Scenario 1.lua index a851d9ac86..3df1ec5d54 100644 --- a/Core/Set/SET-GRP/SET-GRP-300 - FilterActive Scenario 1/SET-GRP-300 - FilterActive Scenario 1.lua +++ b/Core/Set/SET-GRP/SET-GRP-300 - FilterActive Scenario 1/SET-GRP-300 - FilterActive Scenario 1.lua @@ -1,8 +1,8 @@ --- The mission contains templates, which are late activated groups. Only the active groups should be included. --- It should count 3 groups in DCS.log. - -SetGroup = SET_GROUP:New():FilterCoalitions("blue"):FilterCategories("ground"):FilterActive():FilterOnce() -SetGroup:Flush() -SetGroup:I( { Count = SetGroup:Count() } ) - -MESSAGE:NewType( "There are " .. SetGroup:Count() .. " groups in the SetGroup.", MESSAGE.Type.Information ):ToAll() +-- The mission contains templates, which are late activated groups. Only the active groups should be included. +-- It should count 3 groups in DCS.log. + +SetGroup = SET_GROUP:New():FilterCoalitions("blue"):FilterCategories("ground"):FilterActive():FilterOnce() +SetGroup:Flush() +SetGroup:I( { Count = SetGroup:Count() } ) + +MESSAGE:NewType( "There are " .. SetGroup:Count() .. " groups in the SetGroup.", MESSAGE.Type.Information ):ToAll() diff --git a/Core/Set/SET-GRP/SET-GRP-300 - FilterActive Scenario 2/SET-GRP-300 - FilterActive Scenario 2.lua b/Core/Set/SET-GRP/SET-GRP-300 - FilterActive Scenario 2/SET-GRP-300 - FilterActive Scenario 2.lua index 6d8db5d616..c41818504f 100644 --- a/Core/Set/SET-GRP/SET-GRP-300 - FilterActive Scenario 2/SET-GRP-300 - FilterActive Scenario 2.lua +++ b/Core/Set/SET-GRP/SET-GRP-300 - FilterActive Scenario 2/SET-GRP-300 - FilterActive Scenario 2.lua @@ -1,8 +1,8 @@ --- The mission contains templates, which are late activated groups. All groups should be included. --- It should count 7 groups in DCS.log. - -SetGroup = SET_GROUP:New():FilterCoalitions("blue"):FilterCategories("ground"):FilterOnce() -SetGroup:Flush() -SetGroup:I( { Count = SetGroup:Count() } ) - -MESSAGE:NewType( "There are " .. SetGroup:Count() .. " groups in the SetGroup.", MESSAGE.Type.Information ):ToAll() +-- The mission contains templates, which are late activated groups. All groups should be included. +-- It should count 7 groups in DCS.log. + +SetGroup = SET_GROUP:New():FilterCoalitions("blue"):FilterCategories("ground"):FilterOnce() +SetGroup:Flush() +SetGroup:I( { Count = SetGroup:Count() } ) + +MESSAGE:NewType( "There are " .. SetGroup:Count() .. " groups in the SetGroup.", MESSAGE.Type.Information ):ToAll() diff --git a/Core/Set/SET-UNT/SET-UNT-100 - FilterOnce Scenario 1/SET-UNT-100 - Unit Sets.lua b/Core/Set/SET-UNT/SET-UNT-100 - FilterOnce Scenario 1/SET-UNT-100 - Unit Sets.lua index 9b2806f476..ed0518e126 100644 --- a/Core/Set/SET-UNT/SET-UNT-100 - FilterOnce Scenario 1/SET-UNT-100 - Unit Sets.lua +++ b/Core/Set/SET-UNT/SET-UNT-100 - FilterOnce Scenario 1/SET-UNT-100 - Unit Sets.lua @@ -1,7 +1,7 @@ - -SetUnit = SET_UNIT:New():FilterCoalitions("blue"):FilterCategories("ground"):FilterOnce() - -SetUnit:Flush() - -SetUnit:I(SetUnit:Count()) - + +SetUnit = SET_UNIT:New():FilterCoalitions("blue"):FilterCategories("ground"):FilterOnce() + +SetUnit:Flush() + +SetUnit:I(SetUnit:Count()) + diff --git a/Core/Set/SET-UNT/SET-UNT-110 - FilterOnce Scenario 2/SET-UNT-110 - FilterOnce Ground.lua b/Core/Set/SET-UNT/SET-UNT-110 - FilterOnce Scenario 2/SET-UNT-110 - FilterOnce Ground.lua index 84bed68067..1183395618 100644 --- a/Core/Set/SET-UNT/SET-UNT-110 - FilterOnce Scenario 2/SET-UNT-110 - FilterOnce Ground.lua +++ b/Core/Set/SET-UNT/SET-UNT-110 - FilterOnce Scenario 2/SET-UNT-110 - FilterOnce Ground.lua @@ -1,12 +1,12 @@ - -SetUnit = SET_UNIT:New():FilterCoalitions("blue"):FilterCategories("ground"):FilterOnce() -SetUnit:Flush() -SetUnit:I( { Count = SetUnit:Count() } ) - -SCHEDULER:New( nil, - function() - SetUnit = SET_UNIT:New():FilterCoalitions("blue"):FilterCategories("ground"):FilterOnce() - SetUnit:Flush() - SetUnit:I( { Count = SetUnit:Count() } ) - end, {}, 60 ) - + +SetUnit = SET_UNIT:New():FilterCoalitions("blue"):FilterCategories("ground"):FilterOnce() +SetUnit:Flush() +SetUnit:I( { Count = SetUnit:Count() } ) + +SCHEDULER:New( nil, + function() + SetUnit = SET_UNIT:New():FilterCoalitions("blue"):FilterCategories("ground"):FilterOnce() + SetUnit:Flush() + SetUnit:I( { Count = SetUnit:Count() } ) + end, {}, 60 ) + diff --git a/Core/Set/SET-UNT/SET-UNT-120 - FilterOnce Scenario 3/SET-UNT-120 - FilterOnce Scenario 3.lua b/Core/Set/SET-UNT/SET-UNT-120 - FilterOnce Scenario 3/SET-UNT-120 - FilterOnce Scenario 3.lua index 0be25eb3a5..82d3b015c8 100644 --- a/Core/Set/SET-UNT/SET-UNT-120 - FilterOnce Scenario 3/SET-UNT-120 - FilterOnce Scenario 3.lua +++ b/Core/Set/SET-UNT/SET-UNT-120 - FilterOnce Scenario 3/SET-UNT-120 - FilterOnce Scenario 3.lua @@ -1,16 +1,16 @@ -SCHEDULER:New( nil, - function() - SetUnit = SET_UNIT:New():FilterCoalitions("blue"):FilterCategories("ground"):FilterOnce() - SetUnit:Flush() - SetUnit:I( { Count = SetUnit:Count() } ) - end, {}, 0, 30 ) - -GroupPlanes = GROUP:FindByName( "Planes #001" ) - -GroupPlanes:HandleEvent( EVENTS.EngineShutdown ) - -function GroupPlanes:OnEventEngineShutdown( EventData ) - - EventData.IniUnit:Destroy() - +SCHEDULER:New( nil, + function() + SetUnit = SET_UNIT:New():FilterCoalitions("blue"):FilterCategories("ground"):FilterOnce() + SetUnit:Flush() + SetUnit:I( { Count = SetUnit:Count() } ) + end, {}, 0, 30 ) + +GroupPlanes = GROUP:FindByName( "Planes #001" ) + +GroupPlanes:HandleEvent( EVENTS.EngineShutdown ) + +function GroupPlanes:OnEventEngineShutdown( EventData ) + + EventData.IniUnit:Destroy() + end \ No newline at end of file diff --git a/Core/Set/SET-UNT/SET-UNT-300 - FilterActive Scenario 1/SET-UNT-300 - FilterActive Scenario 1.lua b/Core/Set/SET-UNT/SET-UNT-300 - FilterActive Scenario 1/SET-UNT-300 - FilterActive Scenario 1.lua index d85a435745..2143e54c53 100644 --- a/Core/Set/SET-UNT/SET-UNT-300 - FilterActive Scenario 1/SET-UNT-300 - FilterActive Scenario 1.lua +++ b/Core/Set/SET-UNT/SET-UNT-300 - FilterActive Scenario 1/SET-UNT-300 - FilterActive Scenario 1.lua @@ -1,8 +1,8 @@ --- The mission contains templates, which are late activated groups. Only the active units should be included. --- It should count 24 units in DCS.log. - -SetUnit = SET_UNIT:New():FilterCoalitions("blue"):FilterCategories("ground"):FilterActive():FilterOnce() -SetUnit:Flush() -SetUnit:I( { Count = SetUnit:Count() } ) - -MESSAGE:NewType( "There are " .. SetUnit:Count() .. " units in the SetUnit.", MESSAGE.Type.Information ):ToAll() +-- The mission contains templates, which are late activated groups. Only the active units should be included. +-- It should count 24 units in DCS.log. + +SetUnit = SET_UNIT:New():FilterCoalitions("blue"):FilterCategories("ground"):FilterActive():FilterOnce() +SetUnit:Flush() +SetUnit:I( { Count = SetUnit:Count() } ) + +MESSAGE:NewType( "There are " .. SetUnit:Count() .. " units in the SetUnit.", MESSAGE.Type.Information ):ToAll() diff --git a/Core/Spawn/SPA-011 - Ground Ops - Simple Spawning/SPA-011 - Ground Ops - Simple Spawning.lua b/Core/Spawn/SPA-011 - Ground Ops - Simple Spawning/SPA-011 - Ground Ops - Simple Spawning.lua index 4272c98f0b..004b07b59a 100644 --- a/Core/Spawn/SPA-011 - Ground Ops - Simple Spawning/SPA-011 - Ground Ops - Simple Spawning.lua +++ b/Core/Spawn/SPA-011 - Ground Ops - Simple Spawning/SPA-011 - Ground Ops - Simple Spawning.lua @@ -1,22 +1,22 @@ --- 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() - - - +-- 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() + + + diff --git a/Core/Spawn/SPA-012 - Ground Ops - Multiple Spawns/SPA-012 - Ground Ops - Multiple Spawns.lua b/Core/Spawn/SPA-012 - Ground Ops - Multiple Spawns/SPA-012 - Ground Ops - Multiple Spawns.lua index 36ce824e35..edaa3c7316 100644 --- a/Core/Spawn/SPA-012 - Ground Ops - Multiple Spawns/SPA-012 - Ground Ops - Multiple Spawns.lua +++ b/Core/Spawn/SPA-012 - Ground Ops - Multiple Spawns/SPA-012 - Ground Ops - Multiple Spawns.lua @@ -1,26 +1,26 @@ --- 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() - - - +-- 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() + + + diff --git a/Core/Spawn/SPA-013 - Ground Ops - Scheduled Spawns/SPA-013 - Ground Ops - Scheduled Spawns.lua b/Core/Spawn/SPA-013 - Ground Ops - Scheduled Spawns/SPA-013 - Ground Ops - Scheduled Spawns.lua index 3549c9a4ee..f6bb11296c 100644 --- a/Core/Spawn/SPA-013 - Ground Ops - Scheduled Spawns/SPA-013 - Ground Ops - Scheduled Spawns.lua +++ b/Core/Spawn/SPA-013 - Ground Ops - Scheduled Spawns/SPA-013 - Ground Ops - Scheduled Spawns.lua @@ -1,22 +1,22 @@ --- 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 ) - - - - +-- 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 ) + + + + diff --git a/Core/Spawn/SPA-014 - Ground Ops - Scheduled Spawns Limited/SPA-014 - Ground Ops - Scheduled Spawns Limited.lua b/Core/Spawn/SPA-014 - Ground Ops - Scheduled Spawns Limited/SPA-014 - Ground Ops - Scheduled Spawns Limited.lua index 7c9b423c7f..dc7002bad7 100644 --- a/Core/Spawn/SPA-014 - Ground Ops - Scheduled Spawns Limited/SPA-014 - Ground Ops - Scheduled Spawns Limited.lua +++ b/Core/Spawn/SPA-014 - Ground Ops - Scheduled Spawns Limited/SPA-014 - Ground Ops - Scheduled Spawns Limited.lua @@ -1,21 +1,21 @@ --- 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 ) - - +-- 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 ) + + diff --git a/Core/Spawn/SPA-015 - Ground Ops - Randomize Route/SPA-015 - Ground Ops - Randomize Route.lua b/Core/Spawn/SPA-015 - Ground Ops - Randomize Route/SPA-015 - Ground Ops - Randomize Route.lua index c6c88f56a0..e6c7dc830a 100644 --- a/Core/Spawn/SPA-015 - Ground Ops - Randomize Route/SPA-015 - Ground Ops - Randomize Route.lua +++ b/Core/Spawn/SPA-015 - Ground Ops - Randomize Route/SPA-015 - Ground Ops - Randomize Route.lua @@ -1,27 +1,27 @@ --- 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 ) - - - - +-- 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 ) + + + + diff --git a/Core/Spawn/SPA-016 - Ground Ops - Randomize Zones/SPA-016 - Ground Ops - Randomize Zones.lua b/Core/Spawn/SPA-016 - Ground Ops - Randomize Zones/SPA-016 - Ground Ops - Randomize Zones.lua index 3bf1f8bfbe..2675f03586 100644 --- a/Core/Spawn/SPA-016 - Ground Ops - Randomize Zones/SPA-016 - Ground Ops - Randomize Zones.lua +++ b/Core/Spawn/SPA-016 - Ground Ops - Randomize Zones/SPA-016 - Ground Ops - Randomize Zones.lua @@ -1,29 +1,29 @@ --- 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 ) - +-- 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 ) + diff --git a/Core/Spawn/SPA-017 - Ground Ops - Set AI inactive while spawning/SPA-017 - Ground Ops - Set AI inactive while spawning.lua b/Core/Spawn/SPA-017 - Ground Ops - Set AI inactive while spawning/SPA-017 - Ground Ops - Set AI inactive while spawning.lua index 54d89d920f..2109de8b52 100644 --- a/Core/Spawn/SPA-017 - Ground Ops - Set AI inactive while spawning/SPA-017 - Ground Ops - Set AI inactive while spawning.lua +++ b/Core/Spawn/SPA-017 - Ground Ops - Set AI inactive while spawning/SPA-017 - Ground Ops - Set AI inactive while spawning.lua @@ -1,31 +1,31 @@ --- 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 ) - +-- 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 ) + diff --git a/Core/Spawn/SPA-018 - Ground Ops - Randomize Templates/SPA-018 - Ground Ops - Randomize Templates.lua b/Core/Spawn/SPA-018 - Ground Ops - Randomize Templates/SPA-018 - Ground Ops - Randomize Templates.lua index 4258bd86c6..28118b01c9 100644 --- a/Core/Spawn/SPA-018 - Ground Ops - Randomize Templates/SPA-018 - Ground Ops - Randomize Templates.lua +++ b/Core/Spawn/SPA-018 - Ground Ops - Randomize Templates/SPA-018 - Ground Ops - Randomize Templates.lua @@ -1,28 +1,28 @@ ---- --- 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 ) - +--- +-- 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 ) + diff --git a/Core/Spawn/SPA-019 - Ground Ops - Randomize Templates without Waypoints/SPA-019 - Ground Ops - Randomize Templates without Waypoints.lua b/Core/Spawn/SPA-019 - Ground Ops - Randomize Templates without Waypoints/SPA-019 - Ground Ops - Randomize Templates without Waypoints.lua index e636abb572..cfd64c10de 100644 --- a/Core/Spawn/SPA-019 - Ground Ops - Randomize Templates without Waypoints/SPA-019 - Ground Ops - Randomize Templates without Waypoints.lua +++ b/Core/Spawn/SPA-019 - Ground Ops - Randomize Templates without Waypoints/SPA-019 - Ground Ops - Randomize Templates without Waypoints.lua @@ -1,27 +1,27 @@ ---- --- 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 ) - +--- +-- 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 ) + diff --git a/Core/Spawn/SPA-020 - Ground Ops - Randomize Templates in Zones no WP/SPA-020 - Ground Ops - Randomize Templates in Zones no WP.lua b/Core/Spawn/SPA-020 - Ground Ops - Randomize Templates in Zones no WP/SPA-020 - Ground Ops - Randomize Templates in Zones no WP.lua index ba61228a34..87c0a4be1d 100644 --- a/Core/Spawn/SPA-020 - Ground Ops - Randomize Templates in Zones no WP/SPA-020 - Ground Ops - Randomize Templates in Zones no WP.lua +++ b/Core/Spawn/SPA-020 - Ground Ops - Randomize Templates in Zones no WP/SPA-020 - Ground Ops - Randomize Templates in Zones no WP.lua @@ -1,29 +1,29 @@ ---- --- 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 ) - +--- +-- 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 ) + diff --git a/Core/Spawn/SPA-021 - Ground Ops - Scheduled Spawns Limited Keep Unit Names/SPA-021 - Ground Ops - Scheduled Spawns Limited Keep Unit Names.lua b/Core/Spawn/SPA-021 - Ground Ops - Scheduled Spawns Limited Keep Unit Names/SPA-021 - Ground Ops - Scheduled Spawns Limited Keep Unit Names.lua index f3f1ad8d1c..97cd6ef8ff 100644 --- a/Core/Spawn/SPA-021 - Ground Ops - Scheduled Spawns Limited Keep Unit Names/SPA-021 - Ground Ops - Scheduled Spawns Limited Keep Unit Names.lua +++ b/Core/Spawn/SPA-021 - Ground Ops - Scheduled Spawns Limited Keep Unit Names/SPA-021 - Ground Ops - Scheduled Spawns Limited Keep Unit Names.lua @@ -1,27 +1,27 @@ ---- --- 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 ) - - +--- +-- 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 ) + + diff --git a/Core/Spawn/SPA-022 - Ground Ops - Scheduled Spawns Limited with long interval/SPA-022 - Ground Ops - Scheduled Spawns Limited with long interval.lua b/Core/Spawn/SPA-022 - Ground Ops - Scheduled Spawns Limited with long interval/SPA-022 - Ground Ops - Scheduled Spawns Limited with long interval.lua index 5096cddc56..01978f8be7 100644 --- a/Core/Spawn/SPA-022 - Ground Ops - Scheduled Spawns Limited with long interval/SPA-022 - Ground Ops - Scheduled Spawns Limited with long interval.lua +++ b/Core/Spawn/SPA-022 - Ground Ops - Scheduled Spawns Limited with long interval/SPA-022 - Ground Ops - Scheduled Spawns Limited with long interval.lua @@ -1,23 +1,23 @@ --- 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 ) - - - - +-- 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 ) + + + + diff --git a/Core/Spawn/SPA-023 - Ground Ops - SpawnStart and SpawnStop/SPA-023 - Ground Ops - SpawnStart and SpawnStop.lua b/Core/Spawn/SPA-023 - Ground Ops - SpawnStart and SpawnStop/SPA-023 - Ground Ops - SpawnStart and SpawnStop.lua index 17c3d32d80..0c3647a3cd 100644 --- a/Core/Spawn/SPA-023 - Ground Ops - SpawnStart and SpawnStop/SPA-023 - Ground Ops - SpawnStart and SpawnStop.lua +++ b/Core/Spawn/SPA-023 - Ground Ops - SpawnStart and SpawnStop/SPA-023 - Ground Ops - SpawnStart and SpawnStop.lua @@ -1,26 +1,26 @@ ---- --- 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() - - - - +--- +-- 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() + + + + diff --git a/Core/Spawn/SPA-024 - Ground Ops - Arrays Normandy/SPA-024 - Ground Ops - Arrays.lua b/Core/Spawn/SPA-024 - Ground Ops - Arrays Normandy/SPA-024 - Ground Ops - Arrays.lua index 43730154a9..1bdb911081 100644 --- a/Core/Spawn/SPA-024 - Ground Ops - Arrays Normandy/SPA-024 - Ground Ops - Arrays.lua +++ b/Core/Spawn/SPA-024 - Ground Ops - Arrays Normandy/SPA-024 - Ground Ops - Arrays.lua @@ -1,27 +1,27 @@ ---- --- 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 ) - - - - - +--- +-- 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 ) + + + + + diff --git a/Core/Spawn/SPA-024 - Ground Ops - Arrays/SPA-024 - Ground Ops - Arrays.lua b/Core/Spawn/SPA-024 - Ground Ops - Arrays/SPA-024 - Ground Ops - Arrays.lua index 43730154a9..1bdb911081 100644 --- a/Core/Spawn/SPA-024 - Ground Ops - Arrays/SPA-024 - Ground Ops - Arrays.lua +++ b/Core/Spawn/SPA-024 - Ground Ops - Arrays/SPA-024 - Ground Ops - Arrays.lua @@ -1,27 +1,27 @@ ---- --- 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 ) - - - - - +--- +-- 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 ) + + + + + diff --git a/Core/Spawn/SPA-025 - Ground Ops - Spawn Hidden/SPA-025 - Ground Ops - Spawn Hidden.lua b/Core/Spawn/SPA-025 - Ground Ops - Spawn Hidden/SPA-025 - Ground Ops - Spawn Hidden.lua index 58c162e33d..1d7837712f 100644 --- a/Core/Spawn/SPA-025 - Ground Ops - Spawn Hidden/SPA-025 - Ground Ops - Spawn Hidden.lua +++ b/Core/Spawn/SPA-025 - Ground Ops - Spawn Hidden/SPA-025 - Ground Ops - Spawn Hidden.lua @@ -1,22 +1,22 @@ --- 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() - - - +-- 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() + + + diff --git a/Core/Spawn/SPA-026 - Ground Ops - Spawn RandomizeTemplate Hidden/SPA-026 - Ground Ops - Spawn RandomizeTemplate Hidden.lua b/Core/Spawn/SPA-026 - Ground Ops - Spawn RandomizeTemplate Hidden/SPA-026 - Ground Ops - Spawn RandomizeTemplate Hidden.lua index 50e602b532..be23d79481 100644 --- a/Core/Spawn/SPA-026 - Ground Ops - Spawn RandomizeTemplate Hidden/SPA-026 - Ground Ops - Spawn RandomizeTemplate Hidden.lua +++ b/Core/Spawn/SPA-026 - Ground Ops - Spawn RandomizeTemplate Hidden/SPA-026 - Ground Ops - Spawn RandomizeTemplate Hidden.lua @@ -1,26 +1,26 @@ --- 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() - - - +-- 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() + + + diff --git a/Core/Spawn/SPA-027 - Ground Ops - Respawning After Destroy/SPA-027 - Ground Ops - Respawning After Destroy.lua b/Core/Spawn/SPA-027 - Ground Ops - Respawning After Destroy/SPA-027 - Ground Ops - Respawning After Destroy.lua index 75d481066d..b749e58a8f 100644 --- a/Core/Spawn/SPA-027 - Ground Ops - Respawning After Destroy/SPA-027 - Ground Ops - Respawning After Destroy.lua +++ b/Core/Spawn/SPA-027 - Ground Ops - Respawning After Destroy/SPA-027 - Ground Ops - Respawning After Destroy.lua @@ -1,25 +1,25 @@ --- 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 ) - - - +-- 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 ) + + + diff --git a/Core/Spawn/SPA-100 - Air Ops - CleanUp of Inactive Units/SPA-100 - Air Ops - Scheduled Spawn Helicopters with CleanUp of Inactive Units.lua b/Core/Spawn/SPA-100 - Air Ops - CleanUp of Inactive Units/SPA-100 - Air Ops - Scheduled Spawn Helicopters with CleanUp of Inactive Units.lua index c7d62a568c..0d07b33fc1 100644 --- a/Core/Spawn/SPA-100 - Air Ops - CleanUp of Inactive Units/SPA-100 - Air Ops - Scheduled Spawn Helicopters with CleanUp of Inactive Units.lua +++ b/Core/Spawn/SPA-100 - Air Ops - CleanUp of Inactive Units/SPA-100 - Air Ops - Scheduled Spawn Helicopters with CleanUp of Inactive Units.lua @@ -1,8 +1,8 @@ --- 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 ) - +-- 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 ) + diff --git a/Core/Spawn/SPA-110 - Limit Spawning/SPA-110 - Limit Spawning.lua b/Core/Spawn/SPA-110 - Limit Spawning/SPA-110 - Limit Spawning.lua index 1ff4c90c02..eb0b7e1eb4 100644 --- a/Core/Spawn/SPA-110 - Limit Spawning/SPA-110 - Limit Spawning.lua +++ b/Core/Spawn/SPA-110 - Limit Spawning/SPA-110 - Limit Spawning.lua @@ -1,17 +1,17 @@ ---- --- 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 ) - - +--- +-- 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 ) + + diff --git a/Core/Spawn/SPA-120 - Air Ops - Scheduled Spawn with Repeat on Landing with Limit/SPA-120 - Air Ops - Scheduled Spawn with Repeat on Landing with Limit.lua b/Core/Spawn/SPA-120 - Air Ops - Scheduled Spawn with Repeat on Landing with Limit/SPA-120 - Air Ops - Scheduled Spawn with Repeat on Landing with Limit.lua index 536e568ded..a08603b410 100644 --- a/Core/Spawn/SPA-120 - Air Ops - Scheduled Spawn with Repeat on Landing with Limit/SPA-120 - Air Ops - Scheduled Spawn with Repeat on Landing with Limit.lua +++ b/Core/Spawn/SPA-120 - Air Ops - Scheduled Spawn with Repeat on Landing with Limit/SPA-120 - Air Ops - Scheduled Spawn with Repeat on Landing with Limit.lua @@ -1,35 +1,35 @@ ---- --- 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 +--- +-- 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 diff --git a/Core/Spawn/SPA-121 - Air Ops - Scheduled Spawns with Repeat on Landing with Limit/SPA-121 - Air Ops - Scheduled Spawns with Repeat on Landing with Limit.lua b/Core/Spawn/SPA-121 - Air Ops - Scheduled Spawns with Repeat on Landing with Limit/SPA-121 - Air Ops - Scheduled Spawns with Repeat on Landing with Limit.lua index e65470a72d..c5f8affe7f 100644 --- a/Core/Spawn/SPA-121 - Air Ops - Scheduled Spawns with Repeat on Landing with Limit/SPA-121 - Air Ops - Scheduled Spawns with Repeat on Landing with Limit.lua +++ b/Core/Spawn/SPA-121 - Air Ops - Scheduled Spawns with Repeat on Landing with Limit/SPA-121 - Air Ops - Scheduled Spawns with Repeat on Landing with Limit.lua @@ -1,51 +1,51 @@ ---- --- 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 +--- +-- 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 diff --git a/Core/Spawn/SPA-122 - Air Ops - OnLand test for Scheduled Spawns/SPA-122 - Air Ops - OnLand test for Scheduled Spawns.lua b/Core/Spawn/SPA-122 - Air Ops - OnLand test for Scheduled Spawns/SPA-122 - Air Ops - OnLand test for Scheduled Spawns.lua index b2e2028c1b..aa977c793f 100644 --- a/Core/Spawn/SPA-122 - Air Ops - OnLand test for Scheduled Spawns/SPA-122 - Air Ops - OnLand test for Scheduled Spawns.lua +++ b/Core/Spawn/SPA-122 - Air Ops - OnLand test for Scheduled Spawns/SPA-122 - Air Ops - OnLand test for Scheduled Spawns.lua @@ -1,47 +1,47 @@ ---- --- 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 +--- +-- 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 diff --git a/Core/Spawn/SPA-123 - Air Ops - Repeat on Landing and InitCleanUp/SPA-123 - Air Ops - Repeat on Landing and InitCleanUp.lua b/Core/Spawn/SPA-123 - Air Ops - Repeat on Landing and InitCleanUp/SPA-123 - Air Ops - Repeat on Landing and InitCleanUp.lua index 59fa26f1eb..076b58e253 100644 --- a/Core/Spawn/SPA-123 - Air Ops - Repeat on Landing and InitCleanUp/SPA-123 - Air Ops - Repeat on Landing and InitCleanUp.lua +++ b/Core/Spawn/SPA-123 - Air Ops - Repeat on Landing and InitCleanUp/SPA-123 - Air Ops - Repeat on Landing and InitCleanUp.lua @@ -1,28 +1,28 @@ ---- --- 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 +--- +-- 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 diff --git a/Core/Spawn/SPA-130 - Uncontrolled Spawning/SPA-130 - Uncontrolled Spawning.lua b/Core/Spawn/SPA-130 - Uncontrolled Spawning/SPA-130 - Uncontrolled Spawning.lua index 6eb08c7921..98ef7e11fb 100644 --- a/Core/Spawn/SPA-130 - Uncontrolled Spawning/SPA-130 - Uncontrolled Spawning.lua +++ b/Core/Spawn/SPA-130 - Uncontrolled Spawning/SPA-130 - Uncontrolled Spawning.lua @@ -1,47 +1,47 @@ ---- --- 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 +--- +-- 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 ) \ No newline at end of file diff --git a/Core/Spawn/SPA-131 - Air Ops - SpawnAtAirbase/SPA-131 - Air Ops - Nevada - SpawnAtAirbase.lua b/Core/Spawn/SPA-131 - Air Ops - SpawnAtAirbase/SPA-131 - Air Ops - Nevada - SpawnAtAirbase.lua index b7b1df3a94..13f670b4ca 100644 --- a/Core/Spawn/SPA-131 - Air Ops - SpawnAtAirbase/SPA-131 - Air Ops - Nevada - SpawnAtAirbase.lua +++ b/Core/Spawn/SPA-131 - Air Ops - SpawnAtAirbase/SPA-131 - Air Ops - Nevada - SpawnAtAirbase.lua @@ -1,11 +1,11 @@ --- 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 ) - - - +-- 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 ) + + + diff --git a/Core/Spawn/SPA-200 - Randomize Unit Types/SPA-200 - Randomize Unit Types.lua b/Core/Spawn/SPA-200 - Randomize Unit Types/SPA-200 - Randomize Unit Types.lua index 4302dd371c..49a51f7e21 100644 --- a/Core/Spawn/SPA-200 - Randomize Unit Types/SPA-200 - Randomize Unit Types.lua +++ b/Core/Spawn/SPA-200 - Randomize Unit Types/SPA-200 - Randomize Unit Types.lua @@ -1,11 +1,11 @@ ---- --- 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 ) - - +--- +-- 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 ) + + diff --git a/Core/Spawn/SPA-220 - Randomize Zones/SPA-220 - Randomize Zones.lua b/Core/Spawn/SPA-220 - Randomize Zones/SPA-220 - Randomize Zones.lua index 99388199ba..08b57de998 100644 --- a/Core/Spawn/SPA-220 - Randomize Zones/SPA-220 - Randomize Zones.lua +++ b/Core/Spawn/SPA-220 - Randomize Zones/SPA-220 - Randomize Zones.lua @@ -1,51 +1,51 @@ --- 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 -) +-- 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 +) diff --git a/Core/Spawn/SPA-310 - Spawn at Static position/SPA-310 - Spawn at Static position.lua b/Core/Spawn/SPA-310 - Spawn at Static position/SPA-310 - Spawn at Static position.lua index f33af118ab..90beecd21f 100644 --- a/Core/Spawn/SPA-310 - Spawn at Static position/SPA-310 - Spawn at Static position.lua +++ b/Core/Spawn/SPA-310 - Spawn at Static position/SPA-310 - Spawn at Static position.lua @@ -1,52 +1,52 @@ - -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 -) + +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 +) diff --git a/Core/Spawn/SPA-320 - Spawn at Unit position/SPA-320 - Spawn at Unit position.lua b/Core/Spawn/SPA-320 - Spawn at Unit position/SPA-320 - Spawn at Unit position.lua index 01e52eda02..a9a462f44c 100644 --- a/Core/Spawn/SPA-320 - Spawn at Unit position/SPA-320 - Spawn at Unit position.lua +++ b/Core/Spawn/SPA-320 - Spawn at Unit position/SPA-320 - Spawn at Unit position.lua @@ -1,52 +1,52 @@ - -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 -) + +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 +) diff --git a/Core/Spawn/SPA-330 - Spawn at Vec2 position/SPA-330 - Spawn at Vec2 position.lua b/Core/Spawn/SPA-330 - Spawn at Vec2 position/SPA-330 - Spawn at Vec2 position.lua index fbb754c873..a2de3504c7 100644 --- a/Core/Spawn/SPA-330 - Spawn at Vec2 position/SPA-330 - Spawn at Vec2 position.lua +++ b/Core/Spawn/SPA-330 - Spawn at Vec2 position/SPA-330 - Spawn at Vec2 position.lua @@ -1,61 +1,61 @@ - -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 -) + +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 +) diff --git a/Core/Spawn/SPA-340 - Spawn at Vec3 position/SPA-340 - Spawn at Vec3 position.lua b/Core/Spawn/SPA-340 - Spawn at Vec3 position/SPA-340 - Spawn at Vec3 position.lua index df0d253ef1..4032e80cce 100644 --- a/Core/Spawn/SPA-340 - Spawn at Vec3 position/SPA-340 - Spawn at Vec3 position.lua +++ b/Core/Spawn/SPA-340 - Spawn at Vec3 position/SPA-340 - Spawn at Vec3 position.lua @@ -1,59 +1,59 @@ - -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 -) + +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 +) diff --git a/Core/Spawn/SPA-350 - Spawn at Vec3 position RandomizePosition/SPA-350 - Spawn at Vec3 position RandomizePosition.lua b/Core/Spawn/SPA-350 - Spawn at Vec3 position RandomizePosition/SPA-350 - Spawn at Vec3 position RandomizePosition.lua index e3ea496327..3122b26dda 100644 --- a/Core/Spawn/SPA-350 - Spawn at Vec3 position RandomizePosition/SPA-350 - Spawn at Vec3 position RandomizePosition.lua +++ b/Core/Spawn/SPA-350 - Spawn at Vec3 position RandomizePosition/SPA-350 - Spawn at Vec3 position RandomizePosition.lua @@ -1,73 +1,73 @@ ---- --- Name: SPA-350 - Spawn at Vec3 position RandomzePosition --- Author: FlightControl --- Date Created: 14 Mar 2017 --- --- # Situation: --- --- Ground troops, Airplanes, Helicopters and Ships are spawning from Vec3 points. --- The API InitRandomizePosition is tested here, ensure that groups are replaced within a 900 to 1000 zone band at random positions. --- --- # Test cases: --- --- 1. Observe the random positioning of the groups. There should be no scattering of units. --- - -local Iterations = 10 -local Iteration = 1 - -GroundZones = { "GroundZone1", "GroundZone2", "GroundZone3" } -GroundRandomizeZones = { "GroundRandomizeZone1", "GroundRandomizeZone2", "GroundRandomizeZone3" } -AirplaneZones = { "AirplaneZone1", "AirplaneZone2", "AirplaneZone3" } -HelicopterZones = { "HelicopterZone1", "HelicopterZone2", "HelicopterZone3" } -ShipZones = { "ShipZone1", "ShipZone2", "ShipZone3" } - -HeightLimit = 500 - -SpawnGrounds = SPAWN:New("Ground"):InitLimit( 20, 10 ):InitRandomizePosition( true , 1000, 900 ) -SpawnRandomizeGrounds = SPAWN:New("GroundRandomize"):InitLimit( 20, 10 ):InitRandomizePosition( true , 1000, 900 ) -SpawnAirplanes = SPAWN:New("Airplane"):InitLimit( 20, 10 ):InitRandomizePosition( true , 1000, 900 ) -SpawnHelicopters = SPAWN:New("Helicopter"):InitLimit( 20, 10 ):InitRandomizePosition( true , 1000, 900 ) -SpawnShips = SPAWN:New("Ship"):InitLimit( 20, 10 ):InitRandomizePosition( true , 1000, 900 ) - ---- Spawns these groups slowly. -SCHEDULER:New( nil, - - function( Interation, Iterations ) - do - -- Spawn Ground - local ZoneName = GroundZones[ math.random( 1, 3 ) ] - local SpawnVec3 = POINT_VEC3:NewFromVec3( ZONE:New( ZoneName ):GetVec3() ) - SpawnGrounds:SpawnFromVec3( SpawnVec3:GetVec3() ) - end - - do - -- Spawn Ground Randomize - local ZoneName = GroundRandomizeZones[ math.random( 1, 3 ) ] - local SpawnVec3 = POINT_VEC3:NewFromVec3( ZONE:New( ZoneName ):GetVec3() ) - SpawnRandomizeGrounds:SpawnFromVec3( SpawnVec3:GetVec3() ) - end - - do - -- Spawn Airplanes - local ZoneName = AirplaneZones[ math.random( 1, 3 ) ] - local SpawnVec3 = POINT_VEC3:NewFromVec3( ZONE:New( ZoneName ):GetVec3() ) - SpawnAirplanes:SpawnFromVec3( SpawnVec3:GetVec3() ) - end - - do - -- Spawn Helicopters - local ZoneName = HelicopterZones[ math.random( 1, 3 ) ] - local SpawnVec3 = POINT_VEC3:NewFromVec3( ZONE:New( ZoneName ):GetVec3() ) - SpawnHelicopters:SpawnFromVec3( SpawnVec3:GetVec3() ) - end - - do - -- Spawn Ships - local ZoneName = ShipZones[ math.random( 1, 3 ) ] - local SpawnVec3 = POINT_VEC3:NewFromVec3( ZONE:New( ZoneName ):GetVec3() ) - SpawnShips:SpawnFromVec3( SpawnVec3:GetVec3() ) - end - - end, {}, 0, 15, 0.5 -) +--- +-- 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 +) diff --git a/Core/Spawn/SPA-350 - Spawn at Vec3 position RandomizePosition/SPA-350 - Spawn at Vec3 position RandomzePosition.lua b/Core/Spawn/SPA-350 - Spawn at Vec3 position RandomizePosition/SPA-350 - Spawn at Vec3 position RandomzePosition.lua index e3ea496327..3122b26dda 100644 --- a/Core/Spawn/SPA-350 - Spawn at Vec3 position RandomizePosition/SPA-350 - Spawn at Vec3 position RandomzePosition.lua +++ b/Core/Spawn/SPA-350 - Spawn at Vec3 position RandomizePosition/SPA-350 - Spawn at Vec3 position RandomzePosition.lua @@ -1,73 +1,73 @@ ---- --- Name: SPA-350 - Spawn at Vec3 position RandomzePosition --- Author: FlightControl --- Date Created: 14 Mar 2017 --- --- # Situation: --- --- Ground troops, Airplanes, Helicopters and Ships are spawning from Vec3 points. --- The API InitRandomizePosition is tested here, ensure that groups are replaced within a 900 to 1000 zone band at random positions. --- --- # Test cases: --- --- 1. Observe the random positioning of the groups. There should be no scattering of units. --- - -local Iterations = 10 -local Iteration = 1 - -GroundZones = { "GroundZone1", "GroundZone2", "GroundZone3" } -GroundRandomizeZones = { "GroundRandomizeZone1", "GroundRandomizeZone2", "GroundRandomizeZone3" } -AirplaneZones = { "AirplaneZone1", "AirplaneZone2", "AirplaneZone3" } -HelicopterZones = { "HelicopterZone1", "HelicopterZone2", "HelicopterZone3" } -ShipZones = { "ShipZone1", "ShipZone2", "ShipZone3" } - -HeightLimit = 500 - -SpawnGrounds = SPAWN:New("Ground"):InitLimit( 20, 10 ):InitRandomizePosition( true , 1000, 900 ) -SpawnRandomizeGrounds = SPAWN:New("GroundRandomize"):InitLimit( 20, 10 ):InitRandomizePosition( true , 1000, 900 ) -SpawnAirplanes = SPAWN:New("Airplane"):InitLimit( 20, 10 ):InitRandomizePosition( true , 1000, 900 ) -SpawnHelicopters = SPAWN:New("Helicopter"):InitLimit( 20, 10 ):InitRandomizePosition( true , 1000, 900 ) -SpawnShips = SPAWN:New("Ship"):InitLimit( 20, 10 ):InitRandomizePosition( true , 1000, 900 ) - ---- Spawns these groups slowly. -SCHEDULER:New( nil, - - function( Interation, Iterations ) - do - -- Spawn Ground - local ZoneName = GroundZones[ math.random( 1, 3 ) ] - local SpawnVec3 = POINT_VEC3:NewFromVec3( ZONE:New( ZoneName ):GetVec3() ) - SpawnGrounds:SpawnFromVec3( SpawnVec3:GetVec3() ) - end - - do - -- Spawn Ground Randomize - local ZoneName = GroundRandomizeZones[ math.random( 1, 3 ) ] - local SpawnVec3 = POINT_VEC3:NewFromVec3( ZONE:New( ZoneName ):GetVec3() ) - SpawnRandomizeGrounds:SpawnFromVec3( SpawnVec3:GetVec3() ) - end - - do - -- Spawn Airplanes - local ZoneName = AirplaneZones[ math.random( 1, 3 ) ] - local SpawnVec3 = POINT_VEC3:NewFromVec3( ZONE:New( ZoneName ):GetVec3() ) - SpawnAirplanes:SpawnFromVec3( SpawnVec3:GetVec3() ) - end - - do - -- Spawn Helicopters - local ZoneName = HelicopterZones[ math.random( 1, 3 ) ] - local SpawnVec3 = POINT_VEC3:NewFromVec3( ZONE:New( ZoneName ):GetVec3() ) - SpawnHelicopters:SpawnFromVec3( SpawnVec3:GetVec3() ) - end - - do - -- Spawn Ships - local ZoneName = ShipZones[ math.random( 1, 3 ) ] - local SpawnVec3 = POINT_VEC3:NewFromVec3( ZONE:New( ZoneName ):GetVec3() ) - SpawnShips:SpawnFromVec3( SpawnVec3:GetVec3() ) - end - - end, {}, 0, 15, 0.5 -) +--- +-- 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 +) diff --git a/Core/SpawnStatic/SPS - 010 - Simple Spawning/SPS - 010 - Simple Spawning.lua b/Core/SpawnStatic/SPS - 010 - Simple Spawning/SPS - 010 - Simple Spawning.lua index a533d78eef..44b5fdaf5f 100644 --- a/Core/SpawnStatic/SPS - 010 - Simple Spawning/SPS - 010 - Simple Spawning.lua +++ b/Core/SpawnStatic/SPS - 010 - Simple Spawning/SPS - 010 - Simple Spawning.lua @@ -1,31 +1,31 @@ ---- Name: SPS-100 - Simple Spawning --- Author: FlightControl --- Date Created: 09 Apr 2017 --- --- # Situation: --- --- At Gudauta spawn a static. --- --- # Test cases: --- --- 1. Observe that the static is spawned. - - -local ZonePosition = ZONE:New( "Position" ) - -local SpawnBuilding = SPAWNSTATIC:NewFromStatic( "Building", country.id.GERMANY ) -local SpawnBarrack = SPAWNSTATIC:NewFromStatic( "Barrack", country.id.GERMANY ) - -local ZonePointVec2 = ZonePosition:GetPointVec2() - -local Building = SpawnBuilding:SpawnFromZone( ZonePosition, 0 ) - -for Heading = 0, 360,60 do - local Radial = Heading * ( math.pi*2 ) / 360 - local x = ZonePointVec2:GetLat() + math.cos( Radial ) * 150 - local y = ZonePointVec2:GetLon() + math.sin( Radial ) * 150 - SpawnBarrack:SpawnFromPointVec2( POINT_VEC2:New( x, y ), Heading + 90 ) -end - - - +--- Name: SPS-100 - Simple Spawning +-- Author: FlightControl +-- Date Created: 09 Apr 2017 +-- +-- # Situation: +-- +-- At Gudauta spawn a static. +-- +-- # Test cases: +-- +-- 1. Observe that the static is spawned. + + +local ZonePosition = ZONE:New( "Position" ) + +local SpawnBuilding = SPAWNSTATIC:NewFromStatic( "Building", country.id.GERMANY ) +local SpawnBarrack = SPAWNSTATIC:NewFromStatic( "Barrack", country.id.GERMANY ) + +local ZonePointVec2 = ZonePosition:GetPointVec2() + +local Building = SpawnBuilding:SpawnFromZone( ZonePosition, 0 ) + +for Heading = 0, 360,60 do + local Radial = Heading * ( math.pi*2 ) / 360 + local x = ZonePointVec2:GetLat() + math.cos( Radial ) * 150 + local y = ZonePointVec2:GetLon() + math.sin( Radial ) * 150 + SpawnBarrack:SpawnFromPointVec2( POINT_VEC2:New( x, y ), Heading + 90 ) +end + + + diff --git a/Core/SpawnStatic/SPS - 050- Spawn FARPs/SPS - 050 - Spawn FARPs.lua b/Core/SpawnStatic/SPS - 050- Spawn FARPs/SPS - 050 - Spawn FARPs.lua index 338aa2e2c6..0bedefd7f5 100644 --- a/Core/SpawnStatic/SPS - 050- Spawn FARPs/SPS - 050 - Spawn FARPs.lua +++ b/Core/SpawnStatic/SPS - 050- Spawn FARPs/SPS - 050 - Spawn FARPs.lua @@ -1,62 +1,62 @@ ---- --- FARPS --- This demo shows how to dynamically spawn FARPs into a mission. --- --- We spawn two FARPS in a zone near Batumi. --- The first FARP is names "FARP Berlin" and the second "FARP London". --- We put coloured smoke on the spawned objects to mark them. --- --- The data is taken from "template" FARPS. Note that if the same --- name as the template is used, the original object is despawned --- automatically when the new object is spawned. --- --- As FARPS in DCS are strange creatures, which are hybrids of groups --- and statics, the function :InitFARP is necessary. ---- - --- Zone near Batumi on land. -local ZoneSpawn=ZONE:FindByName("Spawn Land") - - --- Create a SPAWNSTATIC object from a template static FARP object. -local SpawnStaticFarp=SPAWNSTATIC:NewFromStatic("Static FARP Template-1", country.id.GERMANY) - - --- Spawning FARPS is special in DCS. Therefore, we need to specify that this is a FARP. We also set the callsign and the frequency. -SpawnStaticFarp:InitFARP(CALLSIGN.FARP.Berlin, 130.000, 0) - --- Spawn FARP with heading 90°. It's name will be "Farp Berlin". -local FarpBerlin=SpawnStaticFarp:SpawnFromZone(ZoneSpawn, 90, "FARP Berlin") - --- Smoke static green. -FarpBerlin:GetCoordinate():SmokeGreen() - - --- The second FAPR gets callsign London and used radio frequency 131 MHz. -SpawnStaticFarp:InitFARP(CALLSIGN.FARP.London, 131.000, 0) - --- We set the country to UK. -SpawnStaticFarp:InitCountry(country.id.UK) - --- Spawn the FARP at a random location inside the zone. -local FarpLondon=SpawnStaticFarp:SpawnFromCoordinate(ZoneSpawn:GetRandomCoordinate(), nil, "Farp London") - --- Put red smoke at FARP London. -FarpLondon:GetCoordinate():SmokeRed() - - --- Function to check if the STATIC/AIRBASE objects can be found. -local function check() - - -- Try to find static. - local StaticBerlin=STATIC:FindByName("FARP Berlin") - - -- Launch red flare. - StaticBerlin:GetCoordinate():FlareRed() - - -- Get the airbase object. - local AirbaseBerlin=AIRBASE:FindByName("FARP Berlin") - AirbaseBerlin:MarkParkingSpots() - -end +--- +-- FARPS +-- This demo shows how to dynamically spawn FARPs into a mission. +-- +-- We spawn two FARPS in a zone near Batumi. +-- The first FARP is names "FARP Berlin" and the second "FARP London". +-- We put coloured smoke on the spawned objects to mark them. +-- +-- The data is taken from "template" FARPS. Note that if the same +-- name as the template is used, the original object is despawned +-- automatically when the new object is spawned. +-- +-- As FARPS in DCS are strange creatures, which are hybrids of groups +-- and statics, the function :InitFARP is necessary. +--- + +-- Zone near Batumi on land. +local ZoneSpawn=ZONE:FindByName("Spawn Land") + + +-- Create a SPAWNSTATIC object from a template static FARP object. +local SpawnStaticFarp=SPAWNSTATIC:NewFromStatic("Static FARP Template-1", country.id.GERMANY) + + +-- Spawning FARPS is special in DCS. Therefore, we need to specify that this is a FARP. We also set the callsign and the frequency. +SpawnStaticFarp:InitFARP(CALLSIGN.FARP.Berlin, 130.000, 0) + +-- Spawn FARP with heading 90°. It's name will be "Farp Berlin". +local FarpBerlin=SpawnStaticFarp:SpawnFromZone(ZoneSpawn, 90, "FARP Berlin") + +-- Smoke static green. +FarpBerlin:GetCoordinate():SmokeGreen() + + +-- The second FAPR gets callsign London and used radio frequency 131 MHz. +SpawnStaticFarp:InitFARP(CALLSIGN.FARP.London, 131.000, 0) + +-- We set the country to UK. +SpawnStaticFarp:InitCountry(country.id.UK) + +-- Spawn the FARP at a random location inside the zone. +local FarpLondon=SpawnStaticFarp:SpawnFromCoordinate(ZoneSpawn:GetRandomCoordinate(), nil, "Farp London") + +-- Put red smoke at FARP London. +FarpLondon:GetCoordinate():SmokeRed() + + +-- Function to check if the STATIC/AIRBASE objects can be found. +local function check() + + -- Try to find static. + local StaticBerlin=STATIC:FindByName("FARP Berlin") + + -- Launch red flare. + StaticBerlin:GetCoordinate():FlareRed() + + -- Get the airbase object. + local AirbaseBerlin=AIRBASE:FindByName("FARP Berlin") + AirbaseBerlin:MarkParkingSpots() + +end TIMER:New(check):Start(1) \ No newline at end of file diff --git a/Core/Zone/ZON-100 - Normal Zone/ZON-100 - Normal Zone.lua b/Core/Zone/ZON-100 - Normal Zone/ZON-100 - Normal Zone.lua index 82baa19771..bb721f8ad9 100644 --- a/Core/Zone/ZON-100 - Normal Zone/ZON-100 - Normal Zone.lua +++ b/Core/Zone/ZON-100 - Normal Zone/ZON-100 - Normal Zone.lua @@ -1,32 +1,32 @@ ---- --- Name: ZON-100 - Normal Zone --- Author: FlightControl --- Date Created: 21 Feb 2017 --- --- # Situation: --- --- A ZONE has been defined, which boundaries are smoking. --- A vehicle is driving through the zone perimeters. --- When the vehicle is driving in the zone, a red smoke is fired from the vehicle location. --- --- # Test cases: --- --- 1. Observe the zone perimeter smoke. --- 2. Observe the vehicle smoking a red smoke when driving through the zone. - - -GroupInside = GROUP:FindByName( "Test Inside Polygon" ) -GroupOutside = GROUP:FindByName( "Test Outside Polygon" ) - -ZoneA = ZONE:New( "Zone A" ) -ZoneA:SmokeZone( SMOKECOLOR.White, 90 ) - -Messager = SCHEDULER:New( nil, - function() - GroupInside:MessageToAll( ( GroupInside:IsCompletelyInZone( ZoneA ) ) and "Inside Zone A" or "Outside Zone A", 1 ) - if GroupInside:IsCompletelyInZone( ZoneA ) then - GroupInside:GetUnit(1):SmokeRed() - end - end, - {}, 0, 1 ) - +--- +-- Name: ZON-100 - Normal Zone +-- Author: FlightControl +-- Date Created: 21 Feb 2017 +-- +-- # Situation: +-- +-- A ZONE has been defined, which boundaries are smoking. +-- A vehicle is driving through the zone perimeters. +-- When the vehicle is driving in the zone, a red smoke is fired from the vehicle location. +-- +-- # Test cases: +-- +-- 1. Observe the zone perimeter smoke. +-- 2. Observe the vehicle smoking a red smoke when driving through the zone. + + +GroupInside = GROUP:FindByName( "Test Inside Polygon" ) +GroupOutside = GROUP:FindByName( "Test Outside Polygon" ) + +ZoneA = ZONE:New( "Zone A" ) +ZoneA:SmokeZone( SMOKECOLOR.White, 90 ) + +Messager = SCHEDULER:New( nil, + function() + GroupInside:MessageToAll( ( GroupInside:IsCompletelyInZone( ZoneA ) ) and "Inside Zone A" or "Outside Zone A", 1 ) + if GroupInside:IsCompletelyInZone( ZoneA ) then + GroupInside:GetUnit(1):SmokeRed() + end + end, + {}, 0, 1 ) + diff --git a/Core/Zone/ZON-101 - Normal Zone - Random Point/ZON-101 - Normal Zone - Random Point.lua b/Core/Zone/ZON-101 - Normal Zone - Random Point/ZON-101 - Normal Zone - Random Point.lua index 60f255fcda..75b2776c9c 100644 --- a/Core/Zone/ZON-101 - Normal Zone - Random Point/ZON-101 - Normal Zone - Random Point.lua +++ b/Core/Zone/ZON-101 - Normal Zone - Random Point/ZON-101 - Normal Zone - Random Point.lua @@ -1,43 +1,43 @@ ---- --- Name: ZON-101 - Normal Zone - Random Point --- Author: FlightControl --- Date Created: 18 Feb 2017 --- --- # Situation: --- --- Three zones are defined. --- 15 points are smoked in each zone. --- The first 15 points are blue smoked using the GetRandomVec2() API. --- The second 15 points are orange smoked using the GetRandomPointVec2() API. --- The third 15 points are red smoked using the GetRandomPointVec3() API. --- Note: The zones perimeters are also smoked in white, so you can observe the random point placement. --- Note: At each zone an vehicle is placed, so you can view the smoking in external view. --- --- # Test cases: --- --- 1. Observe smoking of Blue smoke in Zone 1. --- 2. Observe smoking of Orange smoke in Zone 2. --- 3. Observe smoking of Red smoke in Zone 3. - -Zone1 = ZONE:New( "Zone 1" ) -Zone2 = ZONE:New( "Zone 2" ) -Zone3 = ZONE:New( "Zone 3" ) - -Zone1:SmokeZone( SMOKECOLOR.White, 18 ) -Zone2:SmokeZone( SMOKECOLOR.White, 18 ) -Zone3:SmokeZone( SMOKECOLOR.White, 18 ) - -for i = 1, 15 do - -- Zone 1 - local Vec2 = Zone1:GetRandomVec2() - local PointVec2 = POINT_VEC2:NewFromVec2( Vec2 ) - PointVec2:SmokeBlue() - - -- Zone 2 - local PointVec2 = Zone2:GetRandomPointVec2() - PointVec2:SmokeOrange() - - -- Zone 3 - local PointVec3 = Zone3:GetRandomPointVec3() - PointVec3:SmokeRed() -end +--- +-- Name: ZON-101 - Normal Zone - Random Point +-- Author: FlightControl +-- Date Created: 18 Feb 2017 +-- +-- # Situation: +-- +-- Three zones are defined. +-- 15 points are smoked in each zone. +-- The first 15 points are blue smoked using the GetRandomVec2() API. +-- The second 15 points are orange smoked using the GetRandomPointVec2() API. +-- The third 15 points are red smoked using the GetRandomPointVec3() API. +-- Note: The zones perimeters are also smoked in white, so you can observe the random point placement. +-- Note: At each zone an vehicle is placed, so you can view the smoking in external view. +-- +-- # Test cases: +-- +-- 1. Observe smoking of Blue smoke in Zone 1. +-- 2. Observe smoking of Orange smoke in Zone 2. +-- 3. Observe smoking of Red smoke in Zone 3. + +Zone1 = ZONE:New( "Zone 1" ) +Zone2 = ZONE:New( "Zone 2" ) +Zone3 = ZONE:New( "Zone 3" ) + +Zone1:SmokeZone( SMOKECOLOR.White, 18 ) +Zone2:SmokeZone( SMOKECOLOR.White, 18 ) +Zone3:SmokeZone( SMOKECOLOR.White, 18 ) + +for i = 1, 15 do + -- Zone 1 + local Vec2 = Zone1:GetRandomVec2() + local PointVec2 = POINT_VEC2:NewFromVec2( Vec2 ) + PointVec2:SmokeBlue() + + -- Zone 2 + local PointVec2 = Zone2:GetRandomPointVec2() + PointVec2:SmokeOrange() + + -- Zone 3 + local PointVec3 = Zone3:GetRandomPointVec3() + PointVec3:SmokeRed() +end diff --git a/Core/Zone/ZON-102 - Normal Zone Boundary/ZON-102 - Normal Zone Boundary.lua b/Core/Zone/ZON-102 - Normal Zone Boundary/ZON-102 - Normal Zone Boundary.lua index 361f2a7f91..24ce852035 100644 --- a/Core/Zone/ZON-102 - Normal Zone Boundary/ZON-102 - Normal Zone Boundary.lua +++ b/Core/Zone/ZON-102 - Normal Zone Boundary/ZON-102 - Normal Zone Boundary.lua @@ -1,32 +1,32 @@ ---- --- Name: ZON-100 - Normal Zone --- Author: FlightControl --- Date Created: 21 Feb 2017 --- --- # Situation: --- --- A ZONE has been defined, which boundaries are smoking. --- A vehicle is driving through the zone perimeters. --- When the vehicle is driving in the zone, a red smoke is fired from the vehicle location. --- --- # Test cases: --- --- 1. Observe the zone perimeter smoke. --- 2. Observe the vehicle smoking a red smoke when driving through the zone. - - -GroupInside = GROUP:FindByName( "Test Inside Polygon" ) -GroupOutside = GROUP:FindByName( "Test Outside Polygon" ) - -ZoneA = ZONE:New( "Zone A" ) -ZoneA:BoundZone( 90 ) - -Messager = SCHEDULER:New( nil, - function() - GroupInside:MessageToAll( ( GroupInside:IsCompletelyInZone( ZoneA ) ) and "Inside Zone A" or "Outside Zone A", 1 ) - if GroupInside:IsCompletelyInZone( ZoneA ) then - GroupInside:GetUnit(1):SmokeRed() - end - end, - {}, 0, 1 ) - +--- +-- Name: ZON-100 - Normal Zone +-- Author: FlightControl +-- Date Created: 21 Feb 2017 +-- +-- # Situation: +-- +-- A ZONE has been defined, which boundaries are smoking. +-- A vehicle is driving through the zone perimeters. +-- When the vehicle is driving in the zone, a red smoke is fired from the vehicle location. +-- +-- # Test cases: +-- +-- 1. Observe the zone perimeter smoke. +-- 2. Observe the vehicle smoking a red smoke when driving through the zone. + + +GroupInside = GROUP:FindByName( "Test Inside Polygon" ) +GroupOutside = GROUP:FindByName( "Test Outside Polygon" ) + +ZoneA = ZONE:New( "Zone A" ) +ZoneA:BoundZone( 90 ) + +Messager = SCHEDULER:New( nil, + function() + GroupInside:MessageToAll( ( GroupInside:IsCompletelyInZone( ZoneA ) ) and "Inside Zone A" or "Outside Zone A", 1 ) + if GroupInside:IsCompletelyInZone( ZoneA ) then + GroupInside:GetUnit(1):SmokeRed() + end + end, + {}, 0, 1 ) + diff --git a/Core/Zone/ZON-103 - Test if GROUP object is in ZONE/SET-102 - Test SET_GROUP object against ZONE.lua b/Core/Zone/ZON-103 - Test if GROUP object is in ZONE/SET-102 - Test SET_GROUP object against ZONE.lua index 98700a4be3..db60dc57a0 100644 --- a/Core/Zone/ZON-103 - Test if GROUP object is in ZONE/SET-102 - Test SET_GROUP object against ZONE.lua +++ b/Core/Zone/ZON-103 - Test if GROUP object is in ZONE/SET-102 - Test SET_GROUP object against ZONE.lua @@ -1,34 +1,34 @@ ---- --- Name: SET-102 - Test SET_GROUP object against ZONE --- Author: FlightControl --- Date Created: 31 Mar 2017 --- --- # Situation: --- --- A ZONE has been defined, and the SET_GROUP object is checked against the zone. --- --- # Test cases: --- --- 1. Observe the zone perimeter, and place the SET_GROUP object in or out of the zone. --- 2. Observe the results of the functions. - - -SetGroupObject = SET_GROUP:New():FilterCoalitions("blue"):FilterPrefixes("Group Object"):FilterStart() - -Zone = ZONE:New( "Zone" ) - -SetGroupObject:ForEachGroupCompletelyInZone( Zone, - function( GroupObject ) - GroupObject:E( { GroupObject:GetName(), "I am completely in Zone" } ) - end ) - -SetGroupObject:ForEachGroupPartlyInZone( Zone, - function( GroupObject ) - GroupObject:E( { GroupObject:GetName(), "I am partially in Zone" } ) - end ) - -SetGroupObject:ForEachGroupNotInZone( Zone, - function( GroupObject ) - GroupObject:E( { GroupObject:GetName(), "I am not in Zone" } ) - end ) - +--- +-- Name: SET-102 - Test SET_GROUP object against ZONE +-- Author: FlightControl +-- Date Created: 31 Mar 2017 +-- +-- # Situation: +-- +-- A ZONE has been defined, and the SET_GROUP object is checked against the zone. +-- +-- # Test cases: +-- +-- 1. Observe the zone perimeter, and place the SET_GROUP object in or out of the zone. +-- 2. Observe the results of the functions. + + +SetGroupObject = SET_GROUP:New():FilterCoalitions("blue"):FilterPrefixes("Group Object"):FilterStart() + +Zone = ZONE:New( "Zone" ) + +SetGroupObject:ForEachGroupCompletelyInZone( Zone, + function( GroupObject ) + GroupObject:E( { GroupObject:GetName(), "I am completely in Zone" } ) + end ) + +SetGroupObject:ForEachGroupPartlyInZone( Zone, + function( GroupObject ) + GroupObject:E( { GroupObject:GetName(), "I am partially in Zone" } ) + end ) + +SetGroupObject:ForEachGroupNotInZone( Zone, + function( GroupObject ) + GroupObject:E( { GroupObject:GetName(), "I am not in Zone" } ) + end ) + diff --git a/Core/Zone/ZON-103 - Test if GROUP object is in ZONE/ZON-103 - Test if GROUP object is in ZONE.lua b/Core/Zone/ZON-103 - Test if GROUP object is in ZONE/ZON-103 - Test if GROUP object is in ZONE.lua index 1a893154b1..8271df5e89 100644 --- a/Core/Zone/ZON-103 - Test if GROUP object is in ZONE/ZON-103 - Test if GROUP object is in ZONE.lua +++ b/Core/Zone/ZON-103 - Test if GROUP object is in ZONE/ZON-103 - Test if GROUP object is in ZONE.lua @@ -1,24 +1,24 @@ ---- --- Name: ZON-103 - Test if GROUP object is in ZONE --- Author: FlightControl --- Date Created: 31 Mar 2017 --- --- # Situation: --- --- A ZONE has been defined, and it is checked if a GROUP object is within the zone. --- --- # Test cases: --- --- 1. Observe the zone perimeter, and place the GROUP object in or out of the zone. --- 2. Observe the results of the functions. - - -GroupObject = GROUP:FindByName( "Group Object" ) - -Zone = ZONE:New( "Zone" ) - - -Zone:E( { "Group is completely in Zone:", GroupObject:IsCompletelyInZone( Zone ) } ) -Zone:E( { "Group is partially in Zone:", GroupObject:IsPartlyInZone( Zone ) } ) -Zone:E( { "Group is not in Zone:", GroupObject:IsNotInZone( Zone ) } ) - +--- +-- Name: ZON-103 - Test if GROUP object is in ZONE +-- Author: FlightControl +-- Date Created: 31 Mar 2017 +-- +-- # Situation: +-- +-- A ZONE has been defined, and it is checked if a GROUP object is within the zone. +-- +-- # Test cases: +-- +-- 1. Observe the zone perimeter, and place the GROUP object in or out of the zone. +-- 2. Observe the results of the functions. + + +GroupObject = GROUP:FindByName( "Group Object" ) + +Zone = ZONE:New( "Zone" ) + + +Zone:E( { "Group is completely in Zone:", GroupObject:IsCompletelyInZone( Zone ) } ) +Zone:E( { "Group is partially in Zone:", GroupObject:IsPartlyInZone( Zone ) } ) +Zone:E( { "Group is not in Zone:", GroupObject:IsNotInZone( Zone ) } ) + diff --git a/Core/Zone/ZON-110 - ZONE declared in ME/ZON-110 - ZONE declared in ME.lua b/Core/Zone/ZON-110 - ZONE declared in ME/ZON-110 - ZONE declared in ME.lua index eabb547448..38ada22993 100644 --- a/Core/Zone/ZON-110 - ZONE declared in ME/ZON-110 - ZONE declared in ME.lua +++ b/Core/Zone/ZON-110 - ZONE declared in ME/ZON-110 - ZONE declared in ME.lua @@ -1,34 +1,34 @@ ---- --- Name: ZON-110 - ZONE declared in ME --- Author: FlightControl --- Date Created: 21 May 2018 --- --- # Situation: --- --- A ZONE has been defined using the Mission Editor, which boundaries are smoking. --- A vehicle is driving through the zone perimeters. --- When the vehicle is driving in the zone, a red smoke is fired from the vehicle location. --- --- # Test cases: --- --- 1. Observe the zone perimeter smoke. --- 2. Observe the vehicle smoking a red smoke when driving through the zone. - - -GroupInside = GROUP:FindByName( "Test Inside" ) -GroupOutside = GROUP:FindByName( "Test Outside" ) - --- Now I can find the zone instead of doing ZONE:New, because the ZONE object is already in MOOSE. ---ZoneA = ZONE:New( "Zone A" ) -ZoneA = ZONE:FindByName( "Zone A" ) -ZoneA:SmokeZone( SMOKECOLOR.White, 30 ) - -Messager = SCHEDULER:New( nil, - function() - GroupInside:MessageToAll( ( GroupInside:IsCompletelyInZone( ZoneA ) ) and "Inside Zone A" or "Outside Zone A", 1 ) - if GroupInside:IsCompletelyInZone( ZoneA ) then - GroupInside:GetUnit(1):SmokeRed() - end - end, - {}, 0, 1 ) - +--- +-- Name: ZON-110 - ZONE declared in ME +-- Author: FlightControl +-- Date Created: 21 May 2018 +-- +-- # Situation: +-- +-- A ZONE has been defined using the Mission Editor, which boundaries are smoking. +-- A vehicle is driving through the zone perimeters. +-- When the vehicle is driving in the zone, a red smoke is fired from the vehicle location. +-- +-- # Test cases: +-- +-- 1. Observe the zone perimeter smoke. +-- 2. Observe the vehicle smoking a red smoke when driving through the zone. + + +GroupInside = GROUP:FindByName( "Test Inside" ) +GroupOutside = GROUP:FindByName( "Test Outside" ) + +-- Now I can find the zone instead of doing ZONE:New, because the ZONE object is already in MOOSE. +--ZoneA = ZONE:New( "Zone A" ) +ZoneA = ZONE:FindByName( "Zone A" ) +ZoneA:SmokeZone( SMOKECOLOR.White, 30 ) + +Messager = SCHEDULER:New( nil, + function() + GroupInside:MessageToAll( ( GroupInside:IsCompletelyInZone( ZoneA ) ) and "Inside Zone A" or "Outside Zone A", 1 ) + if GroupInside:IsCompletelyInZone( ZoneA ) then + GroupInside:GetUnit(1):SmokeRed() + end + end, + {}, 0, 1 ) + diff --git a/Core/Zone/ZON-190 - Return SCENERY objects in Zone/ZON-190 - Return SCENERY objects in Zone.lua b/Core/Zone/ZON-190 - Return SCENERY objects in Zone/ZON-190 - Return SCENERY objects in Zone.lua index 3455efb90e..8503cd1d2d 100644 --- a/Core/Zone/ZON-190 - Return SCENERY objects in Zone/ZON-190 - Return SCENERY objects in Zone.lua +++ b/Core/Zone/ZON-190 - Return SCENERY objects in Zone/ZON-190 - Return SCENERY objects in Zone.lua @@ -1,22 +1,22 @@ ---- --- Name: ZON-190 - Return SCENERY objects in Zone --- Author: FlightControl --- Date Created: 08 Oct 2017 --- --- # Situation: --- --- # Test cases: --- - - -Zone = ZONE:New( "Zone" ) - - -Zone:Scan( Object.Category.SCENERY ) - -for SceneryTypeName, SceneryData in pairs( Zone:GetScannedScenery() ) do - for SceneryName, SceneryObject in pairs( SceneryData ) do - local SceneryObject = SceneryObject -- Wrapper.Scenery#SCENERY - MESSAGE:NewType( "Scenery: " .. SceneryObject:GetTypeName() .. ", Coord LL DMS: " .. SceneryObject:GetCoordinate():ToStringLLDMS(), MESSAGE.Type.Information ):ToAll() - end +--- +-- Name: ZON-190 - Return SCENERY objects in Zone +-- Author: FlightControl +-- Date Created: 08 Oct 2017 +-- +-- # Situation: +-- +-- # Test cases: +-- + + +Zone = ZONE:New( "Zone" ) + + +Zone:Scan( Object.Category.SCENERY ) + +for SceneryTypeName, SceneryData in pairs( Zone:GetScannedScenery() ) do + for SceneryName, SceneryObject in pairs( SceneryData ) do + local SceneryObject = SceneryObject -- Wrapper.Scenery#SCENERY + MESSAGE:NewType( "Scenery: " .. SceneryObject:GetTypeName() .. ", Coord LL DMS: " .. SceneryObject:GetCoordinate():ToStringLLDMS(), MESSAGE.Type.Information ):ToAll() + end end \ No newline at end of file diff --git a/Core/Zone/ZON-200 - Group Zone/ZON-200 - Group Zone.lua b/Core/Zone/ZON-200 - Group Zone/ZON-200 - Group Zone.lua index c59865b094..e107a17b12 100644 --- a/Core/Zone/ZON-200 - Group Zone/ZON-200 - Group Zone.lua +++ b/Core/Zone/ZON-200 - Group Zone/ZON-200 - Group Zone.lua @@ -1,36 +1,36 @@ ---- --- Name: ZON-200 - Group Zone --- Author: FlightControl --- Date Created: 21 Feb 2017 --- --- # Situation: --- --- A ZONE_GROUP has been defined, which boundaries are smoking. --- A vehicle is driving through the zone perimeters. --- When the vehicle is driving in the zone, a red smoke is fired from the vehicle location. --- --- # Test cases: --- --- 1. Observe the zone perimeter smoke. --- 2. Observe the vehicle smoking a red smoke when driving through the zone. - -GroupInside = GROUP:FindByName( "Test Inside Polygon" ) -GroupOutside = GROUP:FindByName( "Test Outside Polygon" ) - -Tank = GROUP:FindByName( "Tank" ) -ZoneA = ZONE_GROUP:New( "Zone A", Tank, 100 ) - -Messager = SCHEDULER:New( nil, - function() - GroupInside:MessageToAll( ( GroupInside:IsCompletelyInZone( ZoneA ) ) and "Inside Zone A" or "Outside Zone A", 1 ) - if GroupInside:IsCompletelyInZone( ZoneA ) then - GroupInside:GetUnit(1):SmokeRed() - end - end, - {}, 0, 1 ) - -TankZoneColoring = SCHEDULER:New( nil, - function() - ZoneA:FlareZone( FLARECOLOR.White, 90, 60 ) - end, +--- +-- Name: ZON-200 - Group Zone +-- Author: FlightControl +-- Date Created: 21 Feb 2017 +-- +-- # Situation: +-- +-- A ZONE_GROUP has been defined, which boundaries are smoking. +-- A vehicle is driving through the zone perimeters. +-- When the vehicle is driving in the zone, a red smoke is fired from the vehicle location. +-- +-- # Test cases: +-- +-- 1. Observe the zone perimeter smoke. +-- 2. Observe the vehicle smoking a red smoke when driving through the zone. + +GroupInside = GROUP:FindByName( "Test Inside Polygon" ) +GroupOutside = GROUP:FindByName( "Test Outside Polygon" ) + +Tank = GROUP:FindByName( "Tank" ) +ZoneA = ZONE_GROUP:New( "Zone A", Tank, 100 ) + +Messager = SCHEDULER:New( nil, + function() + GroupInside:MessageToAll( ( GroupInside:IsCompletelyInZone( ZoneA ) ) and "Inside Zone A" or "Outside Zone A", 1 ) + if GroupInside:IsCompletelyInZone( ZoneA ) then + GroupInside:GetUnit(1):SmokeRed() + end + end, + {}, 0, 1 ) + +TankZoneColoring = SCHEDULER:New( nil, + function() + ZoneA:FlareZone( FLARECOLOR.White, 90, 60 ) + end, {}, 0, 5 ) \ No newline at end of file diff --git a/Core/Zone/ZON-201 - Group Zone - Random Point/ZON-201 - Group Zone - Random Point.lua b/Core/Zone/ZON-201 - Group Zone - Random Point/ZON-201 - Group Zone - Random Point.lua index 38d0736890..3c0234bf18 100644 --- a/Core/Zone/ZON-201 - Group Zone - Random Point/ZON-201 - Group Zone - Random Point.lua +++ b/Core/Zone/ZON-201 - Group Zone - Random Point/ZON-201 - Group Zone - Random Point.lua @@ -1,43 +1,43 @@ ---- --- Name: ZON-201 - Group Zone - Random Point --- Author: FlightControl --- Date Created: 18 Feb 2017 --- --- # Situation: --- --- Three zones are defined. --- 15 points are smoked in each zone. --- The first 15 points are blue smoked using the GetRandomVec2() API. --- The second 15 points are orange smoked using the GetRandomPointVec2() API. --- The third 15 points are red smoked using the GetRandomPointVec3() API. --- Note: The zones perimeters are also smoked in white, so you can observe the random point placement. --- Note: At each zone an vehicle is placed, so you can view the smoking in external view. --- --- # Test cases: --- --- 1. Observe smoking of Blue smoke in Zone 1. --- 2. Observe smoking of Orange smoke in Zone 2. --- 3. Observe smoking of Red smoke in Zone 3. - -Zone1 = ZONE_GROUP:New( "Zone 1", GROUP:FindByName( "Zone 1" ), 300 ) -Zone2 = ZONE_GROUP:New( "Zone 2", GROUP:FindByName( "Zone 2" ), 300 ) -Zone3 = ZONE_GROUP:New( "Zone 3", GROUP:FindByName( "Zone 3" ), 300 ) - -Zone1:SmokeZone( SMOKECOLOR.White, 18 ) -Zone2:SmokeZone( SMOKECOLOR.White, 18 ) -Zone3:SmokeZone( SMOKECOLOR.White, 18 ) - -for i = 1, 15 do - -- Zone 1 - local Vec2 = Zone1:GetRandomVec2() - local PointVec2 = POINT_VEC2:NewFromVec2( Vec2 ) - PointVec2:SmokeBlue() - - -- Zone 2 - local PointVec2 = Zone2:GetRandomPointVec2() - PointVec2:SmokeOrange() - - -- Zone 3 - local PointVec3 = Zone3:GetRandomPointVec3() - PointVec3:SmokeRed() -end +--- +-- Name: ZON-201 - Group Zone - Random Point +-- Author: FlightControl +-- Date Created: 18 Feb 2017 +-- +-- # Situation: +-- +-- Three zones are defined. +-- 15 points are smoked in each zone. +-- The first 15 points are blue smoked using the GetRandomVec2() API. +-- The second 15 points are orange smoked using the GetRandomPointVec2() API. +-- The third 15 points are red smoked using the GetRandomPointVec3() API. +-- Note: The zones perimeters are also smoked in white, so you can observe the random point placement. +-- Note: At each zone an vehicle is placed, so you can view the smoking in external view. +-- +-- # Test cases: +-- +-- 1. Observe smoking of Blue smoke in Zone 1. +-- 2. Observe smoking of Orange smoke in Zone 2. +-- 3. Observe smoking of Red smoke in Zone 3. + +Zone1 = ZONE_GROUP:New( "Zone 1", GROUP:FindByName( "Zone 1" ), 300 ) +Zone2 = ZONE_GROUP:New( "Zone 2", GROUP:FindByName( "Zone 2" ), 300 ) +Zone3 = ZONE_GROUP:New( "Zone 3", GROUP:FindByName( "Zone 3" ), 300 ) + +Zone1:SmokeZone( SMOKECOLOR.White, 18 ) +Zone2:SmokeZone( SMOKECOLOR.White, 18 ) +Zone3:SmokeZone( SMOKECOLOR.White, 18 ) + +for i = 1, 15 do + -- Zone 1 + local Vec2 = Zone1:GetRandomVec2() + local PointVec2 = POINT_VEC2:NewFromVec2( Vec2 ) + PointVec2:SmokeBlue() + + -- Zone 2 + local PointVec2 = Zone2:GetRandomPointVec2() + PointVec2:SmokeOrange() + + -- Zone 3 + local PointVec3 = Zone3:GetRandomPointVec3() + PointVec3:SmokeRed() +end diff --git a/Core/Zone/ZON-300 - Unit Zone/ZON-300 - Unit Zone.lua b/Core/Zone/ZON-300 - Unit Zone/ZON-300 - Unit Zone.lua index e27334e356..50cb61a369 100644 --- a/Core/Zone/ZON-300 - Unit Zone/ZON-300 - Unit Zone.lua +++ b/Core/Zone/ZON-300 - Unit Zone/ZON-300 - Unit Zone.lua @@ -1,36 +1,36 @@ ---- --- Name: ZON-300 - Unit Zone --- Author: FlightControl --- Date Created: 21 Feb 2017 --- --- # Situation: --- --- A ZONE_UNIT has been defined, which boundaries are smoking. --- A vehicle is driving through the zone perimeters. --- When the vehicle is driving in the zone, a red smoke is fired from the vehicle location. --- --- # Test cases: --- --- 1. Observe the zone perimeter smoke. --- 2. Observe the vehicle smoking a red smoke when driving through the zone. - -GroupInside = GROUP:FindByName( "Test Inside Polygon" ) -GroupOutside = GROUP:FindByName( "Test Outside Polygon" ) - -Tank = UNIT:FindByName( "Tank" ) -ZoneA = ZONE_UNIT:New( "Zone A", Tank, 100 ) - -Messager = SCHEDULER:New( nil, - function() - GroupInside:MessageToAll( ( GroupInside:IsCompletelyInZone( ZoneA ) ) and "Inside Zone A" or "Outside Zone A", 1 ) - if GroupInside:IsCompletelyInZone( ZoneA ) then - GroupInside:GetUnit(1):SmokeRed() - end - end, - {}, 0, 1 ) - -TankZoneColoring = SCHEDULER:New( nil, - function() - ZoneA:FlareZone( FLARECOLOR.White, 90, 60 ) - end, +--- +-- Name: ZON-300 - Unit Zone +-- Author: FlightControl +-- Date Created: 21 Feb 2017 +-- +-- # Situation: +-- +-- A ZONE_UNIT has been defined, which boundaries are smoking. +-- A vehicle is driving through the zone perimeters. +-- When the vehicle is driving in the zone, a red smoke is fired from the vehicle location. +-- +-- # Test cases: +-- +-- 1. Observe the zone perimeter smoke. +-- 2. Observe the vehicle smoking a red smoke when driving through the zone. + +GroupInside = GROUP:FindByName( "Test Inside Polygon" ) +GroupOutside = GROUP:FindByName( "Test Outside Polygon" ) + +Tank = UNIT:FindByName( "Tank" ) +ZoneA = ZONE_UNIT:New( "Zone A", Tank, 100 ) + +Messager = SCHEDULER:New( nil, + function() + GroupInside:MessageToAll( ( GroupInside:IsCompletelyInZone( ZoneA ) ) and "Inside Zone A" or "Outside Zone A", 1 ) + if GroupInside:IsCompletelyInZone( ZoneA ) then + GroupInside:GetUnit(1):SmokeRed() + end + end, + {}, 0, 1 ) + +TankZoneColoring = SCHEDULER:New( nil, + function() + ZoneA:FlareZone( FLARECOLOR.White, 90, 60 ) + end, {}, 0, 5 ) \ No newline at end of file diff --git a/Core/Zone/ZON-301 - Unit Zone - Random Point/ZON-301 - Unit Zone - Random Point.lua b/Core/Zone/ZON-301 - Unit Zone - Random Point/ZON-301 - Unit Zone - Random Point.lua index db53722a8c..8209c3db65 100644 --- a/Core/Zone/ZON-301 - Unit Zone - Random Point/ZON-301 - Unit Zone - Random Point.lua +++ b/Core/Zone/ZON-301 - Unit Zone - Random Point/ZON-301 - Unit Zone - Random Point.lua @@ -1,43 +1,43 @@ ---- --- Name: ZON-301 - Unit Zone - Random Point --- Author: FlightControl --- Date Created: 18 Feb 2017 --- --- # Situation: --- --- Three zones are defined. --- 15 points are smoked in each zone. --- The first 15 points are blue smoked using the GetRandomVec2() API. --- The second 15 points are orange smoked using the GetRandomPointVec2() API. --- The third 15 points are red smoked using the GetRandomPointVec3() API. --- Note: The zones perimeters are also smoked in white, so you can observe the random point placement. --- Note: At each zone an vehicle is placed, so you can view the smoking in external view. --- --- # Test cases: --- --- 1. Observe smoking of Blue smoke in Zone 1. --- 2. Observe smoking of Orange smoke in Zone 2. --- 3. Observe smoking of Red smoke in Zone 3. - -Zone1 = ZONE_UNIT:New( "Zone 1", UNIT:FindByName( "Zone 1" ), 300 ) -Zone2 = ZONE_UNIT:New( "Zone 2", UNIT:FindByName( "Zone 2" ), 300 ) -Zone3 = ZONE_UNIT:New( "Zone 3", UNIT:FindByName( "Zone 3" ), 300 ) - -Zone1:SmokeZone( SMOKECOLOR.White, 18 ) -Zone2:SmokeZone( SMOKECOLOR.White, 18 ) -Zone3:SmokeZone( SMOKECOLOR.White, 18 ) - -for i = 1, 15 do - -- Zone 1 - local Vec2 = Zone1:GetRandomVec2() - local PointVec2 = POINT_VEC2:NewFromVec2( Vec2 ) - PointVec2:SmokeBlue() - - -- Zone 2 - local PointVec2 = Zone2:GetRandomPointVec2() - PointVec2:SmokeOrange() - - -- Zone 3 - local PointVec3 = Zone3:GetRandomPointVec3() - PointVec3:SmokeRed() -end +--- +-- Name: ZON-301 - Unit Zone - Random Point +-- Author: FlightControl +-- Date Created: 18 Feb 2017 +-- +-- # Situation: +-- +-- Three zones are defined. +-- 15 points are smoked in each zone. +-- The first 15 points are blue smoked using the GetRandomVec2() API. +-- The second 15 points are orange smoked using the GetRandomPointVec2() API. +-- The third 15 points are red smoked using the GetRandomPointVec3() API. +-- Note: The zones perimeters are also smoked in white, so you can observe the random point placement. +-- Note: At each zone an vehicle is placed, so you can view the smoking in external view. +-- +-- # Test cases: +-- +-- 1. Observe smoking of Blue smoke in Zone 1. +-- 2. Observe smoking of Orange smoke in Zone 2. +-- 3. Observe smoking of Red smoke in Zone 3. + +Zone1 = ZONE_UNIT:New( "Zone 1", UNIT:FindByName( "Zone 1" ), 300 ) +Zone2 = ZONE_UNIT:New( "Zone 2", UNIT:FindByName( "Zone 2" ), 300 ) +Zone3 = ZONE_UNIT:New( "Zone 3", UNIT:FindByName( "Zone 3" ), 300 ) + +Zone1:SmokeZone( SMOKECOLOR.White, 18 ) +Zone2:SmokeZone( SMOKECOLOR.White, 18 ) +Zone3:SmokeZone( SMOKECOLOR.White, 18 ) + +for i = 1, 15 do + -- Zone 1 + local Vec2 = Zone1:GetRandomVec2() + local PointVec2 = POINT_VEC2:NewFromVec2( Vec2 ) + PointVec2:SmokeBlue() + + -- Zone 2 + local PointVec2 = Zone2:GetRandomPointVec2() + PointVec2:SmokeOrange() + + -- Zone 3 + local PointVec3 = Zone3:GetRandomPointVec3() + PointVec3:SmokeRed() +end diff --git a/Core/Zone/ZON-400 - Radius Zone/ZON-400 - Radius Zone.lua b/Core/Zone/ZON-400 - Radius Zone/ZON-400 - Radius Zone.lua index c73a6360ea..db873d162e 100644 --- a/Core/Zone/ZON-400 - Radius Zone/ZON-400 - Radius Zone.lua +++ b/Core/Zone/ZON-400 - Radius Zone/ZON-400 - Radius Zone.lua @@ -1,32 +1,32 @@ ---- --- Name: ZON-400 - Radius Zone --- Author: FlightControl --- Date Created: 21 Feb 2017 --- --- # Situation: --- --- A ZONE_RADIUS has been defined, which boundaries are smoking. --- A vehicle is driving through the zone perimeters. --- When the vehicle is driving in the zone, a red smoke is fired from the vehicle location. --- --- # Test cases: --- --- 1. Observe the polygon perimeter smoke. --- 2. Observe the vehicle smoking a red smoke when driving through the zone. - -GroupInside = GROUP:FindByName( "Test Inside Polygon" ) -GroupOutside = GROUP:FindByName( "Test Outside Polygon" ) - -House = STATIC:FindByName( "House" ) -ZoneA = ZONE_RADIUS:New( "Zone A", House:GetVec2(), 300 ) -ZoneA:SmokeZone( SMOKECOLOR.White, 90 ) - -Messager = SCHEDULER:New( nil, - function() - GroupInside:MessageToAll( ( GroupInside:IsCompletelyInZone( ZoneA ) ) and "Inside Zone A" or "Outside Zone A", 1 ) - if GroupInside:IsCompletelyInZone( ZoneA ) then - GroupInside:GetUnit(1):SmokeRed() - end - end, - {}, 0, 1 ) - +--- +-- Name: ZON-400 - Radius Zone +-- Author: FlightControl +-- Date Created: 21 Feb 2017 +-- +-- # Situation: +-- +-- A ZONE_RADIUS has been defined, which boundaries are smoking. +-- A vehicle is driving through the zone perimeters. +-- When the vehicle is driving in the zone, a red smoke is fired from the vehicle location. +-- +-- # Test cases: +-- +-- 1. Observe the polygon perimeter smoke. +-- 2. Observe the vehicle smoking a red smoke when driving through the zone. + +GroupInside = GROUP:FindByName( "Test Inside Polygon" ) +GroupOutside = GROUP:FindByName( "Test Outside Polygon" ) + +House = STATIC:FindByName( "House" ) +ZoneA = ZONE_RADIUS:New( "Zone A", House:GetVec2(), 300 ) +ZoneA:SmokeZone( SMOKECOLOR.White, 90 ) + +Messager = SCHEDULER:New( nil, + function() + GroupInside:MessageToAll( ( GroupInside:IsCompletelyInZone( ZoneA ) ) and "Inside Zone A" or "Outside Zone A", 1 ) + if GroupInside:IsCompletelyInZone( ZoneA ) then + GroupInside:GetUnit(1):SmokeRed() + end + end, + {}, 0, 1 ) + diff --git a/Core/Zone/ZON-401 - Radius Zone - Random Point/ZON-401 - Radius Zone - Random Point.lua b/Core/Zone/ZON-401 - Radius Zone - Random Point/ZON-401 - Radius Zone - Random Point.lua index b3d5112673..1c5f012e2c 100644 --- a/Core/Zone/ZON-401 - Radius Zone - Random Point/ZON-401 - Radius Zone - Random Point.lua +++ b/Core/Zone/ZON-401 - Radius Zone - Random Point/ZON-401 - Radius Zone - Random Point.lua @@ -1,48 +1,48 @@ ---- --- Name: ZON-401 - Radius Zone - Random Point --- Author: FlightControl --- Date Created: 18 Feb 2017 --- --- # Situation: --- --- Three zones are defined. --- 15 points are smoked in each zone. --- The first 15 points are blue smoked using the GetRandomVec2() API. --- The second 15 points are orange smoked using the GetRandomPointVec2() API. --- The third 15 points are red smoked using the GetRandomPointVec3() API. --- Note: The zones perimeters are also smoked in white, so you can observe the random point placement. --- Note: At each zone an vehicle is placed, so you can view the smoking in external view. --- --- # Test cases: --- --- 1. Observe smoking of Blue smoke in Zone 1. --- 2. Observe smoking of Orange smoke in Zone 2. --- 3. Observe smoking of Red smoke in Zone 3. - -Unit1 = UNIT:FindByName( "Zone 1" ) -Unit2 = UNIT:FindByName( "Zone 2" ) -Unit3 = UNIT:FindByName( "Zone 3" ) - - -Zone1 = ZONE_RADIUS:New( "Zone 1", Unit1:GetVec2(), 300 ) -Zone2 = ZONE_RADIUS:New( "Zone 2", Unit2:GetVec2(), 300 ) -Zone3 = ZONE_RADIUS:New( "Zone 3", Unit3:GetVec2(), 300 ) - -Zone1:SmokeZone( SMOKECOLOR.White, 18 ) -Zone2:SmokeZone( SMOKECOLOR.White, 18 ) -Zone3:SmokeZone( SMOKECOLOR.White, 18 ) - -for i = 1, 15 do - -- Zone 1 - local Vec2 = Zone1:GetRandomVec2() - local PointVec2 = POINT_VEC2:NewFromVec2( Vec2 ) - PointVec2:SmokeBlue() - - -- Zone 2 - local PointVec2 = Zone2:GetRandomPointVec2() - PointVec2:SmokeOrange() - - -- Zone 3 - local PointVec3 = Zone3:GetRandomPointVec3() - PointVec3:SmokeRed() -end +--- +-- Name: ZON-401 - Radius Zone - Random Point +-- Author: FlightControl +-- Date Created: 18 Feb 2017 +-- +-- # Situation: +-- +-- Three zones are defined. +-- 15 points are smoked in each zone. +-- The first 15 points are blue smoked using the GetRandomVec2() API. +-- The second 15 points are orange smoked using the GetRandomPointVec2() API. +-- The third 15 points are red smoked using the GetRandomPointVec3() API. +-- Note: The zones perimeters are also smoked in white, so you can observe the random point placement. +-- Note: At each zone an vehicle is placed, so you can view the smoking in external view. +-- +-- # Test cases: +-- +-- 1. Observe smoking of Blue smoke in Zone 1. +-- 2. Observe smoking of Orange smoke in Zone 2. +-- 3. Observe smoking of Red smoke in Zone 3. + +Unit1 = UNIT:FindByName( "Zone 1" ) +Unit2 = UNIT:FindByName( "Zone 2" ) +Unit3 = UNIT:FindByName( "Zone 3" ) + + +Zone1 = ZONE_RADIUS:New( "Zone 1", Unit1:GetVec2(), 300 ) +Zone2 = ZONE_RADIUS:New( "Zone 2", Unit2:GetVec2(), 300 ) +Zone3 = ZONE_RADIUS:New( "Zone 3", Unit3:GetVec2(), 300 ) + +Zone1:SmokeZone( SMOKECOLOR.White, 18 ) +Zone2:SmokeZone( SMOKECOLOR.White, 18 ) +Zone3:SmokeZone( SMOKECOLOR.White, 18 ) + +for i = 1, 15 do + -- Zone 1 + local Vec2 = Zone1:GetRandomVec2() + local PointVec2 = POINT_VEC2:NewFromVec2( Vec2 ) + PointVec2:SmokeBlue() + + -- Zone 2 + local PointVec2 = Zone2:GetRandomPointVec2() + PointVec2:SmokeOrange() + + -- Zone 3 + local PointVec3 = Zone3:GetRandomPointVec3() + PointVec3:SmokeRed() +end diff --git a/Core/Zone/ZON-500 - Polygon Zone/ZON-500 - Polygon Zone.lua b/Core/Zone/ZON-500 - Polygon Zone/ZON-500 - Polygon Zone.lua index b5201c1f01..cdebfff78f 100644 --- a/Core/Zone/ZON-500 - Polygon Zone/ZON-500 - Polygon Zone.lua +++ b/Core/Zone/ZON-500 - Polygon Zone/ZON-500 - Polygon Zone.lua @@ -1,33 +1,33 @@ ---- --- Name: ZON-500 - Polygon Zone --- Author: FlightControl --- Date Created: 18 Feb 2017 --- --- # Situation: --- --- A ZONE_POLYGON has been defined, which boundaries are smoking. --- A vehicle is driving through the zone perimeters. --- When the vehicle is driving in the zone, a red smoke is fired from the vehicle location. --- --- # Test cases: --- --- 1. Observe the polygon perimeter smoke. --- 2. Observe the vehicle smoking a red smoke when driving through the zone. - -GroupInside = GROUP:FindByName( "Test Inside Polygon" ) -GroupOutside = GROUP:FindByName( "Test Outside Polygon" ) - -GroupPolygon = GROUP:FindByName( "Polygon A" ) - -PolygonZone = ZONE_POLYGON:New( "Polygon A", GroupPolygon ) -PolygonZone:SmokeZone( SMOKECOLOR.White, 20 ) - -Messager = SCHEDULER:New( nil, - function() - GroupInside:MessageToAll( ( GroupInside:IsCompletelyInZone( PolygonZone ) ) and "Inside Polygon A" or "Outside Polygon A", 1 ) - if GroupInside:IsCompletelyInZone( PolygonZone ) then - GroupInside:GetUnit(1):SmokeRed() - end - end, - {}, 0, 1 ) - +--- +-- Name: ZON-500 - Polygon Zone +-- Author: FlightControl +-- Date Created: 18 Feb 2017 +-- +-- # Situation: +-- +-- A ZONE_POLYGON has been defined, which boundaries are smoking. +-- A vehicle is driving through the zone perimeters. +-- When the vehicle is driving in the zone, a red smoke is fired from the vehicle location. +-- +-- # Test cases: +-- +-- 1. Observe the polygon perimeter smoke. +-- 2. Observe the vehicle smoking a red smoke when driving through the zone. + +GroupInside = GROUP:FindByName( "Test Inside Polygon" ) +GroupOutside = GROUP:FindByName( "Test Outside Polygon" ) + +GroupPolygon = GROUP:FindByName( "Polygon A" ) + +PolygonZone = ZONE_POLYGON:New( "Polygon A", GroupPolygon ) +PolygonZone:SmokeZone( SMOKECOLOR.White, 20 ) + +Messager = SCHEDULER:New( nil, + function() + GroupInside:MessageToAll( ( GroupInside:IsCompletelyInZone( PolygonZone ) ) and "Inside Polygon A" or "Outside Polygon A", 1 ) + if GroupInside:IsCompletelyInZone( PolygonZone ) then + GroupInside:GetUnit(1):SmokeRed() + end + end, + {}, 0, 1 ) + diff --git a/Core/Zone/ZON-501 - Polygon Zone - Random Point/ZON-501 - Polygon Zone - Random Point.lua b/Core/Zone/ZON-501 - Polygon Zone - Random Point/ZON-501 - Polygon Zone - Random Point.lua index 545c7d9b6c..85cd66947d 100644 --- a/Core/Zone/ZON-501 - Polygon Zone - Random Point/ZON-501 - Polygon Zone - Random Point.lua +++ b/Core/Zone/ZON-501 - Polygon Zone - Random Point/ZON-501 - Polygon Zone - Random Point.lua @@ -1,43 +1,43 @@ ---- --- Name: ZON-501 - Polygon Zone - Random Point --- Author: FlightControl --- Date Created: 18 Feb 2017 --- --- # Situation: --- --- Three zones are defined. --- 15 points are smoked in each zone. --- The first 15 points are blue smoked using the GetRandomVec2() API. --- The second 15 points are orange smoked using the GetRandomPointVec2() API. --- The third 15 points are red smoked using the GetRandomPointVec3() API. --- Note: The zones perimeters are also smoked in white, so you can observe the random point placement. --- Note: At each zone an vehicle is placed, so you can view the smoking in external view. --- --- # Test cases: --- --- 1. Observe smoking of Blue smoke in Zone 1. --- 2. Observe smoking of Orange smoke in Zone 2. --- 3. Observe smoking of Red smoke in Zone 3. - -Zone1 = ZONE_POLYGON:New( "Zone 1", GROUP:FindByName( "Zone 1" ) ) -Zone2 = ZONE_POLYGON:New( "Zone 2", GROUP:FindByName( "Zone 2" ) ) -Zone3 = ZONE_POLYGON:New( "Zone 3", GROUP:FindByName( "Zone 3" ) ) - -Zone1:SmokeZone( SMOKECOLOR.White, 4 ) -Zone2:SmokeZone( SMOKECOLOR.White, 4 ) -Zone3:SmokeZone( SMOKECOLOR.White, 4 ) - -for i = 1, 15 do - -- Zone 1 - local Vec2 = Zone1:GetRandomVec2() - local PointVec2 = POINT_VEC2:NewFromVec2( Vec2 ) - PointVec2:SmokeBlue() - - -- Zone 2 - local PointVec2 = Zone2:GetRandomPointVec2() - PointVec2:SmokeOrange() - - -- Zone 3 - local PointVec3 = Zone3:GetRandomPointVec3() - PointVec3:SmokeRed() -end +--- +-- Name: ZON-501 - Polygon Zone - Random Point +-- Author: FlightControl +-- Date Created: 18 Feb 2017 +-- +-- # Situation: +-- +-- Three zones are defined. +-- 15 points are smoked in each zone. +-- The first 15 points are blue smoked using the GetRandomVec2() API. +-- The second 15 points are orange smoked using the GetRandomPointVec2() API. +-- The third 15 points are red smoked using the GetRandomPointVec3() API. +-- Note: The zones perimeters are also smoked in white, so you can observe the random point placement. +-- Note: At each zone an vehicle is placed, so you can view the smoking in external view. +-- +-- # Test cases: +-- +-- 1. Observe smoking of Blue smoke in Zone 1. +-- 2. Observe smoking of Orange smoke in Zone 2. +-- 3. Observe smoking of Red smoke in Zone 3. + +Zone1 = ZONE_POLYGON:New( "Zone 1", GROUP:FindByName( "Zone 1" ) ) +Zone2 = ZONE_POLYGON:New( "Zone 2", GROUP:FindByName( "Zone 2" ) ) +Zone3 = ZONE_POLYGON:New( "Zone 3", GROUP:FindByName( "Zone 3" ) ) + +Zone1:SmokeZone( SMOKECOLOR.White, 4 ) +Zone2:SmokeZone( SMOKECOLOR.White, 4 ) +Zone3:SmokeZone( SMOKECOLOR.White, 4 ) + +for i = 1, 15 do + -- Zone 1 + local Vec2 = Zone1:GetRandomVec2() + local PointVec2 = POINT_VEC2:NewFromVec2( Vec2 ) + PointVec2:SmokeBlue() + + -- Zone 2 + local PointVec2 = Zone2:GetRandomPointVec2() + PointVec2:SmokeOrange() + + -- Zone 3 + local PointVec3 = Zone3:GetRandomPointVec3() + PointVec3:SmokeRed() +end diff --git a/Core/Zone/ZON-502 - Polygon Zone Boundary/ZON-502 - Polygon Zone Boundary.lua b/Core/Zone/ZON-502 - Polygon Zone Boundary/ZON-502 - Polygon Zone Boundary.lua index c3075153ce..b0ae658d57 100644 --- a/Core/Zone/ZON-502 - Polygon Zone Boundary/ZON-502 - Polygon Zone Boundary.lua +++ b/Core/Zone/ZON-502 - Polygon Zone Boundary/ZON-502 - Polygon Zone Boundary.lua @@ -1,33 +1,33 @@ ---- --- Name: ZON-502 - Polygon Zone Boundary --- Author: FlightControl --- Date Created: 18 Feb 2017 --- --- # Situation: --- --- A ZONE_POLYGON has been defined, which boundaries are tires. --- A vehicle is driving through the zone perimeters. --- When the vehicle is driving in the zone, a red smoke is fired from the vehicle location. --- --- # Test cases: --- --- 1. Observe the polygon perimeter smoke. --- 2. Observe the vehicle smoking a red smoke when driving through the zone. - -GroupInside = GROUP:FindByName( "Test Inside Polygon" ) -GroupOutside = GROUP:FindByName( "Test Outside Polygon" ) - -GroupPolygon = GROUP:FindByName( "Polygon A" ) - -PolygonZone = ZONE_POLYGON:New( "Polygon A", GroupPolygon ) -PolygonZone:BoundZone() - -Messager = SCHEDULER:New( nil, - function() - GroupInside:MessageToAll( ( GroupInside:IsCompletelyInZone( PolygonZone ) ) and "Inside Polygon A" or "Outside Polygon A", 1 ) - if GroupInside:IsCompletelyInZone( PolygonZone ) then - GroupInside:GetUnit(1):SmokeRed() - end - end, - {}, 0, 1 ) - +--- +-- Name: ZON-502 - Polygon Zone Boundary +-- Author: FlightControl +-- Date Created: 18 Feb 2017 +-- +-- # Situation: +-- +-- A ZONE_POLYGON has been defined, which boundaries are tires. +-- A vehicle is driving through the zone perimeters. +-- When the vehicle is driving in the zone, a red smoke is fired from the vehicle location. +-- +-- # Test cases: +-- +-- 1. Observe the polygon perimeter smoke. +-- 2. Observe the vehicle smoking a red smoke when driving through the zone. + +GroupInside = GROUP:FindByName( "Test Inside Polygon" ) +GroupOutside = GROUP:FindByName( "Test Outside Polygon" ) + +GroupPolygon = GROUP:FindByName( "Polygon A" ) + +PolygonZone = ZONE_POLYGON:New( "Polygon A", GroupPolygon ) +PolygonZone:BoundZone() + +Messager = SCHEDULER:New( nil, + function() + GroupInside:MessageToAll( ( GroupInside:IsCompletelyInZone( PolygonZone ) ) and "Inside Polygon A" or "Outside Polygon A", 1 ) + if GroupInside:IsCompletelyInZone( PolygonZone ) then + GroupInside:GetUnit(1):SmokeRed() + end + end, + {}, 0, 1 ) + diff --git a/Core/Zone/ZON-510 - ZONE_POLYGON declared in ME/ZON-510 - ZONE_POLYGON declared in ME.lua b/Core/Zone/ZON-510 - ZONE_POLYGON declared in ME/ZON-510 - ZONE_POLYGON declared in ME.lua index f81020e71f..a4be2633af 100644 --- a/Core/Zone/ZON-510 - ZONE_POLYGON declared in ME/ZON-510 - ZONE_POLYGON declared in ME.lua +++ b/Core/Zone/ZON-510 - ZONE_POLYGON declared in ME/ZON-510 - ZONE_POLYGON declared in ME.lua @@ -1,32 +1,32 @@ ---- --- Name: ZON-510 - ZONE_POLYGON declared in ME --- Author: FlightControl --- Date Created: 21 May 2018 --- --- # Situation: --- --- A ZONE_POLYGON has been defined, within the mission editor using ~ZONE_POLYGON in the group name. --- Its boundaries are smoking. --- A vehicle is driving through the zone perimeters. --- When the vehicle is driving in the zone, a red smoke is fired from the vehicle location. --- --- # Test cases: --- --- 1. Observe the polygon perimeter smoke. --- 2. Observe the vehicle smoking a red smoke when driving through the zone. - -GroupInside = GROUP:FindByName( "Test Inside Polygon" ) -GroupOutside = GROUP:FindByName( "Test Outside Polygon" ) - -PolygonZone = ZONE_POLYGON:FindByName( "Polygon A" ) -PolygonZone:SmokeZone( SMOKECOLOR.White, 10 ) - -Messager = SCHEDULER:New( nil, - function() - GroupInside:MessageToAll( ( GroupInside:IsCompletelyInZone( PolygonZone ) ) and "Inside Polygon A" or "Outside Polygon A", 1 ) - if GroupInside:IsCompletelyInZone( PolygonZone ) then - GroupInside:GetUnit(1):SmokeRed() - end - end, - {}, 0, 1 ) - +--- +-- Name: ZON-510 - ZONE_POLYGON declared in ME +-- Author: FlightControl +-- Date Created: 21 May 2018 +-- +-- # Situation: +-- +-- A ZONE_POLYGON has been defined, within the mission editor using ~ZONE_POLYGON in the group name. +-- Its boundaries are smoking. +-- A vehicle is driving through the zone perimeters. +-- When the vehicle is driving in the zone, a red smoke is fired from the vehicle location. +-- +-- # Test cases: +-- +-- 1. Observe the polygon perimeter smoke. +-- 2. Observe the vehicle smoking a red smoke when driving through the zone. + +GroupInside = GROUP:FindByName( "Test Inside Polygon" ) +GroupOutside = GROUP:FindByName( "Test Outside Polygon" ) + +PolygonZone = ZONE_POLYGON:FindByName( "Polygon A" ) +PolygonZone:SmokeZone( SMOKECOLOR.White, 10 ) + +Messager = SCHEDULER:New( nil, + function() + GroupInside:MessageToAll( ( GroupInside:IsCompletelyInZone( PolygonZone ) ) and "Inside Polygon A" or "Outside Polygon A", 1 ) + if GroupInside:IsCompletelyInZone( PolygonZone ) then + GroupInside:GetUnit(1):SmokeRed() + end + end, + {}, 0, 1 ) + diff --git a/Functional/RAT/Caucasus/RAT-001 - Basic/RAT-001 - Basic.lua b/Functional/RAT/Caucasus/RAT-001 - Basic/RAT-001 - Basic.lua index cdec7034ca..613f3114ad 100644 --- a/Functional/RAT/Caucasus/RAT-001 - Basic/RAT-001 - Basic.lua +++ b/Functional/RAT/Caucasus/RAT-001 - Basic/RAT-001 - Basic.lua @@ -1,18 +1,18 @@ --- Name: RAT-001 - Basic --- Author: funkyfranky --- Date Created: 24 Sep 2017 --- --- # Situation: --- --- Spawn several aircraft at random airports on the map. --- --- # Test cases: --- --- 1. Observe five Yak-40 aircraft being spawned at random airports of the map and fly to random destination airports. --- After the aircraft arrive at their destination they get despawned and then respawned at a new random airport with new random destination. - --- Create RAT object. The only required parameter is the name of the template group in the mission editor. -local yak=RAT:New("RAT_Yak") - --- Spawn five aircraft. +-- Name: RAT-001 - Basic +-- Author: funkyfranky +-- Date Created: 24 Sep 2017 +-- +-- # Situation: +-- +-- Spawn several aircraft at random airports on the map. +-- +-- # Test cases: +-- +-- 1. Observe five Yak-40 aircraft being spawned at random airports of the map and fly to random destination airports. +-- After the aircraft arrive at their destination they get despawned and then respawned at a new random airport with new random destination. + +-- Create RAT object. The only required parameter is the name of the template group in the mission editor. +local yak=RAT:New("RAT_Yak") + +-- Spawn five aircraft. yak:Spawn(5) \ No newline at end of file diff --git a/Functional/RAT/Caucasus/RAT-002 - Fixed Departure/RAT-002 - Fixed Departure.lua b/Functional/RAT/Caucasus/RAT-002 - Fixed Departure/RAT-002 - Fixed Departure.lua index e6929993df..7febe99134 100644 --- a/Functional/RAT/Caucasus/RAT-002 - Fixed Departure/RAT-002 - Fixed Departure.lua +++ b/Functional/RAT/Caucasus/RAT-002 - Fixed Departure/RAT-002 - Fixed Departure.lua @@ -1,22 +1,22 @@ --- Name: RAT-002 - Fixed Departure --- Author: funkyfranky --- Date Created: 24 Sep 2017 --- --- # Situation: --- --- Spawn several aircraft of the same type at Gudauta and let them travel to random airports on the map. --- --- # Test cases: --- --- 1. Observe five Yak-40 aircraft being spawned at Gudauta. Destination airport for each aircraft is random. --- After the aircraft arrive at their destination they get despawned and then respawned again at Gudauta. But the next destination is random again. - --- Create RAT object. The only required parameter is the name of the template group in the mission editor. -local yak=RAT:New("RAT_Yak") - --- Set destination airport. -yak:SetDeparture("Gudauta") - --- Spawn five aircraft. -yak:Spawn(5) - +-- Name: RAT-002 - Fixed Departure +-- Author: funkyfranky +-- Date Created: 24 Sep 2017 +-- +-- # Situation: +-- +-- Spawn several aircraft of the same type at Gudauta and let them travel to random airports on the map. +-- +-- # Test cases: +-- +-- 1. Observe five Yak-40 aircraft being spawned at Gudauta. Destination airport for each aircraft is random. +-- After the aircraft arrive at their destination they get despawned and then respawned again at Gudauta. But the next destination is random again. + +-- Create RAT object. The only required parameter is the name of the template group in the mission editor. +local yak=RAT:New("RAT_Yak") + +-- Set destination airport. +yak:SetDeparture("Gudauta") + +-- Spawn five aircraft. +yak:Spawn(5) + diff --git a/Functional/RAT/Caucasus/RAT-003 - Fixed Destination/RAT-003 - Fixed Destination.lua b/Functional/RAT/Caucasus/RAT-003 - Fixed Destination/RAT-003 - Fixed Destination.lua index 7664e1da24..5d9eadfd28 100644 --- a/Functional/RAT/Caucasus/RAT-003 - Fixed Destination/RAT-003 - Fixed Destination.lua +++ b/Functional/RAT/Caucasus/RAT-003 - Fixed Destination/RAT-003 - Fixed Destination.lua @@ -1,22 +1,22 @@ --- Name: RAT-003 - Fixed Destination --- Author: funkyfranky --- Date Created: 24 Sep 2017 --- --- # Situation: --- --- Spawn several aircraft of the same type at random airports and let them all travel to Sochi-Adler. --- --- # Test cases: --- --- 1. Observe five Yak-40 aircraft being spawned at random airports. They will all fly to Sochi-Adler. --- After the aircraft arrive at their destination they get despawned and then respawned at a random aiport with destination Sochi-Adler. - --- Create RAT object. The only required parameter is the name of the template group in the mission editor. -local yak=RAT:New("RAT_Yak") - --- Set destination airport. -yak:SetDestination("Sochi-Adler") - --- Spawn five aircraft. -yak:Spawn(5) - +-- Name: RAT-003 - Fixed Destination +-- Author: funkyfranky +-- Date Created: 24 Sep 2017 +-- +-- # Situation: +-- +-- Spawn several aircraft of the same type at random airports and let them all travel to Sochi-Adler. +-- +-- # Test cases: +-- +-- 1. Observe five Yak-40 aircraft being spawned at random airports. They will all fly to Sochi-Adler. +-- After the aircraft arrive at their destination they get despawned and then respawned at a random aiport with destination Sochi-Adler. + +-- Create RAT object. The only required parameter is the name of the template group in the mission editor. +local yak=RAT:New("RAT_Yak") + +-- Set destination airport. +yak:SetDestination("Sochi-Adler") + +-- Spawn five aircraft. +yak:Spawn(5) + diff --git a/Functional/RAT/Caucasus/RAT-004 - Fixed Departure and Destination/RAT-004 - Fixed Departure and Destination.lua b/Functional/RAT/Caucasus/RAT-004 - Fixed Departure and Destination/RAT-004 - Fixed Departure and Destination.lua index 7a7e2bdd09..b3dc95e4ae 100644 --- a/Functional/RAT/Caucasus/RAT-004 - Fixed Departure and Destination/RAT-004 - Fixed Departure and Destination.lua +++ b/Functional/RAT/Caucasus/RAT-004 - Fixed Departure and Destination/RAT-004 - Fixed Departure and Destination.lua @@ -1,25 +1,25 @@ --- Name: RAT-004 - Fixed Departure and Destination --- Author: funkyfranky --- Date Created: 24 Sep 2017 --- --- # Situation: --- --- Spawn several aircraft of the same type at Guadauta or Batumi and make them fly to Gelendzhik or Beslan. --- --- # Test cases: --- --- 1. Observe five Yak-40 aircraft being spawned at Gudauta or Batumi. Their destination will be either Gelendzhik or Beslan. --- After the aircraft arrive at their destination they get despawned and then respawned again at one of the defined departure airports. --- Then they will travel to one of the defined destinations again. - --- Create RAT object. The only required parameter is the name of the template group in the mission editor. -local yak=RAT:New("RAT_Yak") - --- Set destination airports. If multiple destinations are specified, they have to be given as a table, i.e. in curly brackets {}. -yak:SetDeparture({"Gudauta", "Batumi"}) - --- Set destination airports. One of these is chosen randomly as destination. -yak:SetDestination({"Gelendzhik", "Beslan"}) - --- Spawn five aircraft. +-- Name: RAT-004 - Fixed Departure and Destination +-- Author: funkyfranky +-- Date Created: 24 Sep 2017 +-- +-- # Situation: +-- +-- Spawn several aircraft of the same type at Guadauta or Batumi and make them fly to Gelendzhik or Beslan. +-- +-- # Test cases: +-- +-- 1. Observe five Yak-40 aircraft being spawned at Gudauta or Batumi. Their destination will be either Gelendzhik or Beslan. +-- After the aircraft arrive at their destination they get despawned and then respawned again at one of the defined departure airports. +-- Then they will travel to one of the defined destinations again. + +-- Create RAT object. The only required parameter is the name of the template group in the mission editor. +local yak=RAT:New("RAT_Yak") + +-- Set destination airports. If multiple destinations are specified, they have to be given as a table, i.e. in curly brackets {}. +yak:SetDeparture({"Gudauta", "Batumi"}) + +-- Set destination airports. One of these is chosen randomly as destination. +yak:SetDestination({"Gelendzhik", "Beslan"}) + +-- Spawn five aircraft. yak:Spawn(5) \ No newline at end of file diff --git a/Functional/RAT/Caucasus/RAT-005 - Resticted Coalition/RAT-005 - Restricted Coalition.lua b/Functional/RAT/Caucasus/RAT-005 - Resticted Coalition/RAT-005 - Restricted Coalition.lua index 29d5bede63..f79dc761a6 100644 --- a/Functional/RAT/Caucasus/RAT-005 - Resticted Coalition/RAT-005 - Restricted Coalition.lua +++ b/Functional/RAT/Caucasus/RAT-005 - Resticted Coalition/RAT-005 - Restricted Coalition.lua @@ -1,47 +1,47 @@ --- Name: RAT-005 - Restricted Coalition --- Author: funkyfranky --- Date Created: 24 Sep 2017 --- --- # Situation: --- --- Spawn several aircraft of the same type at airports belonging to a certain coalition. --- In the mission editor, we have set Sochi-Adler, Gelendzhik, Batumi, Senaki-Kolkhi and Kutaisi to red. --- Likewise, Tbilisi-Lochini, Beslan, Nalchik, Mozdok and Mineralnye-Vody were set to blue. --- --- # Test cases: --- --- 1. Observe three Yak-40 aircraft being spawned at red airports only. The will also only get destination airports belonging to that coalition. --- 2. Observe three Yak-40 being spawned at blue airports only. The coalition of the aircraft is changed manually. - --- Create RAT object. Additionally, to the template group name we give the group an alias to be able to distinguish to another group created from this template. -local yak=RAT:New("RAT_Yak", "Yak Red") - --- This restricts the possible departure and destination airports the airports belonging to the red coalition. --- Here it is important that in the mission editor enough (>2) airports have been set to red! Otherwise there will be no possible departure and/or destination airports. -yak:SetCoalition("sameonly") - --- Explicitly exclude Senaki from possible departures and destinations. -yak:ExcludedAirports("Senaki-Kolkhi") - --- Spawn three aircraft. -yak:Spawn(3) - - - --- Create RAT object. Alias is "Yak Blue". If the same template is used multiple times, it is important to give each RAT object an indiviual name! -local yakblue=RAT:New("RAT_Yak", "Yak Blue") - --- Change coalition of Yak to blue. -yakblue:SetCoalitionAircraft("blue") - --- This restricts the possible departure and destination airports the airports belonging to the blue coalition since the coalition is changed manually. -yakblue:SetCoalition("sameonly") - --- We also change the livery of these groups. If a table of liveries is given, each spawned group gets a random livery. -yakblue:Livery({"Georgian Airlines"}) - --- Explicitly exclude Nalchik from possible departures and destinations. -yakblue:ExcludedAirports({"Nalchik", "Mozdok"}) - --- Spawn three aircraft. +-- Name: RAT-005 - Restricted Coalition +-- Author: funkyfranky +-- Date Created: 24 Sep 2017 +-- +-- # Situation: +-- +-- Spawn several aircraft of the same type at airports belonging to a certain coalition. +-- In the mission editor, we have set Sochi-Adler, Gelendzhik, Batumi, Senaki-Kolkhi and Kutaisi to red. +-- Likewise, Tbilisi-Lochini, Beslan, Nalchik, Mozdok and Mineralnye-Vody were set to blue. +-- +-- # Test cases: +-- +-- 1. Observe three Yak-40 aircraft being spawned at red airports only. The will also only get destination airports belonging to that coalition. +-- 2. Observe three Yak-40 being spawned at blue airports only. The coalition of the aircraft is changed manually. + +-- Create RAT object. Additionally, to the template group name we give the group an alias to be able to distinguish to another group created from this template. +local yak=RAT:New("RAT_Yak", "Yak Red") + +-- This restricts the possible departure and destination airports the airports belonging to the red coalition. +-- Here it is important that in the mission editor enough (>2) airports have been set to red! Otherwise there will be no possible departure and/or destination airports. +yak:SetCoalition("sameonly") + +-- Explicitly exclude Senaki from possible departures and destinations. +yak:ExcludedAirports("Senaki-Kolkhi") + +-- Spawn three aircraft. +yak:Spawn(3) + + + +-- Create RAT object. Alias is "Yak Blue". If the same template is used multiple times, it is important to give each RAT object an indiviual name! +local yakblue=RAT:New("RAT_Yak", "Yak Blue") + +-- Change coalition of Yak to blue. +yakblue:SetCoalitionAircraft("blue") + +-- This restricts the possible departure and destination airports the airports belonging to the blue coalition since the coalition is changed manually. +yakblue:SetCoalition("sameonly") + +-- We also change the livery of these groups. If a table of liveries is given, each spawned group gets a random livery. +yakblue:Livery({"Georgian Airlines"}) + +-- Explicitly exclude Nalchik from possible departures and destinations. +yakblue:ExcludedAirports({"Nalchik", "Mozdok"}) + +-- Spawn three aircraft. yakblue:Spawn(3) \ No newline at end of file diff --git a/Functional/RAT/Caucasus/RAT-006 - Continue Journey/RAT-006 - Continue Journey.lua b/Functional/RAT/Caucasus/RAT-006 - Continue Journey/RAT-006 - Continue Journey.lua index 087629ca4f..d7b40b4fa0 100644 --- a/Functional/RAT/Caucasus/RAT-006 - Continue Journey/RAT-006 - Continue Journey.lua +++ b/Functional/RAT/Caucasus/RAT-006 - Continue Journey/RAT-006 - Continue Journey.lua @@ -1,25 +1,25 @@ --- Name: RAT-006 - Continue Journey --- Author: funkyfranky --- Date Created: 24 Sep 2017 --- --- # Situation: --- --- Spawn several aircraft of the same type at Gudauta. Each will get a random destination. --- Once the aircraft arrives at its destination, it will be respawned there and continue its journey to another random airport. --- Note that we do NOT have to set a departure airport. --- --- # Test cases: --- --- 1. Observe five Yak-40 aircraft being spawned at Gudauta. From there they will hop from airport to airport on the map. - --- Create RAT object. The only required parameter is the name of the template group in the mission editor. -local yak=RAT:New("RAT_Yak") - --- Set Gudauta as departure airport for all spawned aircraft. (Not required for ContinueJourney() to work.) -yak:SetDeparture("Gudauta") - --- This makes aircraft respawn at their destination airport instead of another random airport. -yak:ContinueJourney() - --- Spawn five aircraft. +-- Name: RAT-006 - Continue Journey +-- Author: funkyfranky +-- Date Created: 24 Sep 2017 +-- +-- # Situation: +-- +-- Spawn several aircraft of the same type at Gudauta. Each will get a random destination. +-- Once the aircraft arrives at its destination, it will be respawned there and continue its journey to another random airport. +-- Note that we do NOT have to set a departure airport. +-- +-- # Test cases: +-- +-- 1. Observe five Yak-40 aircraft being spawned at Gudauta. From there they will hop from airport to airport on the map. + +-- Create RAT object. The only required parameter is the name of the template group in the mission editor. +local yak=RAT:New("RAT_Yak") + +-- Set Gudauta as departure airport for all spawned aircraft. (Not required for ContinueJourney() to work.) +yak:SetDeparture("Gudauta") + +-- This makes aircraft respawn at their destination airport instead of another random airport. +yak:ContinueJourney() + +-- Spawn five aircraft. yak:Spawn(5) \ No newline at end of file diff --git a/Functional/RAT/Caucasus/RAT-007 - Commute/RAT-007 - Commute.lua b/Functional/RAT/Caucasus/RAT-007 - Commute/RAT-007 - Commute.lua index 51d2584af3..b6ee513f42 100644 --- a/Functional/RAT/Caucasus/RAT-007 - Commute/RAT-007 - Commute.lua +++ b/Functional/RAT/Caucasus/RAT-007 - Commute/RAT-007 - Commute.lua @@ -1,31 +1,31 @@ --- Name: RAT-007 - Commute --- Author: funkyfranky --- Date Created: 24 Sep 2017 --- --- # Situation: --- --- Spawn several aircraft of the same type at Mozdok and let them fly to Mineralnye Vody. --- Once the aircraft arrives at its destination, it will be respawned there and fly back to Mozdok. --- Note that: --- We do NOT have to set a departure or destination airports. If we don't, the first departure and destination are random. --- Commute() also works for random destination and departure airports. But once they are chosen, aircraft will only commute between those. --- Also note that Commute() does NOT work with spawn in air since the departure airport is not defined then. --- --- # Test cases: --- --- 1. Observe two C-17A being spawned at Mozdok and fly back and forth between Mozdok and Mineralnye Vody until the end of time. - --- Create RAT object. The only required parameter is the name of the template group in the mission editor. -local c17=RAT:New("RAT_C17") - --- Set Gudauta as departure airport. -c17:SetDeparture("Mozdok") - --- Set Mineralnye Vody as destination. -c17:SetDestination("Mineralnye Vody") - --- This makes aircraft respawn at their destination airport and fly back to its departure. Hence, departure cannot be in air. -c17:Commute() - --- Spawn two aircraft. +-- Name: RAT-007 - Commute +-- Author: funkyfranky +-- Date Created: 24 Sep 2017 +-- +-- # Situation: +-- +-- Spawn several aircraft of the same type at Mozdok and let them fly to Mineralnye Vody. +-- Once the aircraft arrives at its destination, it will be respawned there and fly back to Mozdok. +-- Note that: +-- We do NOT have to set a departure or destination airports. If we don't, the first departure and destination are random. +-- Commute() also works for random destination and departure airports. But once they are chosen, aircraft will only commute between those. +-- Also note that Commute() does NOT work with spawn in air since the departure airport is not defined then. +-- +-- # Test cases: +-- +-- 1. Observe two C-17A being spawned at Mozdok and fly back and forth between Mozdok and Mineralnye Vody until the end of time. + +-- Create RAT object. The only required parameter is the name of the template group in the mission editor. +local c17=RAT:New("RAT_C17") + +-- Set Gudauta as departure airport. +c17:SetDeparture("Mozdok") + +-- Set Mineralnye Vody as destination. +c17:SetDestination("Mineralnye Vody") + +-- This makes aircraft respawn at their destination airport and fly back to its departure. Hence, departure cannot be in air. +c17:Commute() + +-- Spawn two aircraft. c17:Spawn(2) \ No newline at end of file diff --git a/Functional/RAT/Caucasus/RAT-008 - Spawn in Air/RAT-008 - Spawn in Air.lua b/Functional/RAT/Caucasus/RAT-008 - Spawn in Air/RAT-008 - Spawn in Air.lua index e50b6f1663..d716df6b68 100644 --- a/Functional/RAT/Caucasus/RAT-008 - Spawn in Air/RAT-008 - Spawn in Air.lua +++ b/Functional/RAT/Caucasus/RAT-008 - Spawn in Air/RAT-008 - Spawn in Air.lua @@ -1,53 +1,53 @@ --- Name: RAT-008 - Spawn in Air --- Author: funkyfranky --- Date Created: 24 Sep 2017 --- --- # Situation: --- --- Spawn several aircraft above airports or at zones pre-defined in the mission editor. --- Note that if takeoff is set to air: --- Airports are treated like zones with a certain radius. --- Spawn happens at a random point anywhere within the zone. --- --- --- # Test cases: --- --- 1. Obsever ten Yak-40 being spawned in air near random airports of the map. --- 2. Observe five C-17A being spawned within Zones "RAT Zone West", and "RAT Zone North". --- 3. Observe eight IL76 being spawned within RAT Zone North or somewhere near Anapa Vityazevo airport. - - --- Create RAT object from Yak-40 template. -local yak=RAT:New("RAT_YAK") - --- Set takeoff type to air. -yak:SetTakeoff("air") - --- Spawn ten Yak-40s. -yak:Spawn(10) - - --- Create RAT object from C-17A template. -local c17=RAT:New("RAT_C17") - --- Set takeoff type to air. -c17:SetTakeoff("air") - --- Set departure zones for C-17. -c17:SetDeparture({"RAT Zone West", "RAT Zone South"}) - --- Spawn five C-17s. -c17:Spawn(5) - - --- Create RAT object from IL76 template. -local il76=RAT:New("RAT_IL76") - --- Set takeoff type to air. -il76:SetTakeoff("air") - --- Set departure zones for C-17. You can mix zone names and airport names. -il76:SetDeparture({"RAT Zone North", "Anapa-Vityazevo"}) - --- Spawn eight C-17s. +-- Name: RAT-008 - Spawn in Air +-- Author: funkyfranky +-- Date Created: 24 Sep 2017 +-- +-- # Situation: +-- +-- Spawn several aircraft above airports or at zones pre-defined in the mission editor. +-- Note that if takeoff is set to air: +-- Airports are treated like zones with a certain radius. +-- Spawn happens at a random point anywhere within the zone. +-- +-- +-- # Test cases: +-- +-- 1. Obsever ten Yak-40 being spawned in air near random airports of the map. +-- 2. Observe five C-17A being spawned within Zones "RAT Zone West", and "RAT Zone North". +-- 3. Observe eight IL76 being spawned within RAT Zone North or somewhere near Anapa Vityazevo airport. + + +-- Create RAT object from Yak-40 template. +local yak=RAT:New("RAT_YAK") + +-- Set takeoff type to air. +yak:SetTakeoff("air") + +-- Spawn ten Yak-40s. +yak:Spawn(10) + + +-- Create RAT object from C-17A template. +local c17=RAT:New("RAT_C17") + +-- Set takeoff type to air. +c17:SetTakeoff("air") + +-- Set departure zones for C-17. +c17:SetDeparture({"RAT Zone West", "RAT Zone South"}) + +-- Spawn five C-17s. +c17:Spawn(5) + + +-- Create RAT object from IL76 template. +local il76=RAT:New("RAT_IL76") + +-- Set takeoff type to air. +il76:SetTakeoff("air") + +-- Set departure zones for C-17. You can mix zone names and airport names. +il76:SetDeparture({"RAT Zone North", "Anapa-Vityazevo"}) + +-- Spawn eight C-17s. il76:Spawn(8) \ No newline at end of file diff --git a/Functional/RAT/Caucasus/RAT-009 - Set Cruise Altitude/RAT-009 - Set Cruise Altitude.lua b/Functional/RAT/Caucasus/RAT-009 - Set Cruise Altitude/RAT-009 - Set Cruise Altitude.lua index ab5a020ec7..454de48c4b 100644 --- a/Functional/RAT/Caucasus/RAT-009 - Set Cruise Altitude/RAT-009 - Set Cruise Altitude.lua +++ b/Functional/RAT/Caucasus/RAT-009 - Set Cruise Altitude/RAT-009 - Set Cruise Altitude.lua @@ -1,46 +1,46 @@ --- Name: RAT-009 - Set Cruise Altitude --- Author: funkyfranky --- Date Created: 24 Sep 2017 --- --- # Situation: --- --- Spawn several aircraft randomly but make them fly at certain cruise altitudes. --- In the first example we specify the flight level, i.e. the altitude above sea level in hundreds of meters. --- There are also methods to set the cruise altitude in meters. These are used in the second example. --- --- Note that when setting a lower bound for the cruise altitude, this automatically adjusts the minimum distance to possible destinations, since the aircraft must have enough time to climb to that alt and descent again to the destination. --- --- # Test cases: --- --- 1. Obsever five Yak-40 being spawned at random airports. They will travel to a random destination but the cruising altitude will not be below 5,000 feet and not be above 20,000 feet. --- Most aircraft will travel at or near 10,000 ft. --- 2. Observe two C-17 being spawned at Tbilisi-Lochini. They will travel to a random destination but the cruise alt is set to be > 5 km. - - --- Create RAT object from Yak-40 template. -local yak=RAT:New("RAT_YAK") - --- Set the minimum flight level. No aircaft will travel below this altitude. -yak:SetFLmin(50) - --- Set maximum flight level to 20,000 ft ASL. No aircraft will be assigned a cruise flight level above this altitude. -yak:SetFLmax(200) - --- Set cruise flight level to 10,000 ft. The final choise is random between FLmin and FLmax, but morst aircraft will travel at his or near this altitude. -yak:SetFLcruise(100) - --- Spawn five Yak-40s. -yak:Spawn(5) - - --- Create RAT object from C-17A template. -local c17=RAT:New("RAT_C17") - --- Set departure zones for C-17. -c17:SetDeparture("Tbilisi-Lochini") - --- All aircraft will fly at least at a height of 5 km ASL. -c17:SetMinCruiseAltitude(5000) - --- Spawn two C-17s. -c17:Spawn(2) +-- Name: RAT-009 - Set Cruise Altitude +-- Author: funkyfranky +-- Date Created: 24 Sep 2017 +-- +-- # Situation: +-- +-- Spawn several aircraft randomly but make them fly at certain cruise altitudes. +-- In the first example we specify the flight level, i.e. the altitude above sea level in hundreds of meters. +-- There are also methods to set the cruise altitude in meters. These are used in the second example. +-- +-- Note that when setting a lower bound for the cruise altitude, this automatically adjusts the minimum distance to possible destinations, since the aircraft must have enough time to climb to that alt and descent again to the destination. +-- +-- # Test cases: +-- +-- 1. Obsever five Yak-40 being spawned at random airports. They will travel to a random destination but the cruising altitude will not be below 5,000 feet and not be above 20,000 feet. +-- Most aircraft will travel at or near 10,000 ft. +-- 2. Observe two C-17 being spawned at Tbilisi-Lochini. They will travel to a random destination but the cruise alt is set to be > 5 km. + + +-- Create RAT object from Yak-40 template. +local yak=RAT:New("RAT_YAK") + +-- Set the minimum flight level. No aircaft will travel below this altitude. +yak:SetFLmin(50) + +-- Set maximum flight level to 20,000 ft ASL. No aircraft will be assigned a cruise flight level above this altitude. +yak:SetFLmax(200) + +-- Set cruise flight level to 10,000 ft. The final choise is random between FLmin and FLmax, but morst aircraft will travel at his or near this altitude. +yak:SetFLcruise(100) + +-- Spawn five Yak-40s. +yak:Spawn(5) + + +-- Create RAT object from C-17A template. +local c17=RAT:New("RAT_C17") + +-- Set departure zones for C-17. +c17:SetDeparture("Tbilisi-Lochini") + +-- All aircraft will fly at least at a height of 5 km ASL. +c17:SetMinCruiseAltitude(5000) + +-- Spawn two C-17s. +c17:Spawn(2) diff --git a/Functional/RAT/Caucasus/RAT-010 - Helo FARP and Ship/RAT-010 - Helo FARP and Ship.lua b/Functional/RAT/Caucasus/RAT-010 - Helo FARP and Ship/RAT-010 - Helo FARP and Ship.lua index 844caabe27..561e2c431f 100644 --- a/Functional/RAT/Caucasus/RAT-010 - Helo FARP and Ship/RAT-010 - Helo FARP and Ship.lua +++ b/Functional/RAT/Caucasus/RAT-010 - Helo FARP and Ship/RAT-010 - Helo FARP and Ship.lua @@ -1,67 +1,67 @@ --- Name: RAT-010 - Helo FARP and Ship --- Author: funkyfranky --- Date Created: 23 Sep 2017 --- --- # Situation: --- --- Spawn helos at FARPS or ships. --- --- # Test cases: --- --- 1. Obsever five Yak-40 being spawned at random airports. They will travel to a random destination but the cruising altitude will not be below 5,000 feet and not be above 20,000 feet. - --- Create RAT object from Huey template. -local huey1=RAT:New("RAT_HUEY", "Huey Berlin") - --- Huey departing from FARP Berlin. -huey1:SetDeparture({"FARP Berlin"}) - --- Flying to Normandy. -huey1:SetDestination({"Normandy"}) - --- Take-off with engines on. -huey1:SetTakeoff("hot") - --- Huey will respawn at Normandy and fly back to FARP Berlin. -huey1:Commute() - --- Huey will be spawned. -huey1:Spawn() - - --- Create RAT object from Huey template. -local huey2=RAT:New("RAT_HUEY", "Huey London") - --- Huey departing from FARP London. -huey2:SetDeparture({"FARP London"}) - --- Flying to Normandy. -huey2:SetDestination({"Normandy"}) - --- Take-off with engines on. -huey2:SetTakeoff("hot") - --- Huey will respawn at Normandy and fly back to FARP London. -huey2:Commute() - --- Huey will be spawned. -huey2:Spawn() - - --- Create RAT object from Huey template. -local huey3=RAT:New("RAT_HUEY", "Huey Anapa") - --- Huey departing from FARP London. -huey3:SetDeparture({"FARP London", "FARP Berlin", "Anapa-Vityazevo"}) - --- Flying to Normandy. -huey3:SetDestination({"FARP London", "FARP Berlin", "Anapa-Vityazevo"}) - --- Take-off with engines on. -huey3:SetTakeoff("hot") - --- Huey will continue its journey. -huey3:ContinueJourney() - --- Huey will be spawned. +-- Name: RAT-010 - Helo FARP and Ship +-- Author: funkyfranky +-- Date Created: 23 Sep 2017 +-- +-- # Situation: +-- +-- Spawn helos at FARPS or ships. +-- +-- # Test cases: +-- +-- 1. Obsever five Yak-40 being spawned at random airports. They will travel to a random destination but the cruising altitude will not be below 5,000 feet and not be above 20,000 feet. + +-- Create RAT object from Huey template. +local huey1=RAT:New("RAT_HUEY", "Huey Berlin") + +-- Huey departing from FARP Berlin. +huey1:SetDeparture({"FARP Berlin"}) + +-- Flying to Normandy. +huey1:SetDestination({"Normandy"}) + +-- Take-off with engines on. +huey1:SetTakeoff("hot") + +-- Huey will respawn at Normandy and fly back to FARP Berlin. +huey1:Commute() + +-- Huey will be spawned. +huey1:Spawn() + + +-- Create RAT object from Huey template. +local huey2=RAT:New("RAT_HUEY", "Huey London") + +-- Huey departing from FARP London. +huey2:SetDeparture({"FARP London"}) + +-- Flying to Normandy. +huey2:SetDestination({"Normandy"}) + +-- Take-off with engines on. +huey2:SetTakeoff("hot") + +-- Huey will respawn at Normandy and fly back to FARP London. +huey2:Commute() + +-- Huey will be spawned. +huey2:Spawn() + + +-- Create RAT object from Huey template. +local huey3=RAT:New("RAT_HUEY", "Huey Anapa") + +-- Huey departing from FARP London. +huey3:SetDeparture({"FARP London", "FARP Berlin", "Anapa-Vityazevo"}) + +-- Flying to Normandy. +huey3:SetDestination({"FARP London", "FARP Berlin", "Anapa-Vityazevo"}) + +-- Take-off with engines on. +huey3:SetTakeoff("hot") + +-- Huey will continue its journey. +huey3:ContinueJourney() + +-- Huey will be spawned. huey3:Spawn() \ No newline at end of file diff --git a/Functional/RAT/Caucasus/RAT-011 - Carrier Ops/RAT-011 - Carrier Ops.lua b/Functional/RAT/Caucasus/RAT-011 - Carrier Ops/RAT-011 - Carrier Ops.lua index d6b1684b24..677a37ccb4 100644 --- a/Functional/RAT/Caucasus/RAT-011 - Carrier Ops/RAT-011 - Carrier Ops.lua +++ b/Functional/RAT/Caucasus/RAT-011 - Carrier Ops/RAT-011 - Carrier Ops.lua @@ -1,43 +1,43 @@ --- Name: RAT-011 - Carrier Ops --- Author: funkyfranky --- Date Created: 24 Sep 2017 --- --- # Situation: --- --- Spawn aircraft flying to and from aircraft carriers --- --- # Test cases: --- --- 1. Observe two SU-33 taking of from Novorossiysk and fly to the Kuznetsov. --- 2. Observe two F-14A taking of from the Carl Vinson flying into Batumi. - --- Create RAT object from Su-33 template. -local su33=RAT:New("RAT_SU33") - --- Huey departing from FARP Berlin. -su33:SetDeparture({"Novorossiysk"}) - --- Flying to Normandy. -su33:SetDestination({"Kuznetsov"}) - --- Take-off with engines on. -su33:SetTakeoff("hot") - --- Spawn two aircraft. -su33:Spawn(2) - - --- Create RAT object from Su-33 template. -local f14=RAT:New("RAT_F14") - --- Huey departing from FARP Berlin. -f14:SetDeparture({"Carl Vinson"}) - --- Flying to Normandy. -f14:SetDestination({"Batumi"}) - --- Take-off with engines on. -f14:SetTakeoff("hot") - --- Spawn two aircraft. +-- Name: RAT-011 - Carrier Ops +-- Author: funkyfranky +-- Date Created: 24 Sep 2017 +-- +-- # Situation: +-- +-- Spawn aircraft flying to and from aircraft carriers +-- +-- # Test cases: +-- +-- 1. Observe two SU-33 taking of from Novorossiysk and fly to the Kuznetsov. +-- 2. Observe two F-14A taking of from the Carl Vinson flying into Batumi. + +-- Create RAT object from Su-33 template. +local su33=RAT:New("RAT_SU33") + +-- Huey departing from FARP Berlin. +su33:SetDeparture({"Novorossiysk"}) + +-- Flying to Normandy. +su33:SetDestination({"Kuznetsov"}) + +-- Take-off with engines on. +su33:SetTakeoff("hot") + +-- Spawn two aircraft. +su33:Spawn(2) + + +-- Create RAT object from Su-33 template. +local f14=RAT:New("RAT_F14") + +-- Huey departing from FARP Berlin. +f14:SetDeparture({"Carl Vinson"}) + +-- Flying to Normandy. +f14:SetDestination({"Batumi"}) + +-- Take-off with engines on. +f14:SetTakeoff("hot") + +-- Spawn two aircraft. f14:Spawn(2) \ No newline at end of file diff --git a/Functional/RAT/Nevada/RAT-010 - Traffic at McCarran International/RAT-010 - Traffic at McCarran International.lua b/Functional/RAT/Nevada/RAT-010 - Traffic at McCarran International/RAT-010 - Traffic at McCarran International.lua index 8cef0b4b16..f3126ac4c4 100644 --- a/Functional/RAT/Nevada/RAT-010 - Traffic at McCarran International/RAT-010 - Traffic at McCarran International.lua +++ b/Functional/RAT/Nevada/RAT-010 - Traffic at McCarran International/RAT-010 - Traffic at McCarran International.lua @@ -1,76 +1,76 @@ ---- --- Name: RAT-010 - Traffic at McCarran International --- Author: funkyfranky --- Date Created: 24 Sep 2017 --- Updated: 10 Oct 2023 --- --- # Situation: --- --- We want to generate some random air traffic at McCarran International Airport. --- --- # Test cases: --- --- 1. KC-135 aircraft are spawned at zones north and east heading to McCarran. --- 2. E-3A aircraft are spawned at McCarran with random destinations. --- 3. Yak-40 aircraft are spawned at random airports heading for McCarran. --- 3. TF-51D aircraft are spawned at Henderson, Boulder City or Echo Bay heading for McCarran. - --- Create RAT object from KC-135 template. -local kc135=RAT:New("RAT_KC135") - -kc135:SetCoalition("same") - --- Set departure zones. We need takeoff "air" for that. -kc135:SetDeparture({"RAT Zone North", "RAT Zone East"}) - --- Set spawn in air. -kc135:SetTakeoff("air") - --- Aircraft will fly to McCarran -kc135:SetDestination(AIRBASE.Nevada.McCarran_International_Airport) - --- Spawn two aircraft. -kc135:Spawn(2) - - --- Create RAT object from E-3A template. -local e3=RAT:New("RAT_E3") - -e3:SetCoalition("same") - --- Aircraft are spawned at McCarran. Destinations are random. -e3:SetDeparture(AIRBASE.Nevada.McCarran_International_Airport) - --- Enable respawn after landing with a delay of six minutes. -e3:RespawnAfterLanding(360) - --- Spawn two aircraft. -e3:Spawn(2) - - --- Create RAT object from Yak-40 template. -local yak=RAT:New("RAT_YAK") - --- These are the airports a Yak-40 gets a parking slot. -yak:SetDeparture({AIRBASE.Nevada.Tonopah_Airport, AIRBASE.Nevada.Tonopah_Test_Range_Airfield, AIRBASE.Nevada.Henderson_Executive_Airport, AIRBASE.Nevada.Nellis_AFB, AIRBASE.Nevada.Groom_Lake_AFB, AIRBASE.Nevada.Laughlin_Airport}) - --- Destination McCarran. -yak:SetDestination(AIRBASE.Nevada.McCarran_International_Airport) - --- Spawn eight Yak-40. -yak:Spawn(8) - - --- Create RAT object from E-3A template. -local tf51=RAT:New("RAT_TF51") - -tf51:SetCoalition("same") - --- Departure airport will be chosen from this list. -tf51:SetDeparture({AIRBASE.Nevada.Henderson_Executive_Airport, AIRBASE.Nevada.Boulder_City_Airport, AIRBASE.Nevada.Echo_Bay}) - --- All will fly to McCarran. -tf51:SetDestination(AIRBASE.Nevada.McCarran_International_Airport) - --- Spawn four TF-51D -tf51:Spawn(4) +--- +-- Name: RAT-010 - Traffic at McCarran International +-- Author: funkyfranky +-- Date Created: 24 Sep 2017 +-- Updated: 10 Oct 2023 +-- +-- # Situation: +-- +-- We want to generate some random air traffic at McCarran International Airport. +-- +-- # Test cases: +-- +-- 1. KC-135 aircraft are spawned at zones north and east heading to McCarran. +-- 2. E-3A aircraft are spawned at McCarran with random destinations. +-- 3. Yak-40 aircraft are spawned at random airports heading for McCarran. +-- 3. TF-51D aircraft are spawned at Henderson, Boulder City or Echo Bay heading for McCarran. + +-- Create RAT object from KC-135 template. +local kc135=RAT:New("RAT_KC135") + +kc135:SetCoalition("same") + +-- Set departure zones. We need takeoff "air" for that. +kc135:SetDeparture({"RAT Zone North", "RAT Zone East"}) + +-- Set spawn in air. +kc135:SetTakeoff("air") + +-- Aircraft will fly to McCarran +kc135:SetDestination(AIRBASE.Nevada.McCarran_International_Airport) + +-- Spawn two aircraft. +kc135:Spawn(2) + + +-- Create RAT object from E-3A template. +local e3=RAT:New("RAT_E3") + +e3:SetCoalition("same") + +-- Aircraft are spawned at McCarran. Destinations are random. +e3:SetDeparture(AIRBASE.Nevada.McCarran_International_Airport) + +-- Enable respawn after landing with a delay of six minutes. +e3:RespawnAfterLanding(360) + +-- Spawn two aircraft. +e3:Spawn(2) + + +-- Create RAT object from Yak-40 template. +local yak=RAT:New("RAT_YAK") + +-- These are the airports a Yak-40 gets a parking slot. +yak:SetDeparture({AIRBASE.Nevada.Tonopah_Airport, AIRBASE.Nevada.Tonopah_Test_Range_Airfield, AIRBASE.Nevada.Henderson_Executive_Airport, AIRBASE.Nevada.Nellis_AFB, AIRBASE.Nevada.Groom_Lake_AFB, AIRBASE.Nevada.Laughlin_Airport}) + +-- Destination McCarran. +yak:SetDestination(AIRBASE.Nevada.McCarran_International_Airport) + +-- Spawn eight Yak-40. +yak:Spawn(8) + + +-- Create RAT object from E-3A template. +local tf51=RAT:New("RAT_TF51") + +tf51:SetCoalition("same") + +-- Departure airport will be chosen from this list. +tf51:SetDeparture({AIRBASE.Nevada.Henderson_Executive_Airport, AIRBASE.Nevada.Boulder_City_Airport, AIRBASE.Nevada.Echo_Bay}) + +-- All will fly to McCarran. +tf51:SetDestination(AIRBASE.Nevada.McCarran_International_Airport) + +-- Spawn four TF-51D +tf51:Spawn(4) diff --git a/Functional/RAT/Nevada/RAT-011 - Traffic at Nellis AFB/RAT-011 - Traffic at Nellis AFB.lua b/Functional/RAT/Nevada/RAT-011 - Traffic at Nellis AFB/RAT-011 - Traffic at Nellis AFB.lua index 56085631d3..17703c0d7c 100644 --- a/Functional/RAT/Nevada/RAT-011 - Traffic at Nellis AFB/RAT-011 - Traffic at Nellis AFB.lua +++ b/Functional/RAT/Nevada/RAT-011 - Traffic at Nellis AFB/RAT-011 - Traffic at Nellis AFB.lua @@ -1,101 +1,101 @@ ---- --- Name: RAT-011 - Traffic at Nellis AFB --- Author: funkyfranky --- Date Created: 24 Sep 2017 --- Updated: 10 Oct 2023 --- --- # Situation: --- --- We want to generate some random air traffic at Nellis AFB. --- --- # Test cases: --- --- 1. F-15C are spawned at Nellis with desitation Tonopah, Groom Lake or Creech. --- 2. A-10C are spawned at Nellis with desitation Tonopah, Groom Lake or Creech. --- 3. F/A-18C are spawned at Tonopah, Groom Lake or Creech and fly to Nellis. --- 4. KC-135 are spawned in air at two zones heading for Nellis. - --- ----------------------------------------------------------------------------------------------------------------------------------------------------------------- - --- Create RAT object from F-15C template. -local f15=RAT:New("RAT_F15C") - --- Departure Nellis. -f15:SetDeparture(AIRBASE.Nevada.Nellis_AFB) -f15:SetCoalition("same") - --- Destination Tonopah, Groom Lake or Creech. -f15:SetDestination({AIRBASE.Nevada.Tonopah_Airport, AIRBASE.Nevada.Groom_Lake_AFB, AIRBASE.Nevada.Creech_AFB}) - --- Spawn three flights. -f15:Spawn(3) - --- ----------------------------------------------------------------------------------------------------------------------------------------------------------------- - -local a10=RAT:New("RAT_A10C") - --- Departure Nellis. -a10:SetDeparture(AIRBASE.Nevada.Nellis_AFB) -a10:SetCoalition("same") - --- Destination Tonopa, Groom Lake or Creech. -a10:SetDestination({AIRBASE.Nevada.Tonopah_Test_Range_Airfield, AIRBASE.Nevada.Groom_Lake_AFB, AIRBASE.Nevada.Creech_AFB}) - --- Spawning will happen 60 seconds after mission start. -a10:SetSpawnDelay(60) - --- Spawn three flights. -a10:Spawn(3) - --- ----------------------------------------------------------------------------------------------------------------------------------------------------------------- - --- Creat RAT object from F/A-18C template. -local f18=RAT:New("RAT_F18C") -f18:SetCoalition("same") - --- Departure airports. -f18:SetDeparture({AIRBASE.Nevada.Tonopah_Test_Range_Airfield, AIRBASE.Nevada.Groom_Lake_AFB, AIRBASE.Nevada.Creech_AFB}) - --- Destination Nellis. -f18:SetDestination(AIRBASE.Nevada.Nellis_AFB) - --- Spawn three flights. -f18:Spawn(3) - --- ----------------------------------------------------------------------------------------------------------------------------------------------------------------- - --- Create RAT object from KC-135 template. -local kc135=RAT:New("RAT_KC135") - --- Set departure zones. We need takeoff "air" for that. -kc135:SetDeparture({"RAT Zone North", "RAT Zone East"}) - --- Set spawn in air. -kc135:SetTakeoff("air") - --- Aircraft will fly to McCarran -kc135:SetDestination(AIRBASE.Nevada.Nellis_AFB) - --- Spawning of aircraft will happen in 2 minute intervalls. -kc135:SetSpawnInterval(120) - --- Spawn two aircraft. -kc135:Spawn(2) - --- ----------------------------------------------------------------------------------------------------------------------------------------------------------------- - --- Store time at mission start -local T0=timer.getTime() - --- Send message with current misson time to all coalisions -local function print_mission_time() - local Tnow=timer.getTime() - local mission_time=Tnow-T0 - local mission_time_minutes=mission_time/60 - local mission_time_seconds=mission_time%60 - local text=string.format("Mission Time: %i:%02d", mission_time_minutes,mission_time_seconds) - MESSAGE:New(text, 5):ToAll() -end - --- Start scheduler to report mission time. +--- +-- Name: RAT-011 - Traffic at Nellis AFB +-- Author: funkyfranky +-- Date Created: 24 Sep 2017 +-- Updated: 10 Oct 2023 +-- +-- # Situation: +-- +-- We want to generate some random air traffic at Nellis AFB. +-- +-- # Test cases: +-- +-- 1. F-15C are spawned at Nellis with desitation Tonopah, Groom Lake or Creech. +-- 2. A-10C are spawned at Nellis with desitation Tonopah, Groom Lake or Creech. +-- 3. F/A-18C are spawned at Tonopah, Groom Lake or Creech and fly to Nellis. +-- 4. KC-135 are spawned in air at two zones heading for Nellis. + +-- ----------------------------------------------------------------------------------------------------------------------------------------------------------------- + +-- Create RAT object from F-15C template. +local f15=RAT:New("RAT_F15C") + +-- Departure Nellis. +f15:SetDeparture(AIRBASE.Nevada.Nellis_AFB) +f15:SetCoalition("same") + +-- Destination Tonopah, Groom Lake or Creech. +f15:SetDestination({AIRBASE.Nevada.Tonopah_Airport, AIRBASE.Nevada.Groom_Lake_AFB, AIRBASE.Nevada.Creech_AFB}) + +-- Spawn three flights. +f15:Spawn(3) + +-- ----------------------------------------------------------------------------------------------------------------------------------------------------------------- + +local a10=RAT:New("RAT_A10C") + +-- Departure Nellis. +a10:SetDeparture(AIRBASE.Nevada.Nellis_AFB) +a10:SetCoalition("same") + +-- Destination Tonopa, Groom Lake or Creech. +a10:SetDestination({AIRBASE.Nevada.Tonopah_Test_Range_Airfield, AIRBASE.Nevada.Groom_Lake_AFB, AIRBASE.Nevada.Creech_AFB}) + +-- Spawning will happen 60 seconds after mission start. +a10:SetSpawnDelay(60) + +-- Spawn three flights. +a10:Spawn(3) + +-- ----------------------------------------------------------------------------------------------------------------------------------------------------------------- + +-- Creat RAT object from F/A-18C template. +local f18=RAT:New("RAT_F18C") +f18:SetCoalition("same") + +-- Departure airports. +f18:SetDeparture({AIRBASE.Nevada.Tonopah_Test_Range_Airfield, AIRBASE.Nevada.Groom_Lake_AFB, AIRBASE.Nevada.Creech_AFB}) + +-- Destination Nellis. +f18:SetDestination(AIRBASE.Nevada.Nellis_AFB) + +-- Spawn three flights. +f18:Spawn(3) + +-- ----------------------------------------------------------------------------------------------------------------------------------------------------------------- + +-- Create RAT object from KC-135 template. +local kc135=RAT:New("RAT_KC135") + +-- Set departure zones. We need takeoff "air" for that. +kc135:SetDeparture({"RAT Zone North", "RAT Zone East"}) + +-- Set spawn in air. +kc135:SetTakeoff("air") + +-- Aircraft will fly to McCarran +kc135:SetDestination(AIRBASE.Nevada.Nellis_AFB) + +-- Spawning of aircraft will happen in 2 minute intervalls. +kc135:SetSpawnInterval(120) + +-- Spawn two aircraft. +kc135:Spawn(2) + +-- ----------------------------------------------------------------------------------------------------------------------------------------------------------------- + +-- Store time at mission start +local T0=timer.getTime() + +-- Send message with current misson time to all coalisions +local function print_mission_time() + local Tnow=timer.getTime() + local mission_time=Tnow-T0 + local mission_time_minutes=mission_time/60 + local mission_time_seconds=mission_time%60 + local text=string.format("Mission Time: %i:%02d", mission_time_minutes,mission_time_seconds) + MESSAGE:New(text, 5):ToAll() +end + +-- Start scheduler to report mission time. local Scheduler_Mission_Time = SCHEDULER:New(nil, print_mission_time, {}, 0, 10) \ No newline at end of file diff --git a/Functional/RAT/Normandy/RAT-020 - WWII Scenario/RAT-020 - WWII Scenario.lua b/Functional/RAT/Normandy/RAT-020 - WWII Scenario/RAT-020 - WWII Scenario.lua index e2b905c049..f774d55136 100644 --- a/Functional/RAT/Normandy/RAT-020 - WWII Scenario/RAT-020 - WWII Scenario.lua +++ b/Functional/RAT/Normandy/RAT-020 - WWII Scenario/RAT-020 - WWII Scenario.lua @@ -1,85 +1,85 @@ --- Name: RAT-020 - WWII Scenario --- Author: funkyfranky --- Date Created: 16 Sep 2017 --- --- # Situation: --- --- We want to generate some random air traffic of WWII units in 1944 Normandy. --- In the mission editor we have defined a couple of red and blue airfields. --- Germans are located to the east while the allies hold the western airfiels and those of southern England. --- Note that the default setting of the RAT aircraft is to hold their weapons and to ignore enemy threads. --- --- # Test cases: --- --- 1. Four two-ship flights of Bf-109 get random routes restricted to red airfields. --- 2. Two two-ship flights of FW-190 similar to the Bf-109s. --- 3. Three two-ship flights of TF-51 get random routes restricted to blue airfields. --- 4. Two two-ship flights of Spitfires are set up analogously to the TF-51 --- 5. One two-ship flight of Spitfires is explicitly ordered to fly back and forth across the channel. - --- ----------------------------------------------------------------------------------------------------------------------------------------------------------------- - --- Create RAT object from Bf-109 template. -local bf109=RAT:New("RAT_Bf109") - --- Airports are restricted to red. -bf109:SetCoalition("sameonly") - --- Spawn four Bf-109. -bf109:Spawn(4) - --- Create RAT object from FW-190 template. -local fw190=RAT:New("RAT_Fw190") - --- Again, airports restricted to red. -fw190:SetCoalition("sameonly") - --- Spawn two FW-190. -fw190:Spawn(2) - --- ----------------------------------------------------------------------------------------------------------------------------------------------------------------- - --- Create RAT object from TF-51 template. -local tf51=RAT:New("RAT_TF-51") - --- Allow only blue airports for departure and destination. -tf51:SetCoalition("sameonly") - --- We exclude ever airport across the channel. -tf51:ExcludedAirports({"Needs Oar Point", "Funtington", "Tangmere", "Ford", "Chailey"}) - --- Spawn three TF-51. -tf51:Spawn(3) - - --- Creat RAT object from Spitfire template. -local spit=RAT:New("RAT_Spit") - --- Blue airports only. -spit:SetCoalition("sameonly") - --- We exclude ever airport across the channel. -spit:ExcludedAirports({"Needs Oar Point", "Funtington", "Tangmere", "Ford", "Chailey"}) - --- Spawn two two-ship flights. -spit:Spawn(2) - --- Create RAT object from Spitfire template. --- NOTE that since we have already used this template, we need to give it another name. --- This is done by the second parameter, which is the alias name for RAT aircraft. --- In particular, this will be the name given in the F10 Menu. --- IMPORTANT: It is no problem to reuse the same template multiple times. But each template must get its own alias! -local spit_commute=RAT:New("RAT_Spit", "RAT_Spit_Commute") - --- These Spitfires get the order fly across the channel and to commute between Chailey and Le Molay. -spit_commute:SetDeparture("Chailey") -spit_commute:SetDestination("Le Molay") -spit_commute:Commute() - --- Set another livery for these aircraft. -spit_commute:Livery("RAF, No. 126 Squadron, Harrowbeer") - --- Spawn one two-ship flight. -spit_commute:Spawn() - +-- Name: RAT-020 - WWII Scenario +-- Author: funkyfranky +-- Date Created: 16 Sep 2017 +-- +-- # Situation: +-- +-- We want to generate some random air traffic of WWII units in 1944 Normandy. +-- In the mission editor we have defined a couple of red and blue airfields. +-- Germans are located to the east while the allies hold the western airfiels and those of southern England. +-- Note that the default setting of the RAT aircraft is to hold their weapons and to ignore enemy threads. +-- +-- # Test cases: +-- +-- 1. Four two-ship flights of Bf-109 get random routes restricted to red airfields. +-- 2. Two two-ship flights of FW-190 similar to the Bf-109s. +-- 3. Three two-ship flights of TF-51 get random routes restricted to blue airfields. +-- 4. Two two-ship flights of Spitfires are set up analogously to the TF-51 +-- 5. One two-ship flight of Spitfires is explicitly ordered to fly back and forth across the channel. + +-- ----------------------------------------------------------------------------------------------------------------------------------------------------------------- + +-- Create RAT object from Bf-109 template. +local bf109=RAT:New("RAT_Bf109") + +-- Airports are restricted to red. +bf109:SetCoalition("sameonly") + +-- Spawn four Bf-109. +bf109:Spawn(4) + +-- Create RAT object from FW-190 template. +local fw190=RAT:New("RAT_Fw190") + +-- Again, airports restricted to red. +fw190:SetCoalition("sameonly") + +-- Spawn two FW-190. +fw190:Spawn(2) + +-- ----------------------------------------------------------------------------------------------------------------------------------------------------------------- + +-- Create RAT object from TF-51 template. +local tf51=RAT:New("RAT_TF-51") + +-- Allow only blue airports for departure and destination. +tf51:SetCoalition("sameonly") + +-- We exclude ever airport across the channel. +tf51:ExcludedAirports({"Needs Oar Point", "Funtington", "Tangmere", "Ford", "Chailey"}) + +-- Spawn three TF-51. +tf51:Spawn(3) + + +-- Creat RAT object from Spitfire template. +local spit=RAT:New("RAT_Spit") + +-- Blue airports only. +spit:SetCoalition("sameonly") + +-- We exclude ever airport across the channel. +spit:ExcludedAirports({"Needs Oar Point", "Funtington", "Tangmere", "Ford", "Chailey"}) + +-- Spawn two two-ship flights. +spit:Spawn(2) + +-- Create RAT object from Spitfire template. +-- NOTE that since we have already used this template, we need to give it another name. +-- This is done by the second parameter, which is the alias name for RAT aircraft. +-- In particular, this will be the name given in the F10 Menu. +-- IMPORTANT: It is no problem to reuse the same template multiple times. But each template must get its own alias! +local spit_commute=RAT:New("RAT_Spit", "RAT_Spit_Commute") + +-- These Spitfires get the order fly across the channel and to commute between Chailey and Le Molay. +spit_commute:SetDeparture("Chailey") +spit_commute:SetDestination("Le Molay") +spit_commute:Commute() + +-- Set another livery for these aircraft. +spit_commute:Livery("RAF, No. 126 Squadron, Harrowbeer") + +-- Spawn one two-ship flight. +spit_commute:Spawn() + -- ----------------------------------------------------------------------------------------------------------------------------------------------------------------- \ No newline at end of file diff --git a/Functional/Scoring/SCO-100 - Scoring Demo/SCO-100 - Scoring Demo.lua b/Functional/Scoring/SCO-100 - Scoring Demo/SCO-100 - Scoring Demo.lua index a64c35bdf2..c63131658c 100644 --- a/Functional/Scoring/SCO-100 - Scoring Demo/SCO-100 - Scoring Demo.lua +++ b/Functional/Scoring/SCO-100 - Scoring Demo/SCO-100 - Scoring Demo.lua @@ -1,38 +1,38 @@ ---- --- Name: SCO-100 - Scoring Demo --- Author: FlightControl --- Date Created: 21 Feb 2017 --- --- # Situation: --- --- A shooting range has been setup. Fly the Ka-50 or the Su-25T to the statics and units located near the airport, and shoot them. --- --- # Test cases: --- --- 1. Observe the scoring granted to your flight when you hit and kill targets. - - -HQ = GROUP:FindByName( "HQ", "Bravo HQ" ) - -CommandCenter = COMMANDCENTER:New( HQ, "Bravo" ) - -Scoring = SCORING:New( "Shooting Range 1" ) - -Scoring:SetScaleDestroyScore( 10 ) - -Scoring:SetScaleDestroyPenalty( 40 ) - -Scoring:AddUnitScore( UNIT:FindByName( "Unit #001" ), 200 ) - --- Test for zone scores. - --- This one is to test scoring on normal units. -ShootingRangeZone = ZONE:New( "ScoringZone1" ) -Scoring:AddZoneScore( ShootingRangeZone, 200 ) - --- This one is to test scoring on scenery. --- Note that you can only destroy scenery with heavy weapons. -SceneryZone = ZONE:New( "ScoringZone2" ) -Scoring:AddZoneScore( SceneryZone, 200 ) - -Scoring:AddStaticScore(STATIC:FindByName( "Shooting Range #010" ), 100 ) +--- +-- Name: SCO-100 - Scoring Demo +-- Author: FlightControl +-- Date Created: 21 Feb 2017 +-- +-- # Situation: +-- +-- A shooting range has been setup. Fly the Ka-50 or the Su-25T to the statics and units located near the airport, and shoot them. +-- +-- # Test cases: +-- +-- 1. Observe the scoring granted to your flight when you hit and kill targets. + + +HQ = GROUP:FindByName( "HQ", "Bravo HQ" ) + +CommandCenter = COMMANDCENTER:New( HQ, "Bravo" ) + +Scoring = SCORING:New( "Shooting Range 1" ) + +Scoring:SetScaleDestroyScore( 10 ) + +Scoring:SetScaleDestroyPenalty( 40 ) + +Scoring:AddUnitScore( UNIT:FindByName( "Unit #001" ), 200 ) + +-- Test for zone scores. + +-- This one is to test scoring on normal units. +ShootingRangeZone = ZONE:New( "ScoringZone1" ) +Scoring:AddZoneScore( ShootingRangeZone, 200 ) + +-- This one is to test scoring on scenery. +-- Note that you can only destroy scenery with heavy weapons. +SceneryZone = ZONE:New( "ScoringZone2" ) +Scoring:AddZoneScore( SceneryZone, 200 ) + +Scoring:AddStaticScore(STATIC:FindByName( "Shooting Range #010" ), 100 ) diff --git a/Functional/Scoring/SCO-101 - Scoring Client to Client/SCO-101 - Scoring Client to Client.lua b/Functional/Scoring/SCO-101 - Scoring Client to Client/SCO-101 - Scoring Client to Client.lua index 176e709ab2..76213478db 100644 --- a/Functional/Scoring/SCO-101 - Scoring Client to Client/SCO-101 - Scoring Client to Client.lua +++ b/Functional/Scoring/SCO-101 - Scoring Client to Client/SCO-101 - Scoring Client to Client.lua @@ -1,21 +1,21 @@ ---- --- Name: SCO-101 - Scoring Client to Client --- Author: FlightControl --- Date Created: 24 Feb 2017 --- --- # Situation: --- --- A shooting range has been setup to test client to client scoring. --- --- # Test cases: --- --- 1. Observe the scoring granted to your flight when you hit and kill other clients. - - -HQ = GROUP:FindByName( "HQ", "Bravo HQ" ) - -CommandCenter = COMMANDCENTER:New( HQ, "Lima" ) - -Scoring = SCORING:New( "Detect Demo" ) - - +--- +-- Name: SCO-101 - Scoring Client to Client +-- Author: FlightControl +-- Date Created: 24 Feb 2017 +-- +-- # Situation: +-- +-- A shooting range has been setup to test client to client scoring. +-- +-- # Test cases: +-- +-- 1. Observe the scoring granted to your flight when you hit and kill other clients. + + +HQ = GROUP:FindByName( "HQ", "Bravo HQ" ) + +CommandCenter = COMMANDCENTER:New( HQ, "Lima" ) + +Scoring = SCORING:New( "Detect Demo" ) + + diff --git a/Functional/Scoring/SCO-200 - Telemetry/SCO-200 - Telemetry.lua b/Functional/Scoring/SCO-200 - Telemetry/SCO-200 - Telemetry.lua index 0161bdd339..84d8ae6f59 100644 --- a/Functional/Scoring/SCO-200 - Telemetry/SCO-200 - Telemetry.lua +++ b/Functional/Scoring/SCO-200 - Telemetry/SCO-200 - Telemetry.lua @@ -1,41 +1,41 @@ ---- --- Name: SCO-200 - Telemetry --- Author: FlightControl --- Date Created: 24 Sep 2017 --- --- # Situation: --- --- A shooting range has been setup. Fly the Ka-50 or the Su-25T to the statics and objects located near the airport, and shoot them. --- --- # Test cases: --- --- 1. Observe the scoring granted to your flight when you hit and kill targets. --- 2. Check the scoring telemetry communicated to the website. - - -HQ = GROUP:FindByName( "HQ", "Bravo HQ" ) - -CommandCenter = COMMANDCENTER:New( HQ, "Bravo" ) - -Scoring = SCORING:New( "Shooting Range 1" ) - -Scoring:SetTelemetryServer( "96.49.78.227", 5010 ) - -Scoring:SetScaleDestroyScore( 10 ) - -Scoring:SetScaleDestroyPenalty( 40 ) - -Scoring:AddUnitScore( UNIT:FindByName( "Unit #001" ), 200 ) - --- Test for zone scores. - --- This one is to test scoring on normal units. -ShootingRangeZone = ZONE:New( "ScoringZone1" ) -Scoring:AddZoneScore( ShootingRangeZone, 200 ) - --- This one is to test scoring on scenery. --- Note that you can only destroy scenery with heavy weapons. -SceneryZone = ZONE:New( "ScoringZone2" ) -Scoring:AddZoneScore( SceneryZone, 200 ) - -Scoring:AddStaticScore(STATIC:FindByName( "Shooting Range #010" ), 100 ) +--- +-- Name: SCO-200 - Telemetry +-- Author: FlightControl +-- Date Created: 24 Sep 2017 +-- +-- # Situation: +-- +-- A shooting range has been setup. Fly the Ka-50 or the Su-25T to the statics and objects located near the airport, and shoot them. +-- +-- # Test cases: +-- +-- 1. Observe the scoring granted to your flight when you hit and kill targets. +-- 2. Check the scoring telemetry communicated to the website. + + +HQ = GROUP:FindByName( "HQ", "Bravo HQ" ) + +CommandCenter = COMMANDCENTER:New( HQ, "Bravo" ) + +Scoring = SCORING:New( "Shooting Range 1" ) + +Scoring:SetTelemetryServer( "96.49.78.227", 5010 ) + +Scoring:SetScaleDestroyScore( 10 ) + +Scoring:SetScaleDestroyPenalty( 40 ) + +Scoring:AddUnitScore( UNIT:FindByName( "Unit #001" ), 200 ) + +-- Test for zone scores. + +-- This one is to test scoring on normal units. +ShootingRangeZone = ZONE:New( "ScoringZone1" ) +Scoring:AddZoneScore( ShootingRangeZone, 200 ) + +-- This one is to test scoring on scenery. +-- Note that you can only destroy scenery with heavy weapons. +SceneryZone = ZONE:New( "ScoringZone2" ) +Scoring:AddZoneScore( SceneryZone, 200 ) + +Scoring:AddStaticScore(STATIC:FindByName( "Shooting Range #010" ), 100 ) diff --git a/Functional/Scoring/SCO-500 - Scoring Multi Player Demo Mission 1/SCO-500 - Scoring Multi Player Demo Mission 1.lua b/Functional/Scoring/SCO-500 - Scoring Multi Player Demo Mission 1/SCO-500 - Scoring Multi Player Demo Mission 1.lua index 127735351b..078bef2e8e 100644 --- a/Functional/Scoring/SCO-500 - Scoring Multi Player Demo Mission 1/SCO-500 - Scoring Multi Player Demo Mission 1.lua +++ b/Functional/Scoring/SCO-500 - Scoring Multi Player Demo Mission 1/SCO-500 - Scoring Multi Player Demo Mission 1.lua @@ -1,139 +1,139 @@ ---- --- Name: SCO-500 - Scoring Multi Player Demo Mission 1 --- Author: Pikey and FlightControl --- Date Created: 1 Mar 2017 --- --- # Situation: --- --- A demo mission for the scoring. Read the briefing and have fun. --- --- # Test cases: --- --- 1. Observe the scoring granted to your flight when you hit and kill targets. - --- Define the patrol zones -BlueCapZone = ZONE_POLYGON:New( "BlueCapZone", GROUP:FindByName( "Blue CAP Zone Patrol" ) ) -RedCapZone = ZONE_POLYGON:New( "RedCapZone", GROUP:FindByName( "Red CAP Zone Patrol" ) ) - --- Define the engage zones -BlueEngageZone = ZONE_POLYGON:New( "BlueEngageZone", GROUP:FindByName( "Blue CAP Zone Engage" ) ) -RedEngageZone = ZONE_POLYGON:New( "RedEngageZone", GROUP:FindByName( "Red CAP Zone Engage" ) ) - --- Define the Spawn zones for ground vehicles -BlueSpawnGroundZone = ZONE_POLYGON:New( "BlueSpawnGroundZone", GROUP:FindByName( "Blue Spawn Zone" ) ) ---RedSpawnGroundZone = ZONE_POLYGON:New( "RedSpawnGroundZone", GROUP:FindByName( "Red Spawn Zone" ) ) - -RedSpawnGroundZone = ZONE:New( "Red Spawn Zone" ) - --- Define the Scoring zones that define the shelters -BlueShelterZone = ZONE_POLYGON:New( "Blue Shelters", GROUP:FindByName( "Blue Shelters" ) ) -RedShelterZone = ZONE_POLYGON:New( "Red Shelters", GROUP:FindByName( "Red Shelters" ) ) - --- Define the Set of Clients that are used for the AI Balancers -BluePlanesClientSet = SET_CLIENT:New():FilterCoalitions( "blue" ):FilterCategories( "plane" ):FilterPrefixes( "Blue Player") -RedPlanesClientSet = SET_CLIENT:New():FilterCoalitions( "red" ):FilterCategories( "plane" ):FilterPrefixes( "Red Player") - --- Define the Spawn objects for the AI planes -BluePlanesSpawn = SPAWN:New( "BlueAICAP" ):InitCleanUp( 120 ):InitLimit( 5, 0 ) -RedPlanesSpawn = SPAWN:New( "RedAICAP" ):InitCleanUp( 120 ):InitLimit( 5, 0 ) - --- Define the AI Balancers for the planes -BlueAIB = AI_BALANCER:New( BluePlanesClientSet, BluePlanesSpawn ):InitSpawnInterval( 60, 1200 ) -RedAIB = AI_BALANCER:New( RedPlanesClientSet, RedPlanesSpawn ):InitSpawnInterval( 60, 1200 ) - --- Define the Spawn objects for the airbase defenses -BlueAirbaseDefense1Spawn = SPAWN:New( "Blue Airbase Defense 1" ):InitLimit( 10, 10 ):SpawnScheduled( 60, 0 ) -BlueAirbaseDefense2Spawn = SPAWN:New( "Blue Airbase Defense 2" ):InitLimit( 2, 10 ):SpawnScheduled( 60, 0 ) -RedAirbaseDefense1Spawn = SPAWN:New( "Red Airbase Defense 1" ):InitLimit( 10, 10 ):SpawnScheduled( 60, 0 ) -RedAirbaseDefense2Spawn = SPAWN:New( "Red Airbase Defense 2" ):InitLimit( 2, 10 ):SpawnScheduled( 60, 0 ) - --- Define the ground forces spawning engines... - --- First define the template arrays. -BlueGroundTemplates = { "Blue Ground Forces 1", "Blue Ground Forces 2", "Blue Ground Forces 3" } -RedGroundTemplates = { "Red Ground Forces 2", "Red Ground Forces 2", "Red Ground Forces 3" } - --- New we are using these templates to define the spawn objects for the ground forces. --- We spawn them at random places into the define zone. -BlueGroundSpawn = SPAWN - :New( "Blue Ground Forces" ) - :InitLimit( 12, 30 ) - :InitRandomizeZones( { BlueSpawnGroundZone } ) - :InitRandomizeTemplate( BlueGroundTemplates ) - :SpawnScheduled( 60, 0.2 ) - -RedGroundSpawn = SPAWN - :New( "Red Ground Forces" ) - :InitLimit( 12, 30 ) - :InitRandomizeTemplate( RedGroundTemplates ) - :InitRandomizeZones( { RedSpawnGroundZone } ) - :SpawnScheduled( 60, 0.2 ) - - - -BlueCap = {} -RedCap = {} - --- Define the OnAfterSpawned events of the AI balancer Spawn Groups -function BlueAIB:OnAfterSpawned( SetGroup, From, Event, To, AIGroup ) - if AIGroup then - BlueCap[AIGroup] = BlueCap[AIGroup] or AI_CAP_ZONE:New( BlueCapZone, 500, 3000, 450, 1200 ) - local Cap = BlueCap[AIGroup] -- AI.AI_CAP#AI_CAP_ZONE - - Cap:ManageFuel( 0.4, 180 ) - Cap:SetEngageZone( BlueEngageZone ) - Cap:SetControllable( AIGroup ) - Cap:Start() - end -end - -function RedAIB:OnAfterSpawned( SetGroup, From, Event, To, AIGroup ) - - if AIGroup then - RedCap[AIGroup] = RedCap[AIGroup] or AI_CAP_ZONE:New( RedCapZone, 500, 3000, 450, 1200 ) - local Cap = RedCap[AIGroup] -- AI.AI_CAP#AI_CAP_ZONE - - Cap:ManageFuel( 0.4, 180 ) - Cap:SetEngageZone( BlueEngageZone ) - Cap:SetControllable( AIGroup ) - Cap:Start() - end -end - - - - --- Okay, now that we defined all this stuff, now make the SCORING setup ... - --- First define a Scoring object -local Scoring = SCORING:New( "SCO-500 - Scoring Demonstration Mission" ) - --- Define within the scoring the shelter designated targets. -Scoring:AddZoneScore( BlueShelterZone, 50 ) -- Per shelter destroyed, 50 extra points are granted. -Scoring:AddZoneScore( RedShelterZone, 50 ) -- Per shelter destroyed, 50 extra points are granted. - --- Define the static objects that give extra scores -Scoring:AddStaticScore( STATIC:FindByName( "Red Factory 1"), 100 ) -Scoring:AddStaticScore( STATIC:FindByName( "Red Factory 2"), 100 ) -Scoring:AddStaticScore( STATIC:FindByName( "Red Factory 3"), 100 ) -Scoring:AddStaticScore( STATIC:FindByName( "Red Factory 4"), 100 ) - -Scoring:AddStaticScore( STATIC:FindByName( "Red Truck #001"), 80 ) -Scoring:AddStaticScore( STATIC:FindByName( "Red Truck #002"), 80 ) -Scoring:AddStaticScore( STATIC:FindByName( "Red Truck #003"), 80 ) -Scoring:AddStaticScore( STATIC:FindByName( "Red Truck #004"), 80 ) - -Scoring:AddStaticScore( STATIC:FindByName( "Blue Factory 1" ), 100 ) -Scoring:AddStaticScore( STATIC:FindByName( "Blue Factory 2" ), 100 ) -Scoring:AddStaticScore( STATIC:FindByName( "Blue Factory 3" ), 100 ) -Scoring:AddStaticScore( STATIC:FindByName( "Blue Factory 4" ), 100 ) - -Scoring:AddStaticScore( STATIC:FindByName( "Blue Truck #001" ), 80 ) -Scoring:AddStaticScore( STATIC:FindByName( "Blue Truck #002" ), 80 ) -Scoring:AddStaticScore( STATIC:FindByName( "Blue Truck #003" ), 80 ) -Scoring:AddStaticScore( STATIC:FindByName( "Blue Truck #004" ), 80 ) - --- Scale the scoring rewarded. -Scoring:SetScaleDestroyScore( 30 ) -Scoring:SetScaleDestroyPenalty( 90 ) -- Penalties are punished more than normal destroys. - +--- +-- Name: SCO-500 - Scoring Multi Player Demo Mission 1 +-- Author: Pikey and FlightControl +-- Date Created: 1 Mar 2017 +-- +-- # Situation: +-- +-- A demo mission for the scoring. Read the briefing and have fun. +-- +-- # Test cases: +-- +-- 1. Observe the scoring granted to your flight when you hit and kill targets. + +-- Define the patrol zones +BlueCapZone = ZONE_POLYGON:New( "BlueCapZone", GROUP:FindByName( "Blue CAP Zone Patrol" ) ) +RedCapZone = ZONE_POLYGON:New( "RedCapZone", GROUP:FindByName( "Red CAP Zone Patrol" ) ) + +-- Define the engage zones +BlueEngageZone = ZONE_POLYGON:New( "BlueEngageZone", GROUP:FindByName( "Blue CAP Zone Engage" ) ) +RedEngageZone = ZONE_POLYGON:New( "RedEngageZone", GROUP:FindByName( "Red CAP Zone Engage" ) ) + +-- Define the Spawn zones for ground vehicles +BlueSpawnGroundZone = ZONE_POLYGON:New( "BlueSpawnGroundZone", GROUP:FindByName( "Blue Spawn Zone" ) ) +--RedSpawnGroundZone = ZONE_POLYGON:New( "RedSpawnGroundZone", GROUP:FindByName( "Red Spawn Zone" ) ) + +RedSpawnGroundZone = ZONE:New( "Red Spawn Zone" ) + +-- Define the Scoring zones that define the shelters +BlueShelterZone = ZONE_POLYGON:New( "Blue Shelters", GROUP:FindByName( "Blue Shelters" ) ) +RedShelterZone = ZONE_POLYGON:New( "Red Shelters", GROUP:FindByName( "Red Shelters" ) ) + +-- Define the Set of Clients that are used for the AI Balancers +BluePlanesClientSet = SET_CLIENT:New():FilterCoalitions( "blue" ):FilterCategories( "plane" ):FilterPrefixes( "Blue Player") +RedPlanesClientSet = SET_CLIENT:New():FilterCoalitions( "red" ):FilterCategories( "plane" ):FilterPrefixes( "Red Player") + +-- Define the Spawn objects for the AI planes +BluePlanesSpawn = SPAWN:New( "BlueAICAP" ):InitCleanUp( 120 ):InitLimit( 5, 0 ) +RedPlanesSpawn = SPAWN:New( "RedAICAP" ):InitCleanUp( 120 ):InitLimit( 5, 0 ) + +-- Define the AI Balancers for the planes +BlueAIB = AI_BALANCER:New( BluePlanesClientSet, BluePlanesSpawn ):InitSpawnInterval( 60, 1200 ) +RedAIB = AI_BALANCER:New( RedPlanesClientSet, RedPlanesSpawn ):InitSpawnInterval( 60, 1200 ) + +-- Define the Spawn objects for the airbase defenses +BlueAirbaseDefense1Spawn = SPAWN:New( "Blue Airbase Defense 1" ):InitLimit( 10, 10 ):SpawnScheduled( 60, 0 ) +BlueAirbaseDefense2Spawn = SPAWN:New( "Blue Airbase Defense 2" ):InitLimit( 2, 10 ):SpawnScheduled( 60, 0 ) +RedAirbaseDefense1Spawn = SPAWN:New( "Red Airbase Defense 1" ):InitLimit( 10, 10 ):SpawnScheduled( 60, 0 ) +RedAirbaseDefense2Spawn = SPAWN:New( "Red Airbase Defense 2" ):InitLimit( 2, 10 ):SpawnScheduled( 60, 0 ) + +-- Define the ground forces spawning engines... + +-- First define the template arrays. +BlueGroundTemplates = { "Blue Ground Forces 1", "Blue Ground Forces 2", "Blue Ground Forces 3" } +RedGroundTemplates = { "Red Ground Forces 2", "Red Ground Forces 2", "Red Ground Forces 3" } + +-- New we are using these templates to define the spawn objects for the ground forces. +-- We spawn them at random places into the define zone. +BlueGroundSpawn = SPAWN + :New( "Blue Ground Forces" ) + :InitLimit( 12, 30 ) + :InitRandomizeZones( { BlueSpawnGroundZone } ) + :InitRandomizeTemplate( BlueGroundTemplates ) + :SpawnScheduled( 60, 0.2 ) + +RedGroundSpawn = SPAWN + :New( "Red Ground Forces" ) + :InitLimit( 12, 30 ) + :InitRandomizeTemplate( RedGroundTemplates ) + :InitRandomizeZones( { RedSpawnGroundZone } ) + :SpawnScheduled( 60, 0.2 ) + + + +BlueCap = {} +RedCap = {} + +-- Define the OnAfterSpawned events of the AI balancer Spawn Groups +function BlueAIB:OnAfterSpawned( SetGroup, From, Event, To, AIGroup ) + if AIGroup then + BlueCap[AIGroup] = BlueCap[AIGroup] or AI_CAP_ZONE:New( BlueCapZone, 500, 3000, 450, 1200 ) + local Cap = BlueCap[AIGroup] -- AI.AI_CAP#AI_CAP_ZONE + + Cap:ManageFuel( 0.4, 180 ) + Cap:SetEngageZone( BlueEngageZone ) + Cap:SetControllable( AIGroup ) + Cap:Start() + end +end + +function RedAIB:OnAfterSpawned( SetGroup, From, Event, To, AIGroup ) + + if AIGroup then + RedCap[AIGroup] = RedCap[AIGroup] or AI_CAP_ZONE:New( RedCapZone, 500, 3000, 450, 1200 ) + local Cap = RedCap[AIGroup] -- AI.AI_CAP#AI_CAP_ZONE + + Cap:ManageFuel( 0.4, 180 ) + Cap:SetEngageZone( BlueEngageZone ) + Cap:SetControllable( AIGroup ) + Cap:Start() + end +end + + + + +-- Okay, now that we defined all this stuff, now make the SCORING setup ... + +-- First define a Scoring object +local Scoring = SCORING:New( "SCO-500 - Scoring Demonstration Mission" ) + +-- Define within the scoring the shelter designated targets. +Scoring:AddZoneScore( BlueShelterZone, 50 ) -- Per shelter destroyed, 50 extra points are granted. +Scoring:AddZoneScore( RedShelterZone, 50 ) -- Per shelter destroyed, 50 extra points are granted. + +-- Define the static objects that give extra scores +Scoring:AddStaticScore( STATIC:FindByName( "Red Factory 1"), 100 ) +Scoring:AddStaticScore( STATIC:FindByName( "Red Factory 2"), 100 ) +Scoring:AddStaticScore( STATIC:FindByName( "Red Factory 3"), 100 ) +Scoring:AddStaticScore( STATIC:FindByName( "Red Factory 4"), 100 ) + +Scoring:AddStaticScore( STATIC:FindByName( "Red Truck #001"), 80 ) +Scoring:AddStaticScore( STATIC:FindByName( "Red Truck #002"), 80 ) +Scoring:AddStaticScore( STATIC:FindByName( "Red Truck #003"), 80 ) +Scoring:AddStaticScore( STATIC:FindByName( "Red Truck #004"), 80 ) + +Scoring:AddStaticScore( STATIC:FindByName( "Blue Factory 1" ), 100 ) +Scoring:AddStaticScore( STATIC:FindByName( "Blue Factory 2" ), 100 ) +Scoring:AddStaticScore( STATIC:FindByName( "Blue Factory 3" ), 100 ) +Scoring:AddStaticScore( STATIC:FindByName( "Blue Factory 4" ), 100 ) + +Scoring:AddStaticScore( STATIC:FindByName( "Blue Truck #001" ), 80 ) +Scoring:AddStaticScore( STATIC:FindByName( "Blue Truck #002" ), 80 ) +Scoring:AddStaticScore( STATIC:FindByName( "Blue Truck #003" ), 80 ) +Scoring:AddStaticScore( STATIC:FindByName( "Blue Truck #004" ), 80 ) + +-- Scale the scoring rewarded. +Scoring:SetScaleDestroyScore( 30 ) +Scoring:SetScaleDestroyPenalty( 90 ) -- Penalties are punished more than normal destroys. + diff --git a/Functional/Sead/SEV-001 - SEAD Evasion/SEV-001 - SEAD Evasion.lua b/Functional/Sead/SEV-001 - SEAD Evasion/SEV-001 - SEAD Evasion.lua index ea28a16be7..e4cb4ab944 100644 --- a/Functional/Sead/SEV-001 - SEAD Evasion/SEV-001 - SEAD Evasion.lua +++ b/Functional/Sead/SEV-001 - SEAD Evasion/SEV-001 - SEAD Evasion.lua @@ -1,11 +1,11 @@ - - - --- CCCP SEAD Defenses -SEAD_RU_SAM_Defenses = SEAD - :New( - { 'SAM Test' - } - ) - + + + +-- CCCP SEAD Defenses +SEAD_RU_SAM_Defenses = SEAD + :New( + { 'SAM Test' + } + ) + \ No newline at end of file diff --git a/Functional/Warehouse/Caucasus/WHS-010 - Self Request/WHS-010 - Self Request.lua b/Functional/Warehouse/Caucasus/WHS-010 - Self Request/WHS-010 - Self Request.lua index 9c782b4651..78416f6d99 100644 --- a/Functional/Warehouse/Caucasus/WHS-010 - Self Request/WHS-010 - Self Request.lua +++ b/Functional/Warehouse/Caucasus/WHS-010 - Self Request/WHS-010 - Self Request.lua @@ -1,39 +1,39 @@ ------------------- --- Self Request -- ------------------- --- 1. Two groups of infantry are spawned in the Batumi spawn zone. --- 2. After ~10 seconds they are put back into the warehouse stock. --- 3. After some time they are spawned again. --- 4. And so on and so forth... - --- Create a WAREHOUSE object. -local warehouseBatumi=WAREHOUSE:New(STATIC:FindByName("Warehouse Batumi"), "Batumi") - --- Start warehouse Batumi. -warehouseBatumi:Start() - --- Add one infantry asset. -warehouseBatumi:AddAsset(GROUP:FindByName("Infantry Platoon Alpha"), 4) - --- Add self request for one infantry at Batumi. -warehouseBatumi:AddRequest(warehouseBatumi, WAREHOUSE.Descriptor.ATTRIBUTE, WAREHOUSE.Attribute.GROUND_INFANTRY, 2) - ---- Self request event. Triggered once the assets are spawned in the spawn zone or at the airbase. -function warehouseBatumi:OnAfterSelfRequest(From, Event, To, groupset, request) - local groupset=groupset --Core.Set#SET_GROUP - - -- Loop over all groups spawned from that request. - for _,group in pairs(groupset:GetSet()) do - local group=group --Wrapper.Group#GROUP - - -- Gree smoke on spawned group. - --group:SmokeGreen() - - -- Put asset back to stock after 10 seconds. - warehouseBatumi:__AddAsset(10, group) - end - - -- Add new self request after 20 seconds. - warehouseBatumi:__AddRequest(20, warehouseBatumi, WAREHOUSE.Descriptor.ATTRIBUTE, WAREHOUSE.Attribute.GROUND_INFANTRY, 2) - -end +------------------ +-- Self Request -- +------------------ +-- 1. Two groups of infantry are spawned in the Batumi spawn zone. +-- 2. After ~10 seconds they are put back into the warehouse stock. +-- 3. After some time they are spawned again. +-- 4. And so on and so forth... + +-- Create a WAREHOUSE object. +local warehouseBatumi=WAREHOUSE:New(STATIC:FindByName("Warehouse Batumi"), "Batumi") + +-- Start warehouse Batumi. +warehouseBatumi:Start() + +-- Add one infantry asset. +warehouseBatumi:AddAsset(GROUP:FindByName("Infantry Platoon Alpha"), 4) + +-- Add self request for one infantry at Batumi. +warehouseBatumi:AddRequest(warehouseBatumi, WAREHOUSE.Descriptor.ATTRIBUTE, WAREHOUSE.Attribute.GROUND_INFANTRY, 2) + +--- Self request event. Triggered once the assets are spawned in the spawn zone or at the airbase. +function warehouseBatumi:OnAfterSelfRequest(From, Event, To, groupset, request) + local groupset=groupset --Core.Set#SET_GROUP + + -- Loop over all groups spawned from that request. + for _,group in pairs(groupset:GetSet()) do + local group=group --Wrapper.Group#GROUP + + -- Gree smoke on spawned group. + --group:SmokeGreen() + + -- Put asset back to stock after 10 seconds. + warehouseBatumi:__AddAsset(10, group) + end + + -- Add new self request after 20 seconds. + warehouseBatumi:__AddRequest(20, warehouseBatumi, WAREHOUSE.Descriptor.ATTRIBUTE, WAREHOUSE.Attribute.GROUND_INFANTRY, 2) + +end diff --git a/Functional/Warehouse/Caucasus/WHS-020 - Self Propelled Ground Troops/WHS-020 - Self Propelled Ground Troops.lua b/Functional/Warehouse/Caucasus/WHS-020 - Self Propelled Ground Troops/WHS-020 - Self Propelled Ground Troops.lua index 95c44de753..1091fbe4fa 100644 --- a/Functional/Warehouse/Caucasus/WHS-020 - Self Propelled Ground Troops/WHS-020 - Self Propelled Ground Troops.lua +++ b/Functional/Warehouse/Caucasus/WHS-020 - Self Propelled Ground Troops/WHS-020 - Self Propelled Ground Troops.lua @@ -1,30 +1,30 @@ ----------------------------------- --- Self Propelled Ground Troops -- ----------------------------------- --- 1. Ground troops - APCs and infantry - are transferred from Batumi to FARP Berlin. --- 2. Warehouse Berlin is empty initially. But a request from Batumi is made for APCs. This cannot be processed and is held in the queue. --- 3. Once the assets arrive at Berlin, the request can be processed and some APCs are send back to Batumi. - --- Create WAREHOUSE objects. -local warehouseBatumi=WAREHOUSE:New(STATIC:FindByName("Warehouse Batumi"), "Batumi") -local warehouseBerlin=WAREHOUSE:New(STATIC:FindByName("Warehouse Berlin"), "Berlin") - --- Set spawn zone for warehouse Batumi. -warehouseBatumi:SetSpawnZone(ZONE:New("Warehouse Batumi Spawn Zone")) - --- Start Warehouse at Batumi. -warehouseBatumi:Start() - --- Add 20 infantry groups and 10 APCs as assets to Batumi warehouse stock. -warehouseBatumi:AddAsset("Infantry Platoon Alpha", 20) -warehouseBatumi:AddAsset("TPz Fuchs", 10) - --- Start Warehouse Berlin. -warehouseBerlin:Start() - --- Warehouse Berlin requests ten infantry groups and five APCs from warehouse Batumi -warehouseBatumi:AddRequest(warehouseBerlin, WAREHOUSE.Descriptor.ATTRIBUTE, WAREHOUSE.Attribute.GROUND_INFANTRY, 10) -warehouseBatumi:AddRequest(warehouseBerlin, WAREHOUSE.Descriptor.ATTRIBUTE, WAREHOUSE.Attribute.GROUND_APC, 5) - --- Request from Batumi for two APCs. Initially these are not in stock. When they become available, the request is executed. -warehouseBerlin:AddRequest(warehouseBatumi, WAREHOUSE.Descriptor.ATTRIBUTE, WAREHOUSE.Attribute.GROUND_APC, 2) +---------------------------------- +-- Self Propelled Ground Troops -- +---------------------------------- +-- 1. Ground troops - APCs and infantry - are transferred from Batumi to FARP Berlin. +-- 2. Warehouse Berlin is empty initially. But a request from Batumi is made for APCs. This cannot be processed and is held in the queue. +-- 3. Once the assets arrive at Berlin, the request can be processed and some APCs are send back to Batumi. + +-- Create WAREHOUSE objects. +local warehouseBatumi=WAREHOUSE:New(STATIC:FindByName("Warehouse Batumi"), "Batumi") +local warehouseBerlin=WAREHOUSE:New(STATIC:FindByName("Warehouse Berlin"), "Berlin") + +-- Set spawn zone for warehouse Batumi. +warehouseBatumi:SetSpawnZone(ZONE:New("Warehouse Batumi Spawn Zone")) + +-- Start Warehouse at Batumi. +warehouseBatumi:Start() + +-- Add 20 infantry groups and 10 APCs as assets to Batumi warehouse stock. +warehouseBatumi:AddAsset("Infantry Platoon Alpha", 20) +warehouseBatumi:AddAsset("TPz Fuchs", 10) + +-- Start Warehouse Berlin. +warehouseBerlin:Start() + +-- Warehouse Berlin requests ten infantry groups and five APCs from warehouse Batumi +warehouseBatumi:AddRequest(warehouseBerlin, WAREHOUSE.Descriptor.ATTRIBUTE, WAREHOUSE.Attribute.GROUND_INFANTRY, 10) +warehouseBatumi:AddRequest(warehouseBerlin, WAREHOUSE.Descriptor.ATTRIBUTE, WAREHOUSE.Attribute.GROUND_APC, 5) + +-- Request from Batumi for two APCs. Initially these are not in stock. When they become available, the request is executed. +warehouseBerlin:AddRequest(warehouseBatumi, WAREHOUSE.Descriptor.ATTRIBUTE, WAREHOUSE.Attribute.GROUND_APC, 2) diff --git a/Functional/Warehouse/Caucasus/WHS-030 - Self Propelled Airborne/WHS-030 - Self Propelled Airborne.lua b/Functional/Warehouse/Caucasus/WHS-030 - Self Propelled Airborne/WHS-030 - Self Propelled Airborne.lua index ce0a6a1365..721d1b642c 100644 --- a/Functional/Warehouse/Caucasus/WHS-030 - Self Propelled Airborne/WHS-030 - Self Propelled Airborne.lua +++ b/Functional/Warehouse/Caucasus/WHS-030 - Self Propelled Airborne/WHS-030 - Self Propelled Airborne.lua @@ -1,29 +1,29 @@ ------------------------------------- --- Self Propelled Airborne Assets -- ------------------------------------- --- 1. Kutaisi requests two Yak-52 with high (10) priority from Senaki. --- 2. Kobuleti requests half Yak-52 with low (70) priority and gets the remaining half of the rest. --- 3. FARP London requests 1/3 of all available Hueys from Senaki. - --- Create WAREHOUSE objects. -local warehouseSenaki = WAREHOUSE:New(STATIC:FindByName("Warehouse Senaki"), "Senaki") -local warehouseKutaisi = WAREHOUSE:New(STATIC:FindByName("Warehouse Kutaisi"), "Kutaisi") -local warehouseKobuleti = WAREHOUSE:New(STATIC:FindByName("Warehouse Kobuleti"), "Kobuleti") -local warehouseLondon = WAREHOUSE:New(STATIC:FindByName("Warehouse London"), "London") - --- Start warehouses -warehouseSenaki:Start() -warehouseKutaisi:Start() -warehouseKobuleti:Start() -warehouseLondon:Start() - --- Add assets to Senaki warehouse -warehouseSenaki:AddAsset("Yak-52", 10) -warehouseSenaki:AddAsset("Huey", 6) - --- Kusaisi requests 3 Yak-52 form Senaki while Kobuleti wants all the rest. -warehouseSenaki:AddRequest(warehouseKutaisi, WAREHOUSE.Descriptor.GROUPNAME, "Yak-52", 1, nil, nil, 10) -warehouseSenaki:AddRequest(warehouseKobuleti, WAREHOUSE.Descriptor.GROUPNAME, "Yak-52", WAREHOUSE.Quantity.HALF, nil, nil, 70) - --- FARP London wants 1/3 of the six available Hueys. -warehouseSenaki:AddRequest(warehouseLondon, WAREHOUSE.Descriptor.GROUPNAME, "Huey", WAREHOUSE.Quantity.THIRD) +------------------------------------ +-- Self Propelled Airborne Assets -- +------------------------------------ +-- 1. Kutaisi requests two Yak-52 with high (10) priority from Senaki. +-- 2. Kobuleti requests half Yak-52 with low (70) priority and gets the remaining half of the rest. +-- 3. FARP London requests 1/3 of all available Hueys from Senaki. + +-- Create WAREHOUSE objects. +local warehouseSenaki = WAREHOUSE:New(STATIC:FindByName("Warehouse Senaki"), "Senaki") +local warehouseKutaisi = WAREHOUSE:New(STATIC:FindByName("Warehouse Kutaisi"), "Kutaisi") +local warehouseKobuleti = WAREHOUSE:New(STATIC:FindByName("Warehouse Kobuleti"), "Kobuleti") +local warehouseLondon = WAREHOUSE:New(STATIC:FindByName("Warehouse London"), "London") + +-- Start warehouses +warehouseSenaki:Start() +warehouseKutaisi:Start() +warehouseKobuleti:Start() +warehouseLondon:Start() + +-- Add assets to Senaki warehouse +warehouseSenaki:AddAsset("Yak-52", 10) +warehouseSenaki:AddAsset("Huey", 6) + +-- Kusaisi requests 3 Yak-52 form Senaki while Kobuleti wants all the rest. +warehouseSenaki:AddRequest(warehouseKutaisi, WAREHOUSE.Descriptor.GROUPNAME, "Yak-52", 1, nil, nil, 10) +warehouseSenaki:AddRequest(warehouseKobuleti, WAREHOUSE.Descriptor.GROUPNAME, "Yak-52", WAREHOUSE.Quantity.HALF, nil, nil, 70) + +-- FARP London wants 1/3 of the six available Hueys. +warehouseSenaki:AddRequest(warehouseLondon, WAREHOUSE.Descriptor.GROUPNAME, "Huey", WAREHOUSE.Quantity.THIRD) diff --git a/Functional/Warehouse/Caucasus/WHS-160 - Resupply/WHS-016 - Resupply.lua b/Functional/Warehouse/Caucasus/WHS-160 - Resupply/WHS-016 - Resupply.lua index 9f74967d60..9cd4f5c05a 100644 --- a/Functional/Warehouse/Caucasus/WHS-160 - Resupply/WHS-016 - Resupply.lua +++ b/Functional/Warehouse/Caucasus/WHS-160 - Resupply/WHS-016 - Resupply.lua @@ -1,103 +1,103 @@ ------------------------ --- Test 17: Resupply -- ------------------------ --- Warehouse at FARP Berlin is located at the front line and sends infantry groups to the battle zone. --- Whenever a group dies, a new group is send from the warehouse to the battle zone. --- Additionally, for each dead group, Berlin requests resupply from Batumi. - --- Display mission time every 30 seconds. -SCHEDULER:New(nil, UTILS.DisplayMissionTime, {5}, 30, 30) - -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- - --- Define Warehouses. -local warehouse={} - --- Blue warehouses -warehouse.Senaki = WAREHOUSE:New(STATIC:FindByName("Warehouse Senaki"), "Senaki") --Functional.Warehouse#WAREHOUSE -warehouse.Batumi = WAREHOUSE:New(STATIC:FindByName("Warehouse Batumi"), "Batumi") --Functional.Warehouse#WAREHOUSE -warehouse.Kobuleti = WAREHOUSE:New(STATIC:FindByName("Warehouse Kobuleti"), "Kobuleti") --Functional.Warehouse#WAREHOUSE -warehouse.Kutaisi = WAREHOUSE:New(STATIC:FindByName("Warehouse Kutaisi"), "Kutaisi") --Functional.Warehouse#WAREHOUSE -warehouse.Berlin = WAREHOUSE:New(STATIC:FindByName("Warehouse Berlin"), "Berlin") --Functional.Warehouse#WAREHOUSE -warehouse.London = WAREHOUSE:New(STATIC:FindByName("Warehouse London"), "London") --Functional.Warehouse#WAREHOUSE -warehouse.Stennis = WAREHOUSE:New(STATIC:FindByName("Warehouse Stennis"), "Stennis") --Functional.Warehouse#WAREHOUSE -warehouse.Pampa = WAREHOUSE:New(STATIC:FindByName("Warehouse Pampa"), "Pampa") --Functional.Warehouse#WAREHOUSE -warehouse.Pearth = WAREHOUSE:New(STATIC:FindByName("Warehouse Pearth"), "Pearth") --Functional.Warehouse#WAREHOUSE --- Red warehouse -warehouse.Sukhumi = WAREHOUSE:New(STATIC:FindByName("Warehouse Sukhumi"), "Sukhumi") --Functional.Warehouse#WAREHOUSE -warehouse.Gudauta = WAREHOUSE:New(STATIC:FindByName("Warehouse Gudauta"), "Gudauta") --Functional.Warehouse#WAREHOUSE -warehouse.Sochi = WAREHOUSE:New(STATIC:FindByName("Warehouse Sochi"), "Sochi") --Functional.Warehouse#WAREHOUSE - --- Fine tune warehouses if necessary. -warehouse.Batumi:SetSpawnZone(ZONE:New("Warehouse Batumi Spawn Zone")) -warehouse.Senaki:SetSpawnZone(ZONE:New("Warehouse Senaki Spawn Zone")) -warehouse.Kobuleti:SetSpawnZone(ZONE_POLYGON:New("Warehouse Kobuleti Spawn Zone", GROUP:FindByName("Warehouse Kobuleti Spawn Zone"))) - - --- Creat explosion at an object. -local function Explosion(object, power) - power=power or 1000 - if object and object:IsAlive() then - object:GetCoordinate():Explosion(power) - end -end - - --- Start warehouses. -warehouse.Batumi:Start() -warehouse.Berlin:Start() - --- Front line warehouse. -warehouse.Berlin:AddAsset("Infantry Platoon Alpha", 6) - --- Resupply warehouse. -warehouse.Batumi:AddAsset("Infantry Platoon Alpha", 50) - --- Battle zone near FARP Berlin. This is where the action is! -local BattleZone=ZONE:New("Virtual Battle Zone") - --- Send infantry groups to the battle zone. Two groups every ~60 seconds. -for i=1,2 do - local time=(i-1)*60+10 - warehouse.Berlin:__AddRequest(time, warehouse.Berlin, WAREHOUSE.Descriptor.ATTRIBUTE, WAREHOUSE.Attribute.GROUND_INFANTRY, 2, nil, nil, nil, "To Battle Zone") -end - --- Take care of the spawned units. -function warehouse.Berlin:OnAfterSelfRequest(From,Event,To,groupset,request) - local groupset=groupset --Core.Set#SET_GROUP - local request=request --Functional.Warehouse#WAREHOUSE.Pendingitem - - -- Get assignment of this request. - local assignment=warehouse.Berlin:GetAssignment(request) - - if assignment=="To Battle Zone" then - - for _,group in pairs(groupset:GetSet()) do - local group=group --Wrapper.Group#GROUP - - -- Route group to Battle zone. - local ToCoord=BattleZone:GetRandomCoordinate() - group:RouteGroundOnRoad(ToCoord, group:GetSpeedMax()*80) - - -- After 3-5 minutes we create an explosion to destroy the group. - SCHEDULER:New(nil, Explosion, {group, 50}, math.random(180, 300)) - end - - end - -end - --- An asset has died ==> request resupply for it. -function warehouse.Berlin:OnAfterAssetDead(From, Event, To, asset, request) - local asset=asset --Functional.Warehouse#WAREHOUSE.Assetitem - local request=request --Functional.Warehouse#WAREHOUSE.Pendingitem - - -- Get assignment. - local assignment=warehouse.Berlin:GetAssignment(request) - - -- Request resupply for dead asset from Batumi. - warehouse.Batumi:AddRequest(warehouse.Berlin, WAREHOUSE.Descriptor.ATTRIBUTE, asset.attribute, nil, nil, nil, nil, "Resupply") - - -- Send asset to Battle zone either now or when they arrive. - warehouse.Berlin:AddRequest(warehouse.Berlin, WAREHOUSE.Descriptor.ATTRIBUTE, asset.attribute, 1, nil, nil, nil, assignment) -end +----------------------- +-- Test 17: Resupply -- +----------------------- +-- Warehouse at FARP Berlin is located at the front line and sends infantry groups to the battle zone. +-- Whenever a group dies, a new group is send from the warehouse to the battle zone. +-- Additionally, for each dead group, Berlin requests resupply from Batumi. + +-- Display mission time every 30 seconds. +SCHEDULER:New(nil, UTILS.DisplayMissionTime, {5}, 30, 30) + +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + +-- Define Warehouses. +local warehouse={} + +-- Blue warehouses +warehouse.Senaki = WAREHOUSE:New(STATIC:FindByName("Warehouse Senaki"), "Senaki") --Functional.Warehouse#WAREHOUSE +warehouse.Batumi = WAREHOUSE:New(STATIC:FindByName("Warehouse Batumi"), "Batumi") --Functional.Warehouse#WAREHOUSE +warehouse.Kobuleti = WAREHOUSE:New(STATIC:FindByName("Warehouse Kobuleti"), "Kobuleti") --Functional.Warehouse#WAREHOUSE +warehouse.Kutaisi = WAREHOUSE:New(STATIC:FindByName("Warehouse Kutaisi"), "Kutaisi") --Functional.Warehouse#WAREHOUSE +warehouse.Berlin = WAREHOUSE:New(STATIC:FindByName("Warehouse Berlin"), "Berlin") --Functional.Warehouse#WAREHOUSE +warehouse.London = WAREHOUSE:New(STATIC:FindByName("Warehouse London"), "London") --Functional.Warehouse#WAREHOUSE +warehouse.Stennis = WAREHOUSE:New(STATIC:FindByName("Warehouse Stennis"), "Stennis") --Functional.Warehouse#WAREHOUSE +warehouse.Pampa = WAREHOUSE:New(STATIC:FindByName("Warehouse Pampa"), "Pampa") --Functional.Warehouse#WAREHOUSE +warehouse.Pearth = WAREHOUSE:New(STATIC:FindByName("Warehouse Pearth"), "Pearth") --Functional.Warehouse#WAREHOUSE +-- Red warehouse +warehouse.Sukhumi = WAREHOUSE:New(STATIC:FindByName("Warehouse Sukhumi"), "Sukhumi") --Functional.Warehouse#WAREHOUSE +warehouse.Gudauta = WAREHOUSE:New(STATIC:FindByName("Warehouse Gudauta"), "Gudauta") --Functional.Warehouse#WAREHOUSE +warehouse.Sochi = WAREHOUSE:New(STATIC:FindByName("Warehouse Sochi"), "Sochi") --Functional.Warehouse#WAREHOUSE + +-- Fine tune warehouses if necessary. +warehouse.Batumi:SetSpawnZone(ZONE:New("Warehouse Batumi Spawn Zone")) +warehouse.Senaki:SetSpawnZone(ZONE:New("Warehouse Senaki Spawn Zone")) +warehouse.Kobuleti:SetSpawnZone(ZONE_POLYGON:New("Warehouse Kobuleti Spawn Zone", GROUP:FindByName("Warehouse Kobuleti Spawn Zone"))) + + +-- Creat explosion at an object. +local function Explosion(object, power) + power=power or 1000 + if object and object:IsAlive() then + object:GetCoordinate():Explosion(power) + end +end + + +-- Start warehouses. +warehouse.Batumi:Start() +warehouse.Berlin:Start() + +-- Front line warehouse. +warehouse.Berlin:AddAsset("Infantry Platoon Alpha", 6) + +-- Resupply warehouse. +warehouse.Batumi:AddAsset("Infantry Platoon Alpha", 50) + +-- Battle zone near FARP Berlin. This is where the action is! +local BattleZone=ZONE:New("Virtual Battle Zone") + +-- Send infantry groups to the battle zone. Two groups every ~60 seconds. +for i=1,2 do + local time=(i-1)*60+10 + warehouse.Berlin:__AddRequest(time, warehouse.Berlin, WAREHOUSE.Descriptor.ATTRIBUTE, WAREHOUSE.Attribute.GROUND_INFANTRY, 2, nil, nil, nil, "To Battle Zone") +end + +-- Take care of the spawned units. +function warehouse.Berlin:OnAfterSelfRequest(From,Event,To,groupset,request) + local groupset=groupset --Core.Set#SET_GROUP + local request=request --Functional.Warehouse#WAREHOUSE.Pendingitem + + -- Get assignment of this request. + local assignment=warehouse.Berlin:GetAssignment(request) + + if assignment=="To Battle Zone" then + + for _,group in pairs(groupset:GetSet()) do + local group=group --Wrapper.Group#GROUP + + -- Route group to Battle zone. + local ToCoord=BattleZone:GetRandomCoordinate() + group:RouteGroundOnRoad(ToCoord, group:GetSpeedMax()*80) + + -- After 3-5 minutes we create an explosion to destroy the group. + SCHEDULER:New(nil, Explosion, {group, 50}, math.random(180, 300)) + end + + end + +end + +-- An asset has died ==> request resupply for it. +function warehouse.Berlin:OnAfterAssetDead(From, Event, To, asset, request) + local asset=asset --Functional.Warehouse#WAREHOUSE.Assetitem + local request=request --Functional.Warehouse#WAREHOUSE.Pendingitem + + -- Get assignment. + local assignment=warehouse.Berlin:GetAssignment(request) + + -- Request resupply for dead asset from Batumi. + warehouse.Batumi:AddRequest(warehouse.Berlin, WAREHOUSE.Descriptor.ATTRIBUTE, asset.attribute, nil, nil, nil, nil, "Resupply") + + -- Send asset to Battle zone either now or when they arrive. + warehouse.Berlin:AddRequest(warehouse.Berlin, WAREHOUSE.Descriptor.ATTRIBUTE, asset.attribute, 1, nil, nil, nil, assignment) +end diff --git a/Functional/Warehouse/Caucasus/WHS-170 - Resupply/WHS-016 - Resupply.lua b/Functional/Warehouse/Caucasus/WHS-170 - Resupply/WHS-016 - Resupply.lua index 9f74967d60..9cd4f5c05a 100644 --- a/Functional/Warehouse/Caucasus/WHS-170 - Resupply/WHS-016 - Resupply.lua +++ b/Functional/Warehouse/Caucasus/WHS-170 - Resupply/WHS-016 - Resupply.lua @@ -1,103 +1,103 @@ ------------------------ --- Test 17: Resupply -- ------------------------ --- Warehouse at FARP Berlin is located at the front line and sends infantry groups to the battle zone. --- Whenever a group dies, a new group is send from the warehouse to the battle zone. --- Additionally, for each dead group, Berlin requests resupply from Batumi. - --- Display mission time every 30 seconds. -SCHEDULER:New(nil, UTILS.DisplayMissionTime, {5}, 30, 30) - -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- - --- Define Warehouses. -local warehouse={} - --- Blue warehouses -warehouse.Senaki = WAREHOUSE:New(STATIC:FindByName("Warehouse Senaki"), "Senaki") --Functional.Warehouse#WAREHOUSE -warehouse.Batumi = WAREHOUSE:New(STATIC:FindByName("Warehouse Batumi"), "Batumi") --Functional.Warehouse#WAREHOUSE -warehouse.Kobuleti = WAREHOUSE:New(STATIC:FindByName("Warehouse Kobuleti"), "Kobuleti") --Functional.Warehouse#WAREHOUSE -warehouse.Kutaisi = WAREHOUSE:New(STATIC:FindByName("Warehouse Kutaisi"), "Kutaisi") --Functional.Warehouse#WAREHOUSE -warehouse.Berlin = WAREHOUSE:New(STATIC:FindByName("Warehouse Berlin"), "Berlin") --Functional.Warehouse#WAREHOUSE -warehouse.London = WAREHOUSE:New(STATIC:FindByName("Warehouse London"), "London") --Functional.Warehouse#WAREHOUSE -warehouse.Stennis = WAREHOUSE:New(STATIC:FindByName("Warehouse Stennis"), "Stennis") --Functional.Warehouse#WAREHOUSE -warehouse.Pampa = WAREHOUSE:New(STATIC:FindByName("Warehouse Pampa"), "Pampa") --Functional.Warehouse#WAREHOUSE -warehouse.Pearth = WAREHOUSE:New(STATIC:FindByName("Warehouse Pearth"), "Pearth") --Functional.Warehouse#WAREHOUSE --- Red warehouse -warehouse.Sukhumi = WAREHOUSE:New(STATIC:FindByName("Warehouse Sukhumi"), "Sukhumi") --Functional.Warehouse#WAREHOUSE -warehouse.Gudauta = WAREHOUSE:New(STATIC:FindByName("Warehouse Gudauta"), "Gudauta") --Functional.Warehouse#WAREHOUSE -warehouse.Sochi = WAREHOUSE:New(STATIC:FindByName("Warehouse Sochi"), "Sochi") --Functional.Warehouse#WAREHOUSE - --- Fine tune warehouses if necessary. -warehouse.Batumi:SetSpawnZone(ZONE:New("Warehouse Batumi Spawn Zone")) -warehouse.Senaki:SetSpawnZone(ZONE:New("Warehouse Senaki Spawn Zone")) -warehouse.Kobuleti:SetSpawnZone(ZONE_POLYGON:New("Warehouse Kobuleti Spawn Zone", GROUP:FindByName("Warehouse Kobuleti Spawn Zone"))) - - --- Creat explosion at an object. -local function Explosion(object, power) - power=power or 1000 - if object and object:IsAlive() then - object:GetCoordinate():Explosion(power) - end -end - - --- Start warehouses. -warehouse.Batumi:Start() -warehouse.Berlin:Start() - --- Front line warehouse. -warehouse.Berlin:AddAsset("Infantry Platoon Alpha", 6) - --- Resupply warehouse. -warehouse.Batumi:AddAsset("Infantry Platoon Alpha", 50) - --- Battle zone near FARP Berlin. This is where the action is! -local BattleZone=ZONE:New("Virtual Battle Zone") - --- Send infantry groups to the battle zone. Two groups every ~60 seconds. -for i=1,2 do - local time=(i-1)*60+10 - warehouse.Berlin:__AddRequest(time, warehouse.Berlin, WAREHOUSE.Descriptor.ATTRIBUTE, WAREHOUSE.Attribute.GROUND_INFANTRY, 2, nil, nil, nil, "To Battle Zone") -end - --- Take care of the spawned units. -function warehouse.Berlin:OnAfterSelfRequest(From,Event,To,groupset,request) - local groupset=groupset --Core.Set#SET_GROUP - local request=request --Functional.Warehouse#WAREHOUSE.Pendingitem - - -- Get assignment of this request. - local assignment=warehouse.Berlin:GetAssignment(request) - - if assignment=="To Battle Zone" then - - for _,group in pairs(groupset:GetSet()) do - local group=group --Wrapper.Group#GROUP - - -- Route group to Battle zone. - local ToCoord=BattleZone:GetRandomCoordinate() - group:RouteGroundOnRoad(ToCoord, group:GetSpeedMax()*80) - - -- After 3-5 minutes we create an explosion to destroy the group. - SCHEDULER:New(nil, Explosion, {group, 50}, math.random(180, 300)) - end - - end - -end - --- An asset has died ==> request resupply for it. -function warehouse.Berlin:OnAfterAssetDead(From, Event, To, asset, request) - local asset=asset --Functional.Warehouse#WAREHOUSE.Assetitem - local request=request --Functional.Warehouse#WAREHOUSE.Pendingitem - - -- Get assignment. - local assignment=warehouse.Berlin:GetAssignment(request) - - -- Request resupply for dead asset from Batumi. - warehouse.Batumi:AddRequest(warehouse.Berlin, WAREHOUSE.Descriptor.ATTRIBUTE, asset.attribute, nil, nil, nil, nil, "Resupply") - - -- Send asset to Battle zone either now or when they arrive. - warehouse.Berlin:AddRequest(warehouse.Berlin, WAREHOUSE.Descriptor.ATTRIBUTE, asset.attribute, 1, nil, nil, nil, assignment) -end +----------------------- +-- Test 17: Resupply -- +----------------------- +-- Warehouse at FARP Berlin is located at the front line and sends infantry groups to the battle zone. +-- Whenever a group dies, a new group is send from the warehouse to the battle zone. +-- Additionally, for each dead group, Berlin requests resupply from Batumi. + +-- Display mission time every 30 seconds. +SCHEDULER:New(nil, UTILS.DisplayMissionTime, {5}, 30, 30) + +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + +-- Define Warehouses. +local warehouse={} + +-- Blue warehouses +warehouse.Senaki = WAREHOUSE:New(STATIC:FindByName("Warehouse Senaki"), "Senaki") --Functional.Warehouse#WAREHOUSE +warehouse.Batumi = WAREHOUSE:New(STATIC:FindByName("Warehouse Batumi"), "Batumi") --Functional.Warehouse#WAREHOUSE +warehouse.Kobuleti = WAREHOUSE:New(STATIC:FindByName("Warehouse Kobuleti"), "Kobuleti") --Functional.Warehouse#WAREHOUSE +warehouse.Kutaisi = WAREHOUSE:New(STATIC:FindByName("Warehouse Kutaisi"), "Kutaisi") --Functional.Warehouse#WAREHOUSE +warehouse.Berlin = WAREHOUSE:New(STATIC:FindByName("Warehouse Berlin"), "Berlin") --Functional.Warehouse#WAREHOUSE +warehouse.London = WAREHOUSE:New(STATIC:FindByName("Warehouse London"), "London") --Functional.Warehouse#WAREHOUSE +warehouse.Stennis = WAREHOUSE:New(STATIC:FindByName("Warehouse Stennis"), "Stennis") --Functional.Warehouse#WAREHOUSE +warehouse.Pampa = WAREHOUSE:New(STATIC:FindByName("Warehouse Pampa"), "Pampa") --Functional.Warehouse#WAREHOUSE +warehouse.Pearth = WAREHOUSE:New(STATIC:FindByName("Warehouse Pearth"), "Pearth") --Functional.Warehouse#WAREHOUSE +-- Red warehouse +warehouse.Sukhumi = WAREHOUSE:New(STATIC:FindByName("Warehouse Sukhumi"), "Sukhumi") --Functional.Warehouse#WAREHOUSE +warehouse.Gudauta = WAREHOUSE:New(STATIC:FindByName("Warehouse Gudauta"), "Gudauta") --Functional.Warehouse#WAREHOUSE +warehouse.Sochi = WAREHOUSE:New(STATIC:FindByName("Warehouse Sochi"), "Sochi") --Functional.Warehouse#WAREHOUSE + +-- Fine tune warehouses if necessary. +warehouse.Batumi:SetSpawnZone(ZONE:New("Warehouse Batumi Spawn Zone")) +warehouse.Senaki:SetSpawnZone(ZONE:New("Warehouse Senaki Spawn Zone")) +warehouse.Kobuleti:SetSpawnZone(ZONE_POLYGON:New("Warehouse Kobuleti Spawn Zone", GROUP:FindByName("Warehouse Kobuleti Spawn Zone"))) + + +-- Creat explosion at an object. +local function Explosion(object, power) + power=power or 1000 + if object and object:IsAlive() then + object:GetCoordinate():Explosion(power) + end +end + + +-- Start warehouses. +warehouse.Batumi:Start() +warehouse.Berlin:Start() + +-- Front line warehouse. +warehouse.Berlin:AddAsset("Infantry Platoon Alpha", 6) + +-- Resupply warehouse. +warehouse.Batumi:AddAsset("Infantry Platoon Alpha", 50) + +-- Battle zone near FARP Berlin. This is where the action is! +local BattleZone=ZONE:New("Virtual Battle Zone") + +-- Send infantry groups to the battle zone. Two groups every ~60 seconds. +for i=1,2 do + local time=(i-1)*60+10 + warehouse.Berlin:__AddRequest(time, warehouse.Berlin, WAREHOUSE.Descriptor.ATTRIBUTE, WAREHOUSE.Attribute.GROUND_INFANTRY, 2, nil, nil, nil, "To Battle Zone") +end + +-- Take care of the spawned units. +function warehouse.Berlin:OnAfterSelfRequest(From,Event,To,groupset,request) + local groupset=groupset --Core.Set#SET_GROUP + local request=request --Functional.Warehouse#WAREHOUSE.Pendingitem + + -- Get assignment of this request. + local assignment=warehouse.Berlin:GetAssignment(request) + + if assignment=="To Battle Zone" then + + for _,group in pairs(groupset:GetSet()) do + local group=group --Wrapper.Group#GROUP + + -- Route group to Battle zone. + local ToCoord=BattleZone:GetRandomCoordinate() + group:RouteGroundOnRoad(ToCoord, group:GetSpeedMax()*80) + + -- After 3-5 minutes we create an explosion to destroy the group. + SCHEDULER:New(nil, Explosion, {group, 50}, math.random(180, 300)) + end + + end + +end + +-- An asset has died ==> request resupply for it. +function warehouse.Berlin:OnAfterAssetDead(From, Event, To, asset, request) + local asset=asset --Functional.Warehouse#WAREHOUSE.Assetitem + local request=request --Functional.Warehouse#WAREHOUSE.Pendingitem + + -- Get assignment. + local assignment=warehouse.Berlin:GetAssignment(request) + + -- Request resupply for dead asset from Batumi. + warehouse.Batumi:AddRequest(warehouse.Berlin, WAREHOUSE.Descriptor.ATTRIBUTE, asset.attribute, nil, nil, nil, nil, "Resupply") + + -- Send asset to Battle zone either now or when they arrive. + warehouse.Berlin:AddRequest(warehouse.Berlin, WAREHOUSE.Descriptor.ATTRIBUTE, asset.attribute, 1, nil, nil, nil, assignment) +end diff --git a/Sound/Radio/RAD-000 - Transmission from Static/RAD-000 - Transmission from Static.lua b/Sound/Radio/RAD-000 - Transmission from Static/RAD-000 - Transmission from Static.lua index 296604a1dc..63c03e94ca 100644 --- a/Sound/Radio/RAD-000 - Transmission from Static/RAD-000 - Transmission from Static.lua +++ b/Sound/Radio/RAD-000 - Transmission from Static/RAD-000 - Transmission from Static.lua @@ -1,19 +1,19 @@ --- This test mission demonstrates the RADIO class, particularily when the transmiter is anything but a UNIT or a GROUP (a STATIC in this case) --- The Player is in a Su25T parked on Batumi, and a Russian command center named "Russian Command Center" is placed 12km east of Batumi. - --- Note that if you are not using an ASM aircraft (a clickable cockpit aircraft), then the frequency and the modulation is not important. --- If you want to test the mission fully, replance the SU25T by an ASM aircraft you own and tune to the right frequency (108AM here) - -CommandCenter = STATIC:FindByName("Russian Command Center") - --- Let's get a reference to the Command Center's RADIO -CommandCenterRadio = CommandCenter:GetRadio() - --- Now, we'll set up the next transmission -CommandCenterRadio:SetFileName("Noise.ogg") -- We first need the file name of a sound, -CommandCenterRadio:SetFrequency(108) -- then a frequency in MHz, -CommandCenterRadio:SetModulation(radio.modulation.AM) -- a modulation (we use DCS' enumartion, this way we don't have to type numbers)... -CommandCenterRadio:SetPower(100) -- and finally a power in Watts. A "normal" ground TACAN station has a power of 120W. - --- We have finished tinkering with our transmission, now is the time to broadcast it ! +-- This test mission demonstrates the RADIO class, particularily when the transmiter is anything but a UNIT or a GROUP (a STATIC in this case) +-- The Player is in a Su25T parked on Batumi, and a Russian command center named "Russian Command Center" is placed 12km east of Batumi. + +-- Note that if you are not using an ASM aircraft (a clickable cockpit aircraft), then the frequency and the modulation is not important. +-- If you want to test the mission fully, replance the SU25T by an ASM aircraft you own and tune to the right frequency (108AM here) + +CommandCenter = STATIC:FindByName("Russian Command Center") + +-- Let's get a reference to the Command Center's RADIO +CommandCenterRadio = CommandCenter:GetRadio() + +-- Now, we'll set up the next transmission +CommandCenterRadio:SetFileName("Noise.ogg") -- We first need the file name of a sound, +CommandCenterRadio:SetFrequency(108) -- then a frequency in MHz, +CommandCenterRadio:SetModulation(radio.modulation.AM) -- a modulation (we use DCS' enumartion, this way we don't have to type numbers)... +CommandCenterRadio:SetPower(100) -- and finally a power in Watts. A "normal" ground TACAN station has a power of 120W. + +-- We have finished tinkering with our transmission, now is the time to broadcast it ! CommandCenterRadio:Broadcast() \ No newline at end of file diff --git a/Sound/Radio/RAD-001 - Transmission from UNIT or GROUP/RAD-001 - Transmission from UNIT or GROUP.lua b/Sound/Radio/RAD-001 - Transmission from UNIT or GROUP/RAD-001 - Transmission from UNIT or GROUP.lua index 53b86eccbb..daf3208968 100644 --- a/Sound/Radio/RAD-001 - Transmission from UNIT or GROUP/RAD-001 - Transmission from UNIT or GROUP.lua +++ b/Sound/Radio/RAD-001 - Transmission from UNIT or GROUP/RAD-001 - Transmission from UNIT or GROUP.lua @@ -1,25 +1,25 @@ --- This test mission demonstrates the RADIO class, particularily when the transmiter is a UNIT or a GROUP --- The Player is in a Su25T parked on Batumi, and a Russian MiG-29 creatively named "Sergey" is placed above Kobuleti and is --- inbound for a landing on Batumi - --- Note that if you are not using an ASM aircraft (a clickable cockpit aircraft), then the frequency and the modulation is not important. --- If you want to test the mission fully, replance the SU25T by an ASM aircraft you own and tune to the right frequency (108AM here) - -Sergey = UNIT:FindByName("Sergey") - --- Let's get a reference to Sergey's RADIO -SergeyRadio = Sergey:GetRadio() - --- Now, we'll set up the next transmission -SergeyRadio:SetFileName("Noise.ogg") -- We first need the file name of a sound, -SergeyRadio:SetFrequency(108) -- then a frequency in MHz, -SergeyRadio:SetModulation(radio.modulation.AM) -- and a modulation (we use DCS' enumartion, this way we don't have to type numbers). - --- Since Sergey is a UNIT, we can add a subtitle (displayed on the top left) to the transmission, and loop the transmission -SergeyRadio:SetSubtitle("Hey, hear that noise ?", 5) -- The subtitle "Noise" will be displayed for 5 secs -SergeyRadio:SetLoop(false) - --- Notice that we didn't have to imput a power ? If the broadcater is a UNIT or a GROUP, DCS automatically guesses the power to use depending on the type of UNIT or GROUP - --- We have finished tinkering with our transmission, now is the time to broadcast it ! +-- This test mission demonstrates the RADIO class, particularily when the transmiter is a UNIT or a GROUP +-- The Player is in a Su25T parked on Batumi, and a Russian MiG-29 creatively named "Sergey" is placed above Kobuleti and is +-- inbound for a landing on Batumi + +-- Note that if you are not using an ASM aircraft (a clickable cockpit aircraft), then the frequency and the modulation is not important. +-- If you want to test the mission fully, replance the SU25T by an ASM aircraft you own and tune to the right frequency (108AM here) + +Sergey = UNIT:FindByName("Sergey") + +-- Let's get a reference to Sergey's RADIO +SergeyRadio = Sergey:GetRadio() + +-- Now, we'll set up the next transmission +SergeyRadio:SetFileName("Noise.ogg") -- We first need the file name of a sound, +SergeyRadio:SetFrequency(108) -- then a frequency in MHz, +SergeyRadio:SetModulation(radio.modulation.AM) -- and a modulation (we use DCS' enumartion, this way we don't have to type numbers). + +-- Since Sergey is a UNIT, we can add a subtitle (displayed on the top left) to the transmission, and loop the transmission +SergeyRadio:SetSubtitle("Hey, hear that noise ?", 5) -- The subtitle "Noise" will be displayed for 5 secs +SergeyRadio:SetLoop(false) + +-- Notice that we didn't have to imput a power ? If the broadcater is a UNIT or a GROUP, DCS automatically guesses the power to use depending on the type of UNIT or GROUP + +-- We have finished tinkering with our transmission, now is the time to broadcast it ! SergeyRadio:Broadcast() \ No newline at end of file diff --git a/Sound/Radio/RAD-002 - Transmission Tips and Tricks/RAD-002 - Transmission Tips and Tricks.lua b/Sound/Radio/RAD-002 - Transmission Tips and Tricks/RAD-002 - Transmission Tips and Tricks.lua index 0d7a473f1b..e39c5224e7 100644 --- a/Sound/Radio/RAD-002 - Transmission Tips and Tricks/RAD-002 - Transmission Tips and Tricks.lua +++ b/Sound/Radio/RAD-002 - Transmission Tips and Tricks/RAD-002 - Transmission Tips and Tricks.lua @@ -1,91 +1,91 @@ --- This test mission demonstrates the RADIO class in a practical scenario. --- It also focuses on how to create transmissions faster and more efficiently --- Please Read both RAD-000 and RAD-001, as well as SCH-000 code first. - --- Note that if you are not using an ASM aircraft (a clickable cockpit aircraft), then the frequency and the modulation is not important. --- If you want to test the mission fully, replance the SU25T by an ASM aircraft you own and tune to the right frequency (115AM here) - --- The Player is in a Su25T parked on Batumi, and a Russian command center named "Batumi Tower" placed near Batumi will act as Batumi's Radio Tower. --- This mission also features the "Viktor" flight, a Russian Su25, who is inbound for landing on Batumi. --- The goal of this script is to manage the dialog between Viktor and Batumi Tower. - --- The (short) conversation between Viktor and Batumi Tower will happen on 115 AM --- Time 0 : Batumi Tower "Viktor flight, this is Batumi Tower, enter left base runway one two five, report 5 kilometers final. Over." --- Time 10 : Viktor "Report 5 kilometers final, one two five, viktor" --- Time 145 : Viktor "Batumi Tower, Viktor is 5 kilomters final, request landing clearance. Over?" --- Time 154 : Batumi Tower "Viktor flight, you are claer to land, runway one two five. Check gear down." --- Time 160 : Viktor "Clear to land, One two five, Viktor" --- Time 210 : Viktor "Viktor, touchdown" --- Time 215 : Batumi Tower "Viktor, confirmed touchdown, taxi to parking area, Batumi Tower out." - - -BatumiRadio = STATIC:FindByName("Batumi Tower"):GetRadio() -ViktorRadio = UNIT:FindByName("Viktor"):GetRadio() - --- Let's first explore different shortcuts to setup a transmission before broadcastiong it ------------------------------------------------------------------------------------------------------------------------------------------------------- --- First, the long way. -BatumiRadio:SetFileName("Batumi Tower - Enter left base.ogg") -BatumiRadio:SetFrequency(115) -BatumiRadio:SetModulation(radio.modulation.AM) -BatumiRadio:SetPower(100) - --- Every RADIO.SetXXX() function returns the radio, so we can rewrite the code above this way : -BatumiRadio:SetFileName("Batumi Tower - Enter left base.ogg"):SetFrequency(115):SetModulation(radio.modulation.AM):SetPower(100) - --- We can also use the shortcut RADIO:NewGenericTransmission() to set multiple parameters in one function call --- If our broadcaster was a UNIT or a GROUP, the more appropriate shortcut to use would have been NewUnitTransmission() --- it works for both UNIT and GROUP, despite its name ! -BatumiRadio:NewGenericTransmission("Batumi Tower - Enter left base.ogg", 115, radio.modulation.AM, 100) - --- If you already set some parameters previously, you don't have to redo it ! --- NewGenericTransmission's paramter have to be set in order -BatumiRadio:NewGenericTransmission("Batumi Tower - Enter left base.ogg", 115) -- Modulation is still AM and power is still 100 (set previously) - ---If you want to change only the sound file, the frequency and the power for exemple, you can still use the appropriate Set function -BatumiRadio:NewGenericTransmission("Batumi Tower - Enter left base.ogg", 115):SetPower(100) - --- We have finished tinkering with our transmission, now is the time to broadcast it ! -BatumiRadio:Broadcast() - --- Now, if Viktor answered imedately, the two radio broadcasts would overlap. We need to delay Viktor's answer. ------------------------------------------------------------------------------------------------------------------------------------------------------- -CommunitcationScheduler = SCHEDULER:New( nil, - function() - ViktorRadio:SetFileName("Viktor - Enter left base ack.ogg"):SetFrequency(115):SetModulation(radio.modulation.AM):Broadcast() -- We don't specify a subtitle since we don't want one - end, {}, 10 -- 10s delay - ) - --- Viktor takes 145s to be 5km final, and need to contact Batumi Tower. ------------------------------------------------------------------------------------------------------------------------------------------------------- -CommunitcationScheduler:Schedule( nil, - function() - ViktorRadio:SetFileName("Viktor - Request landing clearance.ogg"):Broadcast() --We only specify the new file name, since frequency and modulation didn't change - end, {}, 145 - ) - --- Now that you understand everything about the RADIO class, the rest is pretty trivial -------------------------------------------------------------------------------------------------------------------------------------------------------- -CommunitcationScheduler:Schedule( nil, - function() - BatumiRadio:SetFileName("Batumi Tower - Clear to land.ogg"):Broadcast() - end, {}, 154 - ) - -CommunitcationScheduler:Schedule( nil, - function() - ViktorRadio:SetFileName("Viktor - Clear to land ack.ogg"):Broadcast() - end, {}, 160 - ) - -CommunitcationScheduler:Schedule( nil, - function() - ViktorRadio:SetFileName("Viktor - Touchdown.ogg"):Broadcast() - end, {}, 210 - ) - -CommunitcationScheduler:Schedule( nil, - function() - BatumiRadio:SetFileName("Batumi Tower - Taxi to parking.ogg"):Broadcast() - end, {}, 215 +-- This test mission demonstrates the RADIO class in a practical scenario. +-- It also focuses on how to create transmissions faster and more efficiently +-- Please Read both RAD-000 and RAD-001, as well as SCH-000 code first. + +-- Note that if you are not using an ASM aircraft (a clickable cockpit aircraft), then the frequency and the modulation is not important. +-- If you want to test the mission fully, replance the SU25T by an ASM aircraft you own and tune to the right frequency (115AM here) + +-- The Player is in a Su25T parked on Batumi, and a Russian command center named "Batumi Tower" placed near Batumi will act as Batumi's Radio Tower. +-- This mission also features the "Viktor" flight, a Russian Su25, who is inbound for landing on Batumi. +-- The goal of this script is to manage the dialog between Viktor and Batumi Tower. + +-- The (short) conversation between Viktor and Batumi Tower will happen on 115 AM +-- Time 0 : Batumi Tower "Viktor flight, this is Batumi Tower, enter left base runway one two five, report 5 kilometers final. Over." +-- Time 10 : Viktor "Report 5 kilometers final, one two five, viktor" +-- Time 145 : Viktor "Batumi Tower, Viktor is 5 kilomters final, request landing clearance. Over?" +-- Time 154 : Batumi Tower "Viktor flight, you are claer to land, runway one two five. Check gear down." +-- Time 160 : Viktor "Clear to land, One two five, Viktor" +-- Time 210 : Viktor "Viktor, touchdown" +-- Time 215 : Batumi Tower "Viktor, confirmed touchdown, taxi to parking area, Batumi Tower out." + + +BatumiRadio = STATIC:FindByName("Batumi Tower"):GetRadio() +ViktorRadio = UNIT:FindByName("Viktor"):GetRadio() + +-- Let's first explore different shortcuts to setup a transmission before broadcastiong it +------------------------------------------------------------------------------------------------------------------------------------------------------ +-- First, the long way. +BatumiRadio:SetFileName("Batumi Tower - Enter left base.ogg") +BatumiRadio:SetFrequency(115) +BatumiRadio:SetModulation(radio.modulation.AM) +BatumiRadio:SetPower(100) + +-- Every RADIO.SetXXX() function returns the radio, so we can rewrite the code above this way : +BatumiRadio:SetFileName("Batumi Tower - Enter left base.ogg"):SetFrequency(115):SetModulation(radio.modulation.AM):SetPower(100) + +-- We can also use the shortcut RADIO:NewGenericTransmission() to set multiple parameters in one function call +-- If our broadcaster was a UNIT or a GROUP, the more appropriate shortcut to use would have been NewUnitTransmission() +-- it works for both UNIT and GROUP, despite its name ! +BatumiRadio:NewGenericTransmission("Batumi Tower - Enter left base.ogg", 115, radio.modulation.AM, 100) + +-- If you already set some parameters previously, you don't have to redo it ! +-- NewGenericTransmission's paramter have to be set in order +BatumiRadio:NewGenericTransmission("Batumi Tower - Enter left base.ogg", 115) -- Modulation is still AM and power is still 100 (set previously) + +--If you want to change only the sound file, the frequency and the power for exemple, you can still use the appropriate Set function +BatumiRadio:NewGenericTransmission("Batumi Tower - Enter left base.ogg", 115):SetPower(100) + +-- We have finished tinkering with our transmission, now is the time to broadcast it ! +BatumiRadio:Broadcast() + +-- Now, if Viktor answered imedately, the two radio broadcasts would overlap. We need to delay Viktor's answer. +------------------------------------------------------------------------------------------------------------------------------------------------------ +CommunitcationScheduler = SCHEDULER:New( nil, + function() + ViktorRadio:SetFileName("Viktor - Enter left base ack.ogg"):SetFrequency(115):SetModulation(radio.modulation.AM):Broadcast() -- We don't specify a subtitle since we don't want one + end, {}, 10 -- 10s delay + ) + +-- Viktor takes 145s to be 5km final, and need to contact Batumi Tower. +------------------------------------------------------------------------------------------------------------------------------------------------------ +CommunitcationScheduler:Schedule( nil, + function() + ViktorRadio:SetFileName("Viktor - Request landing clearance.ogg"):Broadcast() --We only specify the new file name, since frequency and modulation didn't change + end, {}, 145 + ) + +-- Now that you understand everything about the RADIO class, the rest is pretty trivial +------------------------------------------------------------------------------------------------------------------------------------------------------- +CommunitcationScheduler:Schedule( nil, + function() + BatumiRadio:SetFileName("Batumi Tower - Clear to land.ogg"):Broadcast() + end, {}, 154 + ) + +CommunitcationScheduler:Schedule( nil, + function() + ViktorRadio:SetFileName("Viktor - Clear to land ack.ogg"):Broadcast() + end, {}, 160 + ) + +CommunitcationScheduler:Schedule( nil, + function() + ViktorRadio:SetFileName("Viktor - Touchdown.ogg"):Broadcast() + end, {}, 210 + ) + +CommunitcationScheduler:Schedule( nil, + function() + BatumiRadio:SetFileName("Batumi Tower - Taxi to parking.ogg"):Broadcast() + end, {}, 215 ) \ No newline at end of file diff --git a/Sound/Radio/RAD-010 - Beacons/RAD-010 - Beacons.lua b/Sound/Radio/RAD-010 - Beacons/RAD-010 - Beacons.lua index f34f4c1132..d5c9820495 100644 --- a/Sound/Radio/RAD-010 - Beacons/RAD-010 - Beacons.lua +++ b/Sound/Radio/RAD-010 - Beacons/RAD-010 - Beacons.lua @@ -1,22 +1,22 @@ --- This test mission demonstrates the BEACON class. --- The goal is to activate 2 types of beacons : 1 TACAN beacon attach to an aircraft, and 1 generic radio beacon attach to a ground UNIT - --- The player aircraft needs to be ASM and TACAN compatible. Please replace the M2000C by an aircraft you own and can receive TACAN signals - --- Activates the trace to see what BEACON does in the log ---BASE:TraceClass("BEACON") -BASE:TraceLevel(3) - --- Create our UNITs on which we'll attach a BEACON -local Aircraft = UNIT:FindByName("Unit1") -local LandUnit = UNIT:FindByName("Unit2") - --- Now, let's start with the TACAN Beacon. --- Note that they are limited to Y band. Notice also that this particular TACAN can be homed on. -local BeaconAircraft = Aircraft:GetBeacon() -BeaconAircraft:AATACAN(6, "UNIT1", true) - --- And let's setup the ground based radio beacon ! --- Notice how this beacon will stop in 20 sec (last parameter). -local BeaconLand = LandUnit:GetBeacon() +-- This test mission demonstrates the BEACON class. +-- The goal is to activate 2 types of beacons : 1 TACAN beacon attach to an aircraft, and 1 generic radio beacon attach to a ground UNIT + +-- The player aircraft needs to be ASM and TACAN compatible. Please replace the M2000C by an aircraft you own and can receive TACAN signals + +-- Activates the trace to see what BEACON does in the log +--BASE:TraceClass("BEACON") +BASE:TraceLevel(3) + +-- Create our UNITs on which we'll attach a BEACON +local Aircraft = UNIT:FindByName("Unit1") +local LandUnit = UNIT:FindByName("Unit2") + +-- Now, let's start with the TACAN Beacon. +-- Note that they are limited to Y band. Notice also that this particular TACAN can be homed on. +local BeaconAircraft = Aircraft:GetBeacon() +BeaconAircraft:AATACAN(6, "UNIT1", true) + +-- And let's setup the ground based radio beacon ! +-- Notice how this beacon will stop in 20 sec (last parameter). +local BeaconLand = LandUnit:GetBeacon() BeaconLand:RadioBeacon("Morse.ogg", 129, radio.modulation.AM, 100, 20) \ No newline at end of file diff --git a/Sound/Radio/RAD-100 - Speech/RAD-100 - Speech.lua b/Sound/Radio/RAD-100 - Speech/RAD-100 - Speech.lua index 4523bcce21..779d67ffb9 100644 --- a/Sound/Radio/RAD-100 - Speech/RAD-100 - Speech.lua +++ b/Sound/Radio/RAD-100 - Speech/RAD-100 - Speech.lua @@ -1,19 +1,19 @@ --- This test mission demonstrates the BEACON class. --- The goal is to activate 2 types of beacons : 1 TACAN beacon attach to an aircraft, and 1 generic radio beacon attach to a ground UNIT - --- The player aircraft needs to be ASM and TACAN compatible. Please replace the M2000C by an aircraft you own and can receive TACAN signals - --- Activates the trace to see what BEACON does in the log ---BASE:TraceClass("BEACON") -BASE:TraceLevel(3) - --- Create our UNITs on which we'll attach a BEACON -local Aircraft = UNIT:FindByName("Unit1") -local LandUnit = UNIT:FindByName("Unit2") - -RadioSpeech = RADIOSPEECH:New( 124 ) -RadioSpeech:SetSenderUnitName( "Unit2" ) - -RadioSpeech:Start() - +-- This test mission demonstrates the BEACON class. +-- The goal is to activate 2 types of beacons : 1 TACAN beacon attach to an aircraft, and 1 generic radio beacon attach to a ground UNIT + +-- The player aircraft needs to be ASM and TACAN compatible. Please replace the M2000C by an aircraft you own and can receive TACAN signals + +-- Activates the trace to see what BEACON does in the log +--BASE:TraceClass("BEACON") +BASE:TraceLevel(3) + +-- Create our UNITs on which we'll attach a BEACON +local Aircraft = UNIT:FindByName("Unit1") +local LandUnit = UNIT:FindByName("Unit2") + +RadioSpeech = RADIOSPEECH:New( 124 ) +RadioSpeech:SetSenderUnitName( "Unit2" ) + +RadioSpeech:Start() + RadioSpeech:ScheduleRepeat( 5, 30, 0, nil, RadioSpeech.Speak, "springfield11, patrolling" ) \ No newline at end of file diff --git a/Tasking/Task_A2A/TSK-300 - A2A - SWEEP/TSK-300 - A2A - SWEEP.lua b/Tasking/Task_A2A/TSK-300 - A2A - SWEEP/TSK-300 - A2A - SWEEP.lua index e421d3c531..5c878cc5dc 100644 --- a/Tasking/Task_A2A/TSK-300 - A2A - SWEEP/TSK-300 - A2A - SWEEP.lua +++ b/Tasking/Task_A2A/TSK-300 - A2A - SWEEP/TSK-300 - A2A - SWEEP.lua @@ -1,30 +1,30 @@ ---- --- Name: TSK-300 - A2A - SWEEP --- Author: FlightControl --- Date Created: 28 May 2017 --- --- # Situation: --- --- This mission demonstrates the Sweeping of target areas. --- --- # Test cases: - -do - local HQ = GROUP:FindByName( "HQ", "Bravo HQ" ) - - local CommandCenter = COMMANDCENTER:New( HQ, "Bravo" ) - - local Scoring = SCORING:New( "Target Sweeping Demonstration" ) - - local Mission = MISSION - :New( CommandCenter, "Sweeping", "Primary", "Wait until the detected targets get undetected. And see if a SWEEP task is allocated.", coalition.side.BLUE ) - :AddScoring( Scoring ) - - AttackGroups = SET_GROUP:New():FilterCoalitions( "red" ):FilterPrefixes( "Attack" ):FilterStart() - - TargetSetUnit = SET_UNIT:New():FilterCoalitions( "blue" ):FilterPrefixes( "Target" ):FilterStart() - - TaskSWEEP = TASK_A2A_SWEEP:New( Mission, AttackGroups, "SWEEP", TargetSetUnit ) - -end - +--- +-- Name: TSK-300 - A2A - SWEEP +-- Author: FlightControl +-- Date Created: 28 May 2017 +-- +-- # Situation: +-- +-- This mission demonstrates the Sweeping of target areas. +-- +-- # Test cases: + +do + local HQ = GROUP:FindByName( "HQ", "Bravo HQ" ) + + local CommandCenter = COMMANDCENTER:New( HQ, "Bravo" ) + + local Scoring = SCORING:New( "Target Sweeping Demonstration" ) + + local Mission = MISSION + :New( CommandCenter, "Sweeping", "Primary", "Wait until the detected targets get undetected. And see if a SWEEP task is allocated.", coalition.side.BLUE ) + :AddScoring( Scoring ) + + AttackGroups = SET_GROUP:New():FilterCoalitions( "red" ):FilterPrefixes( "Attack" ):FilterStart() + + TargetSetUnit = SET_UNIT:New():FilterCoalitions( "blue" ):FilterPrefixes( "Target" ):FilterStart() + + TaskSWEEP = TASK_A2A_SWEEP:New( Mission, AttackGroups, "SWEEP", TargetSetUnit ) + +end + diff --git a/Tasking/Task_A2A_Dispatcher/TAD-A2A-000 - AREAS - Detection test/TAD-A2A-000 - AREAS - Detection test.lua b/Tasking/Task_A2A_Dispatcher/TAD-A2A-000 - AREAS - Detection test/TAD-A2A-000 - AREAS - Detection test.lua index 75bdd7fa92..97d8b00d48 100644 --- a/Tasking/Task_A2A_Dispatcher/TAD-A2A-000 - AREAS - Detection test/TAD-A2A-000 - AREAS - Detection test.lua +++ b/Tasking/Task_A2A_Dispatcher/TAD-A2A-000 - AREAS - Detection test/TAD-A2A-000 - AREAS - Detection test.lua @@ -1,73 +1,73 @@ ---- --- Name: TAD-A2A-001 - A2A - AREAS detection test --- Author: FlightControl --- Date Created: 17 May 2017 --- --- # Situation: --- --- This mission demonstrates the dynamic task dispatching for Air to Air operations. --- Intruders are flying towards the EWR units. --- The detection method used is the DETECTION_AREAS method, which groups detected targets per detected area. --- --- # Test cases: --- --- 1. Observe the EWR's detecting targets and grouping them. --- 2. Check that the HQ provides menus to engage on a task set by the EWRs. --- -HQ = GROUP:FindByName( "HQ", "Bravo" ) - -CommandCenter = COMMANDCENTER:New( HQ, "Lima" ) - -Scoring = SCORING:New( "A2A Dispatching demo" ) - -Mission = MISSION - :New( CommandCenter, "A2A Mission", "High", "Watch the air enemy units being detected.", coalition.side.RED ) - :AddScoring( Scoring ) - -EWRSet = SET_GROUP:New():FilterPrefixes( "EWR Red" ):FilterCoalitions("red"):FilterStart() - -EWRDetection = DETECTION_AREAS:New( EWRSet, 30000 ) -EWRDetection:SetFriendliesRange( 80000 ) -EWRDetection:SetRefreshTimeInterval( 30 ) - - -AttackGroups = SET_GROUP:New():FilterCoalitions( "red" ):FilterPrefixes( "Defender" ):FilterStart() - -TaskDispatcher = TASK_A2A_DISPATCHER:New( Mission, AttackGroups, EWRDetection ) -TaskDispatcher:SetRefreshTimeInterval( 10 ) - -AIDispatcher = AI_A2A_GCICAP:New( { "EWR Blue" } ) - -BlueTemplates = { - "Defender-1", - "Defender-2" - } - -AIDispatcher:SetSquadron( "001", AIRBASE.Caucasus.Batumi, BlueTemplates, 20 ) -AIDispatcher:SetSquadronGci( "001", 600, 800 ) - -AIDispatcher:SetSquadron( "002", AIRBASE.Caucasus.Senaki_Kolkhi, BlueTemplates, 20 ) -AIDispatcher:SetSquadronGci( "002", 600, 800 ) - -AIDispatcher:SetSquadron( "003", AIRBASE.Caucasus.Kobuleti, BlueTemplates,20 ) -AIDispatcher:SetSquadronGci( "003", 600, 800 ) - -AIDispatcher:SetSquadron( "004", AIRBASE.Caucasus.Kutaisi, BlueTemplates, 20 ) -AIDispatcher:SetSquadronGci( "004", 600, 800 ) - - - - ---- @param #TaskDispatcher self --- @param From --- @param Event --- @param To --- @param Tasking.Task_A2A#TASK_A2A Task --- @param Wrapper.Unit#UNIT TaskUnit --- @param #string PlayerName -function TaskDispatcher:OnAfterAssign( From, Event, To, Task, TaskUnit, PlayerName ) - Task:SetScoreOnProgress( PlayerName, 20, TaskUnit ) - Task:SetScoreOnSuccess( PlayerName, 200, TaskUnit ) - Task:SetScoreOnFail( PlayerName, -100, TaskUnit ) -end - +--- +-- Name: TAD-A2A-001 - A2A - AREAS detection test +-- Author: FlightControl +-- Date Created: 17 May 2017 +-- +-- # Situation: +-- +-- This mission demonstrates the dynamic task dispatching for Air to Air operations. +-- Intruders are flying towards the EWR units. +-- The detection method used is the DETECTION_AREAS method, which groups detected targets per detected area. +-- +-- # Test cases: +-- +-- 1. Observe the EWR's detecting targets and grouping them. +-- 2. Check that the HQ provides menus to engage on a task set by the EWRs. +-- +HQ = GROUP:FindByName( "HQ", "Bravo" ) + +CommandCenter = COMMANDCENTER:New( HQ, "Lima" ) + +Scoring = SCORING:New( "A2A Dispatching demo" ) + +Mission = MISSION + :New( CommandCenter, "A2A Mission", "High", "Watch the air enemy units being detected.", coalition.side.RED ) + :AddScoring( Scoring ) + +EWRSet = SET_GROUP:New():FilterPrefixes( "EWR Red" ):FilterCoalitions("red"):FilterStart() + +EWRDetection = DETECTION_AREAS:New( EWRSet, 30000 ) +EWRDetection:SetFriendliesRange( 80000 ) +EWRDetection:SetRefreshTimeInterval( 30 ) + + +AttackGroups = SET_GROUP:New():FilterCoalitions( "red" ):FilterPrefixes( "Defender" ):FilterStart() + +TaskDispatcher = TASK_A2A_DISPATCHER:New( Mission, AttackGroups, EWRDetection ) +TaskDispatcher:SetRefreshTimeInterval( 10 ) + +AIDispatcher = AI_A2A_GCICAP:New( { "EWR Blue" } ) + +BlueTemplates = { + "Defender-1", + "Defender-2" + } + +AIDispatcher:SetSquadron( "001", AIRBASE.Caucasus.Batumi, BlueTemplates, 20 ) +AIDispatcher:SetSquadronGci( "001", 600, 800 ) + +AIDispatcher:SetSquadron( "002", AIRBASE.Caucasus.Senaki_Kolkhi, BlueTemplates, 20 ) +AIDispatcher:SetSquadronGci( "002", 600, 800 ) + +AIDispatcher:SetSquadron( "003", AIRBASE.Caucasus.Kobuleti, BlueTemplates,20 ) +AIDispatcher:SetSquadronGci( "003", 600, 800 ) + +AIDispatcher:SetSquadron( "004", AIRBASE.Caucasus.Kutaisi, BlueTemplates, 20 ) +AIDispatcher:SetSquadronGci( "004", 600, 800 ) + + + + +--- @param #TaskDispatcher self +-- @param From +-- @param Event +-- @param To +-- @param Tasking.Task_A2A#TASK_A2A Task +-- @param Wrapper.Unit#UNIT TaskUnit +-- @param #string PlayerName +function TaskDispatcher:OnAfterAssign( From, Event, To, Task, TaskUnit, PlayerName ) + Task:SetScoreOnProgress( PlayerName, 20, TaskUnit ) + Task:SetScoreOnSuccess( PlayerName, 200, TaskUnit ) + Task:SetScoreOnFail( PlayerName, -100, TaskUnit ) +end + diff --git a/Tasking/Task_A2A_Dispatcher/TAD-A2A-010 - AREAS - Intercept Task/TAD-A2A-010 - AREAS - Intercept Task.lua b/Tasking/Task_A2A_Dispatcher/TAD-A2A-010 - AREAS - Intercept Task/TAD-A2A-010 - AREAS - Intercept Task.lua index 3cdd368d54..f86d8dce1f 100644 --- a/Tasking/Task_A2A_Dispatcher/TAD-A2A-010 - AREAS - Intercept Task/TAD-A2A-010 - AREAS - Intercept Task.lua +++ b/Tasking/Task_A2A_Dispatcher/TAD-A2A-010 - AREAS - Intercept Task/TAD-A2A-010 - AREAS - Intercept Task.lua @@ -1,36 +1,36 @@ ---- --- Name: TAD-A2A-010 - AREAS - Intercept Task --- Author: FlightControl --- Date Created: 13 Mar 2017 --- --- This mission demonstrates the dynamic task dispatching for Air to Air operations. --- Intruders are flying towards the EWR units. --- The detection method used is the DETECTION_AREAS method, which groups detected targets per detected area. --- --- Observe the planes flying towards the EWR. --- Upon detection, an INTERCEPT task should be created. --- Join the task and destroy the intruders. --- Check if the task is successful after destroying the target. --- --- -local HQ = GROUP:FindByName( "HQ", "Bravo" ) - -local CommandCenter = COMMANDCENTER:New( HQ, "Bravo" ) - -local Scoring = SCORING:New( "A2A Dispatching Demo" ) - -local Mission = MISSION - :New( CommandCenter, "A2A Intercept Mission", "Primary", "INTERCEPT Task Test. Observe the planes flying towards the EWR. Upon detection, an INTERCEPT task should be created. Join the task and destroy the intruders.Check if the task is successful after destroying the target.", coalition.side.RED ) - :AddScoring( Scoring ) - -local EWRSet = SET_GROUP:New():FilterPrefixes( "EWR" ):FilterCoalitions("red"):FilterStart() - -local EWRDetection = DETECTION_AREAS:New( EWRSet, 6000 ) -EWRDetection:SetFriendliesRange( 10000 ) -EWRDetection:SetRefreshTimeInterval( 10 ) - - -local AttackGroups = SET_GROUP:New():FilterCoalitions( "red" ):FilterPrefixes( "Attack" ):FilterStart() - -TaskDispatcher = TASK_A2A_DISPATCHER:New( Mission, AttackGroups, EWRDetection ) -TaskDispatcher:SetRefreshTimeInterval( 10 ) +--- +-- Name: TAD-A2A-010 - AREAS - Intercept Task +-- Author: FlightControl +-- Date Created: 13 Mar 2017 +-- +-- This mission demonstrates the dynamic task dispatching for Air to Air operations. +-- Intruders are flying towards the EWR units. +-- The detection method used is the DETECTION_AREAS method, which groups detected targets per detected area. +-- +-- Observe the planes flying towards the EWR. +-- Upon detection, an INTERCEPT task should be created. +-- Join the task and destroy the intruders. +-- Check if the task is successful after destroying the target. +-- +-- +local HQ = GROUP:FindByName( "HQ", "Bravo" ) + +local CommandCenter = COMMANDCENTER:New( HQ, "Bravo" ) + +local Scoring = SCORING:New( "A2A Dispatching Demo" ) + +local Mission = MISSION + :New( CommandCenter, "A2A Intercept Mission", "Primary", "INTERCEPT Task Test. Observe the planes flying towards the EWR. Upon detection, an INTERCEPT task should be created. Join the task and destroy the intruders.Check if the task is successful after destroying the target.", coalition.side.RED ) + :AddScoring( Scoring ) + +local EWRSet = SET_GROUP:New():FilterPrefixes( "EWR" ):FilterCoalitions("red"):FilterStart() + +local EWRDetection = DETECTION_AREAS:New( EWRSet, 6000 ) +EWRDetection:SetFriendliesRange( 10000 ) +EWRDetection:SetRefreshTimeInterval( 10 ) + + +local AttackGroups = SET_GROUP:New():FilterCoalitions( "red" ):FilterPrefixes( "Attack" ):FilterStart() + +TaskDispatcher = TASK_A2A_DISPATCHER:New( Mission, AttackGroups, EWRDetection ) +TaskDispatcher:SetRefreshTimeInterval( 10 ) diff --git a/Tasking/Task_A2A_Dispatcher/TAD-A2A-020 - AREAS - Sweep Task/TAD-A2A-020 - AREAS - Sweep Task.lua b/Tasking/Task_A2A_Dispatcher/TAD-A2A-020 - AREAS - Sweep Task/TAD-A2A-020 - AREAS - Sweep Task.lua index 1b626ac2d5..79cb118ce5 100644 --- a/Tasking/Task_A2A_Dispatcher/TAD-A2A-020 - AREAS - Sweep Task/TAD-A2A-020 - AREAS - Sweep Task.lua +++ b/Tasking/Task_A2A_Dispatcher/TAD-A2A-020 - AREAS - Sweep Task/TAD-A2A-020 - AREAS - Sweep Task.lua @@ -1,47 +1,47 @@ ---- --- Name: TAD-A2A-020 - AREAS - Sweep Task --- Author: FlightControl --- Date Created: 17 May 2017 --- --- # Situation: --- --- This mission demonstrates the dynamic task dispatching for Air to Air operations. --- Intruders are flying towards the EWR units. --- The detection method used is the DETECTION_AREAS method, which groups detected targets per detected area. --- --- # Test cases: --- --- Observe the EWR's detecting targets and grouping them. --- Check that the HQ provides menus to engage on a task set by the EWRs. --- Once the intruder is detected, an INTERCEPT task is created. --- Observe that it goes back into the mountains. --- And the task should return to a SWEEP task. --- -local HQ = GROUP:FindByName( "HQ", "Bravo" ) - -local CommandCenter = COMMANDCENTER:New( HQ, "Bravo" ) - -local Scoring = SCORING:New( "A2A Dispatching Demo" ) - -local Mission = MISSION - :New( CommandCenter, "A2A Sweep Mission", "Primary", - "SWEEP Task Test. " .. - "Observe the EWR's detecting targets and grouping them. " .. - "Check that the HQ provides menus to engage on a task set by the EWRs. " .. - "Once the intruder is detected, an INTERCEPT task is created. " .. - "Observe that it goes back into the mountains. " .. - "And the task should return to a SWEEP task.", - coalition.side.RED ) - :AddScoring( Scoring ) - -local EWRSet = SET_GROUP:New():FilterPrefixes( "EWR" ):FilterCoalitions("red"):FilterStart() - -local EWRDetection = DETECTION_AREAS:New( EWRSet, 6000 ) -EWRDetection:SetFriendliesRange( 10000 ) -EWRDetection:SetRefreshTimeInterval(30) - - -local AttackGroups = SET_GROUP:New():FilterCoalitions( "red" ):FilterPrefixes( "Attack" ):FilterStart() - -TaskDispatcher = TASK_A2A_DISPATCHER:New( Mission, AttackGroups, EWRDetection ) -TaskDispatcher:SetRefreshTimeInterval( 10 ) +--- +-- Name: TAD-A2A-020 - AREAS - Sweep Task +-- Author: FlightControl +-- Date Created: 17 May 2017 +-- +-- # Situation: +-- +-- This mission demonstrates the dynamic task dispatching for Air to Air operations. +-- Intruders are flying towards the EWR units. +-- The detection method used is the DETECTION_AREAS method, which groups detected targets per detected area. +-- +-- # Test cases: +-- +-- Observe the EWR's detecting targets and grouping them. +-- Check that the HQ provides menus to engage on a task set by the EWRs. +-- Once the intruder is detected, an INTERCEPT task is created. +-- Observe that it goes back into the mountains. +-- And the task should return to a SWEEP task. +-- +local HQ = GROUP:FindByName( "HQ", "Bravo" ) + +local CommandCenter = COMMANDCENTER:New( HQ, "Bravo" ) + +local Scoring = SCORING:New( "A2A Dispatching Demo" ) + +local Mission = MISSION + :New( CommandCenter, "A2A Sweep Mission", "Primary", + "SWEEP Task Test. " .. + "Observe the EWR's detecting targets and grouping them. " .. + "Check that the HQ provides menus to engage on a task set by the EWRs. " .. + "Once the intruder is detected, an INTERCEPT task is created. " .. + "Observe that it goes back into the mountains. " .. + "And the task should return to a SWEEP task.", + coalition.side.RED ) + :AddScoring( Scoring ) + +local EWRSet = SET_GROUP:New():FilterPrefixes( "EWR" ):FilterCoalitions("red"):FilterStart() + +local EWRDetection = DETECTION_AREAS:New( EWRSet, 6000 ) +EWRDetection:SetFriendliesRange( 10000 ) +EWRDetection:SetRefreshTimeInterval(30) + + +local AttackGroups = SET_GROUP:New():FilterCoalitions( "red" ):FilterPrefixes( "Attack" ):FilterStart() + +TaskDispatcher = TASK_A2A_DISPATCHER:New( Mission, AttackGroups, EWRDetection ) +TaskDispatcher:SetRefreshTimeInterval( 10 ) diff --git a/Tasking/Task_A2G/TSK-A2A-100 - SEAD/TSK-010 - Task Modelling - SEAD.lua b/Tasking/Task_A2G/TSK-A2A-100 - SEAD/TSK-010 - Task Modelling - SEAD.lua index 42c56c1ed0..26ccd154b2 100644 --- a/Tasking/Task_A2G/TSK-A2A-100 - SEAD/TSK-010 - Task Modelling - SEAD.lua +++ b/Tasking/Task_A2G/TSK-A2A-100 - SEAD/TSK-010 - Task Modelling - SEAD.lua @@ -1,27 +1,27 @@ ---- --- Name: TSK-010 - Task Modelling - SEAD.lua --- Author: FlightControl --- Date Created: 31 Mar 2017 --- --- # Situation: --- --- This mission demonstrates the Task_SEAD. --- --- # Test cases: --- - -HQ = GROUP:FindByName( "HQ", "Bravo HQ" ) - -CommandCenter = COMMANDCENTER:New( HQ, "Lima" ) - -Scoring = SCORING:New( "Detect Demo" ) - -Mission = MISSION - :New( CommandCenter, "Overlord", "High", "SEAD the area!", coalition.side.RED ) - :AddScoring( Scoring ) - -AttackGroups = SET_GROUP:New():FilterCoalitions( "red" ):FilterPrefixes( "Attack" ):FilterStart() - -TargetSetUnit = SET_UNIT:New():FilterCoalitions("blue"):FilterPrefixes("Target"):FilterStart() - -TaskSEAD = TASK_A2G_SEAD:New(Mission,AttackGroups,"SEAD",TargetSetUnit) +--- +-- Name: TSK-010 - Task Modelling - SEAD.lua +-- Author: FlightControl +-- Date Created: 31 Mar 2017 +-- +-- # Situation: +-- +-- This mission demonstrates the Task_SEAD. +-- +-- # Test cases: +-- + +HQ = GROUP:FindByName( "HQ", "Bravo HQ" ) + +CommandCenter = COMMANDCENTER:New( HQ, "Lima" ) + +Scoring = SCORING:New( "Detect Demo" ) + +Mission = MISSION + :New( CommandCenter, "Overlord", "High", "SEAD the area!", coalition.side.RED ) + :AddScoring( Scoring ) + +AttackGroups = SET_GROUP:New():FilterCoalitions( "red" ):FilterPrefixes( "Attack" ):FilterStart() + +TargetSetUnit = SET_UNIT:New():FilterCoalitions("blue"):FilterPrefixes("Target"):FilterStart() + +TaskSEAD = TASK_A2G_SEAD:New(Mission,AttackGroups,"SEAD",TargetSetUnit) diff --git a/Tasking/Task_A2G/TSK-A2A-200 - BAI/TSK-100 - A2G - BAI.lua b/Tasking/Task_A2G/TSK-A2A-200 - BAI/TSK-100 - A2G - BAI.lua index cdec1d3237..98f2e43a55 100644 --- a/Tasking/Task_A2G/TSK-A2A-200 - BAI/TSK-100 - A2G - BAI.lua +++ b/Tasking/Task_A2G/TSK-A2A-200 - BAI/TSK-100 - A2G - BAI.lua @@ -1,27 +1,27 @@ ---- --- Name: TSK-100 - A2G - BAI --- Author: FlightControl --- Date Created: 28 May 2017 --- --- # Situation: --- --- This mission demonstrates the Task_BAI. --- --- # Test cases: --- - -HQ = GROUP:FindByName( "HQ", "Bravo HQ" ) - -CommandCenter = COMMANDCENTER:New( HQ, "Bravo" ) - -Scoring = SCORING:New( "BAI Demo" ) - -Mission = MISSION - :New( CommandCenter, "Overlord", "Primary", "Perform a Battlefield Air Interdiction in the area!", coalition.side.RED ) - :AddScoring( Scoring ) - -AttackGroups = SET_GROUP:New():FilterCoalitions( "red" ):FilterPrefixes( "Attack" ):FilterStart() - -TargetSetUnit = SET_UNIT:New():FilterCoalitions("blue"):FilterPrefixes( "Target" ):FilterStart() - -TaskBAI = TASK_A2G_BAI:New( Mission, AttackGroups,"BAI", TargetSetUnit ) +--- +-- Name: TSK-100 - A2G - BAI +-- Author: FlightControl +-- Date Created: 28 May 2017 +-- +-- # Situation: +-- +-- This mission demonstrates the Task_BAI. +-- +-- # Test cases: +-- + +HQ = GROUP:FindByName( "HQ", "Bravo HQ" ) + +CommandCenter = COMMANDCENTER:New( HQ, "Bravo" ) + +Scoring = SCORING:New( "BAI Demo" ) + +Mission = MISSION + :New( CommandCenter, "Overlord", "Primary", "Perform a Battlefield Air Interdiction in the area!", coalition.side.RED ) + :AddScoring( Scoring ) + +AttackGroups = SET_GROUP:New():FilterCoalitions( "red" ):FilterPrefixes( "Attack" ):FilterStart() + +TargetSetUnit = SET_UNIT:New():FilterCoalitions("blue"):FilterPrefixes( "Target" ):FilterStart() + +TaskBAI = TASK_A2G_BAI:New( Mission, AttackGroups,"BAI", TargetSetUnit ) diff --git a/Tasking/Task_A2G/TSK-A2G-110 - BAI - WWII Mode/TSK-101 - A2G - BAI - WWII Mode.lua b/Tasking/Task_A2G/TSK-A2G-110 - BAI - WWII Mode/TSK-101 - A2G - BAI - WWII Mode.lua index 439800abd8..1aaf6fd36e 100644 --- a/Tasking/Task_A2G/TSK-A2G-110 - BAI - WWII Mode/TSK-101 - A2G - BAI - WWII Mode.lua +++ b/Tasking/Task_A2G/TSK-A2G-110 - BAI - WWII Mode/TSK-101 - A2G - BAI - WWII Mode.lua @@ -1,29 +1,29 @@ ---- --- Name: TSK-101 - A2G - BAI - WWII Mode --- Author: FlightControl --- Date Created: 28 May 2017 --- --- # Situation: --- --- This mission demonstrates the Task_BAI. --- --- # Test cases: --- - -HQ = GROUP:FindByName( "HQ", "Bravo HQ" ) - -CommandCenter = COMMANDCENTER:New( HQ, "Bravo" ) -CommandCenter:SetModeWWII() -CommandCenter:SetReferenceZones( "Airbase" ) - -Scoring = SCORING:New( "BAI Demo" ) - -Mission = MISSION - :New( CommandCenter, "Overlord", "Primary", "Perform a Battlefield Air Interdiction in the area!", coalition.side.RED ) - :AddScoring( Scoring ) - -AttackGroups = SET_GROUP:New():FilterCoalitions( "red" ):FilterPrefixes( "Attack" ):FilterStart() - -TargetSetUnit = SET_UNIT:New():FilterCoalitions("blue"):FilterPrefixes( "Target" ):FilterStart() - -TaskBAI = TASK_A2G_BAI:New( Mission, AttackGroups,"BAI", TargetSetUnit ) +--- +-- Name: TSK-101 - A2G - BAI - WWII Mode +-- Author: FlightControl +-- Date Created: 28 May 2017 +-- +-- # Situation: +-- +-- This mission demonstrates the Task_BAI. +-- +-- # Test cases: +-- + +HQ = GROUP:FindByName( "HQ", "Bravo HQ" ) + +CommandCenter = COMMANDCENTER:New( HQ, "Bravo" ) +CommandCenter:SetModeWWII() +CommandCenter:SetReferenceZones( "Airbase" ) + +Scoring = SCORING:New( "BAI Demo" ) + +Mission = MISSION + :New( CommandCenter, "Overlord", "Primary", "Perform a Battlefield Air Interdiction in the area!", coalition.side.RED ) + :AddScoring( Scoring ) + +AttackGroups = SET_GROUP:New():FilterCoalitions( "red" ):FilterPrefixes( "Attack" ):FilterStart() + +TargetSetUnit = SET_UNIT:New():FilterCoalitions("blue"):FilterPrefixes( "Target" ):FilterStart() + +TaskBAI = TASK_A2G_BAI:New( Mission, AttackGroups,"BAI", TargetSetUnit ) diff --git a/Tasking/Task_A2G_Dispatcher/TAD-A2G-000 - AREAS - Detection test/TAD-A2G-000 - AREAS - Detection test.lua b/Tasking/Task_A2G_Dispatcher/TAD-A2G-000 - AREAS - Detection test/TAD-A2G-000 - AREAS - Detection test.lua index 0c1c246ba6..7aa2ff8131 100644 --- a/Tasking/Task_A2G_Dispatcher/TAD-A2G-000 - AREAS - Detection test/TAD-A2G-000 - AREAS - Detection test.lua +++ b/Tasking/Task_A2G_Dispatcher/TAD-A2G-000 - AREAS - Detection test/TAD-A2G-000 - AREAS - Detection test.lua @@ -1,51 +1,51 @@ - --- --- Name: TAD-A2G-000 - AREAS - Detection test --- Author: FlightControl --- Date Created: 15 Mar 2018 --- --- # Situation: --- --- This mission demonstrates the dynamic task dispatching for Air to Ground operations. --- Reconnassance vehicles are placed at strategic locations, scanning for the enemy locations. --- The detection method used is the DETECTION_AREAS method, which groups detected targets into areas. --- The AttackSet will engage upon the enemy, which is a Set of Groups seated by Players. --- A2G Tasks are being dispatched to the Players as enemy locations are being detected by the Recce. --- Observe that A2G Tasks are being dispatched to the player. - - --- Declare the Command Center -local HQ = GROUP - :FindByName( "HQ", "Bravo HQ" ) - -local CommandCenter = COMMANDCENTER - :New( HQ, "Lima" ) -- Create the CommandCenter. - --- Declare the Mission for the Command Center. -local Mission = MISSION - :New( CommandCenter, "Overlord", "High", "Attack Detect Mission Briefing", coalition.side.RED ) -- Create the Mission. - --- Define the RecceSet that will detect the enemy. -local RecceSet = SET_GROUP - :New() -- Create the RecceSet, which is the set of groups detecting the enemy locations. - :FilterPrefixes( "Recce" ) -- All Recce groups start with the name "Recce". - :FilterCoalitions("red") -- only the red coalition. - :FilterStart() -- Start the dynamic building of the set. - --- Setup the detection. We use DETECTION_AREAS to detect and group the enemies. -local DetectionAreas = DETECTION_AREAS - :New( RecceSet, 3000 ) -- The RecceSet will detect the enemies, and group them into areas of a 3 km radius. - --- Setup the AttackSet, which is a SET_GROUP. --- The SET_GROUP is a dynamic collection of GROUP objects. -local AttackSet = SET_GROUP - :New() -- Create the SET_GROUP object. - :FilterCoalitions( "red" ) -- Only incorporate the RED coalitions. - :FilterPrefixes( "Attack" ) -- Only incorporate groups that start with the name Attack. - :FilterStart() -- Start the dynamic building of the set. - --- Now we have everything to setup the main A2G TaskDispatcher. -TaskDispatcher = TASK_A2G_DISPATCHER - :New( Mission, AttackSet, DetectionAreas ) -- We assign the TaskDispatcher under Mission. The AttackSet will engage the enemy and will recieve the dispatched Tasks. The DetectionAreas will report any detected enemies to the TaskDispatcher. - --- We use the MISSILETRAINER for demonstration purposes. -MissileTrainer = MISSILETRAINER:New( 100, "Missiles will be destroyed for training when they reach your plane." ) + --- +-- Name: TAD-A2G-000 - AREAS - Detection test +-- Author: FlightControl +-- Date Created: 15 Mar 2018 +-- +-- # Situation: +-- +-- This mission demonstrates the dynamic task dispatching for Air to Ground operations. +-- Reconnassance vehicles are placed at strategic locations, scanning for the enemy locations. +-- The detection method used is the DETECTION_AREAS method, which groups detected targets into areas. +-- The AttackSet will engage upon the enemy, which is a Set of Groups seated by Players. +-- A2G Tasks are being dispatched to the Players as enemy locations are being detected by the Recce. +-- Observe that A2G Tasks are being dispatched to the player. + + +-- Declare the Command Center +local HQ = GROUP + :FindByName( "HQ", "Bravo HQ" ) + +local CommandCenter = COMMANDCENTER + :New( HQ, "Lima" ) -- Create the CommandCenter. + +-- Declare the Mission for the Command Center. +local Mission = MISSION + :New( CommandCenter, "Overlord", "High", "Attack Detect Mission Briefing", coalition.side.RED ) -- Create the Mission. + +-- Define the RecceSet that will detect the enemy. +local RecceSet = SET_GROUP + :New() -- Create the RecceSet, which is the set of groups detecting the enemy locations. + :FilterPrefixes( "Recce" ) -- All Recce groups start with the name "Recce". + :FilterCoalitions("red") -- only the red coalition. + :FilterStart() -- Start the dynamic building of the set. + +-- Setup the detection. We use DETECTION_AREAS to detect and group the enemies. +local DetectionAreas = DETECTION_AREAS + :New( RecceSet, 3000 ) -- The RecceSet will detect the enemies, and group them into areas of a 3 km radius. + +-- Setup the AttackSet, which is a SET_GROUP. +-- The SET_GROUP is a dynamic collection of GROUP objects. +local AttackSet = SET_GROUP + :New() -- Create the SET_GROUP object. + :FilterCoalitions( "red" ) -- Only incorporate the RED coalitions. + :FilterPrefixes( "Attack" ) -- Only incorporate groups that start with the name Attack. + :FilterStart() -- Start the dynamic building of the set. + +-- Now we have everything to setup the main A2G TaskDispatcher. +TaskDispatcher = TASK_A2G_DISPATCHER + :New( Mission, AttackSet, DetectionAreas ) -- We assign the TaskDispatcher under Mission. The AttackSet will engage the enemy and will recieve the dispatched Tasks. The DetectionAreas will report any detected enemies to the TaskDispatcher. + +-- We use the MISSILETRAINER for demonstration purposes. +MissileTrainer = MISSILETRAINER:New( 100, "Missiles will be destroyed for training when they reach your plane." ) diff --git a/Tasking/Task_A2G_Dispatcher/TAD-A2G-001 - AREAS - Destroy Test/TAD-A2G-001 - AREAS - Destroy Test.lua b/Tasking/Task_A2G_Dispatcher/TAD-A2G-001 - AREAS - Destroy Test/TAD-A2G-001 - AREAS - Destroy Test.lua index aea23069d0..e727a85123 100644 --- a/Tasking/Task_A2G_Dispatcher/TAD-A2G-001 - AREAS - Destroy Test/TAD-A2G-001 - AREAS - Destroy Test.lua +++ b/Tasking/Task_A2G_Dispatcher/TAD-A2G-001 - AREAS - Destroy Test/TAD-A2G-001 - AREAS - Destroy Test.lua @@ -1,52 +1,52 @@ - --- --- Name: TAD-A2G-001 - AREAS - Destroy Test --- Author: FlightControl --- Date Created: 15 Mar 2018 --- --- This mission demonstrates the dynamic task dispatching for Air to Ground operations. --- Reconnassance vehicles are placed at strategic locations, scanning for the enemy locations. --- The detection method used is the DETECTION_AREAS method, which groups detected targets into areas. --- The AttackSet will engage upon the enemy, which is a Set of Groups seated by Players. --- A2G Tasks are being dispatched to the Players as enemy locations are being detected by the Recce. --- Observe that A2G Tasks are being dispatched to the player. --- Get seated in the Attack Plane, there is also an AI with you, who will attack the ground targets. --- Join the A2G Task that was dispatched to you. --- Once the AI in your group destroys the target, you should see that the A2G task got success. - - --- Declare the Command Center -local HQ = GROUP - :FindByName( "HQ", "Bravo HQ" ) - -local CommandCenter = COMMANDCENTER - :New( HQ, "Lima" ) -- Create the CommandCenter. - --- Declare the Mission for the Command Center. -local Mission = MISSION - :New( CommandCenter, "Overlord", "High", "Attack Detect Mission Briefing", coalition.side.RED ) -- Create the Mission. - --- Define the RecceSet that will detect the enemy. -local RecceSet = SET_GROUP - :New() -- Create the RecceSet, which is the set of groups detecting the enemy locations. - :FilterPrefixes( "Recce" ) -- All Recce groups start with the name "Recce". - :FilterCoalitions("red") -- only the red coalition. - :FilterStart() -- Start the dynamic building of the set. - --- Setup the detection. We use DETECTION_AREAS to detect and group the enemies. -local DetectionAreas = DETECTION_AREAS - :New( RecceSet, 3000 ) -- The RecceSet will detect the enemies, and group them into areas of a 3 km radius. - --- Setup the AttackSet, which is a SET_GROUP. --- The SET_GROUP is a dynamic collection of GROUP objects. -local AttackSet = SET_GROUP - :New() -- Create the SET_GROUP object. - :FilterCoalitions( "red" ) -- Only incorporate the RED coalitions. - :FilterPrefixes( "Attack" ) -- Only incorporate groups that start with the name Attack. - :FilterStart() -- Start the dynamic building of the set. - --- Now we have everything to setup the main A2G TaskDispatcher. -TaskDispatcher = TASK_A2G_DISPATCHER - :New( Mission, AttackSet, DetectionAreas ) -- We assign the TaskDispatcher under Mission. The AttackSet will engage the enemy and will recieve the dispatched Tasks. The DetectionAreas will report any detected enemies to the TaskDispatcher. - --- We use the MISSILETRAINER for demonstration purposes. -MissileTrainer = MISSILETRAINER:New( 100, "Missiles will be destroyed for training when they reach your plane." ) + --- +-- Name: TAD-A2G-001 - AREAS - Destroy Test +-- Author: FlightControl +-- Date Created: 15 Mar 2018 +-- +-- This mission demonstrates the dynamic task dispatching for Air to Ground operations. +-- Reconnassance vehicles are placed at strategic locations, scanning for the enemy locations. +-- The detection method used is the DETECTION_AREAS method, which groups detected targets into areas. +-- The AttackSet will engage upon the enemy, which is a Set of Groups seated by Players. +-- A2G Tasks are being dispatched to the Players as enemy locations are being detected by the Recce. +-- Observe that A2G Tasks are being dispatched to the player. +-- Get seated in the Attack Plane, there is also an AI with you, who will attack the ground targets. +-- Join the A2G Task that was dispatched to you. +-- Once the AI in your group destroys the target, you should see that the A2G task got success. + + +-- Declare the Command Center +local HQ = GROUP + :FindByName( "HQ", "Bravo HQ" ) + +local CommandCenter = COMMANDCENTER + :New( HQ, "Lima" ) -- Create the CommandCenter. + +-- Declare the Mission for the Command Center. +local Mission = MISSION + :New( CommandCenter, "Overlord", "High", "Attack Detect Mission Briefing", coalition.side.RED ) -- Create the Mission. + +-- Define the RecceSet that will detect the enemy. +local RecceSet = SET_GROUP + :New() -- Create the RecceSet, which is the set of groups detecting the enemy locations. + :FilterPrefixes( "Recce" ) -- All Recce groups start with the name "Recce". + :FilterCoalitions("red") -- only the red coalition. + :FilterStart() -- Start the dynamic building of the set. + +-- Setup the detection. We use DETECTION_AREAS to detect and group the enemies. +local DetectionAreas = DETECTION_AREAS + :New( RecceSet, 3000 ) -- The RecceSet will detect the enemies, and group them into areas of a 3 km radius. + +-- Setup the AttackSet, which is a SET_GROUP. +-- The SET_GROUP is a dynamic collection of GROUP objects. +local AttackSet = SET_GROUP + :New() -- Create the SET_GROUP object. + :FilterCoalitions( "red" ) -- Only incorporate the RED coalitions. + :FilterPrefixes( "Attack" ) -- Only incorporate groups that start with the name Attack. + :FilterStart() -- Start the dynamic building of the set. + +-- Now we have everything to setup the main A2G TaskDispatcher. +TaskDispatcher = TASK_A2G_DISPATCHER + :New( Mission, AttackSet, DetectionAreas ) -- We assign the TaskDispatcher under Mission. The AttackSet will engage the enemy and will recieve the dispatched Tasks. The DetectionAreas will report any detected enemies to the TaskDispatcher. + +-- We use the MISSILETRAINER for demonstration purposes. +MissileTrainer = MISSILETRAINER:New( 100, "Missiles will be destroyed for training when they reach your plane." ) diff --git a/Tasking/Task_A2G_Dispatcher/TAD-A2G-002 - AREAS - Task Success Test/TAD-A2G-002 - AREAS - Task Success Test.lua b/Tasking/Task_A2G_Dispatcher/TAD-A2G-002 - AREAS - Task Success Test/TAD-A2G-002 - AREAS - Task Success Test.lua index 9376e92086..9f251ac838 100644 --- a/Tasking/Task_A2G_Dispatcher/TAD-A2G-002 - AREAS - Task Success Test/TAD-A2G-002 - AREAS - Task Success Test.lua +++ b/Tasking/Task_A2G_Dispatcher/TAD-A2G-002 - AREAS - Task Success Test/TAD-A2G-002 - AREAS - Task Success Test.lua @@ -1,66 +1,66 @@ - --- --- Name: TAD-A2G-002 - AREAS - Task Success Test --- Author: FlightControl --- Date Created: 15 Mar 2018 --- --- This mission demonstrates the dynamic task dispatching for Air to Ground operations. --- Reconnassance vehicles are placed at strategic locations, scanning for the enemy locations. --- The detection method used is the DETECTION_AREAS method, which groups detected targets into areas. --- The AttackSet will engage upon the enemy, which is a Set of Groups seated by Players. --- A2G Tasks are being dispatched to the Players as enemy locations are being detected by the Recce. --- Observe that A2G Tasks are being dispatched to the player. --- Get seated in the Attack Plane, there is also an AI with you, who will attack the ground targets. --- Join the A2G Task that was dispatched to you. --- Once the AI in your group destroys the target, you should see that the A2G task got success. - - --- Declare the Command Center -local HQ = GROUP - :FindByName( "HQ", "Bravo HQ" ) - -local CommandCenter = COMMANDCENTER - :New( HQ, "Lima" ) -- Create the CommandCenter. - --- Declare the Mission for the Command Center. -local Mission = MISSION - :New( CommandCenter, "Overlord", "High", "Attack Detect Mission Briefing", coalition.side.RED ) -- Create the Mission. - --- Define the RecceSet that will detect the enemy. -local RecceSet = SET_GROUP - :New() -- Create the RecceSet, which is the set of groups detecting the enemy locations. - :FilterPrefixes( "Recce" ) -- All Recce groups start with the name "Recce". - :FilterCoalitions("red") -- only the red coalition. - :FilterStart() -- Start the dynamic building of the set. - --- Setup the detection. We use DETECTION_AREAS to detect and group the enemies. -local DetectionAreas = DETECTION_AREAS - :New( RecceSet, 3000 ) -- The RecceSet will detect the enemies, and group them into areas of a 3 km radius. - --- Setup the AttackSet, which is a SET_GROUP. --- The SET_GROUP is a dynamic collection of GROUP objects. -local AttackSet = SET_GROUP - :New() -- Create the SET_GROUP object. - :FilterCoalitions( "red" ) -- Only incorporate the RED coalitions. - :FilterPrefixes( "Attack" ) -- Only incorporate groups that start with the name Attack. - :FilterStart() -- Start the dynamic building of the set. - --- Now we have everything to setup the main A2G TaskDispatcher. -TaskDispatcher = TASK_A2G_DISPATCHER - :New( Mission, AttackSet, DetectionAreas ) -- We assign the TaskDispatcher under Mission. The AttackSet will engage the enemy and will recieve the dispatched Tasks. The DetectionAreas will report any detected enemies to the TaskDispatcher. - - - ---- Success Handler OnAfter for TaskDispatcher --- @function [parent=#TaskDispatcher] OnAfterSuccess --- @param #TaskDispatcher self --- @param #string From --- @param #string Event --- @param #string To --- @param Tasking.Task#TASK Task -function TaskDispatcher:OnAfterSuccess( From, Event, To, Task ) - self:E( "Task Success!!!" ) -end - - --- We use the MISSILETRAINER for demonstration purposes. -MissileTrainer = MISSILETRAINER:New( 100, "Missiles will be destroyed for training when they reach your plane." ) + --- +-- Name: TAD-A2G-002 - AREAS - Task Success Test +-- Author: FlightControl +-- Date Created: 15 Mar 2018 +-- +-- This mission demonstrates the dynamic task dispatching for Air to Ground operations. +-- Reconnassance vehicles are placed at strategic locations, scanning for the enemy locations. +-- The detection method used is the DETECTION_AREAS method, which groups detected targets into areas. +-- The AttackSet will engage upon the enemy, which is a Set of Groups seated by Players. +-- A2G Tasks are being dispatched to the Players as enemy locations are being detected by the Recce. +-- Observe that A2G Tasks are being dispatched to the player. +-- Get seated in the Attack Plane, there is also an AI with you, who will attack the ground targets. +-- Join the A2G Task that was dispatched to you. +-- Once the AI in your group destroys the target, you should see that the A2G task got success. + + +-- Declare the Command Center +local HQ = GROUP + :FindByName( "HQ", "Bravo HQ" ) + +local CommandCenter = COMMANDCENTER + :New( HQ, "Lima" ) -- Create the CommandCenter. + +-- Declare the Mission for the Command Center. +local Mission = MISSION + :New( CommandCenter, "Overlord", "High", "Attack Detect Mission Briefing", coalition.side.RED ) -- Create the Mission. + +-- Define the RecceSet that will detect the enemy. +local RecceSet = SET_GROUP + :New() -- Create the RecceSet, which is the set of groups detecting the enemy locations. + :FilterPrefixes( "Recce" ) -- All Recce groups start with the name "Recce". + :FilterCoalitions("red") -- only the red coalition. + :FilterStart() -- Start the dynamic building of the set. + +-- Setup the detection. We use DETECTION_AREAS to detect and group the enemies. +local DetectionAreas = DETECTION_AREAS + :New( RecceSet, 3000 ) -- The RecceSet will detect the enemies, and group them into areas of a 3 km radius. + +-- Setup the AttackSet, which is a SET_GROUP. +-- The SET_GROUP is a dynamic collection of GROUP objects. +local AttackSet = SET_GROUP + :New() -- Create the SET_GROUP object. + :FilterCoalitions( "red" ) -- Only incorporate the RED coalitions. + :FilterPrefixes( "Attack" ) -- Only incorporate groups that start with the name Attack. + :FilterStart() -- Start the dynamic building of the set. + +-- Now we have everything to setup the main A2G TaskDispatcher. +TaskDispatcher = TASK_A2G_DISPATCHER + :New( Mission, AttackSet, DetectionAreas ) -- We assign the TaskDispatcher under Mission. The AttackSet will engage the enemy and will recieve the dispatched Tasks. The DetectionAreas will report any detected enemies to the TaskDispatcher. + + + +--- Success Handler OnAfter for TaskDispatcher +-- @function [parent=#TaskDispatcher] OnAfterSuccess +-- @param #TaskDispatcher self +-- @param #string From +-- @param #string Event +-- @param #string To +-- @param Tasking.Task#TASK Task +function TaskDispatcher:OnAfterSuccess( From, Event, To, Task ) + self:E( "Task Success!!!" ) +end + + +-- We use the MISSILETRAINER for demonstration purposes. +MissileTrainer = MISSILETRAINER:New( 100, "Missiles will be destroyed for training when they reach your plane." ) diff --git a/Tasking/Task_A2G_Dispatcher/TAD-A2G-010 - AREAS - Split SEAD to BAI and SEAD/TAD-A2G-010 - AREAS - Split SEAD to BAI and SEAD.lua b/Tasking/Task_A2G_Dispatcher/TAD-A2G-010 - AREAS - Split SEAD to BAI and SEAD/TAD-A2G-010 - AREAS - Split SEAD to BAI and SEAD.lua index bc1b6964a1..cefac732f2 100644 --- a/Tasking/Task_A2G_Dispatcher/TAD-A2G-010 - AREAS - Split SEAD to BAI and SEAD/TAD-A2G-010 - AREAS - Split SEAD to BAI and SEAD.lua +++ b/Tasking/Task_A2G_Dispatcher/TAD-A2G-010 - AREAS - Split SEAD to BAI and SEAD/TAD-A2G-010 - AREAS - Split SEAD to BAI and SEAD.lua @@ -1,50 +1,50 @@ --- Name: TAD-A2G-010 - AREAS - Split SEAD to BAI and SEAD --- Author: FlightControl --- Date Created: 05 Dec 2017 --- --- This mission demonstrates the dynamic task dispatching for Air to Ground operations. --- This test is about a SEAD task, dispatched, that is split into a SEAD and BAI task, when units are moving away from the zone. --- While the units are moving away, monitor if the task is correctly split into a SEAD and BAI task! --- This is only applicable for AREA detections. Other detection methods won't have this dynamic. - --- Declare the Command Center -local HQ = GROUP - :FindByName( "HQ", "Bravo HQ" ) - -local CommandCenter = COMMANDCENTER - :New( HQ, "Lima" ) -- Create the CommandCenter. - --- Declare the Mission for the Command Center. -local Mission = MISSION - :New( CommandCenter, "Overlord", "High", - "This mission demonstrates the dynamic task dispatching for Air to Ground operations. " .. - "This test is about a SEAD task, dispatched, that is split into a SEAD and BAI task, when units are moving away from the zone. " .. - "While the units are moving away, monitor if the task is correctly split into a SEAD and BAI task! " .. - "This is only applicable for AREA detections. Other detection methods won't have this dynamic.", - coalition.side.RED ) -- Create the Mission. - --- Define the RecceSet that will detect the enemy. -local RecceSet = SET_GROUP - :New() -- Create the RecceSet, which is the set of groups detecting the enemy locations. - :FilterPrefixes( "Recce" ) -- All Recce groups start with the name "Recce". - :FilterCoalitions("red") -- only the red coalition. - :FilterStart() -- Start the dynamic building of the set. - --- Setup the detection. We use DETECTION_AREAS to detect and group the enemies. -local DetectionAreas = DETECTION_AREAS - :New( RecceSet, 3000 ) -- The RecceSet will detect the enemies, and group them into areas of a 3 km radius. - --- Setup the AttackSet, which is a SET_GROUP. --- The SET_GROUP is a dynamic collection of GROUP objects. -local AttackSet = SET_GROUP - :New() -- Create the SET_GROUP object. - :FilterCoalitions( "red" ) -- Only incorporate the RED coalitions. - :FilterPrefixes( "Attack" ) -- Only incorporate groups that start with the name Attack. - :FilterStart() -- Start the dynamic building of the set. - --- Now we have everything to setup the main A2G TaskDispatcher. -TaskDispatcher = TASK_A2G_DISPATCHER - :New( Mission, AttackSet, DetectionAreas ) -- We assign the TaskDispatcher under Mission. The AttackSet will engage the enemy and will recieve the dispatched Tasks. The DetectionAreas will report any detected enemies to the TaskDispatcher. - --- We use the MISSILETRAINER for demonstration purposes. -MissileTrainer = MISSILETRAINER:New( 100, "Missiles will be destroyed for training when they reach your plane." ) +-- Name: TAD-A2G-010 - AREAS - Split SEAD to BAI and SEAD +-- Author: FlightControl +-- Date Created: 05 Dec 2017 +-- +-- This mission demonstrates the dynamic task dispatching for Air to Ground operations. +-- This test is about a SEAD task, dispatched, that is split into a SEAD and BAI task, when units are moving away from the zone. +-- While the units are moving away, monitor if the task is correctly split into a SEAD and BAI task! +-- This is only applicable for AREA detections. Other detection methods won't have this dynamic. + +-- Declare the Command Center +local HQ = GROUP + :FindByName( "HQ", "Bravo HQ" ) + +local CommandCenter = COMMANDCENTER + :New( HQ, "Lima" ) -- Create the CommandCenter. + +-- Declare the Mission for the Command Center. +local Mission = MISSION + :New( CommandCenter, "Overlord", "High", + "This mission demonstrates the dynamic task dispatching for Air to Ground operations. " .. + "This test is about a SEAD task, dispatched, that is split into a SEAD and BAI task, when units are moving away from the zone. " .. + "While the units are moving away, monitor if the task is correctly split into a SEAD and BAI task! " .. + "This is only applicable for AREA detections. Other detection methods won't have this dynamic.", + coalition.side.RED ) -- Create the Mission. + +-- Define the RecceSet that will detect the enemy. +local RecceSet = SET_GROUP + :New() -- Create the RecceSet, which is the set of groups detecting the enemy locations. + :FilterPrefixes( "Recce" ) -- All Recce groups start with the name "Recce". + :FilterCoalitions("red") -- only the red coalition. + :FilterStart() -- Start the dynamic building of the set. + +-- Setup the detection. We use DETECTION_AREAS to detect and group the enemies. +local DetectionAreas = DETECTION_AREAS + :New( RecceSet, 3000 ) -- The RecceSet will detect the enemies, and group them into areas of a 3 km radius. + +-- Setup the AttackSet, which is a SET_GROUP. +-- The SET_GROUP is a dynamic collection of GROUP objects. +local AttackSet = SET_GROUP + :New() -- Create the SET_GROUP object. + :FilterCoalitions( "red" ) -- Only incorporate the RED coalitions. + :FilterPrefixes( "Attack" ) -- Only incorporate groups that start with the name Attack. + :FilterStart() -- Start the dynamic building of the set. + +-- Now we have everything to setup the main A2G TaskDispatcher. +TaskDispatcher = TASK_A2G_DISPATCHER + :New( Mission, AttackSet, DetectionAreas ) -- We assign the TaskDispatcher under Mission. The AttackSet will engage the enemy and will recieve the dispatched Tasks. The DetectionAreas will report any detected enemies to the TaskDispatcher. + +-- We use the MISSILETRAINER for demonstration purposes. +MissileTrainer = MISSILETRAINER:New( 100, "Missiles will be destroyed for training when they reach your plane." ) diff --git a/Tasking/Task_A2G_Dispatcher/TAD-A2G-011 - AREAS - Split SEAD to CAS and SEAD/TAD-A2G-011 - AREAS - Split SEAD to CAS and SEAD.lua b/Tasking/Task_A2G_Dispatcher/TAD-A2G-011 - AREAS - Split SEAD to CAS and SEAD/TAD-A2G-011 - AREAS - Split SEAD to CAS and SEAD.lua index 69171660fd..8d1bd70745 100644 --- a/Tasking/Task_A2G_Dispatcher/TAD-A2G-011 - AREAS - Split SEAD to CAS and SEAD/TAD-A2G-011 - AREAS - Split SEAD to CAS and SEAD.lua +++ b/Tasking/Task_A2G_Dispatcher/TAD-A2G-011 - AREAS - Split SEAD to CAS and SEAD/TAD-A2G-011 - AREAS - Split SEAD to CAS and SEAD.lua @@ -1,50 +1,50 @@ --- Name: TAD-A2G-011 - AREAS - Split SEAD to CAS and SEAD --- Author: FlightControl --- Date Created: 05 Dec 2017 --- --- This mission demonstrates the dynamic task dispatching for Air to Ground operations. --- This test is about a SEAD task, dispatched, that is split into a SEAD and CAS task, when units are moving away from the zone. --- While the units are moving away, monitor if the task is correctly split into a SEAD and CAS task! --- This is only applicable for AREA detections. Other detection methods won't have this dynamic. - --- Declare the Command Center -local HQ = GROUP - :FindByName( "HQ", "Bravo HQ" ) - -local CommandCenter = COMMANDCENTER - :New( HQ, "Lima" ) -- Create the CommandCenter. - --- Declare the Mission for the Command Center. -local Mission = MISSION - :New( CommandCenter, "Overlord", "High", - "This mission demonstrates the dynamic task dispatching for Air to Ground operations. " .. - "This test is about a SEAD task, dispatched, that is split into a SEAD and BAI task, when units are moving away from the zone. " .. - "While the units are moving away, monitor if the task is correctly split into a SEAD and BAI task! " .. - "This is only applicable for AREA detections. Other detection methods won't have this dynamic.", - coalition.side.RED ) -- Create the Mission. - --- Define the RecceSet that will detect the enemy. -local RecceSet = SET_GROUP - :New() -- Create the RecceSet, which is the set of groups detecting the enemy locations. - :FilterPrefixes( "Recce" ) -- All Recce groups start with the name "Recce". - :FilterCoalitions("red") -- only the red coalition. - :FilterStart() -- Start the dynamic building of the set. - --- Setup the detection. We use DETECTION_AREAS to detect and group the enemies. -local DetectionAreas = DETECTION_AREAS - :New( RecceSet, 3000 ) -- The RecceSet will detect the enemies, and group them into areas of a 3 km radius. - --- Setup the AttackSet, which is a SET_GROUP. --- The SET_GROUP is a dynamic collection of GROUP objects. -local AttackSet = SET_GROUP - :New() -- Create the SET_GROUP object. - :FilterCoalitions( "red" ) -- Only incorporate the RED coalitions. - :FilterPrefixes( "Attack" ) -- Only incorporate groups that start with the name Attack. - :FilterStart() -- Start the dynamic building of the set. - --- Now we have everything to setup the main A2G TaskDispatcher. -TaskDispatcher = TASK_A2G_DISPATCHER - :New( Mission, AttackSet, DetectionAreas ) -- We assign the TaskDispatcher under Mission. The AttackSet will engage the enemy and will recieve the dispatched Tasks. The DetectionAreas will report any detected enemies to the TaskDispatcher. - --- We use the MISSILETRAINER for demonstration purposes. -MissileTrainer = MISSILETRAINER:New( 100, "Missiles will be destroyed for training when they reach your plane." ) +-- Name: TAD-A2G-011 - AREAS - Split SEAD to CAS and SEAD +-- Author: FlightControl +-- Date Created: 05 Dec 2017 +-- +-- This mission demonstrates the dynamic task dispatching for Air to Ground operations. +-- This test is about a SEAD task, dispatched, that is split into a SEAD and CAS task, when units are moving away from the zone. +-- While the units are moving away, monitor if the task is correctly split into a SEAD and CAS task! +-- This is only applicable for AREA detections. Other detection methods won't have this dynamic. + +-- Declare the Command Center +local HQ = GROUP + :FindByName( "HQ", "Bravo HQ" ) + +local CommandCenter = COMMANDCENTER + :New( HQ, "Lima" ) -- Create the CommandCenter. + +-- Declare the Mission for the Command Center. +local Mission = MISSION + :New( CommandCenter, "Overlord", "High", + "This mission demonstrates the dynamic task dispatching for Air to Ground operations. " .. + "This test is about a SEAD task, dispatched, that is split into a SEAD and BAI task, when units are moving away from the zone. " .. + "While the units are moving away, monitor if the task is correctly split into a SEAD and BAI task! " .. + "This is only applicable for AREA detections. Other detection methods won't have this dynamic.", + coalition.side.RED ) -- Create the Mission. + +-- Define the RecceSet that will detect the enemy. +local RecceSet = SET_GROUP + :New() -- Create the RecceSet, which is the set of groups detecting the enemy locations. + :FilterPrefixes( "Recce" ) -- All Recce groups start with the name "Recce". + :FilterCoalitions("red") -- only the red coalition. + :FilterStart() -- Start the dynamic building of the set. + +-- Setup the detection. We use DETECTION_AREAS to detect and group the enemies. +local DetectionAreas = DETECTION_AREAS + :New( RecceSet, 3000 ) -- The RecceSet will detect the enemies, and group them into areas of a 3 km radius. + +-- Setup the AttackSet, which is a SET_GROUP. +-- The SET_GROUP is a dynamic collection of GROUP objects. +local AttackSet = SET_GROUP + :New() -- Create the SET_GROUP object. + :FilterCoalitions( "red" ) -- Only incorporate the RED coalitions. + :FilterPrefixes( "Attack" ) -- Only incorporate groups that start with the name Attack. + :FilterStart() -- Start the dynamic building of the set. + +-- Now we have everything to setup the main A2G TaskDispatcher. +TaskDispatcher = TASK_A2G_DISPATCHER + :New( Mission, AttackSet, DetectionAreas ) -- We assign the TaskDispatcher under Mission. The AttackSet will engage the enemy and will recieve the dispatched Tasks. The DetectionAreas will report any detected enemies to the TaskDispatcher. + +-- We use the MISSILETRAINER for demonstration purposes. +MissileTrainer = MISSILETRAINER:New( 100, "Missiles will be destroyed for training when they reach your plane." ) diff --git a/Tasking/Task_A2G_Dispatcher/TAD-A2G-020 - AREAS - Remain BAI as Player/TAD-A2G-020 - AREAS - Remain BAI as Player.lua b/Tasking/Task_A2G_Dispatcher/TAD-A2G-020 - AREAS - Remain BAI as Player/TAD-A2G-020 - AREAS - Remain BAI as Player.lua index 1122cdc124..8ef755de83 100644 --- a/Tasking/Task_A2G_Dispatcher/TAD-A2G-020 - AREAS - Remain BAI as Player/TAD-A2G-020 - AREAS - Remain BAI as Player.lua +++ b/Tasking/Task_A2G_Dispatcher/TAD-A2G-020 - AREAS - Remain BAI as Player/TAD-A2G-020 - AREAS - Remain BAI as Player.lua @@ -1,52 +1,52 @@ --- Name: TAD-A2G-020 - AREAS - Remain BAI as a Player --- Author: FlightControl --- Date Created: 20 Dec 2017 --- --- This mission demonstrates the dynamic task dispatching for Air to Ground operations. --- This test is about checking that if a player in the air is approaching a BAI task zone, that the task is not converted to a CAS! --- Jump into the helicopter. Fly to the blue targets. They won't fire at you. --- The su-34 will detect the blue targets, but will report a BAI task, even if you are in the helicopter are near to the targets. --- This is a very important aspect of BAI. --- Only ground units should be considered as friendlies and would convert a task in CAS if near the enemy. - --- Declare the Command Center -local HQ = GROUP - :FindByName( "HQ", "Bravo HQ" ) - -local CommandCenter = COMMANDCENTER - :New( HQ, "Lima" ) -- Create the CommandCenter. - --- Declare the Mission for the Command Center. -local Mission = MISSION - :New( CommandCenter, "Overlord", "High", - "This mission demonstrates the dynamic task dispatching for Air to Ground operations. " .. - "This test is about a SEAD task, dispatched, that is split into a SEAD and BAI task, when units are moving away from the zone. " .. - "While the units are moving away, monitor if the task is correctly split into a SEAD and BAI task! " .. - "This is only applicable for AREA detections. Other detection methods won't have this dynamic.", - coalition.side.RED ) -- Create the Mission. - --- Define the RecceSet that will detect the enemy. -local RecceSet = SET_GROUP - :New() -- Create the RecceSet, which is the set of groups detecting the enemy locations. - :FilterPrefixes( "Recce" ) -- All Recce groups start with the name "Recce". - :FilterCoalitions("red") -- only the red coalition. - :FilterStart() -- Start the dynamic building of the set. - --- Setup the detection. We use DETECTION_AREAS to detect and group the enemies. -local DetectionAreas = DETECTION_AREAS - :New( RecceSet, 3000 ) -- The RecceSet will detect the enemies, and group them into areas of a 3 km radius. - --- Setup the AttackSet, which is a SET_GROUP. --- The SET_GROUP is a dynamic collection of GROUP objects. -local AttackSet = SET_GROUP - :New() -- Create the SET_GROUP object. - :FilterCoalitions( "red" ) -- Only incorporate the RED coalitions. - :FilterPrefixes( "Attack" ) -- Only incorporate groups that start with the name Attack. - :FilterStart() -- Start the dynamic building of the set. - --- Now we have everything to setup the main A2G TaskDispatcher. -TaskDispatcher = TASK_A2G_DISPATCHER - :New( Mission, AttackSet, DetectionAreas ) -- We assign the TaskDispatcher under Mission. The AttackSet will engage the enemy and will recieve the dispatched Tasks. The DetectionAreas will report any detected enemies to the TaskDispatcher. - --- We use the MISSILETRAINER for demonstration purposes. -MissileTrainer = MISSILETRAINER:New( 100, "Missiles will be destroyed for training when they reach your plane." ) +-- Name: TAD-A2G-020 - AREAS - Remain BAI as a Player +-- Author: FlightControl +-- Date Created: 20 Dec 2017 +-- +-- This mission demonstrates the dynamic task dispatching for Air to Ground operations. +-- This test is about checking that if a player in the air is approaching a BAI task zone, that the task is not converted to a CAS! +-- Jump into the helicopter. Fly to the blue targets. They won't fire at you. +-- The su-34 will detect the blue targets, but will report a BAI task, even if you are in the helicopter are near to the targets. +-- This is a very important aspect of BAI. +-- Only ground units should be considered as friendlies and would convert a task in CAS if near the enemy. + +-- Declare the Command Center +local HQ = GROUP + :FindByName( "HQ", "Bravo HQ" ) + +local CommandCenter = COMMANDCENTER + :New( HQ, "Lima" ) -- Create the CommandCenter. + +-- Declare the Mission for the Command Center. +local Mission = MISSION + :New( CommandCenter, "Overlord", "High", + "This mission demonstrates the dynamic task dispatching for Air to Ground operations. " .. + "This test is about a SEAD task, dispatched, that is split into a SEAD and BAI task, when units are moving away from the zone. " .. + "While the units are moving away, monitor if the task is correctly split into a SEAD and BAI task! " .. + "This is only applicable for AREA detections. Other detection methods won't have this dynamic.", + coalition.side.RED ) -- Create the Mission. + +-- Define the RecceSet that will detect the enemy. +local RecceSet = SET_GROUP + :New() -- Create the RecceSet, which is the set of groups detecting the enemy locations. + :FilterPrefixes( "Recce" ) -- All Recce groups start with the name "Recce". + :FilterCoalitions("red") -- only the red coalition. + :FilterStart() -- Start the dynamic building of the set. + +-- Setup the detection. We use DETECTION_AREAS to detect and group the enemies. +local DetectionAreas = DETECTION_AREAS + :New( RecceSet, 3000 ) -- The RecceSet will detect the enemies, and group them into areas of a 3 km radius. + +-- Setup the AttackSet, which is a SET_GROUP. +-- The SET_GROUP is a dynamic collection of GROUP objects. +local AttackSet = SET_GROUP + :New() -- Create the SET_GROUP object. + :FilterCoalitions( "red" ) -- Only incorporate the RED coalitions. + :FilterPrefixes( "Attack" ) -- Only incorporate groups that start with the name Attack. + :FilterStart() -- Start the dynamic building of the set. + +-- Now we have everything to setup the main A2G TaskDispatcher. +TaskDispatcher = TASK_A2G_DISPATCHER + :New( Mission, AttackSet, DetectionAreas ) -- We assign the TaskDispatcher under Mission. The AttackSet will engage the enemy and will recieve the dispatched Tasks. The DetectionAreas will report any detected enemies to the TaskDispatcher. + +-- We use the MISSILETRAINER for demonstration purposes. +MissileTrainer = MISSILETRAINER:New( 100, "Missiles will be destroyed for training when they reach your plane." ) diff --git a/Tasking/Task_A2G_Dispatcher/TAD-A2G-021 - AREAS - Remain BAI as AI/TAD-A2G-021 - AREAS - Remain BAI as AI.lua b/Tasking/Task_A2G_Dispatcher/TAD-A2G-021 - AREAS - Remain BAI as AI/TAD-A2G-021 - AREAS - Remain BAI as AI.lua index cdc3c37280..2442a6b95e 100644 --- a/Tasking/Task_A2G_Dispatcher/TAD-A2G-021 - AREAS - Remain BAI as AI/TAD-A2G-021 - AREAS - Remain BAI as AI.lua +++ b/Tasking/Task_A2G_Dispatcher/TAD-A2G-021 - AREAS - Remain BAI as AI/TAD-A2G-021 - AREAS - Remain BAI as AI.lua @@ -1,52 +1,52 @@ --- Name: TAD-A2G-021 - AREAS - Remain BAI as AI --- Author: FlightControl --- Date Created: 20 Dec 2017 --- --- This mission demonstrates the dynamic task dispatching for Air to Ground operations. --- This test is about checking that if a player in the air is approaching a BAI task zone, that the task is not converted to a CAS! --- Jump into the su-25T. The AI Helicopter Attack will fly to the detected blue targets. They won't fire at the helicopters. --- The su-34 will detect the blue targets, but will report a BAI task, even if the AI helicopters is near the targets. --- This is a very important aspect of BAI. --- Only ground units should be considered as friendlies and would convert a task in CAS if near the enemy. - --- Declare the Command Center -local HQ = GROUP - :FindByName( "HQ", "Bravo HQ" ) - -local CommandCenter = COMMANDCENTER - :New( HQ, "Lima" ) -- Create the CommandCenter. - --- Declare the Mission for the Command Center. -local Mission = MISSION - :New( CommandCenter, "Overlord", "High", - "This mission demonstrates the dynamic task dispatching for Air to Ground operations. " .. - "This test is about a SEAD task, dispatched, that is split into a SEAD and BAI task, when units are moving away from the zone. " .. - "While the units are moving away, monitor if the task is correctly split into a SEAD and BAI task! " .. - "This is only applicable for AREA detections. Other detection methods won't have this dynamic.", - coalition.side.RED ) -- Create the Mission. - --- Define the RecceSet that will detect the enemy. -local RecceSet = SET_GROUP - :New() -- Create the RecceSet, which is the set of groups detecting the enemy locations. - :FilterPrefixes( "Recce" ) -- All Recce groups start with the name "Recce". - :FilterCoalitions("red") -- only the red coalition. - :FilterStart() -- Start the dynamic building of the set. - --- Setup the detection. We use DETECTION_AREAS to detect and group the enemies. -local DetectionAreas = DETECTION_AREAS - :New( RecceSet, 3000 ) -- The RecceSet will detect the enemies, and group them into areas of a 3 km radius. - --- Setup the AttackSet, which is a SET_GROUP. --- The SET_GROUP is a dynamic collection of GROUP objects. -local AttackSet = SET_GROUP - :New() -- Create the SET_GROUP object. - :FilterCoalitions( "red" ) -- Only incorporate the RED coalitions. - :FilterPrefixes( "Attack" ) -- Only incorporate groups that start with the name Attack. - :FilterStart() -- Start the dynamic building of the set. - --- Now we have everything to setup the main A2G TaskDispatcher. -TaskDispatcher = TASK_A2G_DISPATCHER - :New( Mission, AttackSet, DetectionAreas ) -- We assign the TaskDispatcher under Mission. The AttackSet will engage the enemy and will recieve the dispatched Tasks. The DetectionAreas will report any detected enemies to the TaskDispatcher. - --- We use the MISSILETRAINER for demonstration purposes. -MissileTrainer = MISSILETRAINER:New( 100, "Missiles will be destroyed for training when they reach your plane." ) +-- Name: TAD-A2G-021 - AREAS - Remain BAI as AI +-- Author: FlightControl +-- Date Created: 20 Dec 2017 +-- +-- This mission demonstrates the dynamic task dispatching for Air to Ground operations. +-- This test is about checking that if a player in the air is approaching a BAI task zone, that the task is not converted to a CAS! +-- Jump into the su-25T. The AI Helicopter Attack will fly to the detected blue targets. They won't fire at the helicopters. +-- The su-34 will detect the blue targets, but will report a BAI task, even if the AI helicopters is near the targets. +-- This is a very important aspect of BAI. +-- Only ground units should be considered as friendlies and would convert a task in CAS if near the enemy. + +-- Declare the Command Center +local HQ = GROUP + :FindByName( "HQ", "Bravo HQ" ) + +local CommandCenter = COMMANDCENTER + :New( HQ, "Lima" ) -- Create the CommandCenter. + +-- Declare the Mission for the Command Center. +local Mission = MISSION + :New( CommandCenter, "Overlord", "High", + "This mission demonstrates the dynamic task dispatching for Air to Ground operations. " .. + "This test is about a SEAD task, dispatched, that is split into a SEAD and BAI task, when units are moving away from the zone. " .. + "While the units are moving away, monitor if the task is correctly split into a SEAD and BAI task! " .. + "This is only applicable for AREA detections. Other detection methods won't have this dynamic.", + coalition.side.RED ) -- Create the Mission. + +-- Define the RecceSet that will detect the enemy. +local RecceSet = SET_GROUP + :New() -- Create the RecceSet, which is the set of groups detecting the enemy locations. + :FilterPrefixes( "Recce" ) -- All Recce groups start with the name "Recce". + :FilterCoalitions("red") -- only the red coalition. + :FilterStart() -- Start the dynamic building of the set. + +-- Setup the detection. We use DETECTION_AREAS to detect and group the enemies. +local DetectionAreas = DETECTION_AREAS + :New( RecceSet, 3000 ) -- The RecceSet will detect the enemies, and group them into areas of a 3 km radius. + +-- Setup the AttackSet, which is a SET_GROUP. +-- The SET_GROUP is a dynamic collection of GROUP objects. +local AttackSet = SET_GROUP + :New() -- Create the SET_GROUP object. + :FilterCoalitions( "red" ) -- Only incorporate the RED coalitions. + :FilterPrefixes( "Attack" ) -- Only incorporate groups that start with the name Attack. + :FilterStart() -- Start the dynamic building of the set. + +-- Now we have everything to setup the main A2G TaskDispatcher. +TaskDispatcher = TASK_A2G_DISPATCHER + :New( Mission, AttackSet, DetectionAreas ) -- We assign the TaskDispatcher under Mission. The AttackSet will engage the enemy and will recieve the dispatched Tasks. The DetectionAreas will report any detected enemies to the TaskDispatcher. + +-- We use the MISSILETRAINER for demonstration purposes. +MissileTrainer = MISSILETRAINER:New( 100, "Missiles will be destroyed for training when they reach your plane." ) diff --git a/Tasking/Task_A2G_Dispatcher/TAD-A2G-090 - AREAS - WWII - Reference Points/TAD-A2G-090 - AREAS - WWII - Reference Points.lua b/Tasking/Task_A2G_Dispatcher/TAD-A2G-090 - AREAS - WWII - Reference Points/TAD-A2G-090 - AREAS - WWII - Reference Points.lua index 11c30eeaa1..f1bfc33caa 100644 --- a/Tasking/Task_A2G_Dispatcher/TAD-A2G-090 - AREAS - WWII - Reference Points/TAD-A2G-090 - AREAS - WWII - Reference Points.lua +++ b/Tasking/Task_A2G_Dispatcher/TAD-A2G-090 - AREAS - WWII - Reference Points/TAD-A2G-090 - AREAS - WWII - Reference Points.lua @@ -1,34 +1,34 @@ --- Name: TAD-A2G-090 - AREAS - WWII - Reference Points --- Author: FlightControl --- Date Created: 17 Mar 2017 --- --- Test if the Command Center is working in WWII mode, and that it selects the closest Reference points for each target... --- Join both tasks sequentially (abort when done), and see if the reference points are selected correctly, following the closest ref point logic. --- --- 1. Join the Attack group of RED. --- 2. Wait until the blue tank is detected. --- 3. Three tasks will de defined, CAS and BAI tasks. --- 4. Join each task using the radio menus. --- 5. Observe that the correct WWII compatible reference points are shown. - -local HQ = GROUP:FindByName( "HQ", "Bravo HQ" ) - -local CommandCenter = COMMANDCENTER:New( HQ, "Bravo" ) -CommandCenter:SetModeWWII() -CommandCenter:SetReferenceZones( "Village" ) - -local Mission = MISSION - :New( CommandCenter, - "Overlord", - "Primary", - "Join each task as a result of the detected targets reported. " .. - "Observe that the correct Targets are reported from the correct reference points! " .. - "\n1. Target #001 -> Village#Dziguri" .. - "\n2. Target #002 -> Village#Horshi" .. - "\n3. Target #003 -> Village#Machkhvareti" - , coalition.side.RED ) - -local RecceSet = SET_GROUP:New():FilterPrefixes( "Recce" ):FilterCoalitions( "red" ):FilterStart() -local DetectionAreas = DETECTION_AREAS:New( RecceSet, 500 ) -local AttackGroups = SET_GROUP:New():FilterCoalitions( "red" ):FilterPrefixes( "Attack" ):FilterStart() -TaskDispatcher = TASK_A2G_DISPATCHER:New( Mission, AttackGroups, DetectionAreas ) +-- Name: TAD-A2G-090 - AREAS - WWII - Reference Points +-- Author: FlightControl +-- Date Created: 17 Mar 2017 +-- +-- Test if the Command Center is working in WWII mode, and that it selects the closest Reference points for each target... +-- Join both tasks sequentially (abort when done), and see if the reference points are selected correctly, following the closest ref point logic. +-- +-- 1. Join the Attack group of RED. +-- 2. Wait until the blue tank is detected. +-- 3. Three tasks will de defined, CAS and BAI tasks. +-- 4. Join each task using the radio menus. +-- 5. Observe that the correct WWII compatible reference points are shown. + +local HQ = GROUP:FindByName( "HQ", "Bravo HQ" ) + +local CommandCenter = COMMANDCENTER:New( HQ, "Bravo" ) +CommandCenter:SetModeWWII() +CommandCenter:SetReferenceZones( "Village" ) + +local Mission = MISSION + :New( CommandCenter, + "Overlord", + "Primary", + "Join each task as a result of the detected targets reported. " .. + "Observe that the correct Targets are reported from the correct reference points! " .. + "\n1. Target #001 -> Village#Dziguri" .. + "\n2. Target #002 -> Village#Horshi" .. + "\n3. Target #003 -> Village#Machkhvareti" + , coalition.side.RED ) + +local RecceSet = SET_GROUP:New():FilterPrefixes( "Recce" ):FilterCoalitions( "red" ):FilterStart() +local DetectionAreas = DETECTION_AREAS:New( RecceSet, 500 ) +local AttackGroups = SET_GROUP:New():FilterCoalitions( "red" ):FilterPrefixes( "Attack" ):FilterStart() +TaskDispatcher = TASK_A2G_DISPATCHER:New( Mission, AttackGroups, DetectionAreas ) diff --git a/Tasking/Task_A2G_Dispatcher/TAD-A2G-100 - TYPES - Detection Test/TAD-A2G-100 - TYPES - Detection test.lua b/Tasking/Task_A2G_Dispatcher/TAD-A2G-100 - TYPES - Detection Test/TAD-A2G-100 - TYPES - Detection test.lua index b36cd3dc9d..f3c3bb7f5d 100644 --- a/Tasking/Task_A2G_Dispatcher/TAD-A2G-100 - TYPES - Detection Test/TAD-A2G-100 - TYPES - Detection test.lua +++ b/Tasking/Task_A2G_Dispatcher/TAD-A2G-100 - TYPES - Detection Test/TAD-A2G-100 - TYPES - Detection test.lua @@ -1,51 +1,51 @@ - --- --- Name: TAD-A2G-100 - TYPES - Detection Test --- Author: FlightControl --- Date Created: 15 Mar 2018 --- --- # Situation: --- --- This mission demonstrates the dynamic task dispatching for Air to Ground operations. --- Reconnassance vehicles are placed at strategic locations, scanning for the enemy locations. --- The detection method used is the DETECTION_TYPES method, which groups detected targets into Unit Types that were detected. --- The AttackSet will engage upon the enemy, which is a Set of Groups seated by Players. --- A2G Tasks are being dispatched to the Players as enemy locations are being detected by the Recce. --- Observe that A2G Tasks are being dispatched to the player. - - --- Declare the Command Center -local HQ = GROUP - :FindByName( "HQ", "Bravo HQ" ) - -local CommandCenter = COMMANDCENTER - :New( HQ, "Lima" ) -- Create the CommandCenter. - --- Declare the Mission for the Command Center. -local Mission = MISSION - :New( CommandCenter, "Overlord", "High", "Attack Detect Mission Briefing", coalition.side.RED ) -- Create the Mission. - --- Define the RecceSet that will detect the enemy. -local RecceSet = SET_GROUP - :New() -- Create the RecceSet, which is the set of groups detecting the enemy locations. - :FilterPrefixes( "Recce" ) -- All Recce groups start with the name "Recce". - :FilterCoalitions("red") -- only the red coalition. - :FilterStart() -- Start the dynamic building of the set. - --- Setup the detection. We use DETECTION_AREAS to detect and group the enemies. -local DetectionAreas = DETECTION_TYPES - :New( RecceSet ) -- The RecceSet will detect the enemies, and group them into unit types that were detected. - --- Setup the AttackSet, which is a SET_GROUP. --- The SET_GROUP is a dynamic collection of GROUP objects. -local AttackSet = SET_GROUP - :New() -- Create the SET_GROUP object. - :FilterCoalitions( "red" ) -- Only incorporate the RED coalitions. - :FilterPrefixes( "Attack" ) -- Only incorporate groups that start with the name Attack. - :FilterStart() -- Start the dynamic building of the set. - --- Now we have everything to setup the main A2G TaskDispatcher. -TaskDispatcher = TASK_A2G_DISPATCHER - :New( Mission, AttackSet, DetectionAreas ) -- We assign the TaskDispatcher under Mission. The AttackSet will engage the enemy and will recieve the dispatched Tasks. The DetectionAreas will report any detected enemies to the TaskDispatcher. - --- We use the MISSILETRAINER for demonstration purposes. -MissileTrainer = MISSILETRAINER:New( 100, "Missiles will be destroyed for training when they reach your plane." ) + --- +-- Name: TAD-A2G-100 - TYPES - Detection Test +-- Author: FlightControl +-- Date Created: 15 Mar 2018 +-- +-- # Situation: +-- +-- This mission demonstrates the dynamic task dispatching for Air to Ground operations. +-- Reconnassance vehicles are placed at strategic locations, scanning for the enemy locations. +-- The detection method used is the DETECTION_TYPES method, which groups detected targets into Unit Types that were detected. +-- The AttackSet will engage upon the enemy, which is a Set of Groups seated by Players. +-- A2G Tasks are being dispatched to the Players as enemy locations are being detected by the Recce. +-- Observe that A2G Tasks are being dispatched to the player. + + +-- Declare the Command Center +local HQ = GROUP + :FindByName( "HQ", "Bravo HQ" ) + +local CommandCenter = COMMANDCENTER + :New( HQ, "Lima" ) -- Create the CommandCenter. + +-- Declare the Mission for the Command Center. +local Mission = MISSION + :New( CommandCenter, "Overlord", "High", "Attack Detect Mission Briefing", coalition.side.RED ) -- Create the Mission. + +-- Define the RecceSet that will detect the enemy. +local RecceSet = SET_GROUP + :New() -- Create the RecceSet, which is the set of groups detecting the enemy locations. + :FilterPrefixes( "Recce" ) -- All Recce groups start with the name "Recce". + :FilterCoalitions("red") -- only the red coalition. + :FilterStart() -- Start the dynamic building of the set. + +-- Setup the detection. We use DETECTION_AREAS to detect and group the enemies. +local DetectionAreas = DETECTION_TYPES + :New( RecceSet ) -- The RecceSet will detect the enemies, and group them into unit types that were detected. + +-- Setup the AttackSet, which is a SET_GROUP. +-- The SET_GROUP is a dynamic collection of GROUP objects. +local AttackSet = SET_GROUP + :New() -- Create the SET_GROUP object. + :FilterCoalitions( "red" ) -- Only incorporate the RED coalitions. + :FilterPrefixes( "Attack" ) -- Only incorporate groups that start with the name Attack. + :FilterStart() -- Start the dynamic building of the set. + +-- Now we have everything to setup the main A2G TaskDispatcher. +TaskDispatcher = TASK_A2G_DISPATCHER + :New( Mission, AttackSet, DetectionAreas ) -- We assign the TaskDispatcher under Mission. The AttackSet will engage the enemy and will recieve the dispatched Tasks. The DetectionAreas will report any detected enemies to the TaskDispatcher. + +-- We use the MISSILETRAINER for demonstration purposes. +MissileTrainer = MISSILETRAINER:New( 100, "Missiles will be destroyed for training when they reach your plane." ) diff --git a/Tasking/Task_A2G_Dispatcher/TAD-A2G-110 - TYPES - Detection Test/TAD-110 - A2G Task Dispatching DETECTION_TYPES.lua b/Tasking/Task_A2G_Dispatcher/TAD-A2G-110 - TYPES - Detection Test/TAD-110 - A2G Task Dispatching DETECTION_TYPES.lua index 87eb406db5..96f1c2f1bc 100644 --- a/Tasking/Task_A2G_Dispatcher/TAD-A2G-110 - TYPES - Detection Test/TAD-110 - A2G Task Dispatching DETECTION_TYPES.lua +++ b/Tasking/Task_A2G_Dispatcher/TAD-A2G-110 - TYPES - Detection Test/TAD-110 - A2G Task Dispatching DETECTION_TYPES.lua @@ -1,35 +1,35 @@ - --- --- Name: TAD-100 - A2G Task Dispatching DETECTION_AREAS --- Author: FlightControl --- Date Created: 06 Mar 2017 --- --- # Situation: --- --- This mission demonstrates the dynamic task dispatching for Air to Ground operations. --- FACA's and FAC's are patrolling around the battle zone, while detecting targets. --- The detection method used is the DETECTION_AREAS method, which groups detected targets into zones. --- --- # Test cases: --- --- 1. Observe the FAC(A)'s detecting targets and grouping them. --- For test, each zone will have a circle of tyres, that are visible on the map too. --- 2. Check that the HQ provides menus to engage on a task set by the FACs. --- -local HQ = GROUP:FindByName( "HQ", "Bravo HQ" ) - -local CommandCenter = COMMANDCENTER:New( HQ, "Lima" ) - -local Scoring = SCORING:New( "Detect Demo" ) - -local Mission = MISSION - :New( CommandCenter, "Overlord", "High", "Attack Detect Mission Briefing", coalition.side.RED ) - :AddScoring( Scoring ) - -local FACSet = SET_GROUP:New():FilterPrefixes( "FAC" ):FilterCoalitions("red"):FilterStart() - -local FACAreas = DETECTION_TYPES:New( FACSet ) - - -local AttackGroups = SET_GROUP:New():FilterCoalitions( "red" ):FilterPrefixes( "Attack" ):FilterStart() -TaskDispatcher = TASK_A2G_DISPATCHER:New( Mission, AttackGroups, FACAreas ) - + --- +-- Name: TAD-100 - A2G Task Dispatching DETECTION_AREAS +-- Author: FlightControl +-- Date Created: 06 Mar 2017 +-- +-- # Situation: +-- +-- This mission demonstrates the dynamic task dispatching for Air to Ground operations. +-- FACA's and FAC's are patrolling around the battle zone, while detecting targets. +-- The detection method used is the DETECTION_AREAS method, which groups detected targets into zones. +-- +-- # Test cases: +-- +-- 1. Observe the FAC(A)'s detecting targets and grouping them. +-- For test, each zone will have a circle of tyres, that are visible on the map too. +-- 2. Check that the HQ provides menus to engage on a task set by the FACs. +-- +local HQ = GROUP:FindByName( "HQ", "Bravo HQ" ) + +local CommandCenter = COMMANDCENTER:New( HQ, "Lima" ) + +local Scoring = SCORING:New( "Detect Demo" ) + +local Mission = MISSION + :New( CommandCenter, "Overlord", "High", "Attack Detect Mission Briefing", coalition.side.RED ) + :AddScoring( Scoring ) + +local FACSet = SET_GROUP:New():FilterPrefixes( "FAC" ):FilterCoalitions("red"):FilterStart() + +local FACAreas = DETECTION_TYPES:New( FACSet ) + + +local AttackGroups = SET_GROUP:New():FilterCoalitions( "red" ):FilterPrefixes( "Attack" ):FilterStart() +TaskDispatcher = TASK_A2G_DISPATCHER:New( Mission, AttackGroups, FACAreas ) + diff --git a/Tasking/Task_A2G_Dispatcher/TAD-A2G-120 - TYPES - Scoring/TAD-220 - A2G Task Dispatching per TYPE and SCORING.lua b/Tasking/Task_A2G_Dispatcher/TAD-A2G-120 - TYPES - Scoring/TAD-220 - A2G Task Dispatching per TYPE and SCORING.lua index bf6e824aa6..2be6e06deb 100644 --- a/Tasking/Task_A2G_Dispatcher/TAD-A2G-120 - TYPES - Scoring/TAD-220 - A2G Task Dispatching per TYPE and SCORING.lua +++ b/Tasking/Task_A2G_Dispatcher/TAD-A2G-120 - TYPES - Scoring/TAD-220 - A2G Task Dispatching per TYPE and SCORING.lua @@ -1,64 +1,64 @@ ---- --- Name: TAD-220 - A2G Task Dispatching per TYPE and SCORING --- Author: FlightControl --- Date Created: 20 Mar 2017 --- --- # Situation: --- --- This mission demonstrates the scoring of dynamic task dispatching for Air to Ground operations. --- --- # Test cases: --- --- 1. Observe the FAC(A)'s detecting targets and grouping them. --- 2. Check that the HQ provides menus to engage on a task set by the FACs. --- 3. Engage on a task and destroy a target. Check if scoring is given for that target. --- 4. Engage all targets in the task, and check if mission success is achieved and that a scoring is given. --- 5. Restart the mission, and crash into the ground, check if you can get penalties. --- -local HQ = GROUP:FindByName( "HQ", "Bravo HQ" ) - -local CommandCenter = COMMANDCENTER:New( HQ, "Lima" ) - -local Scoring = SCORING:New( "Detect Demo" ) - -local Mission = MISSION - :New( CommandCenter, "Overlord", "High", "Attack Detect Mission Briefing", coalition.side.RED ) - :AddScoring( Scoring ) - -local FACSet = SET_GROUP:New():FilterPrefixes( "FAC" ):FilterCoalitions("red"):FilterStart() - -local DetectionTypes = DETECTION_TYPES:New( FACSet ) - -local AttackGroups = SET_GROUP:New():FilterCoalitions( "red" ):FilterPrefixes( "Attack" ):FilterStart() - -TaskDispatcher = TASK_A2G_DISPATCHER:New( Mission, AttackGroups, DetectionTypes ) - ---- @param #TaskDispatcher self --- @param From --- @param Event --- @param To --- @param Tasking.Task_A2G#TASK_A2G Task --- @param Wrapper.Unit#UNIT TaskUnit --- @param #string PlayerName -function TaskDispatcher:OnAfterAssign( From, Event, To, Task, TaskUnit, PlayerName ) - self:E( "I am in assigned ... " ) - Task:SetScoreOnProgress( "Player " .. PlayerName .. " destroyed a target", 50, TaskUnit ) - Task:SetScoreOnSuccess( "The task has been successfully completed!", 200, TaskUnit ) - Task:SetScoreOnFail( "The task has failed completion!", 100, TaskUnit ) -end - --- Now this is REALLY neat. I set the goal of the mission to be the destruction of Target #004. --- This is just an example, but many more examples can follow... - --- Every time a Task becomes Successful, it will trigger the Complete event in the Mission. --- The mission designer NEED TO OVERRIDE the OnBeforeComplete to prevent the mission from getting into completion --- too early! - -function Mission:OnBeforeComplete( From, Event, To ) - local Group004 = GROUP:FindByName( "Target #004" ) - if Group004:IsAlive() == false then - Mission:GetCommandCenter():MessageToCoalition( "Mission Complete!" ) - return true - end - return false +--- +-- Name: TAD-220 - A2G Task Dispatching per TYPE and SCORING +-- Author: FlightControl +-- Date Created: 20 Mar 2017 +-- +-- # Situation: +-- +-- This mission demonstrates the scoring of dynamic task dispatching for Air to Ground operations. +-- +-- # Test cases: +-- +-- 1. Observe the FAC(A)'s detecting targets and grouping them. +-- 2. Check that the HQ provides menus to engage on a task set by the FACs. +-- 3. Engage on a task and destroy a target. Check if scoring is given for that target. +-- 4. Engage all targets in the task, and check if mission success is achieved and that a scoring is given. +-- 5. Restart the mission, and crash into the ground, check if you can get penalties. +-- +local HQ = GROUP:FindByName( "HQ", "Bravo HQ" ) + +local CommandCenter = COMMANDCENTER:New( HQ, "Lima" ) + +local Scoring = SCORING:New( "Detect Demo" ) + +local Mission = MISSION + :New( CommandCenter, "Overlord", "High", "Attack Detect Mission Briefing", coalition.side.RED ) + :AddScoring( Scoring ) + +local FACSet = SET_GROUP:New():FilterPrefixes( "FAC" ):FilterCoalitions("red"):FilterStart() + +local DetectionTypes = DETECTION_TYPES:New( FACSet ) + +local AttackGroups = SET_GROUP:New():FilterCoalitions( "red" ):FilterPrefixes( "Attack" ):FilterStart() + +TaskDispatcher = TASK_A2G_DISPATCHER:New( Mission, AttackGroups, DetectionTypes ) + +--- @param #TaskDispatcher self +-- @param From +-- @param Event +-- @param To +-- @param Tasking.Task_A2G#TASK_A2G Task +-- @param Wrapper.Unit#UNIT TaskUnit +-- @param #string PlayerName +function TaskDispatcher:OnAfterAssign( From, Event, To, Task, TaskUnit, PlayerName ) + self:E( "I am in assigned ... " ) + Task:SetScoreOnProgress( "Player " .. PlayerName .. " destroyed a target", 50, TaskUnit ) + Task:SetScoreOnSuccess( "The task has been successfully completed!", 200, TaskUnit ) + Task:SetScoreOnFail( "The task has failed completion!", 100, TaskUnit ) +end + +-- Now this is REALLY neat. I set the goal of the mission to be the destruction of Target #004. +-- This is just an example, but many more examples can follow... + +-- Every time a Task becomes Successful, it will trigger the Complete event in the Mission. +-- The mission designer NEED TO OVERRIDE the OnBeforeComplete to prevent the mission from getting into completion +-- too early! + +function Mission:OnBeforeComplete( From, Event, To ) + local Group004 = GROUP:FindByName( "Target #004" ) + if Group004:IsAlive() == false then + Mission:GetCommandCenter():MessageToCoalition( "Mission Complete!" ) + return true + end + return false end \ No newline at end of file diff --git a/Tasking/Task_A2G_Dispatcher/TAD-A2G-200 - UNITS - Detection Test/TAD-A2G-200 - UNITS - Detection Test.lua b/Tasking/Task_A2G_Dispatcher/TAD-A2G-200 - UNITS - Detection Test/TAD-A2G-200 - UNITS - Detection Test.lua index cb710ab67e..8cbb0ff460 100644 --- a/Tasking/Task_A2G_Dispatcher/TAD-A2G-200 - UNITS - Detection Test/TAD-A2G-200 - UNITS - Detection Test.lua +++ b/Tasking/Task_A2G_Dispatcher/TAD-A2G-200 - UNITS - Detection Test/TAD-A2G-200 - UNITS - Detection Test.lua @@ -1,51 +1,51 @@ - --- --- Name: TAD-A2G-200 - UNITS - Detection Test --- Author: FlightControl --- Date Created: 15 Mar 2018 --- --- # Situation: --- --- This mission demonstrates the dynamic task dispatching for Air to Ground operations. --- Reconnassance vehicles are placed at strategic locations, scanning for the enemy locations. --- The detection method used is the DETECTION_UNITS method, which groups detected targets per detected unit. --- The AttackSet will engage upon the enemy, which is a Set of Groups seated by Players. --- A2G Tasks are being dispatched to the Players as enemy locations are being detected by the Recce. --- Observe that A2G Tasks are being dispatched to the player. - - --- Declare the Command Center -local HQ = GROUP - :FindByName( "HQ", "Bravo HQ" ) - -local CommandCenter = COMMANDCENTER - :New( HQ, "Lima" ) -- Create the CommandCenter. - --- Declare the Mission for the Command Center. -local Mission = MISSION - :New( CommandCenter, "Overlord", "High", "Attack Detect Mission Briefing", coalition.side.RED ) -- Create the Mission. - --- Define the RecceSet that will detect the enemy. -local RecceSet = SET_GROUP - :New() -- Create the RecceSet, which is the set of groups detecting the enemy locations. - :FilterPrefixes( "Recce" ) -- All Recce groups start with the name "Recce". - :FilterCoalitions("red") -- only the red coalition. - :FilterStart() -- Start the dynamic building of the set. - --- Setup the detection. We use DETECTION_AREAS to detect and group the enemies. -local DetectionAreas = DETECTION_UNITS - :New( RecceSet ) -- The RecceSet will detect the enemies, and group them per detected unit. - --- Setup the AttackSet, which is a SET_GROUP. --- The SET_GROUP is a dynamic collection of GROUP objects. -local AttackSet = SET_GROUP - :New() -- Create the SET_GROUP object. - :FilterCoalitions( "red" ) -- Only incorporate the RED coalitions. - :FilterPrefixes( "Attack" ) -- Only incorporate groups that start with the name Attack. - :FilterStart() -- Start the dynamic building of the set. - --- Now we have everything to setup the main A2G TaskDispatcher. -TaskDispatcher = TASK_A2G_DISPATCHER - :New( Mission, AttackSet, DetectionAreas ) -- We assign the TaskDispatcher under Mission. The AttackSet will engage the enemy and will recieve the dispatched Tasks. The DetectionAreas will report any detected enemies to the TaskDispatcher. - --- We use the MISSILETRAINER for demonstration purposes. -MissileTrainer = MISSILETRAINER:New( 100, "Missiles will be destroyed for training when they reach your plane." ) + --- +-- Name: TAD-A2G-200 - UNITS - Detection Test +-- Author: FlightControl +-- Date Created: 15 Mar 2018 +-- +-- # Situation: +-- +-- This mission demonstrates the dynamic task dispatching for Air to Ground operations. +-- Reconnassance vehicles are placed at strategic locations, scanning for the enemy locations. +-- The detection method used is the DETECTION_UNITS method, which groups detected targets per detected unit. +-- The AttackSet will engage upon the enemy, which is a Set of Groups seated by Players. +-- A2G Tasks are being dispatched to the Players as enemy locations are being detected by the Recce. +-- Observe that A2G Tasks are being dispatched to the player. + + +-- Declare the Command Center +local HQ = GROUP + :FindByName( "HQ", "Bravo HQ" ) + +local CommandCenter = COMMANDCENTER + :New( HQ, "Lima" ) -- Create the CommandCenter. + +-- Declare the Mission for the Command Center. +local Mission = MISSION + :New( CommandCenter, "Overlord", "High", "Attack Detect Mission Briefing", coalition.side.RED ) -- Create the Mission. + +-- Define the RecceSet that will detect the enemy. +local RecceSet = SET_GROUP + :New() -- Create the RecceSet, which is the set of groups detecting the enemy locations. + :FilterPrefixes( "Recce" ) -- All Recce groups start with the name "Recce". + :FilterCoalitions("red") -- only the red coalition. + :FilterStart() -- Start the dynamic building of the set. + +-- Setup the detection. We use DETECTION_AREAS to detect and group the enemies. +local DetectionAreas = DETECTION_UNITS + :New( RecceSet ) -- The RecceSet will detect the enemies, and group them per detected unit. + +-- Setup the AttackSet, which is a SET_GROUP. +-- The SET_GROUP is a dynamic collection of GROUP objects. +local AttackSet = SET_GROUP + :New() -- Create the SET_GROUP object. + :FilterCoalitions( "red" ) -- Only incorporate the RED coalitions. + :FilterPrefixes( "Attack" ) -- Only incorporate groups that start with the name Attack. + :FilterStart() -- Start the dynamic building of the set. + +-- Now we have everything to setup the main A2G TaskDispatcher. +TaskDispatcher = TASK_A2G_DISPATCHER + :New( Mission, AttackSet, DetectionAreas ) -- We assign the TaskDispatcher under Mission. The AttackSet will engage the enemy and will recieve the dispatched Tasks. The DetectionAreas will report any detected enemies to the TaskDispatcher. + +-- We use the MISSILETRAINER for demonstration purposes. +MissileTrainer = MISSILETRAINER:New( 100, "Missiles will be destroyed for training when they reach your plane." ) diff --git a/Tasking/Task_A2G_Dispatcher/TAD-A2G-210 - UNITS - Detection Test/TAD-120 - A2G Task Dispatching DETECTION_UNITS.lua b/Tasking/Task_A2G_Dispatcher/TAD-A2G-210 - UNITS - Detection Test/TAD-120 - A2G Task Dispatching DETECTION_UNITS.lua index 0583165a13..6049e078f5 100644 --- a/Tasking/Task_A2G_Dispatcher/TAD-A2G-210 - UNITS - Detection Test/TAD-120 - A2G Task Dispatching DETECTION_UNITS.lua +++ b/Tasking/Task_A2G_Dispatcher/TAD-A2G-210 - UNITS - Detection Test/TAD-120 - A2G Task Dispatching DETECTION_UNITS.lua @@ -1,50 +1,50 @@ ---- --- Name: TAD-120 - A2G Task Dispatching DETECTION_UNITS --- Author: FlightControl --- Date Created: 13 Mar 2017 --- --- # Situation: --- --- This mission demonstrates the dynamic task dispatching for Air to Ground operations. --- FACA's and FAC's are patrolling around the battle field, while detecting targets. --- The detection method used is the DETECTION_UNITS method, which groups detected targets per detected unit. --- --- # Test cases: --- --- 1. Observe the FAC(A)'s detecting targets and grouping them. --- 2. Check that the HQ provides menus to engage on a task set by the FACs. --- -local HQ = GROUP:FindByName( "HQ", "Bravo HQ" ) - -local CommandCenter = COMMANDCENTER:New( HQ, "Lima" ) - -local Scoring = SCORING:New( "Detect Demo" ) - -local Mission = MISSION - :New( CommandCenter, "Overlord", "High", "Attack Detect Mission Briefing", coalition.side.RED ) - :AddScoring( Scoring ) - -local FACSet = SET_GROUP:New():FilterPrefixes( "FAC" ):FilterCoalitions("red"):FilterStart() - -local FACAreas = DETECTION_UNITS:New( FACSet ) - - -local AttackGroups = SET_GROUP:New():FilterCoalitions( "red" ):FilterPrefixes( "Attack" ):FilterStart() - -TaskDispatcher = TASK_A2G_DISPATCHER:New( Mission, AttackGroups, FACAreas ) - --- Now this is REALLY neat. I set the goal of the mission to be the destruction of Target #004. --- This is just an example, but many more examples can follow... - --- Every time a Task becomes Successful, it will trigger the Complete event in the Mission. --- The mission designer NEED TO OVERRIDE the OnBeforeComplete to prevent the mission from getting into completion --- too early! - -function Mission:OnBeforeComplete( From, Event, To ) - local Group004 = GROUP:FindByName( "Target #004" ) - if Group004:IsAlive() == false then - Mission:GetCommandCenter():MessageToCoalition( "Mission Complete!" ) - return true - end - return false +--- +-- Name: TAD-120 - A2G Task Dispatching DETECTION_UNITS +-- Author: FlightControl +-- Date Created: 13 Mar 2017 +-- +-- # Situation: +-- +-- This mission demonstrates the dynamic task dispatching for Air to Ground operations. +-- FACA's and FAC's are patrolling around the battle field, while detecting targets. +-- The detection method used is the DETECTION_UNITS method, which groups detected targets per detected unit. +-- +-- # Test cases: +-- +-- 1. Observe the FAC(A)'s detecting targets and grouping them. +-- 2. Check that the HQ provides menus to engage on a task set by the FACs. +-- +local HQ = GROUP:FindByName( "HQ", "Bravo HQ" ) + +local CommandCenter = COMMANDCENTER:New( HQ, "Lima" ) + +local Scoring = SCORING:New( "Detect Demo" ) + +local Mission = MISSION + :New( CommandCenter, "Overlord", "High", "Attack Detect Mission Briefing", coalition.side.RED ) + :AddScoring( Scoring ) + +local FACSet = SET_GROUP:New():FilterPrefixes( "FAC" ):FilterCoalitions("red"):FilterStart() + +local FACAreas = DETECTION_UNITS:New( FACSet ) + + +local AttackGroups = SET_GROUP:New():FilterCoalitions( "red" ):FilterPrefixes( "Attack" ):FilterStart() + +TaskDispatcher = TASK_A2G_DISPATCHER:New( Mission, AttackGroups, FACAreas ) + +-- Now this is REALLY neat. I set the goal of the mission to be the destruction of Target #004. +-- This is just an example, but many more examples can follow... + +-- Every time a Task becomes Successful, it will trigger the Complete event in the Mission. +-- The mission designer NEED TO OVERRIDE the OnBeforeComplete to prevent the mission from getting into completion +-- too early! + +function Mission:OnBeforeComplete( From, Event, To ) + local Group004 = GROUP:FindByName( "Target #004" ) + if Group004:IsAlive() == false then + Mission:GetCommandCenter():MessageToCoalition( "Mission Complete!" ) + return true + end + return false end \ No newline at end of file diff --git a/Tasking/Task_A2G_Dispatcher/TAD-A2G-220 - UNITS - Scoring/TAD-200 - A2G Task Dispatching with SCORING.lua b/Tasking/Task_A2G_Dispatcher/TAD-A2G-220 - UNITS - Scoring/TAD-200 - A2G Task Dispatching with SCORING.lua index 157f8b6540..b29d3e07f6 100644 --- a/Tasking/Task_A2G_Dispatcher/TAD-A2G-220 - UNITS - Scoring/TAD-200 - A2G Task Dispatching with SCORING.lua +++ b/Tasking/Task_A2G_Dispatcher/TAD-A2G-220 - UNITS - Scoring/TAD-200 - A2G Task Dispatching with SCORING.lua @@ -1,64 +1,64 @@ ---- --- Name: TAD-200 - A2G Task Dispatching with SCORING --- Author: FlightControl --- Date Created: 19 Mar 2017 --- --- # Situation: --- --- This mission demonstrates the scoring of dynamic task dispatching for Air to Ground operations. --- --- # Test cases: --- --- 1. Observe the FAC(A)'s detecting targets and grouping them. --- 2. Check that the HQ provides menus to engage on a task set by the FACs. --- 3. Engage on a task and destroy a target. Check if scoring is given for that target. --- 4. Engage all targets in the task, and check if mission success is achieved and that a scoring is given. --- 5. Restart the mission, and crash into the ground, check if you can get penalties. --- -local HQ = GROUP:FindByName( "HQ", "Bravo HQ" ) - -local CommandCenter = COMMANDCENTER:New( HQ, "Lima" ) - -local Scoring = SCORING:New( "Detect Demo" ) - -local Mission = MISSION - :New( CommandCenter, "Overlord", "High", "Attack Detect Mission Briefing", coalition.side.RED ) - :AddScoring( Scoring ) - -local FACSet = SET_GROUP:New():FilterPrefixes( "FAC" ):FilterCoalitions("red"):FilterStart() - -local FACAreas = DETECTION_UNITS:New( FACSet ) - - -local AttackGroups = SET_GROUP:New():FilterCoalitions( "red" ):FilterPrefixes( "Attack" ):FilterStart() - -TaskDispatcher = TASK_A2G_DISPATCHER:New( Mission, AttackGroups, FACAreas ) - ---- @param #TaskDispatcher self --- @param From --- @param Event --- @param To --- @param Tasking.Task_A2G#TASK_A2G Task --- @param Wrapper.Unit#UNIT TaskUnit --- @param #string PlayerName -function TaskDispatcher:OnAfterAssign( From, Event, To, Task, TaskUnit, PlayerName ) - Task:SetScoreOnProgress( "Player " .. PlayerName .. " destroyed a target", 20, TaskUnit ) - Task:SetScoreOnSuccess( "The task has been successfully completed!", 200, TaskUnit ) - Task:SetScoreOnFail( "The task has failed completion!", -100, TaskUnit ) -end - --- Now this is REALLY neat. I set the goal of the mission to be the destruction of Target #004. --- This is just an example, but many more examples can follow... - --- Every time a Task becomes Successful, it will trigger the Complete event in the Mission. --- The mission designer NEED TO OVERRIDE the OnBeforeComplete to prevent the mission from getting into completion --- too early! - -function Mission:OnBeforeComplete( From, Event, To ) - local Group004 = GROUP:FindByName( "Target #004" ) - if Group004:IsAlive() == false then - Mission:GetCommandCenter():MessageToCoalition( "Mission Complete!" ) - return true - end - return false +--- +-- Name: TAD-200 - A2G Task Dispatching with SCORING +-- Author: FlightControl +-- Date Created: 19 Mar 2017 +-- +-- # Situation: +-- +-- This mission demonstrates the scoring of dynamic task dispatching for Air to Ground operations. +-- +-- # Test cases: +-- +-- 1. Observe the FAC(A)'s detecting targets and grouping them. +-- 2. Check that the HQ provides menus to engage on a task set by the FACs. +-- 3. Engage on a task and destroy a target. Check if scoring is given for that target. +-- 4. Engage all targets in the task, and check if mission success is achieved and that a scoring is given. +-- 5. Restart the mission, and crash into the ground, check if you can get penalties. +-- +local HQ = GROUP:FindByName( "HQ", "Bravo HQ" ) + +local CommandCenter = COMMANDCENTER:New( HQ, "Lima" ) + +local Scoring = SCORING:New( "Detect Demo" ) + +local Mission = MISSION + :New( CommandCenter, "Overlord", "High", "Attack Detect Mission Briefing", coalition.side.RED ) + :AddScoring( Scoring ) + +local FACSet = SET_GROUP:New():FilterPrefixes( "FAC" ):FilterCoalitions("red"):FilterStart() + +local FACAreas = DETECTION_UNITS:New( FACSet ) + + +local AttackGroups = SET_GROUP:New():FilterCoalitions( "red" ):FilterPrefixes( "Attack" ):FilterStart() + +TaskDispatcher = TASK_A2G_DISPATCHER:New( Mission, AttackGroups, FACAreas ) + +--- @param #TaskDispatcher self +-- @param From +-- @param Event +-- @param To +-- @param Tasking.Task_A2G#TASK_A2G Task +-- @param Wrapper.Unit#UNIT TaskUnit +-- @param #string PlayerName +function TaskDispatcher:OnAfterAssign( From, Event, To, Task, TaskUnit, PlayerName ) + Task:SetScoreOnProgress( "Player " .. PlayerName .. " destroyed a target", 20, TaskUnit ) + Task:SetScoreOnSuccess( "The task has been successfully completed!", 200, TaskUnit ) + Task:SetScoreOnFail( "The task has failed completion!", -100, TaskUnit ) +end + +-- Now this is REALLY neat. I set the goal of the mission to be the destruction of Target #004. +-- This is just an example, but many more examples can follow... + +-- Every time a Task becomes Successful, it will trigger the Complete event in the Mission. +-- The mission designer NEED TO OVERRIDE the OnBeforeComplete to prevent the mission from getting into completion +-- too early! + +function Mission:OnBeforeComplete( From, Event, To ) + local Group004 = GROUP:FindByName( "Target #004" ) + if Group004:IsAlive() == false then + Mission:GetCommandCenter():MessageToCoalition( "Mission Complete!" ) + return true + end + return false end \ No newline at end of file diff --git a/Tasking/Task_A2G_Dispatcher/TAD-A2G-320 - AREAS - Scoring/TAD-210 - A2G Task Dispatching #1 for AREAS and SCORING.lua b/Tasking/Task_A2G_Dispatcher/TAD-A2G-320 - AREAS - Scoring/TAD-210 - A2G Task Dispatching #1 for AREAS and SCORING.lua index bda9ccf602..74af4620db 100644 --- a/Tasking/Task_A2G_Dispatcher/TAD-A2G-320 - AREAS - Scoring/TAD-210 - A2G Task Dispatching #1 for AREAS and SCORING.lua +++ b/Tasking/Task_A2G_Dispatcher/TAD-A2G-320 - AREAS - Scoring/TAD-210 - A2G Task Dispatching #1 for AREAS and SCORING.lua @@ -1,65 +1,65 @@ ---- --- Name: TAD-210 - A2G Task Dispatching #1 for AREAS and SCORING --- Author: FlightControl --- Date Created: 19 Mar 2017 --- --- # Situation: --- --- This mission demonstrates the scoring of dynamic task dispatching for Air to Ground operations. --- --- # Test cases: --- --- 1. Observe the FAC(A)'s detecting targets and grouping them. --- 2. Check that the HQ provides menus to engage on a task set by the FACs. --- 3. Engage on a task and destroy a target. Check if scoring is given for that target. --- 4. Engage all targets in the task, and check if mission success is achieved and that a scoring is given. --- 5. Restart the mission, and crash into the ground, check if you can get penalties. --- -local HQ = GROUP:FindByName( "HQ", "Bravo HQ" ) - -local CommandCenter = COMMANDCENTER:New( HQ, "Lima" ) - -local Scoring = SCORING:New( "Detect Demo" ) - -local Mission = MISSION - :New( CommandCenter, "Overlord", "High", "Attack Detect Mission Briefing", coalition.side.RED ) - :AddScoring( Scoring ) - -local FACSet = SET_GROUP:New():FilterPrefixes( "FAC" ):FilterCoalitions("red"):FilterStart() - -local FACAreas = DETECTION_AREAS:New( FACSet, 400 ) -FACAreas:BoundDetectedZones() - - -local AttackGroups = SET_GROUP:New():FilterCoalitions( "red" ):FilterPrefixes( "Attack" ):FilterStart() - -TaskDispatcher = TASK_A2G_DISPATCHER:New( Mission, AttackGroups, FACAreas ) - ---- @param #TaskDispatcher self --- @param From --- @param Event --- @param To --- @param Tasking.Task_A2G#TASK_A2G Task --- @param Wrapper.Unit#UNIT TaskUnit --- @param #string PlayerName -function TaskDispatcher:OnAfterAssign( From, Event, To, Task, TaskUnit, PlayerName ) - Task:SetScoreOnDestroy( "Player " .. PlayerName .. " destroyed a target", 20, TaskUnit ) - Task:SetScoreOnSuccess( "The task has been successfully completed!", 200, TaskUnit ) - Task:SetPenaltyOnFailed( "The task has failed completion!", -100, TaskUnit ) -end - --- Now this is REALLY neat. I set the goal of the mission to be the destruction of Target #004. --- This is just an example, but many more examples can follow... - --- Every time a Task becomes Successful, it will trigger the Complete event in the Mission. --- The mission designer NEED TO OVERRIDE the OnBeforeComplete to prevent the mission from getting into completion --- too early! - -function Mission:OnBeforeComplete( From, Event, To ) - local Group004 = GROUP:FindByName( "Target #004" ) - if Group004:IsAlive() == false then - Mission:GetCommandCenter():MessageToCoalition( "Mission Complete!" ) - return true - end - return false +--- +-- Name: TAD-210 - A2G Task Dispatching #1 for AREAS and SCORING +-- Author: FlightControl +-- Date Created: 19 Mar 2017 +-- +-- # Situation: +-- +-- This mission demonstrates the scoring of dynamic task dispatching for Air to Ground operations. +-- +-- # Test cases: +-- +-- 1. Observe the FAC(A)'s detecting targets and grouping them. +-- 2. Check that the HQ provides menus to engage on a task set by the FACs. +-- 3. Engage on a task and destroy a target. Check if scoring is given for that target. +-- 4. Engage all targets in the task, and check if mission success is achieved and that a scoring is given. +-- 5. Restart the mission, and crash into the ground, check if you can get penalties. +-- +local HQ = GROUP:FindByName( "HQ", "Bravo HQ" ) + +local CommandCenter = COMMANDCENTER:New( HQ, "Lima" ) + +local Scoring = SCORING:New( "Detect Demo" ) + +local Mission = MISSION + :New( CommandCenter, "Overlord", "High", "Attack Detect Mission Briefing", coalition.side.RED ) + :AddScoring( Scoring ) + +local FACSet = SET_GROUP:New():FilterPrefixes( "FAC" ):FilterCoalitions("red"):FilterStart() + +local FACAreas = DETECTION_AREAS:New( FACSet, 400 ) +FACAreas:BoundDetectedZones() + + +local AttackGroups = SET_GROUP:New():FilterCoalitions( "red" ):FilterPrefixes( "Attack" ):FilterStart() + +TaskDispatcher = TASK_A2G_DISPATCHER:New( Mission, AttackGroups, FACAreas ) + +--- @param #TaskDispatcher self +-- @param From +-- @param Event +-- @param To +-- @param Tasking.Task_A2G#TASK_A2G Task +-- @param Wrapper.Unit#UNIT TaskUnit +-- @param #string PlayerName +function TaskDispatcher:OnAfterAssign( From, Event, To, Task, TaskUnit, PlayerName ) + Task:SetScoreOnDestroy( "Player " .. PlayerName .. " destroyed a target", 20, TaskUnit ) + Task:SetScoreOnSuccess( "The task has been successfully completed!", 200, TaskUnit ) + Task:SetPenaltyOnFailed( "The task has failed completion!", -100, TaskUnit ) +end + +-- Now this is REALLY neat. I set the goal of the mission to be the destruction of Target #004. +-- This is just an example, but many more examples can follow... + +-- Every time a Task becomes Successful, it will trigger the Complete event in the Mission. +-- The mission designer NEED TO OVERRIDE the OnBeforeComplete to prevent the mission from getting into completion +-- too early! + +function Mission:OnBeforeComplete( From, Event, To ) + local Group004 = GROUP:FindByName( "Target #004" ) + if Group004:IsAlive() == false then + Mission:GetCommandCenter():MessageToCoalition( "Mission Complete!" ) + return true + end + return false end \ No newline at end of file diff --git a/Tasking/Task_A2G_Dispatcher/TAD-A2G-320 - AREAS - Scoring/TAD-210 - A2G Task Dispatching per AREAS and SCORING.lua b/Tasking/Task_A2G_Dispatcher/TAD-A2G-320 - AREAS - Scoring/TAD-210 - A2G Task Dispatching per AREAS and SCORING.lua index edd47b76a7..f0f5fa30b3 100644 --- a/Tasking/Task_A2G_Dispatcher/TAD-A2G-320 - AREAS - Scoring/TAD-210 - A2G Task Dispatching per AREAS and SCORING.lua +++ b/Tasking/Task_A2G_Dispatcher/TAD-A2G-320 - AREAS - Scoring/TAD-210 - A2G Task Dispatching per AREAS and SCORING.lua @@ -1,65 +1,65 @@ ---- --- Name: TAD-210 - A2G Task Dispatching for AREAS and SCORING --- Author: FlightControl --- Date Created: 19 Mar 2017 --- --- # Situation: --- --- This mission demonstrates the scoring of dynamic task dispatching for Air to Ground operations. --- --- # Test cases: --- --- 1. Observe the FAC(A)'s detecting targets and grouping them. --- 2. Check that the HQ provides menus to engage on a task set by the FACs. --- 3. Engage on a task and destroy a target. Check if scoring is given for that target. --- 4. Engage all targets in the task, and check if mission success is achieved and that a scoring is given. --- 5. Restart the mission, and crash into the ground, check if you can get penalties. --- -local HQ = GROUP:FindByName( "HQ", "Bravo HQ" ) - -local CommandCenter = COMMANDCENTER:New( HQ, "Lima" ) - -local Scoring = SCORING:New( "Detect Demo" ) - -local Mission = MISSION - :New( CommandCenter, "Overlord", "High", "Attack Detect Mission Briefing", coalition.side.RED ) - :AddScoring( Scoring ) - -local FACSet = SET_GROUP:New():FilterPrefixes( "FAC" ):FilterCoalitions("red"):FilterStart() - -local FACAreas = DETECTION_AREAS:New( FACSet, 400 ) -FACAreas:BoundDetectedZones() - - -local AttackGroups = SET_GROUP:New():FilterCoalitions( "red" ):FilterPrefixes( "Attack" ):FilterStart() - -TaskDispatcher = TASK_A2G_DISPATCHER:New( Mission, AttackGroups, FACAreas ) - ---- @param #TaskDispatcher self --- @param From --- @param Event --- @param To --- @param Tasking.Task_A2G#TASK_A2G Task --- @param Wrapper.Unit#UNIT TaskUnit --- @param #string PlayerName -function TaskDispatcher:OnAfterAssign( From, Event, To, Task, TaskUnit, PlayerName ) - Task:SetScoreOnProgress( "Player " .. PlayerName .. " destroyed a target", 20, TaskUnit ) - Task:SetScoreOnSuccess( "The task has been successfully completed!", 200, TaskUnit ) - Task:SetScoreOnFail( "The task has failed completion!", -100, TaskUnit ) -end - --- Now this is REALLY neat. I set the goal of the mission to be the destruction of Target #004. --- This is just an example, but many more examples can follow... - --- Every time a Task becomes Successful, it will trigger the Complete event in the Mission. --- The mission designer NEED TO OVERRIDE the OnBeforeComplete to prevent the mission from getting into completion --- too early! - -function Mission:OnBeforeComplete( From, Event, To ) - local Group004 = GROUP:FindByName( "Target #004" ) - if Group004:IsAlive() == false then - Mission:GetCommandCenter():MessageToCoalition( "Mission Complete!" ) - return true - end - return false +--- +-- Name: TAD-210 - A2G Task Dispatching for AREAS and SCORING +-- Author: FlightControl +-- Date Created: 19 Mar 2017 +-- +-- # Situation: +-- +-- This mission demonstrates the scoring of dynamic task dispatching for Air to Ground operations. +-- +-- # Test cases: +-- +-- 1. Observe the FAC(A)'s detecting targets and grouping them. +-- 2. Check that the HQ provides menus to engage on a task set by the FACs. +-- 3. Engage on a task and destroy a target. Check if scoring is given for that target. +-- 4. Engage all targets in the task, and check if mission success is achieved and that a scoring is given. +-- 5. Restart the mission, and crash into the ground, check if you can get penalties. +-- +local HQ = GROUP:FindByName( "HQ", "Bravo HQ" ) + +local CommandCenter = COMMANDCENTER:New( HQ, "Lima" ) + +local Scoring = SCORING:New( "Detect Demo" ) + +local Mission = MISSION + :New( CommandCenter, "Overlord", "High", "Attack Detect Mission Briefing", coalition.side.RED ) + :AddScoring( Scoring ) + +local FACSet = SET_GROUP:New():FilterPrefixes( "FAC" ):FilterCoalitions("red"):FilterStart() + +local FACAreas = DETECTION_AREAS:New( FACSet, 400 ) +FACAreas:BoundDetectedZones() + + +local AttackGroups = SET_GROUP:New():FilterCoalitions( "red" ):FilterPrefixes( "Attack" ):FilterStart() + +TaskDispatcher = TASK_A2G_DISPATCHER:New( Mission, AttackGroups, FACAreas ) + +--- @param #TaskDispatcher self +-- @param From +-- @param Event +-- @param To +-- @param Tasking.Task_A2G#TASK_A2G Task +-- @param Wrapper.Unit#UNIT TaskUnit +-- @param #string PlayerName +function TaskDispatcher:OnAfterAssign( From, Event, To, Task, TaskUnit, PlayerName ) + Task:SetScoreOnProgress( "Player " .. PlayerName .. " destroyed a target", 20, TaskUnit ) + Task:SetScoreOnSuccess( "The task has been successfully completed!", 200, TaskUnit ) + Task:SetScoreOnFail( "The task has failed completion!", -100, TaskUnit ) +end + +-- Now this is REALLY neat. I set the goal of the mission to be the destruction of Target #004. +-- This is just an example, but many more examples can follow... + +-- Every time a Task becomes Successful, it will trigger the Complete event in the Mission. +-- The mission designer NEED TO OVERRIDE the OnBeforeComplete to prevent the mission from getting into completion +-- too early! + +function Mission:OnBeforeComplete( From, Event, To ) + local Group004 = GROUP:FindByName( "Target #004" ) + if Group004:IsAlive() == false then + Mission:GetCommandCenter():MessageToCoalition( "Mission Complete!" ) + return true + end + return false end \ No newline at end of file diff --git a/Tasking/Task_A2G_Dispatcher/TAD-A2G-601 - ZONES - Destroy/TAD-A2G-001 - AREAS - Destroy Test.lua b/Tasking/Task_A2G_Dispatcher/TAD-A2G-601 - ZONES - Destroy/TAD-A2G-001 - AREAS - Destroy Test.lua index aea23069d0..e727a85123 100644 --- a/Tasking/Task_A2G_Dispatcher/TAD-A2G-601 - ZONES - Destroy/TAD-A2G-001 - AREAS - Destroy Test.lua +++ b/Tasking/Task_A2G_Dispatcher/TAD-A2G-601 - ZONES - Destroy/TAD-A2G-001 - AREAS - Destroy Test.lua @@ -1,52 +1,52 @@ - --- --- Name: TAD-A2G-001 - AREAS - Destroy Test --- Author: FlightControl --- Date Created: 15 Mar 2018 --- --- This mission demonstrates the dynamic task dispatching for Air to Ground operations. --- Reconnassance vehicles are placed at strategic locations, scanning for the enemy locations. --- The detection method used is the DETECTION_AREAS method, which groups detected targets into areas. --- The AttackSet will engage upon the enemy, which is a Set of Groups seated by Players. --- A2G Tasks are being dispatched to the Players as enemy locations are being detected by the Recce. --- Observe that A2G Tasks are being dispatched to the player. --- Get seated in the Attack Plane, there is also an AI with you, who will attack the ground targets. --- Join the A2G Task that was dispatched to you. --- Once the AI in your group destroys the target, you should see that the A2G task got success. - - --- Declare the Command Center -local HQ = GROUP - :FindByName( "HQ", "Bravo HQ" ) - -local CommandCenter = COMMANDCENTER - :New( HQ, "Lima" ) -- Create the CommandCenter. - --- Declare the Mission for the Command Center. -local Mission = MISSION - :New( CommandCenter, "Overlord", "High", "Attack Detect Mission Briefing", coalition.side.RED ) -- Create the Mission. - --- Define the RecceSet that will detect the enemy. -local RecceSet = SET_GROUP - :New() -- Create the RecceSet, which is the set of groups detecting the enemy locations. - :FilterPrefixes( "Recce" ) -- All Recce groups start with the name "Recce". - :FilterCoalitions("red") -- only the red coalition. - :FilterStart() -- Start the dynamic building of the set. - --- Setup the detection. We use DETECTION_AREAS to detect and group the enemies. -local DetectionAreas = DETECTION_AREAS - :New( RecceSet, 3000 ) -- The RecceSet will detect the enemies, and group them into areas of a 3 km radius. - --- Setup the AttackSet, which is a SET_GROUP. --- The SET_GROUP is a dynamic collection of GROUP objects. -local AttackSet = SET_GROUP - :New() -- Create the SET_GROUP object. - :FilterCoalitions( "red" ) -- Only incorporate the RED coalitions. - :FilterPrefixes( "Attack" ) -- Only incorporate groups that start with the name Attack. - :FilterStart() -- Start the dynamic building of the set. - --- Now we have everything to setup the main A2G TaskDispatcher. -TaskDispatcher = TASK_A2G_DISPATCHER - :New( Mission, AttackSet, DetectionAreas ) -- We assign the TaskDispatcher under Mission. The AttackSet will engage the enemy and will recieve the dispatched Tasks. The DetectionAreas will report any detected enemies to the TaskDispatcher. - --- We use the MISSILETRAINER for demonstration purposes. -MissileTrainer = MISSILETRAINER:New( 100, "Missiles will be destroyed for training when they reach your plane." ) + --- +-- Name: TAD-A2G-001 - AREAS - Destroy Test +-- Author: FlightControl +-- Date Created: 15 Mar 2018 +-- +-- This mission demonstrates the dynamic task dispatching for Air to Ground operations. +-- Reconnassance vehicles are placed at strategic locations, scanning for the enemy locations. +-- The detection method used is the DETECTION_AREAS method, which groups detected targets into areas. +-- The AttackSet will engage upon the enemy, which is a Set of Groups seated by Players. +-- A2G Tasks are being dispatched to the Players as enemy locations are being detected by the Recce. +-- Observe that A2G Tasks are being dispatched to the player. +-- Get seated in the Attack Plane, there is also an AI with you, who will attack the ground targets. +-- Join the A2G Task that was dispatched to you. +-- Once the AI in your group destroys the target, you should see that the A2G task got success. + + +-- Declare the Command Center +local HQ = GROUP + :FindByName( "HQ", "Bravo HQ" ) + +local CommandCenter = COMMANDCENTER + :New( HQ, "Lima" ) -- Create the CommandCenter. + +-- Declare the Mission for the Command Center. +local Mission = MISSION + :New( CommandCenter, "Overlord", "High", "Attack Detect Mission Briefing", coalition.side.RED ) -- Create the Mission. + +-- Define the RecceSet that will detect the enemy. +local RecceSet = SET_GROUP + :New() -- Create the RecceSet, which is the set of groups detecting the enemy locations. + :FilterPrefixes( "Recce" ) -- All Recce groups start with the name "Recce". + :FilterCoalitions("red") -- only the red coalition. + :FilterStart() -- Start the dynamic building of the set. + +-- Setup the detection. We use DETECTION_AREAS to detect and group the enemies. +local DetectionAreas = DETECTION_AREAS + :New( RecceSet, 3000 ) -- The RecceSet will detect the enemies, and group them into areas of a 3 km radius. + +-- Setup the AttackSet, which is a SET_GROUP. +-- The SET_GROUP is a dynamic collection of GROUP objects. +local AttackSet = SET_GROUP + :New() -- Create the SET_GROUP object. + :FilterCoalitions( "red" ) -- Only incorporate the RED coalitions. + :FilterPrefixes( "Attack" ) -- Only incorporate groups that start with the name Attack. + :FilterStart() -- Start the dynamic building of the set. + +-- Now we have everything to setup the main A2G TaskDispatcher. +TaskDispatcher = TASK_A2G_DISPATCHER + :New( Mission, AttackSet, DetectionAreas ) -- We assign the TaskDispatcher under Mission. The AttackSet will engage the enemy and will recieve the dispatched Tasks. The DetectionAreas will report any detected enemies to the TaskDispatcher. + +-- We use the MISSILETRAINER for demonstration purposes. +MissileTrainer = MISSILETRAINER:New( 100, "Missiles will be destroyed for training when they reach your plane." ) diff --git a/Tasking/Task_CARGO/TSK-CGO-000 - Boarding Test/TSK-CGO-000 - Boarding Test.lua b/Tasking/Task_CARGO/TSK-CGO-000 - Boarding Test/TSK-CGO-000 - Boarding Test.lua index 3821de4ec7..1c70f53eca 100644 --- a/Tasking/Task_CARGO/TSK-CGO-000 - Boarding Test/TSK-CGO-000 - Boarding Test.lua +++ b/Tasking/Task_CARGO/TSK-CGO-000 - Boarding Test/TSK-CGO-000 - Boarding Test.lua @@ -1,78 +1,78 @@ ---- --- Name: TSK-CGO-000 - Boarding Test --- Author: FlightControl --- Date Created: 12 Apr 2017 --- --- This mission demonstrates the transport of a cargo group using an APC. --- --- There is: --- - 1 APC. --- - 2 Transport Tasks - Transport Workers and Transport Engineers. --- - 2 Cargo - Workers and Engineers. --- - 2 Deployment Zones - Alpha and Beta. --- --- Task Engineers: Transport the Engineers to Deployment Zone Alpha or Zone Beta. --- Task Workers: Transport the Workers to Deployment Zone Beta. --- - -do - local HQ = GROUP:FindByName( "HQ", "Bravo HQ" ) - - local CommandCenter = COMMANDCENTER:New( HQ, "Bravo" ) - - local Scoring = SCORING:New( "Cargo Group Transport Demonstration" ) - - local Mission = MISSION - :New( CommandCenter, "Transport", "High", "Transport the team from Deploy Zone 1 to Deploy Zone 2", coalition.side.BLUE ) - :AddScoring( Scoring ) - - -- Allocate the Transport, which is an APC in the field. - local APC = SET_GROUP:New():FilterPrefixes( "Transport" ):FilterStart() - - -- We will setup the transportation for Engineers. - - -- Here we define the "cargo set", which is a collection of cargo objects. - -- The cargo set will be the input for the cargo transportation task. - -- So a transportation object is handling a cargo set, which is automatically refreshed when new cargo is added/deleted. - local EngineersCargoSet = SET_CARGO:New():FilterTypes( "Engineers" ):FilterStart() - - -- Now we add cargo into the battle scene. - local EngineersGroup = GROUP:FindByName( "Engineers" ) - - -- CARGO_GROUP can be used to setup cargo with a GROUP object underneath. - -- We name this group Engineers. - -- Note that the name of the cargo is "Engineers". - -- The cargoset "EngineersCargoSet" will embed all defined cargo of type Engineers (prefix) into its set. - local EngineersCargoGroup = CARGO_GROUP:New( EngineersGroup, "Engineers", "Radar Team", 500 ) - - - -- We setup the task to transport engineers. - EngineersCargoTransportTask = TASK_CARGO_TRANSPORT:New( Mission, APC, "Transport Engineers", EngineersCargoSet ) - - -- We setup to deploy workers in the deploy zone 1 and 2 (the player can choose). - EngineersCargoTransportTask:AddDeployZone( ZONE_POLYGON:New( "Deploy Zone Alpha", GROUP:FindByName("DeployZone Alpha") ) ) - EngineersCargoTransportTask:AddDeployZone( ZONE_POLYGON:New( "Deploy Zone Beta", GROUP:FindByName("DeployZone Beta") ) ) - - - -- Here we define the "cargo set", which is a collection of cargo objects. - -- The cargo set will be the input for the cargo transportation task. - -- So a transportation object is handling a cargo set, which is automatically refreshed when new cargo is added/deleted. - local WorkersCargoSet = SET_CARGO:New():FilterTypes( "Workers" ):FilterStart() - - local WorkersGroup = GROUP:FindByName( "Workers" ) - - -- CARGO_GROUP can be used to setup cargo with a GROUP object underneath. - -- We name this group Engineers. - -- Note that the name of the cargo is "Workers". - -- The cargoset "WorkersCargoSet" will embed all defined cargo of type Workers (prefix) into its set. - local WorkersCargoGroup = CARGO_GROUP:New( WorkersGroup, "Workers", "Mechanics", 500 ) - - - -- We setup the task to transport workers. - WorkersCargoTransportTask = TASK_CARGO_TRANSPORT:New( Mission, APC, "Transport Workers", WorkersCargoSet ) - - -- We setup to deploy workers in the deploy zone 1. - WorkersCargoTransportTask:AddDeployZone( ZONE_POLYGON:New( "Deploy Zone Beta", GROUP:FindByName("DeployZone Beta") ) ) - -end - +--- +-- Name: TSK-CGO-000 - Boarding Test +-- Author: FlightControl +-- Date Created: 12 Apr 2017 +-- +-- This mission demonstrates the transport of a cargo group using an APC. +-- +-- There is: +-- - 1 APC. +-- - 2 Transport Tasks - Transport Workers and Transport Engineers. +-- - 2 Cargo - Workers and Engineers. +-- - 2 Deployment Zones - Alpha and Beta. +-- +-- Task Engineers: Transport the Engineers to Deployment Zone Alpha or Zone Beta. +-- Task Workers: Transport the Workers to Deployment Zone Beta. +-- + +do + local HQ = GROUP:FindByName( "HQ", "Bravo HQ" ) + + local CommandCenter = COMMANDCENTER:New( HQ, "Bravo" ) + + local Scoring = SCORING:New( "Cargo Group Transport Demonstration" ) + + local Mission = MISSION + :New( CommandCenter, "Transport", "High", "Transport the team from Deploy Zone 1 to Deploy Zone 2", coalition.side.BLUE ) + :AddScoring( Scoring ) + + -- Allocate the Transport, which is an APC in the field. + local APC = SET_GROUP:New():FilterPrefixes( "Transport" ):FilterStart() + + -- We will setup the transportation for Engineers. + + -- Here we define the "cargo set", which is a collection of cargo objects. + -- The cargo set will be the input for the cargo transportation task. + -- So a transportation object is handling a cargo set, which is automatically refreshed when new cargo is added/deleted. + local EngineersCargoSet = SET_CARGO:New():FilterTypes( "Engineers" ):FilterStart() + + -- Now we add cargo into the battle scene. + local EngineersGroup = GROUP:FindByName( "Engineers" ) + + -- CARGO_GROUP can be used to setup cargo with a GROUP object underneath. + -- We name this group Engineers. + -- Note that the name of the cargo is "Engineers". + -- The cargoset "EngineersCargoSet" will embed all defined cargo of type Engineers (prefix) into its set. + local EngineersCargoGroup = CARGO_GROUP:New( EngineersGroup, "Engineers", "Radar Team", 500 ) + + + -- We setup the task to transport engineers. + EngineersCargoTransportTask = TASK_CARGO_TRANSPORT:New( Mission, APC, "Transport Engineers", EngineersCargoSet ) + + -- We setup to deploy workers in the deploy zone 1 and 2 (the player can choose). + EngineersCargoTransportTask:AddDeployZone( ZONE_POLYGON:New( "Deploy Zone Alpha", GROUP:FindByName("DeployZone Alpha") ) ) + EngineersCargoTransportTask:AddDeployZone( ZONE_POLYGON:New( "Deploy Zone Beta", GROUP:FindByName("DeployZone Beta") ) ) + + + -- Here we define the "cargo set", which is a collection of cargo objects. + -- The cargo set will be the input for the cargo transportation task. + -- So a transportation object is handling a cargo set, which is automatically refreshed when new cargo is added/deleted. + local WorkersCargoSet = SET_CARGO:New():FilterTypes( "Workers" ):FilterStart() + + local WorkersGroup = GROUP:FindByName( "Workers" ) + + -- CARGO_GROUP can be used to setup cargo with a GROUP object underneath. + -- We name this group Engineers. + -- Note that the name of the cargo is "Workers". + -- The cargoset "WorkersCargoSet" will embed all defined cargo of type Workers (prefix) into its set. + local WorkersCargoGroup = CARGO_GROUP:New( WorkersGroup, "Workers", "Mechanics", 500 ) + + + -- We setup the task to transport workers. + WorkersCargoTransportTask = TASK_CARGO_TRANSPORT:New( Mission, APC, "Transport Workers", WorkersCargoSet ) + + -- We setup to deploy workers in the deploy zone 1. + WorkersCargoTransportTask:AddDeployZone( ZONE_POLYGON:New( "Deploy Zone Beta", GROUP:FindByName("DeployZone Beta") ) ) + +end + diff --git a/Tasking/Task_CARGO/TSK-CGO-010 - Ground - Respawn on CargoGroup Destroyed/TSK-CGO-010 - Ground - Respawn on CargoGroup Destroyed.lua b/Tasking/Task_CARGO/TSK-CGO-010 - Ground - Respawn on CargoGroup Destroyed/TSK-CGO-010 - Ground - Respawn on CargoGroup Destroyed.lua index 282ba4c27b..12af227c27 100644 --- a/Tasking/Task_CARGO/TSK-CGO-010 - Ground - Respawn on CargoGroup Destroyed/TSK-CGO-010 - Ground - Respawn on CargoGroup Destroyed.lua +++ b/Tasking/Task_CARGO/TSK-CGO-010 - Ground - Respawn on CargoGroup Destroyed/TSK-CGO-010 - Ground - Respawn on CargoGroup Destroyed.lua @@ -1,78 +1,78 @@ ---- --- Name: TSK-CGO-100 - Ground - APC Test --- Author: FlightControl --- Date Created: 12 Apr 2017 --- --- This mission demonstrates the transport of a cargo group using an APC. --- --- There is: --- - 1 APC. --- - 2 Transport Tasks - Transport Workers and Transport Engineers. --- - 2 Cargo - Workers and Engineers. --- - 2 Deployment Zones - Alpha and Beta. --- --- Task Engineers: Transport the Engineers to Deployment Zone Alpha or Zone Beta. --- Task Workers: Transport the Workers to Deployment Zone Beta. --- - -do - local HQ = GROUP:FindByName( "HQ", "Bravo HQ" ) - - local CommandCenter = COMMANDCENTER:New( HQ, "Bravo" ) - - local Scoring = SCORING:New( "Cargo Group Transport Demonstration" ) - - local Mission = MISSION - :New( CommandCenter, "Transport", "High", "Transport the team from Deploy Zone 1 to Deploy Zone 2", coalition.side.BLUE ) - :AddScoring( Scoring ) - - -- Allocate the Transport, which is an APC in the field. - local APC = SET_GROUP:New():FilterPrefixes( "Transport" ):FilterStart() - - -- We will setup the transportation for Engineers. - - -- Here we define the "cargo set", which is a collection of cargo objects. - -- The cargo set will be the input for the cargo transportation task. - -- So a transportation object is handling a cargo set, which is automatically refreshed when new cargo is added/deleted. - local EngineersCargoSet = SET_CARGO:New():FilterTypes( "Engineers" ):FilterStart() - - -- Now we add cargo into the battle scene. - local EngineersGroup = GROUP:FindByName( "Engineers" ) - - -- CARGO_GROUP can be used to setup cargo with a GROUP object underneath. - -- We name this group Engineers. - -- Note that the name of the cargo is "Engineers". - -- The cargoset "EngineersCargoSet" will embed all defined cargo of type Engineers (prefix) into its set. - local EngineersCargoGroup = CARGO_GROUP:New( EngineersGroup, "Engineers", "Radar Team", 500 ):RespawnOnDestroyed( true ) - - - -- We setup the task to transport engineers. - EngineersCargoTransportTask = TASK_CARGO_TRANSPORT:New( Mission, APC, "Transport Engineers", EngineersCargoSet ) - - -- We setup to deploy workers in the deploy zone 1 and 2 (the player can choose). - EngineersCargoTransportTask:AddDeployZone( ZONE_POLYGON:New( "Deploy Zone Alpha", GROUP:FindByName("DeployZone Alpha") ) ) - EngineersCargoTransportTask:AddDeployZone( ZONE_POLYGON:New( "Deploy Zone Beta", GROUP:FindByName("DeployZone Beta") ) ) - - - -- Here we define the "cargo set", which is a collection of cargo objects. - -- The cargo set will be the input for the cargo transportation task. - -- So a transportation object is handling a cargo set, which is automatically refreshed when new cargo is added/deleted. - local WorkersCargoSet = SET_CARGO:New():FilterTypes( "Workers" ):FilterStart() - - local WorkersGroup = GROUP:FindByName( "Workers" ) - - -- CARGO_GROUP can be used to setup cargo with a GROUP object underneath. - -- We name this group Engineers. - -- Note that the name of the cargo is "Workers". - -- The cargoset "WorkersCargoSet" will embed all defined cargo of type Workers (prefix) into its set. - local WorkersCargoGroup = CARGO_GROUP:New( WorkersGroup, "Workers", "Mechanics", 500 ):RespawnOnDestroyed( true ) - - - -- We setup the task to transport workers. - WorkersCargoTransportTask = TASK_CARGO_TRANSPORT:New( Mission, APC, "Transport Workers", WorkersCargoSet ) - - -- We setup to deploy workers in the deploy zone 1. - WorkersCargoTransportTask:AddDeployZone( ZONE_POLYGON:New( "Deploy Zone Beta", GROUP:FindByName("DeployZone Beta") ) ) - -end - +--- +-- Name: TSK-CGO-100 - Ground - APC Test +-- Author: FlightControl +-- Date Created: 12 Apr 2017 +-- +-- This mission demonstrates the transport of a cargo group using an APC. +-- +-- There is: +-- - 1 APC. +-- - 2 Transport Tasks - Transport Workers and Transport Engineers. +-- - 2 Cargo - Workers and Engineers. +-- - 2 Deployment Zones - Alpha and Beta. +-- +-- Task Engineers: Transport the Engineers to Deployment Zone Alpha or Zone Beta. +-- Task Workers: Transport the Workers to Deployment Zone Beta. +-- + +do + local HQ = GROUP:FindByName( "HQ", "Bravo HQ" ) + + local CommandCenter = COMMANDCENTER:New( HQ, "Bravo" ) + + local Scoring = SCORING:New( "Cargo Group Transport Demonstration" ) + + local Mission = MISSION + :New( CommandCenter, "Transport", "High", "Transport the team from Deploy Zone 1 to Deploy Zone 2", coalition.side.BLUE ) + :AddScoring( Scoring ) + + -- Allocate the Transport, which is an APC in the field. + local APC = SET_GROUP:New():FilterPrefixes( "Transport" ):FilterStart() + + -- We will setup the transportation for Engineers. + + -- Here we define the "cargo set", which is a collection of cargo objects. + -- The cargo set will be the input for the cargo transportation task. + -- So a transportation object is handling a cargo set, which is automatically refreshed when new cargo is added/deleted. + local EngineersCargoSet = SET_CARGO:New():FilterTypes( "Engineers" ):FilterStart() + + -- Now we add cargo into the battle scene. + local EngineersGroup = GROUP:FindByName( "Engineers" ) + + -- CARGO_GROUP can be used to setup cargo with a GROUP object underneath. + -- We name this group Engineers. + -- Note that the name of the cargo is "Engineers". + -- The cargoset "EngineersCargoSet" will embed all defined cargo of type Engineers (prefix) into its set. + local EngineersCargoGroup = CARGO_GROUP:New( EngineersGroup, "Engineers", "Radar Team", 500 ):RespawnOnDestroyed( true ) + + + -- We setup the task to transport engineers. + EngineersCargoTransportTask = TASK_CARGO_TRANSPORT:New( Mission, APC, "Transport Engineers", EngineersCargoSet ) + + -- We setup to deploy workers in the deploy zone 1 and 2 (the player can choose). + EngineersCargoTransportTask:AddDeployZone( ZONE_POLYGON:New( "Deploy Zone Alpha", GROUP:FindByName("DeployZone Alpha") ) ) + EngineersCargoTransportTask:AddDeployZone( ZONE_POLYGON:New( "Deploy Zone Beta", GROUP:FindByName("DeployZone Beta") ) ) + + + -- Here we define the "cargo set", which is a collection of cargo objects. + -- The cargo set will be the input for the cargo transportation task. + -- So a transportation object is handling a cargo set, which is automatically refreshed when new cargo is added/deleted. + local WorkersCargoSet = SET_CARGO:New():FilterTypes( "Workers" ):FilterStart() + + local WorkersGroup = GROUP:FindByName( "Workers" ) + + -- CARGO_GROUP can be used to setup cargo with a GROUP object underneath. + -- We name this group Engineers. + -- Note that the name of the cargo is "Workers". + -- The cargoset "WorkersCargoSet" will embed all defined cargo of type Workers (prefix) into its set. + local WorkersCargoGroup = CARGO_GROUP:New( WorkersGroup, "Workers", "Mechanics", 500 ):RespawnOnDestroyed( true ) + + + -- We setup the task to transport workers. + WorkersCargoTransportTask = TASK_CARGO_TRANSPORT:New( Mission, APC, "Transport Workers", WorkersCargoSet ) + + -- We setup to deploy workers in the deploy zone 1. + WorkersCargoTransportTask:AddDeployZone( ZONE_POLYGON:New( "Deploy Zone Beta", GROUP:FindByName("DeployZone Beta") ) ) + +end + diff --git a/Tasking/Task_CARGO/TSK-CGO-100 - Ground - 1 APC - 2 Tasks - 2 Cargo - 2 Zones/TSK-CGO-100 - Ground - 1 APC - 2 Tasks - 2 Cargo - 2 Zones.lua b/Tasking/Task_CARGO/TSK-CGO-100 - Ground - 1 APC - 2 Tasks - 2 Cargo - 2 Zones/TSK-CGO-100 - Ground - 1 APC - 2 Tasks - 2 Cargo - 2 Zones.lua index 059e02d970..f047f0de98 100644 --- a/Tasking/Task_CARGO/TSK-CGO-100 - Ground - 1 APC - 2 Tasks - 2 Cargo - 2 Zones/TSK-CGO-100 - Ground - 1 APC - 2 Tasks - 2 Cargo - 2 Zones.lua +++ b/Tasking/Task_CARGO/TSK-CGO-100 - Ground - 1 APC - 2 Tasks - 2 Cargo - 2 Zones/TSK-CGO-100 - Ground - 1 APC - 2 Tasks - 2 Cargo - 2 Zones.lua @@ -1,69 +1,69 @@ ---- --- Name: TSK-CGO-100 - Ground - APC Test --- Author: FlightControl --- Date Created: 12 Apr 2017 --- --- This mission demonstrates the transport of a cargo group using an APC. --- - -do - local HQ = GROUP:FindByName( "HQ", "Bravo HQ" ) - - local CommandCenter = COMMANDCENTER:New( HQ, "Bravo" ) - - local Scoring = SCORING:New( "Cargo Group Transport Demonstration" ) - - local Mission = MISSION - :New( CommandCenter, "Transport", "High", "Transport the team from Deploy Zone 1 to Deploy Zone 2", coalition.side.BLUE ) - :AddScoring( Scoring ) - - -- Allocate the Transport, which is an APC in the field. - local APC = SET_GROUP:New():FilterPrefixes( "Transport" ):FilterStart() - - -- We will setup the transportation for Engineers. - - -- Here we define the "cargo set", which is a collection of cargo objects. - -- The cargo set will be the input for the cargo transportation task. - -- So a transportation object is handling a cargo set, which is automatically refreshed when new cargo is added/deleted. - local EngineersCargoSet = SET_CARGO:New():FilterTypes( "Engineers" ):FilterStart() - - -- Now we add cargo into the battle scene. - local EngineersGroup = GROUP:FindByName( "Engineers" ) - - -- CARGO_GROUP can be used to setup cargo with a GROUP object underneath. - -- We name this group Engineers. - -- Note that the name of the cargo is "Engineers". - -- The cargoset "EngineersCargoSet" will embed all defined cargo of type Engineers (prefix) into its set. - local EngineersCargoGroup = CARGO_GROUP:New( EngineersGroup, "Engineers", "Radar Team", 500 ) - - - -- We setup the task to transport engineers. - EngineersCargoTransportTask = TASK_CARGO_TRANSPORT:New( Mission, APC, "Transport Engineers", EngineersCargoSet ) - - -- We setup to deploy workers in the deploy zone 1 and 2 (the player can choose). - EngineersCargoTransportTask:AddDeployZone( ZONE_POLYGON:New( "Deploy Zone Alpha", GROUP:FindByName("DeployZone Alpha") ) ) - EngineersCargoTransportTask:AddDeployZone( ZONE_POLYGON:New( "Deploy Zone Beta", GROUP:FindByName("DeployZone Beta") ) ) - - - -- Here we define the "cargo set", which is a collection of cargo objects. - -- The cargo set will be the input for the cargo transportation task. - -- So a transportation object is handling a cargo set, which is automatically refreshed when new cargo is added/deleted. - local WorkersCargoSet = SET_CARGO:New():FilterTypes( "Workers" ):FilterStart() - - local WorkersGroup = GROUP:FindByName( "Workers" ) - - -- CARGO_GROUP can be used to setup cargo with a GROUP object underneath. - -- We name this group Engineers. - -- Note that the name of the cargo is "Workers". - -- The cargoset "WorkersCargoSet" will embed all defined cargo of type Workers (prefix) into its set. - local WorkersCargoGroup = CARGO_GROUP:New( WorkersGroup, "Workers", "Mechanics", 500 ) - - - -- We setup the task to transport workers. - WorkersCargoTransportTask = TASK_CARGO_TRANSPORT:New( Mission, APC, "Transport Workers", WorkersCargoSet ) - - -- We setup to deploy workers in the deploy zone 1. - WorkersCargoTransportTask:AddDeployZone( ZONE_POLYGON:New( "Deploy Zone Beta", GROUP:FindByName("DeployZone Beta") ) ) - -end - +--- +-- Name: TSK-CGO-100 - Ground - APC Test +-- Author: FlightControl +-- Date Created: 12 Apr 2017 +-- +-- This mission demonstrates the transport of a cargo group using an APC. +-- + +do + local HQ = GROUP:FindByName( "HQ", "Bravo HQ" ) + + local CommandCenter = COMMANDCENTER:New( HQ, "Bravo" ) + + local Scoring = SCORING:New( "Cargo Group Transport Demonstration" ) + + local Mission = MISSION + :New( CommandCenter, "Transport", "High", "Transport the team from Deploy Zone 1 to Deploy Zone 2", coalition.side.BLUE ) + :AddScoring( Scoring ) + + -- Allocate the Transport, which is an APC in the field. + local APC = SET_GROUP:New():FilterPrefixes( "Transport" ):FilterStart() + + -- We will setup the transportation for Engineers. + + -- Here we define the "cargo set", which is a collection of cargo objects. + -- The cargo set will be the input for the cargo transportation task. + -- So a transportation object is handling a cargo set, which is automatically refreshed when new cargo is added/deleted. + local EngineersCargoSet = SET_CARGO:New():FilterTypes( "Engineers" ):FilterStart() + + -- Now we add cargo into the battle scene. + local EngineersGroup = GROUP:FindByName( "Engineers" ) + + -- CARGO_GROUP can be used to setup cargo with a GROUP object underneath. + -- We name this group Engineers. + -- Note that the name of the cargo is "Engineers". + -- The cargoset "EngineersCargoSet" will embed all defined cargo of type Engineers (prefix) into its set. + local EngineersCargoGroup = CARGO_GROUP:New( EngineersGroup, "Engineers", "Radar Team", 500 ) + + + -- We setup the task to transport engineers. + EngineersCargoTransportTask = TASK_CARGO_TRANSPORT:New( Mission, APC, "Transport Engineers", EngineersCargoSet ) + + -- We setup to deploy workers in the deploy zone 1 and 2 (the player can choose). + EngineersCargoTransportTask:AddDeployZone( ZONE_POLYGON:New( "Deploy Zone Alpha", GROUP:FindByName("DeployZone Alpha") ) ) + EngineersCargoTransportTask:AddDeployZone( ZONE_POLYGON:New( "Deploy Zone Beta", GROUP:FindByName("DeployZone Beta") ) ) + + + -- Here we define the "cargo set", which is a collection of cargo objects. + -- The cargo set will be the input for the cargo transportation task. + -- So a transportation object is handling a cargo set, which is automatically refreshed when new cargo is added/deleted. + local WorkersCargoSet = SET_CARGO:New():FilterTypes( "Workers" ):FilterStart() + + local WorkersGroup = GROUP:FindByName( "Workers" ) + + -- CARGO_GROUP can be used to setup cargo with a GROUP object underneath. + -- We name this group Engineers. + -- Note that the name of the cargo is "Workers". + -- The cargoset "WorkersCargoSet" will embed all defined cargo of type Workers (prefix) into its set. + local WorkersCargoGroup = CARGO_GROUP:New( WorkersGroup, "Workers", "Mechanics", 500 ) + + + -- We setup the task to transport workers. + WorkersCargoTransportTask = TASK_CARGO_TRANSPORT:New( Mission, APC, "Transport Workers", WorkersCargoSet ) + + -- We setup to deploy workers in the deploy zone 1. + WorkersCargoTransportTask:AddDeployZone( ZONE_POLYGON:New( "Deploy Zone Beta", GROUP:FindByName("DeployZone Beta") ) ) + +end + diff --git a/Tasking/Task_CARGO/TSK-CGO-500 - Helo - 1 Helo - 1 Task - 1 Cargo - 1 Zone/TSK-CGO-500 - Helo - 1 Helo - 1 Task - 1 Cargo - 1 Zone.lua b/Tasking/Task_CARGO/TSK-CGO-500 - Helo - 1 Helo - 1 Task - 1 Cargo - 1 Zone/TSK-CGO-500 - Helo - 1 Helo - 1 Task - 1 Cargo - 1 Zone.lua index f739d22fad..91d37f1c5c 100644 --- a/Tasking/Task_CARGO/TSK-CGO-500 - Helo - 1 Helo - 1 Task - 1 Cargo - 1 Zone/TSK-CGO-500 - Helo - 1 Helo - 1 Task - 1 Cargo - 1 Zone.lua +++ b/Tasking/Task_CARGO/TSK-CGO-500 - Helo - 1 Helo - 1 Task - 1 Cargo - 1 Zone/TSK-CGO-500 - Helo - 1 Helo - 1 Task - 1 Cargo - 1 Zone.lua @@ -1,55 +1,55 @@ ---- --- Name: TSK-CGO-502 - Helo - 1 Helo - 1 Task - 2 Cargo - 1 Zone --- Author: FlightControl --- Date Created: 12 Mar 2018 --- --- This mission demonstrates the transport of a cargo group using an Helicopter. --- --- There is: --- - 1 Helicopter. --- - 1 Transport Task - Transport Workers. --- - 1 Cargo - Workers. --- - 1 Deployment Zone - Alpha. --- --- Task Workers: Transport the Workers to Deployment Zone Alpha. --- - -do - local HQ = GROUP:FindByName( "HQ", "Bravo HQ" ) - - local CommandCenter = COMMANDCENTER:New( HQ, "Bravo" ) - - local Scoring = SCORING:New( "Cargo Group Transport Demonstration" ) - - local Mission = MISSION - :New( CommandCenter, "Transport", "High", "Transport the team from Deploy Zone 1 to Deploy Zone 2", coalition.side.BLUE ) - :AddScoring( Scoring ) - - -- Allocate the Transport, which is an APC in the field. - local APC = SET_GROUP:New():FilterPrefixes( "Transport" ):FilterStart() - - -- We will setup the transportation for Engineers. - - -- Here we define the "cargo set", which is a collection of cargo objects. - -- The cargo set will be the input for the cargo transportation task. - -- So a transportation object is handling a cargo set, which is automatically refreshed when new cargo is added/deleted. - local EngineersCargoSet = SET_CARGO:New():FilterTypes( "Engineers" ):FilterStart() - - -- Now we add cargo into the battle scene. - local EngineersGroup = GROUP:FindByName( "Engineers" ) - - -- CARGO_GROUP can be used to setup cargo with a GROUP object underneath. - -- We name this group Engineers. - -- Note that the name of the cargo is "Engineers". - -- The cargoset "EngineersCargoSet" will embed all defined cargo of type Engineers (prefix) into its set. - local EngineersCargoGroup = CARGO_GROUP:New( EngineersGroup, "Engineers", "Radar Team", 500 ) - - -- We setup the task to transport engineers. - EngineersCargoTransportTask = TASK_CARGO_TRANSPORT:New( Mission, APC, "Transport Engineers", EngineersCargoSet ) - - -- We setup to deploy workers in the deploy zone 1 and 2 (the player can choose). - EngineersCargoTransportTask:AddDeployZone( ZONE_POLYGON:New( "Deploy Zone Beta", GROUP:FindByName("DeployZone Beta") ) ) - - -end - +--- +-- Name: TSK-CGO-502 - Helo - 1 Helo - 1 Task - 2 Cargo - 1 Zone +-- Author: FlightControl +-- Date Created: 12 Mar 2018 +-- +-- This mission demonstrates the transport of a cargo group using an Helicopter. +-- +-- There is: +-- - 1 Helicopter. +-- - 1 Transport Task - Transport Workers. +-- - 1 Cargo - Workers. +-- - 1 Deployment Zone - Alpha. +-- +-- Task Workers: Transport the Workers to Deployment Zone Alpha. +-- + +do + local HQ = GROUP:FindByName( "HQ", "Bravo HQ" ) + + local CommandCenter = COMMANDCENTER:New( HQ, "Bravo" ) + + local Scoring = SCORING:New( "Cargo Group Transport Demonstration" ) + + local Mission = MISSION + :New( CommandCenter, "Transport", "High", "Transport the team from Deploy Zone 1 to Deploy Zone 2", coalition.side.BLUE ) + :AddScoring( Scoring ) + + -- Allocate the Transport, which is an APC in the field. + local APC = SET_GROUP:New():FilterPrefixes( "Transport" ):FilterStart() + + -- We will setup the transportation for Engineers. + + -- Here we define the "cargo set", which is a collection of cargo objects. + -- The cargo set will be the input for the cargo transportation task. + -- So a transportation object is handling a cargo set, which is automatically refreshed when new cargo is added/deleted. + local EngineersCargoSet = SET_CARGO:New():FilterTypes( "Engineers" ):FilterStart() + + -- Now we add cargo into the battle scene. + local EngineersGroup = GROUP:FindByName( "Engineers" ) + + -- CARGO_GROUP can be used to setup cargo with a GROUP object underneath. + -- We name this group Engineers. + -- Note that the name of the cargo is "Engineers". + -- The cargoset "EngineersCargoSet" will embed all defined cargo of type Engineers (prefix) into its set. + local EngineersCargoGroup = CARGO_GROUP:New( EngineersGroup, "Engineers", "Radar Team", 500 ) + + -- We setup the task to transport engineers. + EngineersCargoTransportTask = TASK_CARGO_TRANSPORT:New( Mission, APC, "Transport Engineers", EngineersCargoSet ) + + -- We setup to deploy workers in the deploy zone 1 and 2 (the player can choose). + EngineersCargoTransportTask:AddDeployZone( ZONE_POLYGON:New( "Deploy Zone Beta", GROUP:FindByName("DeployZone Beta") ) ) + + +end + diff --git a/Tasking/Task_CARGO/TSK-CGO-501 - Helo - 1 Helo - 1 Task - 1 Cargo - 2 Zones/TSK-CGO-501 - Helo - 1 Helo - 1 Task - 1 Cargo - 2 Zones.lua b/Tasking/Task_CARGO/TSK-CGO-501 - Helo - 1 Helo - 1 Task - 1 Cargo - 2 Zones/TSK-CGO-501 - Helo - 1 Helo - 1 Task - 1 Cargo - 2 Zones.lua index 01b08e9881..0cd0fa47c6 100644 --- a/Tasking/Task_CARGO/TSK-CGO-501 - Helo - 1 Helo - 1 Task - 1 Cargo - 2 Zones/TSK-CGO-501 - Helo - 1 Helo - 1 Task - 1 Cargo - 2 Zones.lua +++ b/Tasking/Task_CARGO/TSK-CGO-501 - Helo - 1 Helo - 1 Task - 1 Cargo - 2 Zones/TSK-CGO-501 - Helo - 1 Helo - 1 Task - 1 Cargo - 2 Zones.lua @@ -1,56 +1,56 @@ ---- --- Name: TSK-CGO-502 - Helo - 1 Helo - 1 Task - 2 Cargo - 1 Zone --- Author: FlightControl --- Date Created: 12 Mar 2018 --- --- This mission demonstrates the transport of a cargo group using an Helicopter. --- --- There is: --- - 1 Helicopter. --- - 1 Transport Task - Transport Workers. --- - 1 Cargo - Workers. --- - 1 Deployment Zone - Alpha. --- --- Task Workers: Transport the Workers to Deployment Zone Alpha. --- - -do - local HQ = GROUP:FindByName( "HQ", "Bravo HQ" ) - - local CommandCenter = COMMANDCENTER:New( HQ, "Bravo" ) - - local Scoring = SCORING:New( "Cargo Group Transport Demonstration" ) - - local Mission = MISSION - :New( CommandCenter, "Transport", "High", "Transport the team from Deploy Zone 1 to Deploy Zone 2", coalition.side.BLUE ) - :AddScoring( Scoring ) - - -- Allocate the Transport, which is an APC in the field. - local APC = SET_GROUP:New():FilterPrefixes( "Transport" ):FilterStart() - - -- We will setup the transportation for Engineers. - - -- Here we define the "cargo set", which is a collection of cargo objects. - -- The cargo set will be the input for the cargo transportation task. - -- So a transportation object is handling a cargo set, which is automatically refreshed when new cargo is added/deleted. - local EngineersCargoSet = SET_CARGO:New():FilterTypes( "Engineers" ):FilterStart() - - -- Now we add cargo into the battle scene. - local EngineersGroup = GROUP:FindByName( "Engineers" ) - - -- CARGO_GROUP can be used to setup cargo with a GROUP object underneath. - -- We name this group Engineers. - -- Note that the name of the cargo is "Engineers". - -- The cargoset "EngineersCargoSet" will embed all defined cargo of type Engineers (prefix) into its set. - local EngineersCargoGroup = CARGO_GROUP:New( EngineersGroup, "Engineers", "Radar Team", 500 ) - - -- We setup the task to transport engineers. - EngineersCargoTransportTask = TASK_CARGO_TRANSPORT:New( Mission, APC, "Transport Engineers", EngineersCargoSet ) - - -- We setup to deploy workers in the deploy zone 1 and 2 (the player can choose). - EngineersCargoTransportTask:AddDeployZone( ZONE_POLYGON:New( "Deploy Zone Alpha", GROUP:FindByName("DeployZone Alpha") ) ) - EngineersCargoTransportTask:AddDeployZone( ZONE_POLYGON:New( "Deploy Zone Beta", GROUP:FindByName("DeployZone Beta") ) ) - - -end - +--- +-- Name: TSK-CGO-502 - Helo - 1 Helo - 1 Task - 2 Cargo - 1 Zone +-- Author: FlightControl +-- Date Created: 12 Mar 2018 +-- +-- This mission demonstrates the transport of a cargo group using an Helicopter. +-- +-- There is: +-- - 1 Helicopter. +-- - 1 Transport Task - Transport Workers. +-- - 1 Cargo - Workers. +-- - 1 Deployment Zone - Alpha. +-- +-- Task Workers: Transport the Workers to Deployment Zone Alpha. +-- + +do + local HQ = GROUP:FindByName( "HQ", "Bravo HQ" ) + + local CommandCenter = COMMANDCENTER:New( HQ, "Bravo" ) + + local Scoring = SCORING:New( "Cargo Group Transport Demonstration" ) + + local Mission = MISSION + :New( CommandCenter, "Transport", "High", "Transport the team from Deploy Zone 1 to Deploy Zone 2", coalition.side.BLUE ) + :AddScoring( Scoring ) + + -- Allocate the Transport, which is an APC in the field. + local APC = SET_GROUP:New():FilterPrefixes( "Transport" ):FilterStart() + + -- We will setup the transportation for Engineers. + + -- Here we define the "cargo set", which is a collection of cargo objects. + -- The cargo set will be the input for the cargo transportation task. + -- So a transportation object is handling a cargo set, which is automatically refreshed when new cargo is added/deleted. + local EngineersCargoSet = SET_CARGO:New():FilterTypes( "Engineers" ):FilterStart() + + -- Now we add cargo into the battle scene. + local EngineersGroup = GROUP:FindByName( "Engineers" ) + + -- CARGO_GROUP can be used to setup cargo with a GROUP object underneath. + -- We name this group Engineers. + -- Note that the name of the cargo is "Engineers". + -- The cargoset "EngineersCargoSet" will embed all defined cargo of type Engineers (prefix) into its set. + local EngineersCargoGroup = CARGO_GROUP:New( EngineersGroup, "Engineers", "Radar Team", 500 ) + + -- We setup the task to transport engineers. + EngineersCargoTransportTask = TASK_CARGO_TRANSPORT:New( Mission, APC, "Transport Engineers", EngineersCargoSet ) + + -- We setup to deploy workers in the deploy zone 1 and 2 (the player can choose). + EngineersCargoTransportTask:AddDeployZone( ZONE_POLYGON:New( "Deploy Zone Alpha", GROUP:FindByName("DeployZone Alpha") ) ) + EngineersCargoTransportTask:AddDeployZone( ZONE_POLYGON:New( "Deploy Zone Beta", GROUP:FindByName("DeployZone Beta") ) ) + + +end + diff --git a/Tasking/Task_CARGO/TSK-CGO-502 - Helo - 1 Helo - 1 Task - 2 Cargo - 1 Zone/TSK-CGO-502 - Helo - 1 Helo - 1 Task - 2 Cargo - 1 Zone.lua b/Tasking/Task_CARGO/TSK-CGO-502 - Helo - 1 Helo - 1 Task - 2 Cargo - 1 Zone/TSK-CGO-502 - Helo - 1 Helo - 1 Task - 2 Cargo - 1 Zone.lua index d2bb0f8919..531084008d 100644 --- a/Tasking/Task_CARGO/TSK-CGO-502 - Helo - 1 Helo - 1 Task - 2 Cargo - 1 Zone/TSK-CGO-502 - Helo - 1 Helo - 1 Task - 2 Cargo - 1 Zone.lua +++ b/Tasking/Task_CARGO/TSK-CGO-502 - Helo - 1 Helo - 1 Task - 2 Cargo - 1 Zone/TSK-CGO-502 - Helo - 1 Helo - 1 Task - 2 Cargo - 1 Zone.lua @@ -1,64 +1,64 @@ ---- --- Name: TSK-CGO-502 - Helo - 1 Helo - 1 Task - 2 Cargo - 1 Zone --- Author: FlightControl --- Date Created: 12 Mar 2018 --- --- This mission demonstrates the transport of a cargo group using an Helicopter. --- --- There is: --- - 1 Helicopter. --- - 1 Transport Task - Transport Workers. --- - 1 Cargo - Workers. --- - 1 Deployment Zone - Alpha. --- --- Task Workers: Transport the Workers to Deployment Zone Alpha. --- - -do - local HQ = GROUP:FindByName( "HQ", "Bravo HQ" ) - - local CommandCenter = COMMANDCENTER:New( HQ, "Bravo" ) - - local Scoring = SCORING:New( "Cargo Group Transport Demonstration" ) - - local Mission = MISSION - :New( CommandCenter, "Transport", "High", "Transport the team from Deploy Zone 1 to Deploy Zone 2", coalition.side.BLUE ) - :AddScoring( Scoring ) - - -- Allocate the Transport, which is an APC in the field. - local APC = SET_GROUP:New():FilterPrefixes( "Transport" ):FilterStart() - - -- We will setup the transportation for Engineers. - - -- Here we define the "cargo set", which is a collection of cargo objects. - -- The cargo set will be the input for the cargo transportation task. - -- So a transportation object is handling a cargo set, which is automatically refreshed when new cargo is added/deleted. - local EngineersCargoSet = SET_CARGO:New():FilterTypes( "Engineers" ):FilterStart() - - -- Now we add cargo into the battle scene. - local EngineersGroup = GROUP:FindByName( "Engineers" ) - - -- CARGO_GROUP can be used to setup cargo with a GROUP object underneath. - -- We name this group Engineers. - -- Note that the name of the cargo is "Engineers". - -- The cargoset "EngineersCargoSet" will embed all defined cargo of type Engineers (prefix) into its set. - local EngineersCargoGroup = CARGO_GROUP:New( EngineersGroup, "Engineers", "Radar Team", 500 ) - - local WorkersGroup = GROUP:FindByName( "Workers" ) - - -- CARGO_GROUP can be used to setup cargo with a GROUP object underneath. - -- We name this group Engineers. - -- Note that the name of the cargo is "Workers". - -- The cargoset "WorkersCargoSet" will embed all defined cargo of type Workers (prefix) into its set. - local WorkersCargoGroup = CARGO_GROUP:New( WorkersGroup, "Engineers", "Workers", 500 ) - - - -- We setup the task to transport engineers. - EngineersCargoTransportTask = TASK_CARGO_TRANSPORT:New( Mission, APC, "Transport Engineers", EngineersCargoSet ) - - -- We setup to deploy workers in the deploy zone 1 and 2 (the player can choose). - EngineersCargoTransportTask:AddDeployZone( ZONE_POLYGON:New( "Deploy Zone Alpha", GROUP:FindByName("DeployZone Alpha") ) ) - - -end - +--- +-- Name: TSK-CGO-502 - Helo - 1 Helo - 1 Task - 2 Cargo - 1 Zone +-- Author: FlightControl +-- Date Created: 12 Mar 2018 +-- +-- This mission demonstrates the transport of a cargo group using an Helicopter. +-- +-- There is: +-- - 1 Helicopter. +-- - 1 Transport Task - Transport Workers. +-- - 1 Cargo - Workers. +-- - 1 Deployment Zone - Alpha. +-- +-- Task Workers: Transport the Workers to Deployment Zone Alpha. +-- + +do + local HQ = GROUP:FindByName( "HQ", "Bravo HQ" ) + + local CommandCenter = COMMANDCENTER:New( HQ, "Bravo" ) + + local Scoring = SCORING:New( "Cargo Group Transport Demonstration" ) + + local Mission = MISSION + :New( CommandCenter, "Transport", "High", "Transport the team from Deploy Zone 1 to Deploy Zone 2", coalition.side.BLUE ) + :AddScoring( Scoring ) + + -- Allocate the Transport, which is an APC in the field. + local APC = SET_GROUP:New():FilterPrefixes( "Transport" ):FilterStart() + + -- We will setup the transportation for Engineers. + + -- Here we define the "cargo set", which is a collection of cargo objects. + -- The cargo set will be the input for the cargo transportation task. + -- So a transportation object is handling a cargo set, which is automatically refreshed when new cargo is added/deleted. + local EngineersCargoSet = SET_CARGO:New():FilterTypes( "Engineers" ):FilterStart() + + -- Now we add cargo into the battle scene. + local EngineersGroup = GROUP:FindByName( "Engineers" ) + + -- CARGO_GROUP can be used to setup cargo with a GROUP object underneath. + -- We name this group Engineers. + -- Note that the name of the cargo is "Engineers". + -- The cargoset "EngineersCargoSet" will embed all defined cargo of type Engineers (prefix) into its set. + local EngineersCargoGroup = CARGO_GROUP:New( EngineersGroup, "Engineers", "Radar Team", 500 ) + + local WorkersGroup = GROUP:FindByName( "Workers" ) + + -- CARGO_GROUP can be used to setup cargo with a GROUP object underneath. + -- We name this group Engineers. + -- Note that the name of the cargo is "Workers". + -- The cargoset "WorkersCargoSet" will embed all defined cargo of type Workers (prefix) into its set. + local WorkersCargoGroup = CARGO_GROUP:New( WorkersGroup, "Engineers", "Workers", 500 ) + + + -- We setup the task to transport engineers. + EngineersCargoTransportTask = TASK_CARGO_TRANSPORT:New( Mission, APC, "Transport Engineers", EngineersCargoSet ) + + -- We setup to deploy workers in the deploy zone 1 and 2 (the player can choose). + EngineersCargoTransportTask:AddDeployZone( ZONE_POLYGON:New( "Deploy Zone Alpha", GROUP:FindByName("DeployZone Alpha") ) ) + + +end + diff --git a/Tasking/Task_CARGO/TSK-CGO-503 - Helo - 1 Helo - 1 Task - 2 Cargo - 2 Zones/TSK-CGO-503 - Helo - 1 Helo - 1 Task - 2 Cargo - 2 Zones.lua b/Tasking/Task_CARGO/TSK-CGO-503 - Helo - 1 Helo - 1 Task - 2 Cargo - 2 Zones/TSK-CGO-503 - Helo - 1 Helo - 1 Task - 2 Cargo - 2 Zones.lua index 7e0adbfa3e..dbebfac53f 100644 --- a/Tasking/Task_CARGO/TSK-CGO-503 - Helo - 1 Helo - 1 Task - 2 Cargo - 2 Zones/TSK-CGO-503 - Helo - 1 Helo - 1 Task - 2 Cargo - 2 Zones.lua +++ b/Tasking/Task_CARGO/TSK-CGO-503 - Helo - 1 Helo - 1 Task - 2 Cargo - 2 Zones/TSK-CGO-503 - Helo - 1 Helo - 1 Task - 2 Cargo - 2 Zones.lua @@ -1,65 +1,65 @@ ---- --- Name: TSK-CGO-503 - Helo - 1 Helo - 1 Task - 2 Cargo - 2 Zones --- Author: FlightControl --- Date Created: 12 Mar 2018 --- --- This mission demonstrates the transport of a cargo group using an Helicopter. --- --- There is: --- - 1 Helicopter. --- - 1 Transport Task - Transport Workers. --- - 1 Cargo - Workers. --- - 1 Deployment Zone - Alpha. --- --- Task Workers: Transport the Workers to Deployment Zone Alpha. --- - -do - local HQ = GROUP:FindByName( "HQ", "Bravo HQ" ) - - local CommandCenter = COMMANDCENTER:New( HQ, "Bravo" ) - - local Scoring = SCORING:New( "Cargo Group Transport Demonstration" ) - - local Mission = MISSION - :New( CommandCenter, "Transport", "High", "Transport the team from Deploy Zone 1 to Deploy Zone 2", coalition.side.BLUE ) - :AddScoring( Scoring ) - - -- Allocate the Transport, which is an APC in the field. - local APC = SET_GROUP:New():FilterPrefixes( "Transport" ):FilterStart() - - -- We will setup the transportation for Engineers. - - -- Here we define the "cargo set", which is a collection of cargo objects. - -- The cargo set will be the input for the cargo transportation task. - -- So a transportation object is handling a cargo set, which is automatically refreshed when new cargo is added/deleted. - local EngineersCargoSet = SET_CARGO:New():FilterTypes( "Engineers" ):FilterStart() - - -- Now we add cargo into the battle scene. - local EngineersGroup = GROUP:FindByName( "Engineers" ) - - -- CARGO_GROUP can be used to setup cargo with a GROUP object underneath. - -- We name this group Engineers. - -- Note that the name of the cargo is "Engineers". - -- The cargoset "EngineersCargoSet" will embed all defined cargo of type Engineers (prefix) into its set. - local EngineersCargoGroup = CARGO_GROUP:New( EngineersGroup, "Engineers", "Radar Team", 500 ) - - - -- We setup the task to transport engineers. - EngineersCargoTransportTask = TASK_CARGO_TRANSPORT:New( Mission, APC, "Transport Engineers", EngineersCargoSet ) - - -- We setup to deploy workers in the deploy zone 1 and 2 (the player can choose). - EngineersCargoTransportTask:AddDeployZone( ZONE_POLYGON:New( "Deploy Zone Alpha", GROUP:FindByName("DeployZone Alpha") ) ) - EngineersCargoTransportTask:AddDeployZone( ZONE_POLYGON:New( "Deploy Zone Beta", GROUP:FindByName("DeployZone Beta") ) ) - - - local WorkersGroup = GROUP:FindByName( "Workers" ) - - -- CARGO_GROUP can be used to setup cargo with a GROUP object underneath. - -- We name this group Engineers. - -- Note that the name of the cargo is "Workers". - -- The cargoset "WorkersCargoSet" will embed all defined cargo of type Workers (prefix) into its set. - local WorkersCargoGroup = CARGO_GROUP:New( WorkersGroup, "Engineers", "Workers", 500 ) - -end - +--- +-- Name: TSK-CGO-503 - Helo - 1 Helo - 1 Task - 2 Cargo - 2 Zones +-- Author: FlightControl +-- Date Created: 12 Mar 2018 +-- +-- This mission demonstrates the transport of a cargo group using an Helicopter. +-- +-- There is: +-- - 1 Helicopter. +-- - 1 Transport Task - Transport Workers. +-- - 1 Cargo - Workers. +-- - 1 Deployment Zone - Alpha. +-- +-- Task Workers: Transport the Workers to Deployment Zone Alpha. +-- + +do + local HQ = GROUP:FindByName( "HQ", "Bravo HQ" ) + + local CommandCenter = COMMANDCENTER:New( HQ, "Bravo" ) + + local Scoring = SCORING:New( "Cargo Group Transport Demonstration" ) + + local Mission = MISSION + :New( CommandCenter, "Transport", "High", "Transport the team from Deploy Zone 1 to Deploy Zone 2", coalition.side.BLUE ) + :AddScoring( Scoring ) + + -- Allocate the Transport, which is an APC in the field. + local APC = SET_GROUP:New():FilterPrefixes( "Transport" ):FilterStart() + + -- We will setup the transportation for Engineers. + + -- Here we define the "cargo set", which is a collection of cargo objects. + -- The cargo set will be the input for the cargo transportation task. + -- So a transportation object is handling a cargo set, which is automatically refreshed when new cargo is added/deleted. + local EngineersCargoSet = SET_CARGO:New():FilterTypes( "Engineers" ):FilterStart() + + -- Now we add cargo into the battle scene. + local EngineersGroup = GROUP:FindByName( "Engineers" ) + + -- CARGO_GROUP can be used to setup cargo with a GROUP object underneath. + -- We name this group Engineers. + -- Note that the name of the cargo is "Engineers". + -- The cargoset "EngineersCargoSet" will embed all defined cargo of type Engineers (prefix) into its set. + local EngineersCargoGroup = CARGO_GROUP:New( EngineersGroup, "Engineers", "Radar Team", 500 ) + + + -- We setup the task to transport engineers. + EngineersCargoTransportTask = TASK_CARGO_TRANSPORT:New( Mission, APC, "Transport Engineers", EngineersCargoSet ) + + -- We setup to deploy workers in the deploy zone 1 and 2 (the player can choose). + EngineersCargoTransportTask:AddDeployZone( ZONE_POLYGON:New( "Deploy Zone Alpha", GROUP:FindByName("DeployZone Alpha") ) ) + EngineersCargoTransportTask:AddDeployZone( ZONE_POLYGON:New( "Deploy Zone Beta", GROUP:FindByName("DeployZone Beta") ) ) + + + local WorkersGroup = GROUP:FindByName( "Workers" ) + + -- CARGO_GROUP can be used to setup cargo with a GROUP object underneath. + -- We name this group Engineers. + -- Note that the name of the cargo is "Workers". + -- The cargoset "WorkersCargoSet" will embed all defined cargo of type Workers (prefix) into its set. + local WorkersCargoGroup = CARGO_GROUP:New( WorkersGroup, "Engineers", "Workers", 500 ) + +end + diff --git a/Tasking/Task_CARGO/TSK-CGO-510 - Helo - 1 Helo - 2 Task - 2 Cargo - 2 Zones/TSK-CGO-510 - Helo - 1 Helo - 2 Task - 2 Cargo - 2 Zones.lua b/Tasking/Task_CARGO/TSK-CGO-510 - Helo - 1 Helo - 2 Task - 2 Cargo - 2 Zones/TSK-CGO-510 - Helo - 1 Helo - 2 Task - 2 Cargo - 2 Zones.lua index c9c142dcba..56ed2616a3 100644 --- a/Tasking/Task_CARGO/TSK-CGO-510 - Helo - 1 Helo - 2 Task - 2 Cargo - 2 Zones/TSK-CGO-510 - Helo - 1 Helo - 2 Task - 2 Cargo - 2 Zones.lua +++ b/Tasking/Task_CARGO/TSK-CGO-510 - Helo - 1 Helo - 2 Task - 2 Cargo - 2 Zones/TSK-CGO-510 - Helo - 1 Helo - 2 Task - 2 Cargo - 2 Zones.lua @@ -1,77 +1,77 @@ ---- --- Name: TSK-CGO-510 - Helo - 1 Helo - 2 Task - 2 Cargo - 2 Zones --- Author: FlightControl --- Date Created: 12 Mar 2018 --- --- This mission demonstrates the transport of a cargo group using an Helicopter. --- --- There is: --- - 1 Helicopter. --- - 2 Transport Tasks - Transport Workers and Transport Engineers. --- - 2 Cargo - Workers and Engineers. --- - 2 Deployment Zones - Alpha and Beta. --- --- Task Engineers: Transport the Engineers to Deployment Zone Alpha or Zone Beta. --- Task Workers: Transport the Workers to Deployment Zone Beta. - -do - local HQ = GROUP:FindByName( "HQ", "Bravo HQ" ) - - local CommandCenter = COMMANDCENTER:New( HQ, "Bravo" ) - - local Scoring = SCORING:New( "Cargo Group Transport Demonstration" ) - - local Mission = MISSION - :New( CommandCenter, "Transport", "High", "Transport the team from Deploy Zone 1 to Deploy Zone 2", coalition.side.BLUE ) - :AddScoring( Scoring ) - - -- Allocate the Transport, which is an APC in the field. - local APC = SET_GROUP:New():FilterPrefixes( "Transport" ):FilterStart() - - -- We will setup the transportation for Engineers. - - -- Here we define the "cargo set", which is a collection of cargo objects. - -- The cargo set will be the input for the cargo transportation task. - -- So a transportation object is handling a cargo set, which is automatically refreshed when new cargo is added/deleted. - local EngineersCargoSet = SET_CARGO:New():FilterTypes( "Engineers" ):FilterStart() - - -- Now we add cargo into the battle scene. - local EngineersGroup = GROUP:FindByName( "Engineers" ) - - -- CARGO_GROUP can be used to setup cargo with a GROUP object underneath. - -- We name this group Engineers. - -- Note that the name of the cargo is "Engineers". - -- The cargoset "EngineersCargoSet" will embed all defined cargo of type Engineers (prefix) into its set. - local EngineersCargoGroup = CARGO_GROUP:New( EngineersGroup, "Engineers", "Radar Team", 500 ) - - - -- We setup the task to transport engineers. - EngineersCargoTransportTask = TASK_CARGO_TRANSPORT:New( Mission, APC, "Transport Engineers", EngineersCargoSet ) - - -- We setup to deploy workers in the deploy zone 1 and 2 (the player can choose). - EngineersCargoTransportTask:AddDeployZone( ZONE_POLYGON:New( "Deploy Zone Alpha", GROUP:FindByName("DeployZone Alpha") ) ) - EngineersCargoTransportTask:AddDeployZone( ZONE_POLYGON:New( "Deploy Zone Beta", GROUP:FindByName("DeployZone Beta") ) ) - - - -- Here we define the "cargo set", which is a collection of cargo objects. - -- The cargo set will be the input for the cargo transportation task. - -- So a transportation object is handling a cargo set, which is automatically refreshed when new cargo is added/deleted. - local WorkersCargoSet = SET_CARGO:New():FilterTypes( "Workers" ):FilterStart() - - local WorkersGroup = GROUP:FindByName( "Workers" ) - - -- CARGO_GROUP can be used to setup cargo with a GROUP object underneath. - -- We name this group Engineers. - -- Note that the name of the cargo is "Workers". - -- The cargoset "WorkersCargoSet" will embed all defined cargo of type Workers (prefix) into its set. - local WorkersCargoGroup = CARGO_GROUP:New( WorkersGroup, "Workers", "Mechanics", 500 ) - - - -- We setup the task to transport workers. - WorkersCargoTransportTask = TASK_CARGO_TRANSPORT:New( Mission, APC, "Transport Workers", WorkersCargoSet ) - - -- We setup to deploy workers in the deploy zone 1. - WorkersCargoTransportTask:AddDeployZone( ZONE_POLYGON:New( "Deploy Zone Beta", GROUP:FindByName("DeployZone Beta") ) ) - -end - +--- +-- Name: TSK-CGO-510 - Helo - 1 Helo - 2 Task - 2 Cargo - 2 Zones +-- Author: FlightControl +-- Date Created: 12 Mar 2018 +-- +-- This mission demonstrates the transport of a cargo group using an Helicopter. +-- +-- There is: +-- - 1 Helicopter. +-- - 2 Transport Tasks - Transport Workers and Transport Engineers. +-- - 2 Cargo - Workers and Engineers. +-- - 2 Deployment Zones - Alpha and Beta. +-- +-- Task Engineers: Transport the Engineers to Deployment Zone Alpha or Zone Beta. +-- Task Workers: Transport the Workers to Deployment Zone Beta. + +do + local HQ = GROUP:FindByName( "HQ", "Bravo HQ" ) + + local CommandCenter = COMMANDCENTER:New( HQ, "Bravo" ) + + local Scoring = SCORING:New( "Cargo Group Transport Demonstration" ) + + local Mission = MISSION + :New( CommandCenter, "Transport", "High", "Transport the team from Deploy Zone 1 to Deploy Zone 2", coalition.side.BLUE ) + :AddScoring( Scoring ) + + -- Allocate the Transport, which is an APC in the field. + local APC = SET_GROUP:New():FilterPrefixes( "Transport" ):FilterStart() + + -- We will setup the transportation for Engineers. + + -- Here we define the "cargo set", which is a collection of cargo objects. + -- The cargo set will be the input for the cargo transportation task. + -- So a transportation object is handling a cargo set, which is automatically refreshed when new cargo is added/deleted. + local EngineersCargoSet = SET_CARGO:New():FilterTypes( "Engineers" ):FilterStart() + + -- Now we add cargo into the battle scene. + local EngineersGroup = GROUP:FindByName( "Engineers" ) + + -- CARGO_GROUP can be used to setup cargo with a GROUP object underneath. + -- We name this group Engineers. + -- Note that the name of the cargo is "Engineers". + -- The cargoset "EngineersCargoSet" will embed all defined cargo of type Engineers (prefix) into its set. + local EngineersCargoGroup = CARGO_GROUP:New( EngineersGroup, "Engineers", "Radar Team", 500 ) + + + -- We setup the task to transport engineers. + EngineersCargoTransportTask = TASK_CARGO_TRANSPORT:New( Mission, APC, "Transport Engineers", EngineersCargoSet ) + + -- We setup to deploy workers in the deploy zone 1 and 2 (the player can choose). + EngineersCargoTransportTask:AddDeployZone( ZONE_POLYGON:New( "Deploy Zone Alpha", GROUP:FindByName("DeployZone Alpha") ) ) + EngineersCargoTransportTask:AddDeployZone( ZONE_POLYGON:New( "Deploy Zone Beta", GROUP:FindByName("DeployZone Beta") ) ) + + + -- Here we define the "cargo set", which is a collection of cargo objects. + -- The cargo set will be the input for the cargo transportation task. + -- So a transportation object is handling a cargo set, which is automatically refreshed when new cargo is added/deleted. + local WorkersCargoSet = SET_CARGO:New():FilterTypes( "Workers" ):FilterStart() + + local WorkersGroup = GROUP:FindByName( "Workers" ) + + -- CARGO_GROUP can be used to setup cargo with a GROUP object underneath. + -- We name this group Engineers. + -- Note that the name of the cargo is "Workers". + -- The cargoset "WorkersCargoSet" will embed all defined cargo of type Workers (prefix) into its set. + local WorkersCargoGroup = CARGO_GROUP:New( WorkersGroup, "Workers", "Mechanics", 500 ) + + + -- We setup the task to transport workers. + WorkersCargoTransportTask = TASK_CARGO_TRANSPORT:New( Mission, APC, "Transport Workers", WorkersCargoSet ) + + -- We setup to deploy workers in the deploy zone 1. + WorkersCargoTransportTask:AddDeployZone( ZONE_POLYGON:New( "Deploy Zone Beta", GROUP:FindByName("DeployZone Beta") ) ) + +end + diff --git a/Tasking/Task_Capture_Dispatcher/TAD-CAP-000 - Capture Zone Test/TAD-CAP-000 - Capture Zone Test.lua b/Tasking/Task_Capture_Dispatcher/TAD-CAP-000 - Capture Zone Test/TAD-CAP-000 - Capture Zone Test.lua index d4229affc7..00e77306d8 100644 --- a/Tasking/Task_Capture_Dispatcher/TAD-CAP-000 - Capture Zone Test/TAD-CAP-000 - Capture Zone Test.lua +++ b/Tasking/Task_Capture_Dispatcher/TAD-CAP-000 - Capture Zone Test/TAD-CAP-000 - Capture Zone Test.lua @@ -1,117 +1,117 @@ - -do -- Setup the Command Centers - - US_CC = COMMANDCENTER:New( GROUP:FindByName( "BLUEHQ" ), "USA HQ" ) - RU_CC = COMMANDCENTER:New( GROUP:FindByName( "REDHQ" ), "CCCP HQ" ) - -end - -do -- Missions - - US_Mission_EchoBay = MISSION:New( US_CC, "Echo Bay", "Primary", - "Welcome trainee. The airport Groom Lake in Echo Bay needs to be captured.\n" .. - "There are five random capture zones located at the airbase.\n" .. - "Move to one of the capture zones, destroy the fuel tanks in the capture zone, " .. - "and occupy each capture zone with a platoon.\n " .. - "Your orders are to hold position until all capture zones are taken.\n" .. - "Use the map (F10) for a clear indication of the location of each capture zone.\n" .. - "Note that heavy resistance can be expected at the airbase!\n" .. - "Mission 'Echo Bay' is complete when all five capture zones are taken, and held for at least 5 minutes!" - , coalition.side.RED) - - US_Score = SCORING:New( "CAZ-001 - Capture Zone" ) - - US_Mission_EchoBay:AddScoring( US_Score ) - - US_Mission_EchoBay:Start() - -end - - -Players = SET_GROUP:New():FilterPrefixes( "Player" ):FilterStart() - -TaskCaptureZoneDispatcher = TASK_CAPTURE_DISPATCHER:New( US_Mission_EchoBay, Players ) - - ---- define the capture zone - -CaptureZone = ZONE:New( "Alpha-001" ) - -ZoneCaptureCoalition = ZONE_CAPTURE_COALITION:New( CaptureZone, coalition.side.RED ) - - ---- @param Functional.ZoneCaptureCoalition#ZONE_CAPTURE_COALITION self -function ZoneCaptureCoalition:OnEnterGuarded( From, Event, To ) - if From ~= To then - local Coalition = self:GetCoalition() - self:E( { Coalition = Coalition } ) - if Coalition == coalition.side.BLUE then - ZoneCaptureCoalition:Smoke( SMOKECOLOR.Blue ) - US_CC:MessageTypeToCoalition( string.format( "%s is under protection of the USA", ZoneCaptureCoalition:GetZoneName() ), MESSAGE.Type.Information ) - RU_CC:MessageTypeToCoalition( string.format( "%s is under protection of the USA", ZoneCaptureCoalition:GetZoneName() ), MESSAGE.Type.Information ) - else - ZoneCaptureCoalition:Smoke( SMOKECOLOR.Red ) - RU_CC:MessageTypeToCoalition( string.format( "%s is under protection of Russia", ZoneCaptureCoalition:GetZoneName() ), MESSAGE.Type.Information ) - US_CC:MessageTypeToCoalition( string.format( "%s is under protection of Russia", ZoneCaptureCoalition:GetZoneName() ), MESSAGE.Type.Information ) - end - end -end - ---- @param Functional.Protect#ZONE_CAPTURE_COALITION self -function ZoneCaptureCoalition:OnEnterEmpty() - ZoneCaptureCoalition:Smoke( SMOKECOLOR.Green ) - US_CC:MessageTypeToCoalition( string.format( "%s is unprotected, and can be captured!", ZoneCaptureCoalition:GetZoneName() ), MESSAGE.Type.Information ) - RU_CC:MessageTypeToCoalition( string.format( "%s is unprotected, and can be captured!", ZoneCaptureCoalition:GetZoneName() ), MESSAGE.Type.Information ) -end - - ---- @param Functional.Protect#ZONE_CAPTURE_COALITION self -function ZoneCaptureCoalition:OnEnterAttacked() - ZoneCaptureCoalition:Smoke( SMOKECOLOR.White ) - local Coalition = self:GetCoalition() - self:E({Coalition = Coalition}) - if Coalition == coalition.side.BLUE then - US_CC:MessageTypeToCoalition( string.format( "%s is under attack by Russia", ZoneCaptureCoalition:GetZoneName() ), MESSAGE.Type.Information ) - RU_CC:MessageTypeToCoalition( string.format( "We are attacking %s", ZoneCaptureCoalition:GetZoneName() ), MESSAGE.Type.Information ) - else - RU_CC:MessageTypeToCoalition( string.format( "%s is under attack by the USA", ZoneCaptureCoalition:GetZoneName() ), MESSAGE.Type.Information ) - US_CC:MessageTypeToCoalition( string.format( "We are attacking %s", ZoneCaptureCoalition:GetZoneName() ), MESSAGE.Type.Information ) - end -end - ---- @param Functional.Protect#ZONE_CAPTURE_COALITION self -function ZoneCaptureCoalition:OnEnterCaptured() - local Coalition = self:GetCoalition() - self:E({Coalition = Coalition}) - if Coalition == coalition.side.BLUE then - RU_CC:MessageTypeToCoalition( string.format( "%s is captured by the USA, we lost it!", ZoneCaptureCoalition:GetZoneName() ), MESSAGE.Type.Information ) - US_CC:MessageTypeToCoalition( string.format( "We captured %s, Excellent job!", ZoneCaptureCoalition:GetZoneName() ), MESSAGE.Type.Information ) - else - US_CC:MessageTypeToCoalition( string.format( "%s is captured by Russia, we lost it!", ZoneCaptureCoalition:GetZoneName() ), MESSAGE.Type.Information ) - RU_CC:MessageTypeToCoalition( string.format( "We captured %s, Excellent job!", ZoneCaptureCoalition:GetZoneName() ), MESSAGE.Type.Information ) - end - - self:AddScore( "Captured", "Zone captured: Extra points granted.", 200 ) - - self:__Guard( 30 ) -end - -ZoneCaptureCoalition:MonitorDestroyedUnits() -ZoneCaptureCoalition:__Guard( 1 ) -ZoneCaptureCoalition:Start( 5, 15 ) - --- Create the tasks under the mission - -local ZoneCaptureGroupSet = SET_GROUP:New():FilterCoalitions("blue"):FilterStart() - - --- create the capture zone task. - -US_Task_Zone_Capture = TaskCaptureZoneDispatcher:AddCaptureZoneTask( "Capture Zone", ZoneCaptureCoalition, "Capture the zone" ) - -US_CC:SetAutoAssignTasks( true ) -US_CC:SetAutoAcceptTasks( true ) - - - - + +do -- Setup the Command Centers + + US_CC = COMMANDCENTER:New( GROUP:FindByName( "BLUEHQ" ), "USA HQ" ) + RU_CC = COMMANDCENTER:New( GROUP:FindByName( "REDHQ" ), "CCCP HQ" ) + +end + +do -- Missions + + US_Mission_EchoBay = MISSION:New( US_CC, "Echo Bay", "Primary", + "Welcome trainee. The airport Groom Lake in Echo Bay needs to be captured.\n" .. + "There are five random capture zones located at the airbase.\n" .. + "Move to one of the capture zones, destroy the fuel tanks in the capture zone, " .. + "and occupy each capture zone with a platoon.\n " .. + "Your orders are to hold position until all capture zones are taken.\n" .. + "Use the map (F10) for a clear indication of the location of each capture zone.\n" .. + "Note that heavy resistance can be expected at the airbase!\n" .. + "Mission 'Echo Bay' is complete when all five capture zones are taken, and held for at least 5 minutes!" + , coalition.side.RED) + + US_Score = SCORING:New( "CAZ-001 - Capture Zone" ) + + US_Mission_EchoBay:AddScoring( US_Score ) + + US_Mission_EchoBay:Start() + +end + + +Players = SET_GROUP:New():FilterPrefixes( "Player" ):FilterStart() + +TaskCaptureZoneDispatcher = TASK_CAPTURE_DISPATCHER:New( US_Mission_EchoBay, Players ) + + +--- define the capture zone + +CaptureZone = ZONE:New( "Alpha-001" ) + +ZoneCaptureCoalition = ZONE_CAPTURE_COALITION:New( CaptureZone, coalition.side.RED ) + + +--- @param Functional.ZoneCaptureCoalition#ZONE_CAPTURE_COALITION self +function ZoneCaptureCoalition:OnEnterGuarded( From, Event, To ) + if From ~= To then + local Coalition = self:GetCoalition() + self:E( { Coalition = Coalition } ) + if Coalition == coalition.side.BLUE then + ZoneCaptureCoalition:Smoke( SMOKECOLOR.Blue ) + US_CC:MessageTypeToCoalition( string.format( "%s is under protection of the USA", ZoneCaptureCoalition:GetZoneName() ), MESSAGE.Type.Information ) + RU_CC:MessageTypeToCoalition( string.format( "%s is under protection of the USA", ZoneCaptureCoalition:GetZoneName() ), MESSAGE.Type.Information ) + else + ZoneCaptureCoalition:Smoke( SMOKECOLOR.Red ) + RU_CC:MessageTypeToCoalition( string.format( "%s is under protection of Russia", ZoneCaptureCoalition:GetZoneName() ), MESSAGE.Type.Information ) + US_CC:MessageTypeToCoalition( string.format( "%s is under protection of Russia", ZoneCaptureCoalition:GetZoneName() ), MESSAGE.Type.Information ) + end + end +end + +--- @param Functional.Protect#ZONE_CAPTURE_COALITION self +function ZoneCaptureCoalition:OnEnterEmpty() + ZoneCaptureCoalition:Smoke( SMOKECOLOR.Green ) + US_CC:MessageTypeToCoalition( string.format( "%s is unprotected, and can be captured!", ZoneCaptureCoalition:GetZoneName() ), MESSAGE.Type.Information ) + RU_CC:MessageTypeToCoalition( string.format( "%s is unprotected, and can be captured!", ZoneCaptureCoalition:GetZoneName() ), MESSAGE.Type.Information ) +end + + +--- @param Functional.Protect#ZONE_CAPTURE_COALITION self +function ZoneCaptureCoalition:OnEnterAttacked() + ZoneCaptureCoalition:Smoke( SMOKECOLOR.White ) + local Coalition = self:GetCoalition() + self:E({Coalition = Coalition}) + if Coalition == coalition.side.BLUE then + US_CC:MessageTypeToCoalition( string.format( "%s is under attack by Russia", ZoneCaptureCoalition:GetZoneName() ), MESSAGE.Type.Information ) + RU_CC:MessageTypeToCoalition( string.format( "We are attacking %s", ZoneCaptureCoalition:GetZoneName() ), MESSAGE.Type.Information ) + else + RU_CC:MessageTypeToCoalition( string.format( "%s is under attack by the USA", ZoneCaptureCoalition:GetZoneName() ), MESSAGE.Type.Information ) + US_CC:MessageTypeToCoalition( string.format( "We are attacking %s", ZoneCaptureCoalition:GetZoneName() ), MESSAGE.Type.Information ) + end +end + +--- @param Functional.Protect#ZONE_CAPTURE_COALITION self +function ZoneCaptureCoalition:OnEnterCaptured() + local Coalition = self:GetCoalition() + self:E({Coalition = Coalition}) + if Coalition == coalition.side.BLUE then + RU_CC:MessageTypeToCoalition( string.format( "%s is captured by the USA, we lost it!", ZoneCaptureCoalition:GetZoneName() ), MESSAGE.Type.Information ) + US_CC:MessageTypeToCoalition( string.format( "We captured %s, Excellent job!", ZoneCaptureCoalition:GetZoneName() ), MESSAGE.Type.Information ) + else + US_CC:MessageTypeToCoalition( string.format( "%s is captured by Russia, we lost it!", ZoneCaptureCoalition:GetZoneName() ), MESSAGE.Type.Information ) + RU_CC:MessageTypeToCoalition( string.format( "We captured %s, Excellent job!", ZoneCaptureCoalition:GetZoneName() ), MESSAGE.Type.Information ) + end + + self:AddScore( "Captured", "Zone captured: Extra points granted.", 200 ) + + self:__Guard( 30 ) +end + +ZoneCaptureCoalition:MonitorDestroyedUnits() +ZoneCaptureCoalition:__Guard( 1 ) +ZoneCaptureCoalition:Start( 5, 15 ) + +-- Create the tasks under the mission + +local ZoneCaptureGroupSet = SET_GROUP:New():FilterCoalitions("blue"):FilterStart() + + +-- create the capture zone task. + +US_Task_Zone_Capture = TaskCaptureZoneDispatcher:AddCaptureZoneTask( "Capture Zone", ZoneCaptureCoalition, "Capture the zone" ) + +US_CC:SetAutoAssignTasks( true ) +US_CC:SetAutoAcceptTasks( true ) + + + + diff --git a/Tasking/Task_Cargo_Dispatcher/TAD-CGO-000 - CSAR Test/TAD-CGO-000 - CSAR Test.lua b/Tasking/Task_Cargo_Dispatcher/TAD-CGO-000 - CSAR Test/TAD-CGO-000 - CSAR Test.lua index 874d590d70..c8651fcad2 100644 --- a/Tasking/Task_Cargo_Dispatcher/TAD-CGO-000 - CSAR Test/TAD-CGO-000 - CSAR Test.lua +++ b/Tasking/Task_Cargo_Dispatcher/TAD-CGO-000 - CSAR Test/TAD-CGO-000 - CSAR Test.lua @@ -1,34 +1,34 @@ ---- --- Name: TAD-CGO-000 - CSAR Test --- Author: FlightControl --- Date Created: 31 Mar 2018 --- --- # Situation: --- --- This mission demonstrates the dynamic task dispatching for cargo CSAR operations. --- - -HQ = GROUP:FindByName( "HQ", "Bravo" ) - -CommandCenter = COMMANDCENTER - :New( HQ, "Lima" ) - -Mission = MISSION - :New( CommandCenter, "CSAR Missions", "Tactical", "Rescue downed pilots.", coalition.side.RED ) - -AttackGroups = SET_GROUP:New():FilterCoalitions( "red" ):FilterPrefixes( "Rescue" ):FilterStart() - -TaskDispatcher = TASK_CARGO_DISPATCHER:New( Mission, AttackGroups ) - -TaskDispatcher:StartCSARTasks( - "CSAR", - { ZONE_UNIT:New( "Hospital", STATIC:FindByName( "Hospital" ), 100 ) }, - "One of our pilots has ejected. Go out to Search and Rescue our pilot!\n" .. - "Use the radio menu to let the command center assist you with the CSAR tasking." -) - -function TaskDispatcher:OnAfterCargoDeployed( From, Event, To, Task, TaskPrefix, TaskUnit, Cargo, DeployZone ) - - MESSAGE:NewType( "Unit " .. TaskUnit:GetName().. " has deployed cargo " .. Cargo:GetName() .. " at zone " .. DeployZone:GetName() .. " for task " .. Task:GetName() .. ".", MESSAGE.Type.Information ):ToAll() - -end +--- +-- Name: TAD-CGO-000 - CSAR Test +-- Author: FlightControl +-- Date Created: 31 Mar 2018 +-- +-- # Situation: +-- +-- This mission demonstrates the dynamic task dispatching for cargo CSAR operations. +-- + +HQ = GROUP:FindByName( "HQ", "Bravo" ) + +CommandCenter = COMMANDCENTER + :New( HQ, "Lima" ) + +Mission = MISSION + :New( CommandCenter, "CSAR Missions", "Tactical", "Rescue downed pilots.", coalition.side.RED ) + +AttackGroups = SET_GROUP:New():FilterCoalitions( "red" ):FilterPrefixes( "Rescue" ):FilterStart() + +TaskDispatcher = TASK_CARGO_DISPATCHER:New( Mission, AttackGroups ) + +TaskDispatcher:StartCSARTasks( + "CSAR", + { ZONE_UNIT:New( "Hospital", STATIC:FindByName( "Hospital" ), 100 ) }, + "One of our pilots has ejected. Go out to Search and Rescue our pilot!\n" .. + "Use the radio menu to let the command center assist you with the CSAR tasking." +) + +function TaskDispatcher:OnAfterCargoDeployed( From, Event, To, Task, TaskPrefix, TaskUnit, Cargo, DeployZone ) + + MESSAGE:NewType( "Unit " .. TaskUnit:GetName().. " has deployed cargo " .. Cargo:GetName() .. " at zone " .. DeployZone:GetName() .. " for task " .. Task:GetName() .. ".", MESSAGE.Type.Information ):ToAll() + +end diff --git a/Tasking/Task_Cargo_Dispatcher/TAD-CGO-001 - Transport Test/TAD-CGO-001 - Transport Test.lua b/Tasking/Task_Cargo_Dispatcher/TAD-CGO-001 - Transport Test/TAD-CGO-001 - Transport Test.lua index 2a7247906b..c0d5d13ae4 100644 --- a/Tasking/Task_Cargo_Dispatcher/TAD-CGO-001 - Transport Test/TAD-CGO-001 - Transport Test.lua +++ b/Tasking/Task_Cargo_Dispatcher/TAD-CGO-001 - Transport Test/TAD-CGO-001 - Transport Test.lua @@ -1,50 +1,50 @@ ---- --- Name: TAD-CGO-001 - Transport Test --- Author: FlightControl --- Date Created: 31 Mar 2018 --- --- # Situation: --- --- This mission demonstrates the dynamic task dispatching for cargo Transport operations. - - -local HQ = GROUP:FindByName( "HQ", "Bravo" ) - -local CommandCenter = COMMANDCENTER - :New( HQ, "Lima" ) - -local Mission = MISSION - :New( CommandCenter, "Infantry Transportation", "Tactical", - "Board the engineers into your MIL-8MTV.", coalition.side.RED ) - --- Within the mission file, there is a helicopter defined with a player slot (client). --- It has the name "Transport Helicopter". --- The SET_GROUP filter will search for all groups that start with the name "Transport" and will add them to the set. --- The TransportGroups object of type SET_GROUP will be added to the TaskDispatcher as a parameter, to indicate the groups that will transport the cargo. -local TransportGroups = SET_GROUP:New():FilterCoalitions( "red" ):FilterPrefixes( "Transport" ):FilterStart() - --- This is the task dispatcher main object! --- It takes a role in the Mission, for the pilots seated in TransportGroups. -TaskDispatcher = TASK_CARGO_DISPATCHER:New( Mission, TransportGroups ) - --- This zone indicates the location where the engineers can be transported towards. --- After boarding the engineers, the pilot can ask the HQ to provide routing assistance towards this zone. -TaskDispatcher:SetDefaultDeployZone( ZONE:New( "Stadium" ) ) - - --- Here we define the "cargo set", which is a collection of cargo objects. --- The cargo set will be the input for the cargo transportation task. --- So a transportation object is handling a cargo set, which is automatically refreshed when new cargo is added/deleted. -local EngineersSet = SET_CARGO:New():FilterTypes( "Engineers" ):FilterStart() - --- CARGO_GROUP can be used to setup cargo with a GROUP object underneath. --- We name this group "Engineers", and is of type "SAM Engineers". --- The cargoset "EngineersSet" will embed all defined cargo of type Engineers (prefix) into its set. -local EngineerGroup1 = CARGO_GROUP:New( GROUP:FindByName( "Engineers#001" ), "Engineers", "SAM Engineers 1", 500 ) -local EngineerGroup2 = CARGO_GROUP:New( GROUP:FindByName( "Engineers#002" ), "Engineers", "SAM Engineers 2", 500 ) -local EngineerGroup3 = CARGO_GROUP:New( GROUP:FindByName( "Engineers#003" ), "Engineers", "SAM Engineers 3", 500 ) - --- -local WorkplaceTask = TaskDispatcher:AddTransportTask( "Transport", EngineersSet, "Transport the SAM Engineers and its equipment to the Stadium." ) - - +--- +-- Name: TAD-CGO-001 - Transport Test +-- Author: FlightControl +-- Date Created: 31 Mar 2018 +-- +-- # Situation: +-- +-- This mission demonstrates the dynamic task dispatching for cargo Transport operations. + + +local HQ = GROUP:FindByName( "HQ", "Bravo" ) + +local CommandCenter = COMMANDCENTER + :New( HQ, "Lima" ) + +local Mission = MISSION + :New( CommandCenter, "Infantry Transportation", "Tactical", + "Board the engineers into your MIL-8MTV.", coalition.side.RED ) + +-- Within the mission file, there is a helicopter defined with a player slot (client). +-- It has the name "Transport Helicopter". +-- The SET_GROUP filter will search for all groups that start with the name "Transport" and will add them to the set. +-- The TransportGroups object of type SET_GROUP will be added to the TaskDispatcher as a parameter, to indicate the groups that will transport the cargo. +local TransportGroups = SET_GROUP:New():FilterCoalitions( "red" ):FilterPrefixes( "Transport" ):FilterStart() + +-- This is the task dispatcher main object! +-- It takes a role in the Mission, for the pilots seated in TransportGroups. +TaskDispatcher = TASK_CARGO_DISPATCHER:New( Mission, TransportGroups ) + +-- This zone indicates the location where the engineers can be transported towards. +-- After boarding the engineers, the pilot can ask the HQ to provide routing assistance towards this zone. +TaskDispatcher:SetDefaultDeployZone( ZONE:New( "Stadium" ) ) + + +-- Here we define the "cargo set", which is a collection of cargo objects. +-- The cargo set will be the input for the cargo transportation task. +-- So a transportation object is handling a cargo set, which is automatically refreshed when new cargo is added/deleted. +local EngineersSet = SET_CARGO:New():FilterTypes( "Engineers" ):FilterStart() + +-- CARGO_GROUP can be used to setup cargo with a GROUP object underneath. +-- We name this group "Engineers", and is of type "SAM Engineers". +-- The cargoset "EngineersSet" will embed all defined cargo of type Engineers (prefix) into its set. +local EngineerGroup1 = CARGO_GROUP:New( GROUP:FindByName( "Engineers#001" ), "Engineers", "SAM Engineers 1", 500 ) +local EngineerGroup2 = CARGO_GROUP:New( GROUP:FindByName( "Engineers#002" ), "Engineers", "SAM Engineers 2", 500 ) +local EngineerGroup3 = CARGO_GROUP:New( GROUP:FindByName( "Engineers#003" ), "Engineers", "SAM Engineers 3", 500 ) + +-- +local WorkplaceTask = TaskDispatcher:AddTransportTask( "Transport", EngineersSet, "Transport the SAM Engineers and its equipment to the Stadium." ) + + diff --git a/Tasking/Task_Cargo_Dispatcher/TAD-CGO-002 - Transport Test - Crate/TAD-CGO-002 - Transport Test - Crate.lua b/Tasking/Task_Cargo_Dispatcher/TAD-CGO-002 - Transport Test - Crate/TAD-CGO-002 - Transport Test - Crate.lua index 6829b41793..43e2c506a8 100644 --- a/Tasking/Task_Cargo_Dispatcher/TAD-CGO-002 - Transport Test - Crate/TAD-CGO-002 - Transport Test - Crate.lua +++ b/Tasking/Task_Cargo_Dispatcher/TAD-CGO-002 - Transport Test - Crate/TAD-CGO-002 - Transport Test - Crate.lua @@ -1,40 +1,40 @@ ---- --- Name: TAD-CGO-002 - Transport Test - Crate --- Author: FlightControl --- Date Created: 04 Apr 2018 --- --- # Situation: --- --- This mission demonstrates the dynamic task dispatching for cargo Transport operations of a crate. --- - -HQ = GROUP:FindByName( "HQ", "Bravo" ) - -CommandCenter = COMMANDCENTER - :New( HQ, "Lima" ) - -Mission = MISSION - :New( CommandCenter, "Operation SandStorm", "Tactical", "Transport Cargo", coalition.side.RED ) - -TransportGroups = SET_GROUP:New():FilterCoalitions( "red" ):FilterPrefixes( "Transport" ):FilterStart() - -TaskDispatcher = TASK_CARGO_DISPATCHER:New( Mission, TransportGroups ) - -TaskDispatcher:SetDefaultDeployZone( ZONE:New( "Hangar" ) ) - - --- Here we define the "cargo set", which is a collection of cargo objects. --- The cargo set will be the input for the cargo transportation task. --- So a transportation object is handling a cargo set, which is automatically refreshed when new cargo is added/deleted. -local CargoSet = SET_CARGO:New():FilterTypes( "Crates" ):FilterStart() - --- Now we add cargo into the battle scene. -local CrateStatic = STATIC:FindByName( "Crate" ) - --- CARGO_CRATE can be used to setup cargo as a crate or any other static cargo object. --- We name this group "Important things", and is of type "Crates". --- The cargoset "CargoSet" will embed all defined cargo of type Crates into its set. -local CrateCargo = CARGO_CRATE:New( CrateStatic, "Crates", "Important things", 1000, 25 ) - -local WorkplaceTask = TaskDispatcher:AddTransportTask( "Transport Crates", CargoSet, "Transport the Crates near the Hangar." ) - +--- +-- Name: TAD-CGO-002 - Transport Test - Crate +-- Author: FlightControl +-- Date Created: 04 Apr 2018 +-- +-- # Situation: +-- +-- This mission demonstrates the dynamic task dispatching for cargo Transport operations of a crate. +-- + +HQ = GROUP:FindByName( "HQ", "Bravo" ) + +CommandCenter = COMMANDCENTER + :New( HQ, "Lima" ) + +Mission = MISSION + :New( CommandCenter, "Operation SandStorm", "Tactical", "Transport Cargo", coalition.side.RED ) + +TransportGroups = SET_GROUP:New():FilterCoalitions( "red" ):FilterPrefixes( "Transport" ):FilterStart() + +TaskDispatcher = TASK_CARGO_DISPATCHER:New( Mission, TransportGroups ) + +TaskDispatcher:SetDefaultDeployZone( ZONE:New( "Hangar" ) ) + + +-- Here we define the "cargo set", which is a collection of cargo objects. +-- The cargo set will be the input for the cargo transportation task. +-- So a transportation object is handling a cargo set, which is automatically refreshed when new cargo is added/deleted. +local CargoSet = SET_CARGO:New():FilterTypes( "Crates" ):FilterStart() + +-- Now we add cargo into the battle scene. +local CrateStatic = STATIC:FindByName( "Crate" ) + +-- CARGO_CRATE can be used to setup cargo as a crate or any other static cargo object. +-- We name this group "Important things", and is of type "Crates". +-- The cargoset "CargoSet" will embed all defined cargo of type Crates into its set. +local CrateCargo = CARGO_CRATE:New( CrateStatic, "Crates", "Important things", 1000, 25 ) + +local WorkplaceTask = TaskDispatcher:AddTransportTask( "Transport Crates", CargoSet, "Transport the Crates near the Hangar." ) + diff --git a/Tasking/Task_Cargo_Dispatcher/TAD-CGO-003 - Transport Test - Infantry and Crate/TAD-CGO-003 - Transport Test - Infantry and Crate.lua b/Tasking/Task_Cargo_Dispatcher/TAD-CGO-003 - Transport Test - Infantry and Crate/TAD-CGO-003 - Transport Test - Infantry and Crate.lua index b5417a7c7c..7c4c5539fe 100644 --- a/Tasking/Task_Cargo_Dispatcher/TAD-CGO-003 - Transport Test - Infantry and Crate/TAD-CGO-003 - Transport Test - Infantry and Crate.lua +++ b/Tasking/Task_Cargo_Dispatcher/TAD-CGO-003 - Transport Test - Infantry and Crate/TAD-CGO-003 - Transport Test - Infantry and Crate.lua @@ -1,49 +1,49 @@ ---- --- Name: TAD-CGO-003 - Transport Test - Infantry and Crate --- Author: FlightControl --- Date Created: 05 Apr 2018 --- --- # Situation: --- --- This mission demonstrates the dynamic task dispatching for cargo Transport operations of a crate and infantry. --- - -HQ = GROUP:FindByName( "HQ", "Bravo" ) - -CommandCenter = COMMANDCENTER - :New( HQ, "Lima" ) - -Mission = MISSION - :New( CommandCenter, "Operation SandStorm", "Tactical", "Transport Cargo", coalition.side.RED ) - -TransportGroups = SET_GROUP:New():FilterCoalitions( "red" ):FilterPrefixes( "Transport" ):FilterStart() - -TaskDispatcher = TASK_CARGO_DISPATCHER:New( Mission, TransportGroups ) - -TaskDispatcher:SetDefaultDeployZone( ZONE:New( "Hangar" ) ) - - --- Now we add cargo into the battle scene. -local CrateStatic = STATIC:FindByName( "Crate" ) - --- CARGO_CRATE can be used to setup cargo as a crate or any other static cargo object. --- We name this group "Important things", and is of type "Crates". --- The cargoset "CargoSet" will embed all defined cargo of type Crates into its set. -local CrateCargo = CARGO_CRATE:New( CrateStatic, "Football", "Important things", 1000, 25 ) - --- Here we define the "cargo set", which is a collection of cargo objects. --- The cargo set will be the input for the cargo transportation task. --- So a transportation object is handling a cargo set, which is automatically refreshed when new cargo is added/deleted. -local FootballSet = SET_CARGO:New():FilterTypes( "Football" ):FilterStart() - --- Now we add cargo into the battle scene. -local FootballGroup = GROUP:FindByName( "Anderlecht#001" ) - --- CARGO_GROUP can be used to setup cargo with a GROUP object underneath. --- We name this group "FC Anderlecht", and is of type "Football Players". --- The cargoset "EngineersCargoSet" will embed all defined cargo of type Engineers (prefix) into its set. -local FootballPlayerGroup = CARGO_GROUP:New( FootballGroup, "Football", "FC Anderlecht", 500 ) - -local WorkplaceTask = TaskDispatcher:AddTransportTask( "Transport Team", FootballSet, "Transport FC Anderlecht and the equipment near the Hangar." ) - - +--- +-- Name: TAD-CGO-003 - Transport Test - Infantry and Crate +-- Author: FlightControl +-- Date Created: 05 Apr 2018 +-- +-- # Situation: +-- +-- This mission demonstrates the dynamic task dispatching for cargo Transport operations of a crate and infantry. +-- + +HQ = GROUP:FindByName( "HQ", "Bravo" ) + +CommandCenter = COMMANDCENTER + :New( HQ, "Lima" ) + +Mission = MISSION + :New( CommandCenter, "Operation SandStorm", "Tactical", "Transport Cargo", coalition.side.RED ) + +TransportGroups = SET_GROUP:New():FilterCoalitions( "red" ):FilterPrefixes( "Transport" ):FilterStart() + +TaskDispatcher = TASK_CARGO_DISPATCHER:New( Mission, TransportGroups ) + +TaskDispatcher:SetDefaultDeployZone( ZONE:New( "Hangar" ) ) + + +-- Now we add cargo into the battle scene. +local CrateStatic = STATIC:FindByName( "Crate" ) + +-- CARGO_CRATE can be used to setup cargo as a crate or any other static cargo object. +-- We name this group "Important things", and is of type "Crates". +-- The cargoset "CargoSet" will embed all defined cargo of type Crates into its set. +local CrateCargo = CARGO_CRATE:New( CrateStatic, "Football", "Important things", 1000, 25 ) + +-- Here we define the "cargo set", which is a collection of cargo objects. +-- The cargo set will be the input for the cargo transportation task. +-- So a transportation object is handling a cargo set, which is automatically refreshed when new cargo is added/deleted. +local FootballSet = SET_CARGO:New():FilterTypes( "Football" ):FilterStart() + +-- Now we add cargo into the battle scene. +local FootballGroup = GROUP:FindByName( "Anderlecht#001" ) + +-- CARGO_GROUP can be used to setup cargo with a GROUP object underneath. +-- We name this group "FC Anderlecht", and is of type "Football Players". +-- The cargoset "EngineersCargoSet" will embed all defined cargo of type Engineers (prefix) into its set. +local FootballPlayerGroup = CARGO_GROUP:New( FootballGroup, "Football", "FC Anderlecht", 500 ) + +local WorkplaceTask = TaskDispatcher:AddTransportTask( "Transport Team", FootballSet, "Transport FC Anderlecht and the equipment near the Hangar." ) + + diff --git a/Tasking/Task_Cargo_Dispatcher/TAD-CGO-004 - Transport Test - Infantry and Slingload/TAD-CGO-004 - Transport Test - Infantry and Slingload.lua b/Tasking/Task_Cargo_Dispatcher/TAD-CGO-004 - Transport Test - Infantry and Slingload/TAD-CGO-004 - Transport Test - Infantry and Slingload.lua index 3c9b373831..e921cf83bc 100644 --- a/Tasking/Task_Cargo_Dispatcher/TAD-CGO-004 - Transport Test - Infantry and Slingload/TAD-CGO-004 - Transport Test - Infantry and Slingload.lua +++ b/Tasking/Task_Cargo_Dispatcher/TAD-CGO-004 - Transport Test - Infantry and Slingload/TAD-CGO-004 - Transport Test - Infantry and Slingload.lua @@ -1,50 +1,50 @@ ---- --- Name: TAD-CGO-004 - Transport Test - Infantry and Slingload --- Author: FlightControl --- Date Created: 05 Apr 2018 --- --- # Situation: --- --- This mission demonstrates the dynamic task dispatching for cargo Transport operations of a crate and infantry. --- Slingload the concrete and board the infantry. --- - -HQ = GROUP:FindByName( "HQ", "Bravo" ) - -CommandCenter = COMMANDCENTER - :New( HQ, "Lima" ) - -Mission = MISSION - :New( CommandCenter, "Operation SandStorm", "Tactical", "Transport Cargo", coalition.side.RED ) - -TransportGroups = SET_GROUP:New():FilterCoalitions( "red" ):FilterPrefixes( "Transport" ):FilterStart() - -TaskDispatcher = TASK_CARGO_DISPATCHER:New( Mission, TransportGroups ) - -TaskDispatcher:SetDefaultDeployZone( ZONE:New( "Workplace" ) ) - - --- Now we add cargo into the battle scene. -local CrateStatic = STATIC:FindByName( "Tetrapod" ) - --- CARGO_SLINGLOAD can be used to setup cargo as a crate or any other static cargo object. --- We name this group "Important Concrete", and is of type "Workmaterials". --- The cargoset "CargoSet" will embed all defined cargo of type Crates into its set. -local CrateCargo = CARGO_SLINGLOAD:New( CrateStatic, "Workmaterials", "Concrete", 1000, 25 ) - --- Here we define the "cargo set", which is a collection of cargo objects. --- The cargo set will be the input for the cargo transportation task. --- So a transportation object is handling a cargo set, which is automatically refreshed when new cargo is added/deleted. -local CargoSet = SET_CARGO:New():FilterTypes( "Workmaterials" ):FilterStart() - --- Now we add cargo into the battle scene. -local WorkerGroup = GROUP:FindByName( "Workers" ) - --- CARGO_GROUP can be used to setup cargo with a GROUP object underneath. --- We name this group "Workers", and is of type "Workmaterials". --- The cargoset "CargoSet" will embed all defined cargo of type Workmaterials (prefix) into its set. -local WorkerCargoGroup = CARGO_GROUP:New( WorkerGroup, "Workmaterials", "Workers", 500 ) - -local WorkplaceTask = TaskDispatcher:AddTransportTask( "Transport Team", CargoSet, "Transport the workers and the equipment near the Workplace." ) - - +--- +-- Name: TAD-CGO-004 - Transport Test - Infantry and Slingload +-- Author: FlightControl +-- Date Created: 05 Apr 2018 +-- +-- # Situation: +-- +-- This mission demonstrates the dynamic task dispatching for cargo Transport operations of a crate and infantry. +-- Slingload the concrete and board the infantry. +-- + +HQ = GROUP:FindByName( "HQ", "Bravo" ) + +CommandCenter = COMMANDCENTER + :New( HQ, "Lima" ) + +Mission = MISSION + :New( CommandCenter, "Operation SandStorm", "Tactical", "Transport Cargo", coalition.side.RED ) + +TransportGroups = SET_GROUP:New():FilterCoalitions( "red" ):FilterPrefixes( "Transport" ):FilterStart() + +TaskDispatcher = TASK_CARGO_DISPATCHER:New( Mission, TransportGroups ) + +TaskDispatcher:SetDefaultDeployZone( ZONE:New( "Workplace" ) ) + + +-- Now we add cargo into the battle scene. +local CrateStatic = STATIC:FindByName( "Tetrapod" ) + +-- CARGO_SLINGLOAD can be used to setup cargo as a crate or any other static cargo object. +-- We name this group "Important Concrete", and is of type "Workmaterials". +-- The cargoset "CargoSet" will embed all defined cargo of type Crates into its set. +local CrateCargo = CARGO_SLINGLOAD:New( CrateStatic, "Workmaterials", "Concrete", 1000, 25 ) + +-- Here we define the "cargo set", which is a collection of cargo objects. +-- The cargo set will be the input for the cargo transportation task. +-- So a transportation object is handling a cargo set, which is automatically refreshed when new cargo is added/deleted. +local CargoSet = SET_CARGO:New():FilterTypes( "Workmaterials" ):FilterStart() + +-- Now we add cargo into the battle scene. +local WorkerGroup = GROUP:FindByName( "Workers" ) + +-- CARGO_GROUP can be used to setup cargo with a GROUP object underneath. +-- We name this group "Workers", and is of type "Workmaterials". +-- The cargoset "CargoSet" will embed all defined cargo of type Workmaterials (prefix) into its set. +local WorkerCargoGroup = CARGO_GROUP:New( WorkerGroup, "Workmaterials", "Workers", 500 ) + +local WorkplaceTask = TaskDispatcher:AddTransportTask( "Transport Team", CargoSet, "Transport the workers and the equipment near the Workplace." ) + + diff --git a/Tasking/Task_Cargo_Dispatcher/TAD-CGO-005 - Transport Test - Various Cargo/TAD-CGO-005 - Transport Test - Various Cargo.lua b/Tasking/Task_Cargo_Dispatcher/TAD-CGO-005 - Transport Test - Various Cargo/TAD-CGO-005 - Transport Test - Various Cargo.lua index f4bef7993c..97fafebf8a 100644 --- a/Tasking/Task_Cargo_Dispatcher/TAD-CGO-005 - Transport Test - Various Cargo/TAD-CGO-005 - Transport Test - Various Cargo.lua +++ b/Tasking/Task_Cargo_Dispatcher/TAD-CGO-005 - Transport Test - Various Cargo/TAD-CGO-005 - Transport Test - Various Cargo.lua @@ -1,51 +1,51 @@ ---- --- Name: TAD-CGO-005 - Transport Test - Various Cargo --- Author: FlightControl --- Date Created: 05 Apr 2018 --- --- # Situation: --- --- This mission demonstrates the dynamic task dispatching for cargo Transport operations of various cargo types. --- - -HQ = GROUP:FindByName( "HQ", "Bravo" ) - -CommandCenter = COMMANDCENTER - :New( HQ, "Lima" ) - -Mission = MISSION - :New( CommandCenter, "Operation SandStorm", "Tactical", "Transport Cargo", coalition.side.BLUE ) - -TransportGroups = SET_GROUP:New():FilterCoalitions( "blue" ):FilterPrefixes( "Transport" ):FilterStart() - -TaskDispatcher = TASK_CARGO_DISPATCHER:New( Mission, TransportGroups ) - -TaskDispatcher:SetDefaultDeployZone( ZONE:New( "Workplace" ) ) - - -local CargoSet = SET_CARGO:New():FilterTypes( "Workmaterials" ):FilterStart() - -local WorkerCargoGroup = CARGO_GROUP:New( GROUP:FindByName( "Workers" ), "Workmaterials", "Workers", 250 ) -WorkerCargoGroup:ReportSmoke( SMOKECOLOR.Green ) - -local EngineerCargoGroup = CARGO_GROUP:New( GROUP:FindByName( "Engineers" ), "Workmaterials", "Engineers", 100 ) -EngineerCargoGroup:ReportSmoke( SMOKECOLOR.Red ) - -local ConcreteCargo = CARGO_SLINGLOAD:New( STATIC:FindByName( "Concrete" ), "Workmaterials", "Concrete", 100, 25 ) -ConcreteCargo:ReportSmoke( SMOKECOLOR.White ) - -local CrateCargo = CARGO_CRATE:New( STATIC:FindByName( "Crate" ), "Workmaterials", "Crate", 50, 25 ) -CrateCargo:ReportSmoke( SMOKECOLOR.Orange ) - -local EnginesCargo = CARGO_CRATE:New( STATIC:FindByName( "Engines" ), "Workmaterials", "Engines", 150, 25 ) -EnginesCargo:ReportFlare( FLARECOLOR.Red ) - -local FuelCargo = CARGO_SLINGLOAD:New( STATIC:FindByName( "Fuel" ), "Workmaterials", "Fuel", 200, 25 ) -FuelCargo:ReportFlare( FLARECOLOR.Green ) - -local MetalCargo = CARGO_CRATE:New( STATIC:FindByName( "Metal" ), "Workmaterials", "Metal", 500, 25 ) -MetalCargo:ReportFlare( FLARECOLOR.Yellow ) - -local WorkplaceTask = TaskDispatcher:AddTransportTask( "Transport Team", CargoSet, "Transport the workers, engineers and the equipment near the Workplace." ) - - +--- +-- Name: TAD-CGO-005 - Transport Test - Various Cargo +-- Author: FlightControl +-- Date Created: 05 Apr 2018 +-- +-- # Situation: +-- +-- This mission demonstrates the dynamic task dispatching for cargo Transport operations of various cargo types. +-- + +HQ = GROUP:FindByName( "HQ", "Bravo" ) + +CommandCenter = COMMANDCENTER + :New( HQ, "Lima" ) + +Mission = MISSION + :New( CommandCenter, "Operation SandStorm", "Tactical", "Transport Cargo", coalition.side.BLUE ) + +TransportGroups = SET_GROUP:New():FilterCoalitions( "blue" ):FilterPrefixes( "Transport" ):FilterStart() + +TaskDispatcher = TASK_CARGO_DISPATCHER:New( Mission, TransportGroups ) + +TaskDispatcher:SetDefaultDeployZone( ZONE:New( "Workplace" ) ) + + +local CargoSet = SET_CARGO:New():FilterTypes( "Workmaterials" ):FilterStart() + +local WorkerCargoGroup = CARGO_GROUP:New( GROUP:FindByName( "Workers" ), "Workmaterials", "Workers", 250 ) +WorkerCargoGroup:ReportSmoke( SMOKECOLOR.Green ) + +local EngineerCargoGroup = CARGO_GROUP:New( GROUP:FindByName( "Engineers" ), "Workmaterials", "Engineers", 100 ) +EngineerCargoGroup:ReportSmoke( SMOKECOLOR.Red ) + +local ConcreteCargo = CARGO_SLINGLOAD:New( STATIC:FindByName( "Concrete" ), "Workmaterials", "Concrete", 100, 25 ) +ConcreteCargo:ReportSmoke( SMOKECOLOR.White ) + +local CrateCargo = CARGO_CRATE:New( STATIC:FindByName( "Crate" ), "Workmaterials", "Crate", 50, 25 ) +CrateCargo:ReportSmoke( SMOKECOLOR.Orange ) + +local EnginesCargo = CARGO_CRATE:New( STATIC:FindByName( "Engines" ), "Workmaterials", "Engines", 150, 25 ) +EnginesCargo:ReportFlare( FLARECOLOR.Red ) + +local FuelCargo = CARGO_SLINGLOAD:New( STATIC:FindByName( "Fuel" ), "Workmaterials", "Fuel", 200, 25 ) +FuelCargo:ReportFlare( FLARECOLOR.Green ) + +local MetalCargo = CARGO_CRATE:New( STATIC:FindByName( "Metal" ), "Workmaterials", "Metal", 500, 25 ) +MetalCargo:ReportFlare( FLARECOLOR.Yellow ) + +local WorkplaceTask = TaskDispatcher:AddTransportTask( "Transport Team", CargoSet, "Transport the workers, engineers and the equipment near the Workplace." ) + + diff --git a/Tasking/Task_Cargo_Dispatcher/TAD-CGO-006 - Transport Test - Multiple Clients/TAD-CGO-006 - Transport Test - Multiple Clients.lua b/Tasking/Task_Cargo_Dispatcher/TAD-CGO-006 - Transport Test - Multiple Clients/TAD-CGO-006 - Transport Test - Multiple Clients.lua index 8099bb25a1..09ab7c3b77 100644 --- a/Tasking/Task_Cargo_Dispatcher/TAD-CGO-006 - Transport Test - Multiple Clients/TAD-CGO-006 - Transport Test - Multiple Clients.lua +++ b/Tasking/Task_Cargo_Dispatcher/TAD-CGO-006 - Transport Test - Multiple Clients/TAD-CGO-006 - Transport Test - Multiple Clients.lua @@ -1,38 +1,38 @@ ---- --- Name: TAD-CGO-006 - Transport Test - Multiple Clients --- Author: FlightControl --- Date Created: 05 Apr 2018 --- --- # Situation: --- --- This mission demonstrates the dynamic task dispatching for cargo Transport operations of various cargo types. --- - -HQ = GROUP:FindByName( "HQ", "Bravo" ) - -CommandCenter = COMMANDCENTER - :New( HQ, "Lima" ) - -Mission = MISSION - :New( CommandCenter, "Operation SandStorm", "Tactical", "Transport Cargo", coalition.side.RED ) - -TransportGroups = SET_GROUP:New():FilterCoalitions( "blue" ):FilterPrefixes( "Transport" ):FilterStart() - -TaskDispatcher = TASK_CARGO_DISPATCHER:New( Mission, TransportGroups ) - -TaskDispatcher:SetDefaultDeployZone( ZONE:New( "Workplace" ) ) - - -local CargoSet = SET_CARGO:New():FilterTypes( "Workmaterials" ):FilterStart() - -local WorkerCargoGroup = CARGO_GROUP:New( GROUP:FindByName( "Workers" ), "Workmaterials", "Workers", 250 ) -local EngineerCargoGroup = CARGO_GROUP:New( GROUP:FindByName( "Engineers" ), "Workmaterials", "Engineers", 100 ) -local ConcreteCargo = CARGO_SLINGLOAD:New( STATIC:FindByName( "Concrete" ), "Workmaterials", "Concrete", 100, 50 ) -local CrateCargo = CARGO_CRATE:New( STATIC:FindByName( "Crate" ), "Workmaterials", "Crate", 150, 50 ) -local EnginesCargo = CARGO_CRATE:New( STATIC:FindByName( "Engines" ), "Workmaterials", "Engines", 150, 50 ) -local FuelCargo = CARGO_SLINGLOAD:New( STATIC:FindByName( "Fuel" ), "Workmaterials", "Fuel", 150, 50 ) -local MetalCargo = CARGO_CRATE:New( STATIC:FindByName( "Metal" ), "Workmaterials", "Metal", 150, 50 ) - -local WorkplaceTask = TaskDispatcher:AddTransportTask( "Transport Team", CargoSet, "Transport the workers, engineers and the equipment near the Workplace." ) - - +--- +-- Name: TAD-CGO-006 - Transport Test - Multiple Clients +-- Author: FlightControl +-- Date Created: 05 Apr 2018 +-- +-- # Situation: +-- +-- This mission demonstrates the dynamic task dispatching for cargo Transport operations of various cargo types. +-- + +HQ = GROUP:FindByName( "HQ", "Bravo" ) + +CommandCenter = COMMANDCENTER + :New( HQ, "Lima" ) + +Mission = MISSION + :New( CommandCenter, "Operation SandStorm", "Tactical", "Transport Cargo", coalition.side.RED ) + +TransportGroups = SET_GROUP:New():FilterCoalitions( "blue" ):FilterPrefixes( "Transport" ):FilterStart() + +TaskDispatcher = TASK_CARGO_DISPATCHER:New( Mission, TransportGroups ) + +TaskDispatcher:SetDefaultDeployZone( ZONE:New( "Workplace" ) ) + + +local CargoSet = SET_CARGO:New():FilterTypes( "Workmaterials" ):FilterStart() + +local WorkerCargoGroup = CARGO_GROUP:New( GROUP:FindByName( "Workers" ), "Workmaterials", "Workers", 250 ) +local EngineerCargoGroup = CARGO_GROUP:New( GROUP:FindByName( "Engineers" ), "Workmaterials", "Engineers", 100 ) +local ConcreteCargo = CARGO_SLINGLOAD:New( STATIC:FindByName( "Concrete" ), "Workmaterials", "Concrete", 100, 50 ) +local CrateCargo = CARGO_CRATE:New( STATIC:FindByName( "Crate" ), "Workmaterials", "Crate", 150, 50 ) +local EnginesCargo = CARGO_CRATE:New( STATIC:FindByName( "Engines" ), "Workmaterials", "Engines", 150, 50 ) +local FuelCargo = CARGO_SLINGLOAD:New( STATIC:FindByName( "Fuel" ), "Workmaterials", "Fuel", 150, 50 ) +local MetalCargo = CARGO_CRATE:New( STATIC:FindByName( "Metal" ), "Workmaterials", "Metal", 150, 50 ) + +local WorkplaceTask = TaskDispatcher:AddTransportTask( "Transport Team", CargoSet, "Transport the workers, engineers and the equipment near the Workplace." ) + + diff --git a/Tasking/Task_Cargo_Dispatcher/TAD-CGO-007 - Transport Test - Cargo Fun/TAD-CGO-007 - Transport Test - Cargo Fun.lua b/Tasking/Task_Cargo_Dispatcher/TAD-CGO-007 - Transport Test - Cargo Fun/TAD-CGO-007 - Transport Test - Cargo Fun.lua index 430921d6dc..a70e2a93ab 100644 --- a/Tasking/Task_Cargo_Dispatcher/TAD-CGO-007 - Transport Test - Cargo Fun/TAD-CGO-007 - Transport Test - Cargo Fun.lua +++ b/Tasking/Task_Cargo_Dispatcher/TAD-CGO-007 - Transport Test - Cargo Fun/TAD-CGO-007 - Transport Test - Cargo Fun.lua @@ -1,53 +1,53 @@ ---- --- Name: TAD-CGO-007 - Transport Test - Cargo Fun --- Author: FlightControl --- Date Created: 05 Apr 2018 --- --- # Situation: --- --- This mission demonstrates the dynamic task dispatching for cargo Transport operations of various cargo types. --- - -HQ = GROUP:FindByName( "HQ", "Bravo" ) - -CommandCenter = COMMANDCENTER - :New( HQ, "Lima" ) - -Mission = MISSION - :New( CommandCenter, "Operation Cargo Fun", "Tactical", "Transport Cargo", coalition.side.RED ) - -TransportGroups = SET_GROUP:New():FilterCoalitions( "blue" ):FilterPrefixes( "Transport" ):FilterStart() - -TaskDispatcher = TASK_CARGO_DISPATCHER:New( Mission, TransportGroups ) - - - -local CargoSetWorkmaterials = SET_CARGO:New():FilterTypes( "Workmaterials" ):FilterStart() -local EngineerCargoGroup = CARGO_GROUP:New( GROUP:FindByName( "Engineers" ), "Workmaterials", "Engineers", 250 ) -local ConcreteCargo = CARGO_SLINGLOAD:New( STATIC:FindByName( "Concrete" ), "Workmaterials", "Concrete", 150, 50 ) -local CrateCargo = CARGO_CRATE:New( STATIC:FindByName( "Crate" ), "Workmaterials", "Crate", 150, 50 ) -local EnginesCargo = CARGO_CRATE:New( STATIC:FindByName( "Engines" ), "Workmaterials", "Engines", 150, 50 ) -local MetalCargo = CARGO_CRATE:New( STATIC:FindByName( "Metal" ), "Workmaterials", "Metal", 150, 50 ) - -local WorkplaceTask = TaskDispatcher:AddTransportTask( "Transport workmaterials", CargoSetWorkmaterials, "Transport the workers, engineers and the equipment near the Workplace." ) -TaskDispatcher:SetTransportDeployZone( WorkplaceTask, ZONE:New( "Workplace" ) ) - -local CargoSetLiquids = SET_CARGO:New():FilterTypes( "Liquids" ):FilterStart() -local FuelCargo = CARGO_SLINGLOAD:New( STATIC:FindByName( "Fuel" ), "Liquids", "Fuel", 100, 35 ) -local GasCargo = CARGO_SLINGLOAD:New( STATIC:FindByName( "Gas" ), "Liquids", "Gas", 100, 35 ) -local OilCargo = CARGO_SLINGLOAD:New( STATIC:FindByName( "Oil" ), "Liquids", "Oil", 100, 35 ) - -local FactoryTask = TaskDispatcher:AddTransportTask( "Transport liquids", CargoSetLiquids, "Transport the milk, gas, fuel, oil to the factory." ) -TaskDispatcher:SetTransportDeployZone( FactoryTask, ZONE:New( "Factory" ) ) - - -local CargoSetFood = SET_CARGO:New():FilterTypes( "Food" ):FilterStart() -local WorkerCargoGroupA = CARGO_GROUP:New( GROUP:FindByName( "Workers Team A" ), "Food", "Workers Team A", 250 ) -local WorkerCargoGroupB = CARGO_GROUP:New( GROUP:FindByName( "Workers Team B" ), "Food", "Workers Team B", 250 ) -local KitchenstuffCargo = CARGO_CRATE:New( STATIC:FindByName( "Kitchenstuff" ), "Food", "Kitchenstuff", 150, 50 ) -local GoodCargo = CARGO_SLINGLOAD:New( STATIC:FindByName( "Food" ), "Food", "Food", 100, 35 ) -local MilkCargo = CARGO_SLINGLOAD:New( STATIC:FindByName( "Milk" ), "Food", "Milk", 100, 35 ) - -local FoodTask = TaskDispatcher:AddTransportTask( "Transport food", CargoSetFood, "Transport the workers and the food to the cantine." ) -TaskDispatcher:SetTransportDeployZone( FoodTask, ZONE:New( "Cantine" ) ) - +--- +-- Name: TAD-CGO-007 - Transport Test - Cargo Fun +-- Author: FlightControl +-- Date Created: 05 Apr 2018 +-- +-- # Situation: +-- +-- This mission demonstrates the dynamic task dispatching for cargo Transport operations of various cargo types. +-- + +HQ = GROUP:FindByName( "HQ", "Bravo" ) + +CommandCenter = COMMANDCENTER + :New( HQ, "Lima" ) + +Mission = MISSION + :New( CommandCenter, "Operation Cargo Fun", "Tactical", "Transport Cargo", coalition.side.RED ) + +TransportGroups = SET_GROUP:New():FilterCoalitions( "blue" ):FilterPrefixes( "Transport" ):FilterStart() + +TaskDispatcher = TASK_CARGO_DISPATCHER:New( Mission, TransportGroups ) + + + +local CargoSetWorkmaterials = SET_CARGO:New():FilterTypes( "Workmaterials" ):FilterStart() +local EngineerCargoGroup = CARGO_GROUP:New( GROUP:FindByName( "Engineers" ), "Workmaterials", "Engineers", 250 ) +local ConcreteCargo = CARGO_SLINGLOAD:New( STATIC:FindByName( "Concrete" ), "Workmaterials", "Concrete", 150, 50 ) +local CrateCargo = CARGO_CRATE:New( STATIC:FindByName( "Crate" ), "Workmaterials", "Crate", 150, 50 ) +local EnginesCargo = CARGO_CRATE:New( STATIC:FindByName( "Engines" ), "Workmaterials", "Engines", 150, 50 ) +local MetalCargo = CARGO_CRATE:New( STATIC:FindByName( "Metal" ), "Workmaterials", "Metal", 150, 50 ) + +local WorkplaceTask = TaskDispatcher:AddTransportTask( "Transport workmaterials", CargoSetWorkmaterials, "Transport the workers, engineers and the equipment near the Workplace." ) +TaskDispatcher:SetTransportDeployZone( WorkplaceTask, ZONE:New( "Workplace" ) ) + +local CargoSetLiquids = SET_CARGO:New():FilterTypes( "Liquids" ):FilterStart() +local FuelCargo = CARGO_SLINGLOAD:New( STATIC:FindByName( "Fuel" ), "Liquids", "Fuel", 100, 35 ) +local GasCargo = CARGO_SLINGLOAD:New( STATIC:FindByName( "Gas" ), "Liquids", "Gas", 100, 35 ) +local OilCargo = CARGO_SLINGLOAD:New( STATIC:FindByName( "Oil" ), "Liquids", "Oil", 100, 35 ) + +local FactoryTask = TaskDispatcher:AddTransportTask( "Transport liquids", CargoSetLiquids, "Transport the milk, gas, fuel, oil to the factory." ) +TaskDispatcher:SetTransportDeployZone( FactoryTask, ZONE:New( "Factory" ) ) + + +local CargoSetFood = SET_CARGO:New():FilterTypes( "Food" ):FilterStart() +local WorkerCargoGroupA = CARGO_GROUP:New( GROUP:FindByName( "Workers Team A" ), "Food", "Workers Team A", 250 ) +local WorkerCargoGroupB = CARGO_GROUP:New( GROUP:FindByName( "Workers Team B" ), "Food", "Workers Team B", 250 ) +local KitchenstuffCargo = CARGO_CRATE:New( STATIC:FindByName( "Kitchenstuff" ), "Food", "Kitchenstuff", 150, 50 ) +local GoodCargo = CARGO_SLINGLOAD:New( STATIC:FindByName( "Food" ), "Food", "Food", 100, 35 ) +local MilkCargo = CARGO_SLINGLOAD:New( STATIC:FindByName( "Milk" ), "Food", "Milk", 100, 35 ) + +local FoodTask = TaskDispatcher:AddTransportTask( "Transport food", CargoSetFood, "Transport the workers and the food to the cantine." ) +TaskDispatcher:SetTransportDeployZone( FoodTask, ZONE:New( "Cantine" ) ) + diff --git a/Tasking/Task_Cargo_Dispatcher/TAD-CGO-008 - Transport Test - PickedUp and Deployed Handling/TAD-CGO-008 - Transport Test - PickedUp and Deployed Handling.lua b/Tasking/Task_Cargo_Dispatcher/TAD-CGO-008 - Transport Test - PickedUp and Deployed Handling/TAD-CGO-008 - Transport Test - PickedUp and Deployed Handling.lua index d0c88b6fd2..b70cca4159 100644 --- a/Tasking/Task_Cargo_Dispatcher/TAD-CGO-008 - Transport Test - PickedUp and Deployed Handling/TAD-CGO-008 - Transport Test - PickedUp and Deployed Handling.lua +++ b/Tasking/Task_Cargo_Dispatcher/TAD-CGO-008 - Transport Test - PickedUp and Deployed Handling/TAD-CGO-008 - Transport Test - PickedUp and Deployed Handling.lua @@ -1,66 +1,66 @@ ---- --- Name: TAD-CGO-008 - Transport Test - PickedUp and Deployed Handling --- Author: FlightControl --- Date Created: 05 Apr 2018 --- --- # Situation: --- --- This mission demonstrates the dynamic task dispatching for cargo Transport operations of various cargo types. --- --- When cargo is deployed at the Workplace, a large helicopter fleet will descend to the place ... --- When cargo is deployed at the Factory, a SAM site is activated ... --- When cargo is deployed at the Cantine, a some other army soldiers will arrive to join lunch ... --- - -HQ = GROUP:FindByName( "HQ", "Bravo" ) - -CommandCenter = COMMANDCENTER - :New( HQ, "Lima" ) - -Mission = MISSION - :New( CommandCenter, "Operation Cargo Fun", "Tactical", "Transport Cargo", coalition.side.RED ) - -TransportGroups = SET_GROUP:New():FilterCoalitions( "blue" ):FilterPrefixes( "Transport" ):FilterStart() - -TaskDispatcher = TASK_CARGO_DISPATCHER:New( Mission, TransportGroups ) - - -local CargoSetWorkmaterials = SET_CARGO:New():FilterTypes( "Workmaterials" ):FilterStart() -local EngineerCargoGroup = CARGO_GROUP:New( GROUP:FindByName( "Engineers" ), "Workmaterials", "Engineers", 250 ) -local ConcreteCargo = CARGO_SLINGLOAD:New( STATIC:FindByName( "Concrete" ), "Workmaterials", "Concrete", 150, 50 ) -local CrateCargo = CARGO_CRATE:New( STATIC:FindByName( "Crate" ), "Workmaterials", "Crate", 150, 50 ) -local EnginesCargo = CARGO_CRATE:New( STATIC:FindByName( "Engines" ), "Workmaterials", "Engines", 150, 50 ) -local MetalCargo = CARGO_CRATE:New( STATIC:FindByName( "Metal" ), "Workmaterials", "Metal", 150, 50 ) - - -local WorkplaceTask = TaskDispatcher:AddTransportTask( "Build a Workplace", CargoSetWorkmaterials, "Transport the workers, engineers and the equipment near the Workplace." ) -TaskDispatcher:SetTransportDeployZone( WorkplaceTask, ZONE:New( "Workplace" ) ) - - -local CargoSetLiquids = SET_CARGO:New():FilterTypes( "Liquids" ):FilterStart() -local FuelCargo = CARGO_SLINGLOAD:New( STATIC:FindByName( "Fuel" ), "Liquids", "Fuel", 100, 35 ) -local GasCargo = CARGO_SLINGLOAD:New( STATIC:FindByName( "Gas" ), "Liquids", "Gas", 100, 35 ) -local OilCargo = CARGO_SLINGLOAD:New( STATIC:FindByName( "Oil" ), "Liquids", "Oil", 100, 35 ) - -local FactoryTask = TaskDispatcher:AddTransportTask( "Transport liquids", CargoSetLiquids, "Transport the milk, gas, fuel, oil to the factory." ) -TaskDispatcher:SetTransportDeployZone( FactoryTask, ZONE:New( "Factory" ) ) - - -local CargoSetFood = SET_CARGO:New():FilterTypes( "Food" ):FilterStart() -local WorkerCargoGroupA = CARGO_GROUP:New( GROUP:FindByName( "Workers Team A" ), "Food", "Workers Team A", 250 ) -local WorkerCargoGroupB = CARGO_GROUP:New( GROUP:FindByName( "Workers Team B" ), "Food", "Workers Team B", 250 ) -local KitchenstuffCargo = CARGO_CRATE:New( STATIC:FindByName( "Kitchenstuff" ), "Food", "Kitchenstuff", 150, 50 ) -local FoodCargo = CARGO_CRATE:New( STATIC:FindByName( "Food" ), "Food", "Food", 100, 35 ) -local MilkCargo = CARGO_SLINGLOAD:New( STATIC:FindByName( "Milk" ), "Food", "Milk", 100, 35 ) - -local FoodTask = TaskDispatcher:AddTransportTask( "Transport food", CargoSetFood, "Transport the workers and the food to the cantine." ) -TaskDispatcher:SetTransportDeployZone( FoodTask, ZONE:New( "Cantine" ) ) - --- Here we tailor the CargoDeployed event of the TaskDispatcher. - -function TaskDispatcher:OnAfterCargoDeployed( From, Event, To, Task, TaskPrefix, TaskUnit, Cargo, DeployZone ) - - MESSAGE:NewType( "Unit " .. TaskUnit:GetName().. " has deployed cargo " .. Cargo:GetName() .. " at zone " .. DeployZone:GetName() .. " for task " .. Task:GetName() .. ".", MESSAGE.Type.Information ):ToAll() - -end - +--- +-- Name: TAD-CGO-008 - Transport Test - PickedUp and Deployed Handling +-- Author: FlightControl +-- Date Created: 05 Apr 2018 +-- +-- # Situation: +-- +-- This mission demonstrates the dynamic task dispatching for cargo Transport operations of various cargo types. +-- +-- When cargo is deployed at the Workplace, a large helicopter fleet will descend to the place ... +-- When cargo is deployed at the Factory, a SAM site is activated ... +-- When cargo is deployed at the Cantine, a some other army soldiers will arrive to join lunch ... +-- + +HQ = GROUP:FindByName( "HQ", "Bravo" ) + +CommandCenter = COMMANDCENTER + :New( HQ, "Lima" ) + +Mission = MISSION + :New( CommandCenter, "Operation Cargo Fun", "Tactical", "Transport Cargo", coalition.side.RED ) + +TransportGroups = SET_GROUP:New():FilterCoalitions( "blue" ):FilterPrefixes( "Transport" ):FilterStart() + +TaskDispatcher = TASK_CARGO_DISPATCHER:New( Mission, TransportGroups ) + + +local CargoSetWorkmaterials = SET_CARGO:New():FilterTypes( "Workmaterials" ):FilterStart() +local EngineerCargoGroup = CARGO_GROUP:New( GROUP:FindByName( "Engineers" ), "Workmaterials", "Engineers", 250 ) +local ConcreteCargo = CARGO_SLINGLOAD:New( STATIC:FindByName( "Concrete" ), "Workmaterials", "Concrete", 150, 50 ) +local CrateCargo = CARGO_CRATE:New( STATIC:FindByName( "Crate" ), "Workmaterials", "Crate", 150, 50 ) +local EnginesCargo = CARGO_CRATE:New( STATIC:FindByName( "Engines" ), "Workmaterials", "Engines", 150, 50 ) +local MetalCargo = CARGO_CRATE:New( STATIC:FindByName( "Metal" ), "Workmaterials", "Metal", 150, 50 ) + + +local WorkplaceTask = TaskDispatcher:AddTransportTask( "Build a Workplace", CargoSetWorkmaterials, "Transport the workers, engineers and the equipment near the Workplace." ) +TaskDispatcher:SetTransportDeployZone( WorkplaceTask, ZONE:New( "Workplace" ) ) + + +local CargoSetLiquids = SET_CARGO:New():FilterTypes( "Liquids" ):FilterStart() +local FuelCargo = CARGO_SLINGLOAD:New( STATIC:FindByName( "Fuel" ), "Liquids", "Fuel", 100, 35 ) +local GasCargo = CARGO_SLINGLOAD:New( STATIC:FindByName( "Gas" ), "Liquids", "Gas", 100, 35 ) +local OilCargo = CARGO_SLINGLOAD:New( STATIC:FindByName( "Oil" ), "Liquids", "Oil", 100, 35 ) + +local FactoryTask = TaskDispatcher:AddTransportTask( "Transport liquids", CargoSetLiquids, "Transport the milk, gas, fuel, oil to the factory." ) +TaskDispatcher:SetTransportDeployZone( FactoryTask, ZONE:New( "Factory" ) ) + + +local CargoSetFood = SET_CARGO:New():FilterTypes( "Food" ):FilterStart() +local WorkerCargoGroupA = CARGO_GROUP:New( GROUP:FindByName( "Workers Team A" ), "Food", "Workers Team A", 250 ) +local WorkerCargoGroupB = CARGO_GROUP:New( GROUP:FindByName( "Workers Team B" ), "Food", "Workers Team B", 250 ) +local KitchenstuffCargo = CARGO_CRATE:New( STATIC:FindByName( "Kitchenstuff" ), "Food", "Kitchenstuff", 150, 50 ) +local FoodCargo = CARGO_CRATE:New( STATIC:FindByName( "Food" ), "Food", "Food", 100, 35 ) +local MilkCargo = CARGO_SLINGLOAD:New( STATIC:FindByName( "Milk" ), "Food", "Milk", 100, 35 ) + +local FoodTask = TaskDispatcher:AddTransportTask( "Transport food", CargoSetFood, "Transport the workers and the food to the cantine." ) +TaskDispatcher:SetTransportDeployZone( FoodTask, ZONE:New( "Cantine" ) ) + +-- Here we tailor the CargoDeployed event of the TaskDispatcher. + +function TaskDispatcher:OnAfterCargoDeployed( From, Event, To, Task, TaskPrefix, TaskUnit, Cargo, DeployZone ) + + MESSAGE:NewType( "Unit " .. TaskUnit:GetName().. " has deployed cargo " .. Cargo:GetName() .. " at zone " .. DeployZone:GetName() .. " for task " .. Task:GetName() .. ".", MESSAGE.Type.Information ):ToAll() + +end + diff --git a/Tasking/Task_Cargo_Dispatcher/TAD-CGO-009 - Transport Test - Respawning Cargo/TAD-CGO-009 - Transport Test - Respawning Cargo.lua b/Tasking/Task_Cargo_Dispatcher/TAD-CGO-009 - Transport Test - Respawning Cargo/TAD-CGO-009 - Transport Test - Respawning Cargo.lua index bf6c297a6e..f246547629 100644 --- a/Tasking/Task_Cargo_Dispatcher/TAD-CGO-009 - Transport Test - Respawning Cargo/TAD-CGO-009 - Transport Test - Respawning Cargo.lua +++ b/Tasking/Task_Cargo_Dispatcher/TAD-CGO-009 - Transport Test - Respawning Cargo/TAD-CGO-009 - Transport Test - Respawning Cargo.lua @@ -1,82 +1,82 @@ ---- --- Name: TAD-CGO-009 - Transport Test - Respawning Cargo --- Author: FlightControl --- Date Created: 05 Apr 2018 --- --- # Situation: --- --- This mission demonstrates the dynamic task dispatching for cargo Transport operations of various cargo types. --- --- When cargo is deployed at the Workplace, a large helicopter fleet will descend to the place ... --- When cargo is deployed at the Factory, a SAM site is activated ... --- When cargo is deployed at the Cantine, a some other army soldiers will arrive to join lunch ... --- - -HQ = GROUP:FindByName( "HQ", "Bravo" ) - -CommandCenter = COMMANDCENTER - :New( HQ, "Lima" ) - -Mission = MISSION - :New( CommandCenter, "Operation Cargo Fun", "Tactical", "Transport Cargo", coalition.side.RED ) - -TransportGroups = SET_GROUP:New():FilterCoalitions( "blue" ):FilterPrefixes( "Transport" ):FilterStart() - -TaskDispatcher = TASK_CARGO_DISPATCHER:New( Mission, TransportGroups ) - - -local CargoSetWorkmaterials = SET_CARGO:New():FilterTypes( "Workmaterials" ):FilterStart() -local EngineerCargoGroup = CARGO_GROUP:New( GROUP:FindByName( "Engineers" ), "Workmaterials", "Engineers", 250 ):RespawnOnDestroyed( true ) -local ConcreteCargo = CARGO_SLINGLOAD:New( STATIC:FindByName( "Concrete" ), "Workmaterials", "Concrete", 150, 50 ):RespawnOnDestroyed( true ) -local CrateCargo = CARGO_CRATE:New( STATIC:FindByName( "Crate" ), "Workmaterials", "Crate", 150, 50 ):RespawnOnDestroyed( true ) -local EnginesCargo = CARGO_CRATE:New( STATIC:FindByName( "Engines" ), "Workmaterials", "Engines", 150, 50 ):RespawnOnDestroyed( true ) -local MetalCargo = CARGO_CRATE:New( STATIC:FindByName( "Metal" ), "Workmaterials", "Metal", 150, 50 ):RespawnOnDestroyed(true) - -local WorkplaceTask = TaskDispatcher:AddTransportTask( "Build a Workplace", CargoSetWorkmaterials, "Transport the workers, engineers and the equipment near the Workplace." ) -TaskDispatcher:SetTransportDeployZone( WorkplaceTask, ZONE:New( "Workplace" ) ) - -Helos = { SPAWN:New( "Helicopters 1" ), SPAWN:New( "Helicopters 2" ), SPAWN:New( "Helicopters 3" ), SPAWN:New( "Helicopters 4" ), SPAWN:New( "Helicopters 5" ) } - -EnemyHelos = { SPAWN:New( "Enemy Helicopters 1" ), SPAWN:New( "Enemy Helicopters 2" ), SPAWN:New( "Enemy Helicopters 3" ) } - -function WorkplaceTask:OnAfterCargoDeployed( From, Event, To, TaskUnit, Cargo, DeployZone ) - Helos[ math.random(1,#Helos) ]:Spawn() - EnemyHelos[ math.random(1,#EnemyHelos) ]:Spawn() - -end - - - -local CargoSetLiquids = SET_CARGO:New():FilterTypes( "Liquids" ):FilterStart() -local FuelCargo = CARGO_SLINGLOAD:New( STATIC:FindByName( "Fuel" ), "Liquids", "Fuel", 100, 35 ):RespawnOnDestroyed( true ) -local GasCargo = CARGO_SLINGLOAD:New( STATIC:FindByName( "Gas" ), "Liquids", "Gas", 100, 35 ):RespawnOnDestroyed( true ) -local OilCargo = CARGO_SLINGLOAD:New( STATIC:FindByName( "Oil" ), "Liquids", "Oil", 100, 35 ):RespawnOnDestroyed( true ) - -local FactoryTask = TaskDispatcher:AddTransportTask( "Transport liquids", CargoSetLiquids, "Transport the milk, gas, fuel, oil to the factory." ) -TaskDispatcher:SetTransportDeployZone( FactoryTask, ZONE:New( "Factory" ) ) - -SAMSites = { SPAWN:New( "SAM Site 1" ), SPAWN:New( "SAM Site 2" ), SPAWN:New( "SAM Site 3" ), SPAWN:New( "SAM Site 4" ), SPAWN:New( "SAM Site 5" ) } - -AirAttack = { SPAWN:New( "Russia Air Attack 1" ), SPAWN:New( "Russia Air Attack 2" ), SPAWN:New( "Russia Air Attack 3" ), SPAWN:New( "Russia Air Attack 4" ) } - -function FactoryTask:OnAfterCargoDeployed( From, Event, To, TaskUnit, Cargo, DeployZone ) - SAMSites[ math.random(1,#SAMSites) ]:Spawn() - AirAttack[ math.random(1,#AirAttack) ]:Spawn() -end - -local CargoSetFood = SET_CARGO:New():FilterTypes( "Food" ):FilterStart() -local WorkerCargoGroupA = CARGO_GROUP:New( GROUP:FindByName( "Workers Team A" ), "Food", "Workers Team A", 250 ):RespawnOnDestroyed( true ) -local WorkerCargoGroupB = CARGO_GROUP:New( GROUP:FindByName( "Workers Team B" ), "Food", "Workers Team B", 250 ):RespawnOnDestroyed( true ) -local KitchenstuffCargo = CARGO_CRATE:New( STATIC:FindByName( "Kitchenstuff" ), "Food", "Kitchenstuff", 150, 50 ):RespawnOnDestroyed( true ) -local FoodCargo = CARGO_CRATE:New( STATIC:FindByName( "Food" ), "Food", "Food", 100, 35 ) -local MilkCargo = CARGO_SLINGLOAD:New( STATIC:FindByName( "Milk" ), "Food", "Milk", 100, 35 ) - -local FoodTask = TaskDispatcher:AddTransportTask( "Transport food", CargoSetFood, "Transport the workers and the food to the cantine." ) -TaskDispatcher:SetTransportDeployZone( FoodTask, ZONE:New( "Cantine" ) ) - -Hungry = { SPAWN:New( "Hungry 1" ), SPAWN:New( "Hungry 2" ), SPAWN:New( "Hungry 3" ), SPAWN:New( "Hungry 4" ), SPAWN:New( "Hungry 5" ) } - -function FoodTask:OnAfterCargoDeployed( From, Event, To, TaskUnit, Cargo, DeployZone ) - Hungry[ math.random(1,#Hungry) ]:Spawn() -end - +--- +-- Name: TAD-CGO-009 - Transport Test - Respawning Cargo +-- Author: FlightControl +-- Date Created: 05 Apr 2018 +-- +-- # Situation: +-- +-- This mission demonstrates the dynamic task dispatching for cargo Transport operations of various cargo types. +-- +-- When cargo is deployed at the Workplace, a large helicopter fleet will descend to the place ... +-- When cargo is deployed at the Factory, a SAM site is activated ... +-- When cargo is deployed at the Cantine, a some other army soldiers will arrive to join lunch ... +-- + +HQ = GROUP:FindByName( "HQ", "Bravo" ) + +CommandCenter = COMMANDCENTER + :New( HQ, "Lima" ) + +Mission = MISSION + :New( CommandCenter, "Operation Cargo Fun", "Tactical", "Transport Cargo", coalition.side.RED ) + +TransportGroups = SET_GROUP:New():FilterCoalitions( "blue" ):FilterPrefixes( "Transport" ):FilterStart() + +TaskDispatcher = TASK_CARGO_DISPATCHER:New( Mission, TransportGroups ) + + +local CargoSetWorkmaterials = SET_CARGO:New():FilterTypes( "Workmaterials" ):FilterStart() +local EngineerCargoGroup = CARGO_GROUP:New( GROUP:FindByName( "Engineers" ), "Workmaterials", "Engineers", 250 ):RespawnOnDestroyed( true ) +local ConcreteCargo = CARGO_SLINGLOAD:New( STATIC:FindByName( "Concrete" ), "Workmaterials", "Concrete", 150, 50 ):RespawnOnDestroyed( true ) +local CrateCargo = CARGO_CRATE:New( STATIC:FindByName( "Crate" ), "Workmaterials", "Crate", 150, 50 ):RespawnOnDestroyed( true ) +local EnginesCargo = CARGO_CRATE:New( STATIC:FindByName( "Engines" ), "Workmaterials", "Engines", 150, 50 ):RespawnOnDestroyed( true ) +local MetalCargo = CARGO_CRATE:New( STATIC:FindByName( "Metal" ), "Workmaterials", "Metal", 150, 50 ):RespawnOnDestroyed(true) + +local WorkplaceTask = TaskDispatcher:AddTransportTask( "Build a Workplace", CargoSetWorkmaterials, "Transport the workers, engineers and the equipment near the Workplace." ) +TaskDispatcher:SetTransportDeployZone( WorkplaceTask, ZONE:New( "Workplace" ) ) + +Helos = { SPAWN:New( "Helicopters 1" ), SPAWN:New( "Helicopters 2" ), SPAWN:New( "Helicopters 3" ), SPAWN:New( "Helicopters 4" ), SPAWN:New( "Helicopters 5" ) } + +EnemyHelos = { SPAWN:New( "Enemy Helicopters 1" ), SPAWN:New( "Enemy Helicopters 2" ), SPAWN:New( "Enemy Helicopters 3" ) } + +function WorkplaceTask:OnAfterCargoDeployed( From, Event, To, TaskUnit, Cargo, DeployZone ) + Helos[ math.random(1,#Helos) ]:Spawn() + EnemyHelos[ math.random(1,#EnemyHelos) ]:Spawn() + +end + + + +local CargoSetLiquids = SET_CARGO:New():FilterTypes( "Liquids" ):FilterStart() +local FuelCargo = CARGO_SLINGLOAD:New( STATIC:FindByName( "Fuel" ), "Liquids", "Fuel", 100, 35 ):RespawnOnDestroyed( true ) +local GasCargo = CARGO_SLINGLOAD:New( STATIC:FindByName( "Gas" ), "Liquids", "Gas", 100, 35 ):RespawnOnDestroyed( true ) +local OilCargo = CARGO_SLINGLOAD:New( STATIC:FindByName( "Oil" ), "Liquids", "Oil", 100, 35 ):RespawnOnDestroyed( true ) + +local FactoryTask = TaskDispatcher:AddTransportTask( "Transport liquids", CargoSetLiquids, "Transport the milk, gas, fuel, oil to the factory." ) +TaskDispatcher:SetTransportDeployZone( FactoryTask, ZONE:New( "Factory" ) ) + +SAMSites = { SPAWN:New( "SAM Site 1" ), SPAWN:New( "SAM Site 2" ), SPAWN:New( "SAM Site 3" ), SPAWN:New( "SAM Site 4" ), SPAWN:New( "SAM Site 5" ) } + +AirAttack = { SPAWN:New( "Russia Air Attack 1" ), SPAWN:New( "Russia Air Attack 2" ), SPAWN:New( "Russia Air Attack 3" ), SPAWN:New( "Russia Air Attack 4" ) } + +function FactoryTask:OnAfterCargoDeployed( From, Event, To, TaskUnit, Cargo, DeployZone ) + SAMSites[ math.random(1,#SAMSites) ]:Spawn() + AirAttack[ math.random(1,#AirAttack) ]:Spawn() +end + +local CargoSetFood = SET_CARGO:New():FilterTypes( "Food" ):FilterStart() +local WorkerCargoGroupA = CARGO_GROUP:New( GROUP:FindByName( "Workers Team A" ), "Food", "Workers Team A", 250 ):RespawnOnDestroyed( true ) +local WorkerCargoGroupB = CARGO_GROUP:New( GROUP:FindByName( "Workers Team B" ), "Food", "Workers Team B", 250 ):RespawnOnDestroyed( true ) +local KitchenstuffCargo = CARGO_CRATE:New( STATIC:FindByName( "Kitchenstuff" ), "Food", "Kitchenstuff", 150, 50 ):RespawnOnDestroyed( true ) +local FoodCargo = CARGO_CRATE:New( STATIC:FindByName( "Food" ), "Food", "Food", 100, 35 ) +local MilkCargo = CARGO_SLINGLOAD:New( STATIC:FindByName( "Milk" ), "Food", "Milk", 100, 35 ) + +local FoodTask = TaskDispatcher:AddTransportTask( "Transport food", CargoSetFood, "Transport the workers and the food to the cantine." ) +TaskDispatcher:SetTransportDeployZone( FoodTask, ZONE:New( "Cantine" ) ) + +Hungry = { SPAWN:New( "Hungry 1" ), SPAWN:New( "Hungry 2" ), SPAWN:New( "Hungry 3" ), SPAWN:New( "Hungry 4" ), SPAWN:New( "Hungry 5" ) } + +function FoodTask:OnAfterCargoDeployed( From, Event, To, TaskUnit, Cargo, DeployZone ) + Hungry[ math.random(1,#Hungry) ]:Spawn() +end + diff --git a/Tasking/Task_Cargo_Dispatcher/TAD-CGO-010 - Transport Test - Register Cargos/TAD-CGO-010 - Transport Test - Register Cargos.lua b/Tasking/Task_Cargo_Dispatcher/TAD-CGO-010 - Transport Test - Register Cargos/TAD-CGO-010 - Transport Test - Register Cargos.lua index 33165c12b1..4c75ae4d83 100644 --- a/Tasking/Task_Cargo_Dispatcher/TAD-CGO-010 - Transport Test - Register Cargos/TAD-CGO-010 - Transport Test - Register Cargos.lua +++ b/Tasking/Task_Cargo_Dispatcher/TAD-CGO-010 - Transport Test - Register Cargos/TAD-CGO-010 - Transport Test - Register Cargos.lua @@ -1,84 +1,84 @@ ---- --- Name: TAD-CGO-010 - Transport Test - Register Cargos --- Author: FlightControl --- Date Created: 15 Apr 2018 --- --- # Situation: --- --- This mission demonstrates the dynamic task dispatching for cargo Transport operations of various cargo types. --- --- The cargo is defined within the mission editor. --- Each cargo is identified with a ~CARGO tag in the group name. --- --- When cargo is deployed at the Workplace, a large helicopter fleet will descend to the place ... --- When cargo is deployed at the Factory, a SAM site is activated ... --- When cargo is deployed at the Cantine, a some other army soldiers will arrive to join lunch ... --- - -HQ = GROUP:FindByName( "HQ", "Bravo" ) - -CommandCenter = COMMANDCENTER - :New( HQ, "Lima" ) - -Mission = MISSION - :New( CommandCenter, "Operation Cargo Fun", "Tactical", "Transport Cargo", coalition.side.RED ) - -TransportGroups = SET_GROUP:New():FilterCoalitions( "blue" ):FilterPrefixes( "Transport" ):FilterStart() - -TaskDispatcher = TASK_CARGO_DISPATCHER:New( Mission, TransportGroups ) - - --- This is the most important now. You setup a new SET_CARGO filtering the relevant type. --- The actual cargo objects are now created by MOOSE in the background. --- Each cargo is setup in the Mission Editor using the ~CARGO tag in the group name. --- This allows a truly dynamic setup. -local CargoSetWorkmaterials = SET_CARGO:New():FilterTypes( "Workmaterials" ):FilterStart() - -local WorkplaceTask = TaskDispatcher:AddTransportTask( "Build a Workplace", CargoSetWorkmaterials, "Transport the workers, engineers and the equipment near the Workplace." ) -TaskDispatcher:SetTransportDeployZone( WorkplaceTask, ZONE:New( "Workplace" ) ) - -Helos = { SPAWN:New( "Helicopters 1" ), SPAWN:New( "Helicopters 2" ), SPAWN:New( "Helicopters 3" ), SPAWN:New( "Helicopters 4" ), SPAWN:New( "Helicopters 5" ) } - -EnemyHelos = { SPAWN:New( "Enemy Helicopters 1" ), SPAWN:New( "Enemy Helicopters 2" ), SPAWN:New( "Enemy Helicopters 3" ) } - -function WorkplaceTask:OnAfterCargoDeployed( From, Event, To, TaskUnit, Cargo, DeployZone ) - Helos[ math.random(1,#Helos) ]:Spawn() - EnemyHelos[ math.random(1,#EnemyHelos) ]:Spawn() - -end - - - --- This is the most important now. You setup a new SET_CARGO filtering the relevant type. --- The actual cargo objects are now created by MOOSE in the background. --- Each cargo is setup in the Mission Editor using the ~CARGO tag in the group name. --- This allows a truly dynamic setup. -local CargoSetLiquids = SET_CARGO:New():FilterTypes( "Liquids" ):FilterStart() - -local FactoryTask = TaskDispatcher:AddTransportTask( "Transport liquids", CargoSetLiquids, "Transport the milk, gas, fuel, oil to the factory." ) -TaskDispatcher:SetTransportDeployZone( FactoryTask, ZONE:New( "Factory" ) ) - -SAMSites = { SPAWN:New( "SAM Site 1" ), SPAWN:New( "SAM Site 2" ), SPAWN:New( "SAM Site 3" ), SPAWN:New( "SAM Site 4" ), SPAWN:New( "SAM Site 5" ) } - -AirAttack = { SPAWN:New( "Russia Air Attack 1" ), SPAWN:New( "Russia Air Attack 2" ), SPAWN:New( "Russia Air Attack 3" ), SPAWN:New( "Russia Air Attack 4" ) } - -function FactoryTask:OnAfterCargoDeployed( From, Event, To, TaskUnit, Cargo, DeployZone ) - SAMSites[ math.random(1,#SAMSites) ]:Spawn() - AirAttack[ math.random(1,#AirAttack) ]:Spawn() -end - --- This is the most important now. You setup a new SET_CARGO filtering the relevant type. --- The actual cargo objects are now created by MOOSE in the background. --- Each cargo is setup in the Mission Editor using the ~CARGO tag in the group name. --- This allows a truly dynamic setup. -local CargoSetFood = SET_CARGO:New():FilterTypes( "Food" ):FilterStart() - -local FoodTask = TaskDispatcher:AddTransportTask( "Transport food", CargoSetFood, "Transport the workers and the food to the cantine." ) -TaskDispatcher:SetTransportDeployZone( FoodTask, ZONE:New( "Cantine" ) ) - -Hungry = { SPAWN:New( "Hungry 1" ), SPAWN:New( "Hungry 2" ), SPAWN:New( "Hungry 3" ), SPAWN:New( "Hungry 4" ), SPAWN:New( "Hungry 5" ) } - -function FoodTask:OnAfterCargoDeployed( From, Event, To, TaskUnit, Cargo, DeployZone ) - Hungry[ math.random(1,#Hungry) ]:Spawn() -end - +--- +-- Name: TAD-CGO-010 - Transport Test - Register Cargos +-- Author: FlightControl +-- Date Created: 15 Apr 2018 +-- +-- # Situation: +-- +-- This mission demonstrates the dynamic task dispatching for cargo Transport operations of various cargo types. +-- +-- The cargo is defined within the mission editor. +-- Each cargo is identified with a ~CARGO tag in the group name. +-- +-- When cargo is deployed at the Workplace, a large helicopter fleet will descend to the place ... +-- When cargo is deployed at the Factory, a SAM site is activated ... +-- When cargo is deployed at the Cantine, a some other army soldiers will arrive to join lunch ... +-- + +HQ = GROUP:FindByName( "HQ", "Bravo" ) + +CommandCenter = COMMANDCENTER + :New( HQ, "Lima" ) + +Mission = MISSION + :New( CommandCenter, "Operation Cargo Fun", "Tactical", "Transport Cargo", coalition.side.RED ) + +TransportGroups = SET_GROUP:New():FilterCoalitions( "blue" ):FilterPrefixes( "Transport" ):FilterStart() + +TaskDispatcher = TASK_CARGO_DISPATCHER:New( Mission, TransportGroups ) + + +-- This is the most important now. You setup a new SET_CARGO filtering the relevant type. +-- The actual cargo objects are now created by MOOSE in the background. +-- Each cargo is setup in the Mission Editor using the ~CARGO tag in the group name. +-- This allows a truly dynamic setup. +local CargoSetWorkmaterials = SET_CARGO:New():FilterTypes( "Workmaterials" ):FilterStart() + +local WorkplaceTask = TaskDispatcher:AddTransportTask( "Build a Workplace", CargoSetWorkmaterials, "Transport the workers, engineers and the equipment near the Workplace." ) +TaskDispatcher:SetTransportDeployZone( WorkplaceTask, ZONE:New( "Workplace" ) ) + +Helos = { SPAWN:New( "Helicopters 1" ), SPAWN:New( "Helicopters 2" ), SPAWN:New( "Helicopters 3" ), SPAWN:New( "Helicopters 4" ), SPAWN:New( "Helicopters 5" ) } + +EnemyHelos = { SPAWN:New( "Enemy Helicopters 1" ), SPAWN:New( "Enemy Helicopters 2" ), SPAWN:New( "Enemy Helicopters 3" ) } + +function WorkplaceTask:OnAfterCargoDeployed( From, Event, To, TaskUnit, Cargo, DeployZone ) + Helos[ math.random(1,#Helos) ]:Spawn() + EnemyHelos[ math.random(1,#EnemyHelos) ]:Spawn() + +end + + + +-- This is the most important now. You setup a new SET_CARGO filtering the relevant type. +-- The actual cargo objects are now created by MOOSE in the background. +-- Each cargo is setup in the Mission Editor using the ~CARGO tag in the group name. +-- This allows a truly dynamic setup. +local CargoSetLiquids = SET_CARGO:New():FilterTypes( "Liquids" ):FilterStart() + +local FactoryTask = TaskDispatcher:AddTransportTask( "Transport liquids", CargoSetLiquids, "Transport the milk, gas, fuel, oil to the factory." ) +TaskDispatcher:SetTransportDeployZone( FactoryTask, ZONE:New( "Factory" ) ) + +SAMSites = { SPAWN:New( "SAM Site 1" ), SPAWN:New( "SAM Site 2" ), SPAWN:New( "SAM Site 3" ), SPAWN:New( "SAM Site 4" ), SPAWN:New( "SAM Site 5" ) } + +AirAttack = { SPAWN:New( "Russia Air Attack 1" ), SPAWN:New( "Russia Air Attack 2" ), SPAWN:New( "Russia Air Attack 3" ), SPAWN:New( "Russia Air Attack 4" ) } + +function FactoryTask:OnAfterCargoDeployed( From, Event, To, TaskUnit, Cargo, DeployZone ) + SAMSites[ math.random(1,#SAMSites) ]:Spawn() + AirAttack[ math.random(1,#AirAttack) ]:Spawn() +end + +-- This is the most important now. You setup a new SET_CARGO filtering the relevant type. +-- The actual cargo objects are now created by MOOSE in the background. +-- Each cargo is setup in the Mission Editor using the ~CARGO tag in the group name. +-- This allows a truly dynamic setup. +local CargoSetFood = SET_CARGO:New():FilterTypes( "Food" ):FilterStart() + +local FoodTask = TaskDispatcher:AddTransportTask( "Transport food", CargoSetFood, "Transport the workers and the food to the cantine." ) +TaskDispatcher:SetTransportDeployZone( FoodTask, ZONE:New( "Cantine" ) ) + +Hungry = { SPAWN:New( "Hungry 1" ), SPAWN:New( "Hungry 2" ), SPAWN:New( "Hungry 3" ), SPAWN:New( "Hungry 4" ), SPAWN:New( "Hungry 5" ) } + +function FoodTask:OnAfterCargoDeployed( From, Event, To, TaskUnit, Cargo, DeployZone ) + Hungry[ math.random(1,#Hungry) ]:Spawn() +end + diff --git a/Tasking/Task_Cargo_Dispatcher/TAD-CGO-011 - CSAR - Zone/TAD-CGO-011 - CSAR - Zone.lua b/Tasking/Task_Cargo_Dispatcher/TAD-CGO-011 - CSAR - Zone/TAD-CGO-011 - CSAR - Zone.lua index 71cc8daec5..8427057e7b 100644 --- a/Tasking/Task_Cargo_Dispatcher/TAD-CGO-011 - CSAR - Zone/TAD-CGO-011 - CSAR - Zone.lua +++ b/Tasking/Task_Cargo_Dispatcher/TAD-CGO-011 - CSAR - Zone/TAD-CGO-011 - CSAR - Zone.lua @@ -1,36 +1,36 @@ ---- --- Name: TAD-CGO-011 - CSAR - Zone --- Author: FlightControl --- Date Created: 01 Oct 2018 --- --- # Situation: --- --- This mission demonstrates the dynamic task dispatching for cargo CSAR operations. --- It will only spawn pilots for rescue when the pilots eject in the zones indicated. - -HQ = GROUP:FindByName( "HQ", "Bravo" ) - -CommandCenter = COMMANDCENTER - :New( HQ, "Lima" ) - -Mission = MISSION - :New( CommandCenter, "CSAR Missions", "Tactical", "Rescue downed pilots.", coalition.side.RED ) - -AttackGroups = SET_GROUP:New():FilterCoalitions( "red" ):FilterPrefixes( "Rescue" ):FilterStart() - -TaskDispatcher = TASK_CARGO_DISPATCHER:New( Mission, AttackGroups ) - -TaskDispatcher:SetCSARZones( SET_ZONE:New():FilterPrefixes("CSAR"):FilterOnce() ) - -TaskDispatcher:StartCSARTasks( - "CSAR", - { ZONE_UNIT:New( "Hospital", STATIC:FindByName( "Hospital" ), 100 ) }, - "One of our pilots has ejected. Go out to Search and Rescue our pilot!\n" .. - "Use the radio menu to let the command center assist you with the CSAR tasking." -) - -function TaskDispatcher:OnAfterCargoDeployed( From, Event, To, Task, TaskPrefix, TaskUnit, Cargo, DeployZone ) - - MESSAGE:NewType( "Unit " .. TaskUnit:GetName().. " has deployed cargo " .. Cargo:GetName() .. " at zone " .. DeployZone:GetName() .. " for task " .. Task:GetName() .. ".", MESSAGE.Type.Information ):ToAll() - -end +--- +-- Name: TAD-CGO-011 - CSAR - Zone +-- Author: FlightControl +-- Date Created: 01 Oct 2018 +-- +-- # Situation: +-- +-- This mission demonstrates the dynamic task dispatching for cargo CSAR operations. +-- It will only spawn pilots for rescue when the pilots eject in the zones indicated. + +HQ = GROUP:FindByName( "HQ", "Bravo" ) + +CommandCenter = COMMANDCENTER + :New( HQ, "Lima" ) + +Mission = MISSION + :New( CommandCenter, "CSAR Missions", "Tactical", "Rescue downed pilots.", coalition.side.RED ) + +AttackGroups = SET_GROUP:New():FilterCoalitions( "red" ):FilterPrefixes( "Rescue" ):FilterStart() + +TaskDispatcher = TASK_CARGO_DISPATCHER:New( Mission, AttackGroups ) + +TaskDispatcher:SetCSARZones( SET_ZONE:New():FilterPrefixes("CSAR"):FilterOnce() ) + +TaskDispatcher:StartCSARTasks( + "CSAR", + { ZONE_UNIT:New( "Hospital", STATIC:FindByName( "Hospital" ), 100 ) }, + "One of our pilots has ejected. Go out to Search and Rescue our pilot!\n" .. + "Use the radio menu to let the command center assist you with the CSAR tasking." +) + +function TaskDispatcher:OnAfterCargoDeployed( From, Event, To, Task, TaskPrefix, TaskUnit, Cargo, DeployZone ) + + MESSAGE:NewType( "Unit " .. TaskUnit:GetName().. " has deployed cargo " .. Cargo:GetName() .. " at zone " .. DeployZone:GetName() .. " for task " .. Task:GetName() .. ".", MESSAGE.Type.Information ):ToAll() + +end diff --git a/Tasking/Task_Cargo_Dispatcher/TAD-CGO-012 - CSAR - Maximum/TAD-CGO-012 - CSAR - Maximum.lua b/Tasking/Task_Cargo_Dispatcher/TAD-CGO-012 - CSAR - Maximum/TAD-CGO-012 - CSAR - Maximum.lua index 4aff44dca4..2e76013e6f 100644 --- a/Tasking/Task_Cargo_Dispatcher/TAD-CGO-012 - CSAR - Maximum/TAD-CGO-012 - CSAR - Maximum.lua +++ b/Tasking/Task_Cargo_Dispatcher/TAD-CGO-012 - CSAR - Maximum/TAD-CGO-012 - CSAR - Maximum.lua @@ -1,36 +1,36 @@ ---- --- Name: TAD-CGO-011 - CSAR - Zone tests --- Author: FlightControl --- Date Created: 01 Oct 2018 --- --- # Situation: --- --- This mission demonstrates the dynamic task dispatching for cargo CSAR operations. --- It will only spawn pilots for rescue when the pilots eject in the zones indicated. - -HQ = GROUP:FindByName( "HQ", "Bravo" ) - -CommandCenter = COMMANDCENTER - :New( HQ, "Lima" ) - -Mission = MISSION - :New( CommandCenter, "CSAR Missions", "Tactical", "Rescue downed pilots.", coalition.side.RED ) - -AttackGroups = SET_GROUP:New():FilterCoalitions( "red" ):FilterPrefixes( "Rescue" ):FilterStart() - -TaskDispatcher = TASK_CARGO_DISPATCHER:New( Mission, AttackGroups ) - -TaskDispatcher:SetMaxCSAR( 5 ) - -TaskDispatcher:StartCSARTasks( - "CSAR", - { ZONE_UNIT:New( "Hospital", STATIC:FindByName( "Hospital" ), 100 ) }, - "One of our pilots has ejected. Go out to Search and Rescue our pilot!\n" .. - "Use the radio menu to let the command center assist you with the CSAR tasking." -) - -function TaskDispatcher:OnAfterCargoDeployed( From, Event, To, Task, TaskPrefix, TaskUnit, Cargo, DeployZone ) - - MESSAGE:NewType( "Unit " .. TaskUnit:GetName().. " has deployed cargo " .. Cargo:GetName() .. " at zone " .. DeployZone:GetName() .. " for task " .. Task:GetName() .. ".", MESSAGE.Type.Information ):ToAll() - -end +--- +-- Name: TAD-CGO-011 - CSAR - Zone tests +-- Author: FlightControl +-- Date Created: 01 Oct 2018 +-- +-- # Situation: +-- +-- This mission demonstrates the dynamic task dispatching for cargo CSAR operations. +-- It will only spawn pilots for rescue when the pilots eject in the zones indicated. + +HQ = GROUP:FindByName( "HQ", "Bravo" ) + +CommandCenter = COMMANDCENTER + :New( HQ, "Lima" ) + +Mission = MISSION + :New( CommandCenter, "CSAR Missions", "Tactical", "Rescue downed pilots.", coalition.side.RED ) + +AttackGroups = SET_GROUP:New():FilterCoalitions( "red" ):FilterPrefixes( "Rescue" ):FilterStart() + +TaskDispatcher = TASK_CARGO_DISPATCHER:New( Mission, AttackGroups ) + +TaskDispatcher:SetMaxCSAR( 5 ) + +TaskDispatcher:StartCSARTasks( + "CSAR", + { ZONE_UNIT:New( "Hospital", STATIC:FindByName( "Hospital" ), 100 ) }, + "One of our pilots has ejected. Go out to Search and Rescue our pilot!\n" .. + "Use the radio menu to let the command center assist you with the CSAR tasking." +) + +function TaskDispatcher:OnAfterCargoDeployed( From, Event, To, Task, TaskPrefix, TaskUnit, Cargo, DeployZone ) + + MESSAGE:NewType( "Unit " .. TaskUnit:GetName().. " has deployed cargo " .. Cargo:GetName() .. " at zone " .. DeployZone:GetName() .. " for task " .. Task:GetName() .. ".", MESSAGE.Type.Information ):ToAll() + +end diff --git a/Tasking/Task_Cargo_Dispatcher/TAD-CGO-013 - Transport - Pickup and deploy from roof/TAD-CGO-013 - Transport - Pickup and deploy from roof.lua b/Tasking/Task_Cargo_Dispatcher/TAD-CGO-013 - Transport - Pickup and deploy from roof/TAD-CGO-013 - Transport - Pickup and deploy from roof.lua index 04fb48016a..3f08ed4a21 100644 --- a/Tasking/Task_Cargo_Dispatcher/TAD-CGO-013 - Transport - Pickup and deploy from roof/TAD-CGO-013 - Transport - Pickup and deploy from roof.lua +++ b/Tasking/Task_Cargo_Dispatcher/TAD-CGO-013 - Transport - Pickup and deploy from roof/TAD-CGO-013 - Transport - Pickup and deploy from roof.lua @@ -1,34 +1,34 @@ ---- --- Name: TAD-CGO-008 - Transport Test - PickedUp and Deployed Handling --- Author: FlightControl --- Date Created: 12 Oct 2018 --- --- Test to pickup cargo from the roof of a building. --- - -HQ = GROUP:FindByName( "HQ", "Bravo" ) - -CommandCenter = COMMANDCENTER - :New( HQ, "Lima" ) - -Mission = MISSION - :New( CommandCenter, "Operation Cargo Fun", "Tactical", "Transport Cargo", coalition.side.RED ) - -TransportGroups = SET_GROUP:New():FilterCoalitions( "blue" ):FilterPrefixes( "Transport" ):FilterStart() - -CargoWorkers = SET_CARGO:New():FilterTypes( "Workers" ):FilterStart() - -TaskDispatcher = TASK_CARGO_DISPATCHER:New( Mission, TransportGroups ) - -local WorkersTask = TaskDispatcher:AddTransportTask( "Transport Workers", CargoWorkers, "Transport the workers to the other building." ) -TaskDispatcher:SetTransportDeployZone( WorkersTask, ZONE:New( "Workplace" ) ) - - --- Here we tailor the CargoDeployed event of the TaskDispatcher. - -function TaskDispatcher:OnAfterCargoDeployed( From, Event, To, Task, TaskPrefix, TaskUnit, Cargo, DeployZone ) - - MESSAGE:NewType( "Unit " .. TaskUnit:GetName().. " has deployed cargo " .. Cargo:GetName() .. " at zone " .. DeployZone:GetName() .. " for task " .. Task:GetName() .. ".", MESSAGE.Type.Information ):ToAll() - -end - +--- +-- Name: TAD-CGO-008 - Transport Test - PickedUp and Deployed Handling +-- Author: FlightControl +-- Date Created: 12 Oct 2018 +-- +-- Test to pickup cargo from the roof of a building. +-- + +HQ = GROUP:FindByName( "HQ", "Bravo" ) + +CommandCenter = COMMANDCENTER + :New( HQ, "Lima" ) + +Mission = MISSION + :New( CommandCenter, "Operation Cargo Fun", "Tactical", "Transport Cargo", coalition.side.RED ) + +TransportGroups = SET_GROUP:New():FilterCoalitions( "blue" ):FilterPrefixes( "Transport" ):FilterStart() + +CargoWorkers = SET_CARGO:New():FilterTypes( "Workers" ):FilterStart() + +TaskDispatcher = TASK_CARGO_DISPATCHER:New( Mission, TransportGroups ) + +local WorkersTask = TaskDispatcher:AddTransportTask( "Transport Workers", CargoWorkers, "Transport the workers to the other building." ) +TaskDispatcher:SetTransportDeployZone( WorkersTask, ZONE:New( "Workplace" ) ) + + +-- Here we tailor the CargoDeployed event of the TaskDispatcher. + +function TaskDispatcher:OnAfterCargoDeployed( From, Event, To, Task, TaskPrefix, TaskUnit, Cargo, DeployZone ) + + MESSAGE:NewType( "Unit " .. TaskUnit:GetName().. " has deployed cargo " .. Cargo:GetName() .. " at zone " .. DeployZone:GetName() .. " for task " .. Task:GetName() .. ".", MESSAGE.Type.Information ):ToAll() + +end +