Last step of bid folder restructure

This commit is contained in:
kaltokri
2024-01-01 23:44:44 +01:00
parent f31942aef3
commit f15138294b
330 changed files with 7000 additions and 7051 deletions

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -0,0 +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." )

View File

@@ -0,0 +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." )

View File

@@ -0,0 +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." )

View File

@@ -0,0 +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." )

View File

@@ -0,0 +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." )

View File

@@ -0,0 +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." )

View File

@@ -0,0 +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." )

View File

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

View File

@@ -0,0 +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." )

View File

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

View File

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

View File

@@ -0,0 +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
end

View File

@@ -0,0 +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
end

View File

@@ -0,0 +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." )

View File

@@ -0,0 +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
end

View File

@@ -0,0 +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
end

View File

@@ -0,0 +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
end

View File

@@ -0,0 +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
end

View File

@@ -0,0 +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
end

View File

@@ -0,0 +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
end

View File

@@ -0,0 +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
end

View File

@@ -0,0 +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." )

View File

@@ -0,0 +1,47 @@
---
-- 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.
-- Setup the detection. We use DETECTION_AREAS to detect and group the enemies.
local DetectionSetZones = SET_ZONE:New():FilterPrefixes( { "Detection Zone Blue" } ):FilterOnce()
local DetectionZones = DETECTION_ZONES:New( DetectionSetZones, coalition.side.BLUE )
-- 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, DetectionZones ) -- 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." )

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -0,0 +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." )

View File

@@ -0,0 +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." )

View File

@@ -0,0 +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." )

View File

@@ -0,0 +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." )

View File

@@ -0,0 +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." )

View File

@@ -0,0 +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." )

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

Some files were not shown because too many files have changed in this diff Show More