diff --git a/ABP - Airbase Police/ABP-001 - Caucasus/ABP-001 - Caucasus.miz b/ABP - Airbase Police/ABP-001 - Caucasus/ABP-001 - Caucasus.miz index 506f58326b..5c9c5475d0 100644 Binary files a/ABP - Airbase Police/ABP-001 - Caucasus/ABP-001 - Caucasus.miz and b/ABP - Airbase Police/ABP-001 - Caucasus/ABP-001 - Caucasus.miz differ diff --git a/ABP - Airbase Police/ABP-001 - Caucasus/APL-001 - Caucasus.lua b/ABP - Airbase Police/ABP-001 - Caucasus/APL-001 - Caucasus.lua new file mode 100644 index 0000000000..b6f2fe7747 --- /dev/null +++ b/ABP - Airbase Police/ABP-001 - Caucasus/APL-001 - Caucasus.lua @@ -0,0 +1,3 @@ + +local PlanesClientSet = SET_CLIENT:New():FilterCategories( "plane" ):FilterStart() +local AirbasePolice = AIRBASEPOLICE_CAUCASUS:New( PlanesClientSet ) diff --git a/ABP - Airbase Police/ABP-002 - Nevada/ABP-002 - Nevada.miz b/ABP - Airbase Police/ABP-002 - Nevada/ABP-002 - Nevada.miz index 3af143564d..b13fc597f8 100644 Binary files a/ABP - Airbase Police/ABP-002 - Nevada/ABP-002 - Nevada.miz and b/ABP - Airbase Police/ABP-002 - Nevada/ABP-002 - Nevada.miz differ diff --git a/ABP - Airbase Police/ABP-002 - Nevada/APL-002 - Nevada.lua b/ABP - Airbase Police/ABP-002 - Nevada/APL-002 - Nevada.lua new file mode 100644 index 0000000000..680bba1dc9 --- /dev/null +++ b/ABP - Airbase Police/ABP-002 - Nevada/APL-002 - Nevada.lua @@ -0,0 +1,3 @@ + +local PlanesClientSet = SET_CLIENT:New():FilterCategories( "plane" ):FilterStart() +local AirbasePolice = AIRBASEPOLICE_NEVADA:New( PlanesClientSet ) diff --git a/AIB - AI Balancing/AIB-002 - Patrol AI/AIB-002 - Patrol AI.lua b/AIB - AI Balancing/AIB-002 - Patrol AI/AIB-002 - Patrol AI.lua index c0b085a927..d9dcde3c28 100644 --- a/AIB - AI Balancing/AIB-002 - Patrol AI/AIB-002 - Patrol AI.lua +++ b/AIB - AI Balancing/AIB-002 - Patrol AI/AIB-002 - Patrol AI.lua @@ -1,43 +1,43 @@ --- Name: AIB-002 - Patrol AI.lua --- Author: FlightControl --- Date Created: 7 December 2016 --- --- # Situation: --- --- For the red coalition, 2 client slots are foreseen. --- For those players that have not joined the mission, red AI is spawned. --- The red AI should start patrolling an area until fuel is empty and return to the home base. --- --- # Test cases: --- --- 1. If no player is logging into the red slots, 2 red AI planes should be alive. --- 2. If a player joins one red slot, one red AI plane should return to the nearest home base. --- 3. If two players join the red slots, no AI plane should be spawned, and all airborne AI planes should return to the nearest home base. --- 4. Spawned AI should take-off from the airbase, and start patrolling the area around Anapa. --- 5. When the AI is out-of-fuel, it should report it is returning to the home base, and land at Anapa. - --- Define the SET of CLIENTs from the red coalition. This SET is filled during startup. -RU_PlanesClientSet = SET_CLIENT:New():FilterCountries( "RUSSIA" ):FilterCategories( "plane" ) - --- Define the SPAWN object for the red AI plane template. --- We use InitCleanUp to check every 20 seconds, if there are no planes blocked at the airbase, waithing for take-off. --- If a blocked plane exists, this red plane will be ReSpawned. -RU_PlanesSpawn = SPAWN:New( "AI RU" ):InitCleanUp( 20 ) - --- Start the AI_BALANCER, using the SET of red CLIENTs, and the SPAWN object as a parameter. -RU_AI_Balancer = AI_BALANCER:New( RU_PlanesClientSet, RU_PlanesSpawn ) - -local PatrolZones = {} - -function RU_AI_Balancer:OnAfterSpawned( SetGroup, From, Event, To, AIGroup ) - - local PatrolZoneGroup = GROUP:FindByName( "PatrolZone" ) - local PatrolZone = ZONE_POLYGON:New( "PatrolZone", PatrolZoneGroup ) - - - PatrolZones[AIGroup] = AI_PATROL_ZONE:New( PatrolZone, 3000, 6000, 400, 600 ) - PatrolZones[AIGroup]:ManageFuel( 0.2, 60 ) - PatrolZones[AIGroup]:SetControllable( AIGroup ) - PatrolZones[AIGroup]:__Start( 5 ) - -end +-- Name: AIB-002 - Patrol AI.lua +-- Author: FlightControl +-- Date Created: 7 December 2016 +-- +-- # Situation: +-- +-- For the red coalition, 2 client slots are foreseen. +-- For those players that have not joined the mission, red AI is spawned. +-- The red AI should start patrolling an area until fuel is empty and return to the home base. +-- +-- # Test cases: +-- +-- 1. If no player is logging into the red slots, 2 red AI planes should be alive. +-- 2. If a player joins one red slot, one red AI plane should return to the nearest home base. +-- 3. If two players join the red slots, no AI plane should be spawned, and all airborne AI planes should return to the nearest home base. +-- 4. Spawned AI should take-off from the airbase, and start patrolling the area around Anapa. +-- 5. When the AI is out-of-fuel, it should report it is returning to the home base, and land at Anapa. + +-- Define the SET of CLIENTs from the red coalition. This SET is filled during startup. +RU_PlanesClientSet = SET_CLIENT:New():FilterCountries( "RUSSIA" ):FilterCategories( "plane" ) + +-- Define the SPAWN object for the red AI plane template. +-- We use InitCleanUp to check every 20 seconds, if there are no planes blocked at the airbase, waithing for take-off. +-- If a blocked plane exists, this red plane will be ReSpawned. +RU_PlanesSpawn = SPAWN:New( "AI RU" ):InitCleanUp( 20 ) + +-- Start the AI_BALANCER, using the SET of red CLIENTs, and the SPAWN object as a parameter. +RU_AI_Balancer = AI_BALANCER:New( RU_PlanesClientSet, RU_PlanesSpawn ) + +local PatrolZones = {} + +function RU_AI_Balancer:OnAfterSpawned( SetGroup, From, Event, To, AIGroup ) + + local PatrolZoneGroup = GROUP:FindByName( "PatrolZone" ) + local PatrolZone = ZONE_POLYGON:New( "PatrolZone", PatrolZoneGroup ) + + + PatrolZones[AIGroup] = AI_PATROL_ZONE:New( PatrolZone, 3000, 6000, 400, 600 ) + PatrolZones[AIGroup]:ManageFuel( 0.2, 60 ) + PatrolZones[AIGroup]:SetControllable( AIGroup ) + PatrolZones[AIGroup]:__Start( 5 ) + +end diff --git a/AIB - AI Balancing/AIB-002 - Patrol AI/AIB-002 - Patrol AI.miz b/AIB - AI Balancing/AIB-002 - Patrol AI/AIB-002 - Patrol AI.miz index 76288b0e93..1888c34b40 100644 Binary files a/AIB - AI Balancing/AIB-002 - Patrol AI/AIB-002 - Patrol AI.miz and b/AIB - AI Balancing/AIB-002 - Patrol AI/AIB-002 - Patrol AI.miz differ diff --git a/AIB - AI Balancing/AIB-003 - Two coalitions InitCleanUp test/AIB-003 - Two coalitions InitCleanUp test.lua b/AIB - AI Balancing/AIB-003 - Two coalitions InitCleanUp test/AIB-003 - Two coalitions InitCleanUp test.lua index 2f4a137abf..8e50e3e5ca 100644 --- a/AIB - AI Balancing/AIB-003 - Two coalitions InitCleanUp test/AIB-003 - Two coalitions InitCleanUp test.lua +++ b/AIB - AI Balancing/AIB-003 - Two coalitions InitCleanUp test/AIB-003 - Two coalitions InitCleanUp test.lua @@ -1,24 +1,24 @@ -RU_PlanesClientSet = SET_CLIENT:New():FilterCountries( "RUSSIA" ):FilterCategories( "plane" ) -RU_PlanesSpawn = SPAWN:New( "AI RU" ):InitCleanUp( 20 ) -RU_AI_Balancer = AI_BALANCER:New( RU_PlanesClientSet, RU_PlanesSpawn ) - -RU_AirbasesSet = SET_AIRBASE:New():FilterCoalitions("red"):FilterStart() -RU_AirbasesSet:Flush() -RU_AI_Balancer:ReturnToNearestAirbases( 10000, RU_AirbasesSet ) - - -US_PlanesClientSet = SET_CLIENT:New():FilterCountries( "USA" ):FilterCategories( "plane" ) -US_PlanesSpawn = SPAWN:New( "AI US" ):InitCleanUp( 20 ) -US_AI_Balancer = AI_BALANCER:New( US_PlanesClientSet, US_PlanesSpawn ) - ---RU_AI_Balancer:ReturnToHomeAirbase( 10000 ) - ---local PatrolZoneGroup = GROUP:FindByName( "Patrol Zone Blue" ) ---local PatrolZoneBlue = ZONE_POLYGON:New( "PatrolZone", PatrolZoneGroup ) ---local PatrolZoneB = AI_PATROL_ZONE:New( PatrolZoneBlue, 3000, 6000, 900, 1100 ):ManageFuel( 0.2, 180 ) ---US_AI_Balancer:SetPatrolZone( PatrolZoneB ) --- ---local PatrolZoneGroup = GROUP:FindByName( "Patrol Zone Red" ) ---local PatrolZoneRed = ZONE_POLYGON:New( "PatrolZone", PatrolZoneGroup ) ---local PatrolZoneR = AI_PATROL_ZONE:New( PatrolZoneRed, 3000, 6000, 900, 1100 ):ManageFuel( 0.2, 180 ) ---RU_AI_Balancer:SetPatrolZone( PatrolZoneR ) +RU_PlanesClientSet = SET_CLIENT:New():FilterCountries( "RUSSIA" ):FilterCategories( "plane" ) +RU_PlanesSpawn = SPAWN:New( "AI RU" ):InitCleanUp( 20 ) +RU_AI_Balancer = AI_BALANCER:New( RU_PlanesClientSet, RU_PlanesSpawn ) + +RU_AirbasesSet = SET_AIRBASE:New():FilterCoalitions("red"):FilterStart() +RU_AirbasesSet:Flush() +RU_AI_Balancer:ReturnToNearestAirbases( 10000, RU_AirbasesSet ) + + +US_PlanesClientSet = SET_CLIENT:New():FilterCountries( "USA" ):FilterCategories( "plane" ) +US_PlanesSpawn = SPAWN:New( "AI US" ):InitCleanUp( 20 ) +US_AI_Balancer = AI_BALANCER:New( US_PlanesClientSet, US_PlanesSpawn ) + +--RU_AI_Balancer:ReturnToHomeAirbase( 10000 ) + +--local PatrolZoneGroup = GROUP:FindByName( "Patrol Zone Blue" ) +--local PatrolZoneBlue = ZONE_POLYGON:New( "PatrolZone", PatrolZoneGroup ) +--local PatrolZoneB = AI_PATROL_ZONE:New( PatrolZoneBlue, 3000, 6000, 900, 1100 ):ManageFuel( 0.2, 180 ) +--US_AI_Balancer:SetPatrolZone( PatrolZoneB ) +-- +--local PatrolZoneGroup = GROUP:FindByName( "Patrol Zone Red" ) +--local PatrolZoneRed = ZONE_POLYGON:New( "PatrolZone", PatrolZoneGroup ) +--local PatrolZoneR = AI_PATROL_ZONE:New( PatrolZoneRed, 3000, 6000, 900, 1100 ):ManageFuel( 0.2, 180 ) +--RU_AI_Balancer:SetPatrolZone( PatrolZoneR ) diff --git a/AIB - AI Balancing/AIB-003 - Two coalitions InitCleanUp test/AIB-003 - Two coalitions InitCleanUp test.miz b/AIB - AI Balancing/AIB-003 - Two coalitions InitCleanUp test/AIB-003 - Two coalitions InitCleanUp test.miz index 4d439cf5b6..94238dd00e 100644 Binary files a/AIB - AI Balancing/AIB-003 - Two coalitions InitCleanUp test/AIB-003 - Two coalitions InitCleanUp test.miz and b/AIB - AI Balancing/AIB-003 - Two coalitions InitCleanUp test/AIB-003 - Two coalitions InitCleanUp test.miz differ diff --git a/AIB - AI Balancing/AIB-004 - Respawn Test when Destroyed/AIB-004 - Respawn Test when Destroyed.lua b/AIB - AI Balancing/AIB-004 - Respawn Test when Destroyed/AIB-004 - Respawn Test when Destroyed.lua index 07efab0d00..79299c11e3 100644 --- a/AIB - AI Balancing/AIB-004 - Respawn Test when Destroyed/AIB-004 - Respawn Test when Destroyed.lua +++ b/AIB - AI Balancing/AIB-004 - Respawn Test when Destroyed/AIB-004 - Respawn Test when Destroyed.lua @@ -1,47 +1,47 @@ --- Name: AIB-004 - Respawn Test when Destroyed.lua --- Author: FlightControl --- Date Created: 7 January 2017 --- --- # Situation: --- --- For the red coalition, 2 client slots are foreseen. --- For those players that have not joined the mission, red AI is spawned. --- The red AI should start patrolling an area. --- --- The blue side has SAMs nearby. --- Once the red AI takes off, the red AI is attacked by the blue SAMs. --- Red AI should be killed and once that happens, a Respawn of the group should happen! --- The Respawn happens through the InitCleanUp() API of SPAWN. --- --- # Test cases: --- --- 1. If no player is logging into the red slots, 2 red AI planes should be alive. --- 2. If a player joins one red slot, one red AI plane should return to the nearest home base. --- 3. If two players join the red slots, no AI plane should be spawned, and all airborne AI planes should return to the nearest home base. --- 4. Monitor that once a red AI is destroyed, that it ReSpawns... - - --- Define the SET of CLIENTs from the red coalition. This SET is filled during startup. -RU_PlanesClientSet = SET_CLIENT:New():FilterCountries( "RUSSIA" ):FilterCategories( "plane" ) - --- Define the SPAWN object for the red AI plane template. --- We use InitCleanUp to check every 20 seconds, if there are no planes blocked at the airbase, waithing for take-off. --- If a blocked plane exists, this red plane will be ReSpawned. -RU_PlanesSpawn = SPAWN:New( "AI RU" ):InitCleanUp( 20 ) - --- Start the AI_BALANCER, using the SET of red CLIENTs, and the SPAWN object as a parameter. -RU_AI_Balancer = AI_BALANCER:New( RU_PlanesClientSet, RU_PlanesSpawn ) - -function RU_AI_Balancer:OnAfterSpawned( SetGroup, From, Event, To, AIGroup ) - - local PatrolZoneGroup = GROUP:FindByName( "PatrolZone" ) - local PatrolZone = ZONE_POLYGON:New( "PatrolZone", PatrolZoneGroup ) - - - local Patrol = AI_PATROL_ZONE:New( PatrolZone, 3000, 6000, 400, 600 ) - Patrol:ManageFuel( 0.2, 60 ) - Patrol:SetControllable( AIGroup ) - Patrol:__Start( 5 ) - -end - +-- Name: AIB-004 - Respawn Test when Destroyed.lua +-- Author: FlightControl +-- Date Created: 7 January 2017 +-- +-- # Situation: +-- +-- For the red coalition, 2 client slots are foreseen. +-- For those players that have not joined the mission, red AI is spawned. +-- The red AI should start patrolling an area. +-- +-- The blue side has SAMs nearby. +-- Once the red AI takes off, the red AI is attacked by the blue SAMs. +-- Red AI should be killed and once that happens, a Respawn of the group should happen! +-- The Respawn happens through the InitCleanUp() API of SPAWN. +-- +-- # Test cases: +-- +-- 1. If no player is logging into the red slots, 2 red AI planes should be alive. +-- 2. If a player joins one red slot, one red AI plane should return to the nearest home base. +-- 3. If two players join the red slots, no AI plane should be spawned, and all airborne AI planes should return to the nearest home base. +-- 4. Monitor that once a red AI is destroyed, that it ReSpawns... + + +-- Define the SET of CLIENTs from the red coalition. This SET is filled during startup. +RU_PlanesClientSet = SET_CLIENT:New():FilterCountries( "RUSSIA" ):FilterCategories( "plane" ) + +-- Define the SPAWN object for the red AI plane template. +-- We use InitCleanUp to check every 20 seconds, if there are no planes blocked at the airbase, waithing for take-off. +-- If a blocked plane exists, this red plane will be ReSpawned. +RU_PlanesSpawn = SPAWN:New( "AI RU" ):InitCleanUp( 20 ) + +-- Start the AI_BALANCER, using the SET of red CLIENTs, and the SPAWN object as a parameter. +RU_AI_Balancer = AI_BALANCER:New( RU_PlanesClientSet, RU_PlanesSpawn ) + +function RU_AI_Balancer:OnAfterSpawned( SetGroup, From, Event, To, AIGroup ) + + local PatrolZoneGroup = GROUP:FindByName( "PatrolZone" ) + local PatrolZone = ZONE_POLYGON:New( "PatrolZone", PatrolZoneGroup ) + + + local Patrol = AI_PATROL_ZONE:New( PatrolZone, 3000, 6000, 400, 600 ) + Patrol:ManageFuel( 0.2, 60 ) + Patrol:SetControllable( AIGroup ) + Patrol:__Start( 5 ) + +end + diff --git a/AIB - AI Balancing/AIB-004 - Respawn Test when Destroyed/AIB-004 - Respawn Test when Destroyed.miz b/AIB - AI Balancing/AIB-004 - Respawn Test when Destroyed/AIB-004 - Respawn Test when Destroyed.miz index 808d09a893..c8f0898994 100644 Binary files a/AIB - AI Balancing/AIB-004 - Respawn Test when Destroyed/AIB-004 - Respawn Test when Destroyed.miz and b/AIB - AI Balancing/AIB-004 - Respawn Test when Destroyed/AIB-004 - Respawn Test when Destroyed.miz differ diff --git a/AIB - AI Balancing/AIB-005 - Patrol AI and Randomize Zones/AIB-005 - Patrol AI and Randomize Zones.lua b/AIB - AI Balancing/AIB-005 - Patrol AI and Randomize Zones/AIB-005 - Patrol AI and Randomize Zones.lua index f0253d5e94..c4e7e5ad2f 100644 --- a/AIB - AI Balancing/AIB-005 - Patrol AI and Randomize Zones/AIB-005 - Patrol AI and Randomize Zones.lua +++ b/AIB - AI Balancing/AIB-005 - Patrol AI and Randomize Zones/AIB-005 - Patrol AI and Randomize Zones.lua @@ -1,51 +1,51 @@ --- Name: AIB-005 - Patrol AI and Randomize Zones --- Author: FlightControl --- Date Created: 10 Jan 2016 --- --- # Situation: --- --- For the red coalition, 2 client slots are foreseen. --- For those players that have not joined the mission, red AI is spawned. --- The red AI should start patrolling an area until fuel is empty and return to the home base. --- For each AI being spawned, ensure that they fly to a random zone defined within the mission editor. --- Right now there are two patrol zones defined, so the AI should start patrolliing in one of these zones. --- --- # Test cases: --- --- 1. If no player is logging into the red slots, 2 red AI planes should be alive. --- 2. If a player joins one red slot, one red AI plane should return to the nearest home base. --- 3. If two players join the red slots, no AI plane should be spawned, and all airborne AI planes should return to the nearest home base. --- 4. Spawned AI should take-off from the airbase, and start patrolling the area around Anapa. --- 5. When the AI is out-of-fuel, it should report it is returning to the home base, and land at Anapa. --- 6. Ensure that you see the AI patrol in one of the two zones ... - --- Define the SET of CLIENTs from the red coalition. This SET is filled during startup. -RU_PlanesClientSet = SET_CLIENT:New():FilterCountries( "RUSSIA" ):FilterCategories( "plane" ) - --- Define the SPAWN object for the red AI plane template. --- We use InitCleanUp to check every 20 seconds, if there are no planes blocked at the airbase, waithing for take-off. --- If a blocked plane exists, this red plane will be ReSpawned. -RU_PlanesSpawn = SPAWN:New( "AI RU" ):InitCleanUp( 20 ) - --- Start the AI_BALANCER, using the SET of red CLIENTs, and the SPAWN object as a parameter. -RU_AI_Balancer = AI_BALANCER:New( RU_PlanesClientSet, RU_PlanesSpawn ) - --- Create the first polygon zone ... -PatrolZoneGroup1 = GROUP:FindByName( "PatrolZone1" ) -PatrolZone1 = ZONE_POLYGON:New( "PatrolZone1", PatrolZoneGroup1 ) - --- Create the second polygon zone ... -PatrolZoneGroup2 = GROUP:FindByName( "PatrolZone2" ) -PatrolZone2 = ZONE_POLYGON:New( "PatrolZone2", PatrolZoneGroup2 ) - --- Now, create an array of these zones ... -PatrolZoneArray = { PatrolZone1, PatrolZone2 } - -function RU_AI_Balancer:OnAfterSpawned( SetGroup, From, Event, To, AIGroup ) - - local Patrol = AI_PATROL_ZONE:New( PatrolZoneArray[math.random( 1, 2 )], 3000, 6000, 400, 600 ) - Patrol:ManageFuel( 0.2, 60 ) - Patrol:SetControllable( AIGroup ) - Patrol:Start() - -end +-- Name: AIB-005 - Patrol AI and Randomize Zones +-- Author: FlightControl +-- Date Created: 10 Jan 2016 +-- +-- # Situation: +-- +-- For the red coalition, 2 client slots are foreseen. +-- For those players that have not joined the mission, red AI is spawned. +-- The red AI should start patrolling an area until fuel is empty and return to the home base. +-- For each AI being spawned, ensure that they fly to a random zone defined within the mission editor. +-- Right now there are two patrol zones defined, so the AI should start patrolliing in one of these zones. +-- +-- # Test cases: +-- +-- 1. If no player is logging into the red slots, 2 red AI planes should be alive. +-- 2. If a player joins one red slot, one red AI plane should return to the nearest home base. +-- 3. If two players join the red slots, no AI plane should be spawned, and all airborne AI planes should return to the nearest home base. +-- 4. Spawned AI should take-off from the airbase, and start patrolling the area around Anapa. +-- 5. When the AI is out-of-fuel, it should report it is returning to the home base, and land at Anapa. +-- 6. Ensure that you see the AI patrol in one of the two zones ... + +-- Define the SET of CLIENTs from the red coalition. This SET is filled during startup. +RU_PlanesClientSet = SET_CLIENT:New():FilterCountries( "RUSSIA" ):FilterCategories( "plane" ) + +-- Define the SPAWN object for the red AI plane template. +-- We use InitCleanUp to check every 20 seconds, if there are no planes blocked at the airbase, waithing for take-off. +-- If a blocked plane exists, this red plane will be ReSpawned. +RU_PlanesSpawn = SPAWN:New( "AI RU" ):InitCleanUp( 20 ) + +-- Start the AI_BALANCER, using the SET of red CLIENTs, and the SPAWN object as a parameter. +RU_AI_Balancer = AI_BALANCER:New( RU_PlanesClientSet, RU_PlanesSpawn ) + +-- Create the first polygon zone ... +PatrolZoneGroup1 = GROUP:FindByName( "PatrolZone1" ) +PatrolZone1 = ZONE_POLYGON:New( "PatrolZone1", PatrolZoneGroup1 ) + +-- Create the second polygon zone ... +PatrolZoneGroup2 = GROUP:FindByName( "PatrolZone2" ) +PatrolZone2 = ZONE_POLYGON:New( "PatrolZone2", PatrolZoneGroup2 ) + +-- Now, create an array of these zones ... +PatrolZoneArray = { PatrolZone1, PatrolZone2 } + +function RU_AI_Balancer:OnAfterSpawned( SetGroup, From, Event, To, AIGroup ) + + local Patrol = AI_PATROL_ZONE:New( PatrolZoneArray[math.random( 1, 2 )], 3000, 6000, 400, 600 ) + Patrol:ManageFuel( 0.2, 60 ) + Patrol:SetControllable( AIGroup ) + Patrol:Start() + +end diff --git a/AIB - AI Balancing/AIB-005 - Patrol AI and Randomize Zones/AIB-005 - Patrol AI and Randomize Zones.miz b/AIB - AI Balancing/AIB-005 - Patrol AI and Randomize Zones/AIB-005 - Patrol AI and Randomize Zones.miz index 8606007571..d90ff0664a 100644 Binary files a/AIB - AI Balancing/AIB-005 - Patrol AI and Randomize Zones/AIB-005 - Patrol AI and Randomize Zones.miz and b/AIB - AI Balancing/AIB-005 - Patrol AI and Randomize Zones/AIB-005 - Patrol AI and Randomize Zones.miz differ diff --git a/AIB - AI Balancing/AIB-006 - Declutter AI at Airbases/AIB-006 - Declutter AI at Airbases.lua b/AIB - AI Balancing/AIB-006 - Declutter AI at Airbases/AIB-006 - Declutter AI at Airbases.lua index 31574814df..530f718fc4 100644 --- a/AIB - AI Balancing/AIB-006 - Declutter AI at Airbases/AIB-006 - Declutter AI at Airbases.lua +++ b/AIB - AI Balancing/AIB-006 - Declutter AI at Airbases/AIB-006 - Declutter AI at Airbases.lua @@ -1,43 +1,43 @@ --- Name: AIB-005 - Patrol AI and Randomize Zones --- Author: FlightControl --- Date Created: 10 Jan 2016 --- --- # Situation: --- --- For the red coalition, 2 client slots are foreseen. --- For those players that have not joined the mission, red AI is spawned. --- You'll notice a lot of AI is being spawned, as there are a lot of slots... --- If the SPAWN API :InitCleanUp( secs ) is NOT used, you'll notice that the planes block each other on the runway. --- After a short period of time, nothing will move anymore... --- The :InitCleanUp( seconds ) API of the SPAWN class ensure that any AI that is parked longer than the --- specified amount of seconds, is respawned back at the parking position. --- This frees up the other planes departing, and the airbase is in this way decluttered... --- --- # Test cases: --- --- 1. Observe the de-cluttering of planes at Krymsk. --- 2. Play with the InitCleanUp API of the SPAWN class, extende the amount of seconds to find the optimal setting. - --- Define the SET of CLIENTs from the red coalition. This SET is filled during startup. -RU_PlanesClientSet = SET_CLIENT:New():FilterCountries( "RUSSIA" ):FilterCategories( "plane" ) - --- Define the SPAWN object for the red AI plane template. --- We use InitCleanUp to check every 20 seconds, if there are no planes blocked at the airbase, waithing for take-off. --- If a blocked plane exists, this red plane will be ReSpawned. -RU_PlanesSpawn = SPAWN:New( "AI RU" ):InitCleanUp( 20 ) - --- Start the AI_BALANCER, using the SET of red CLIENTs, and the SPAWN object as a parameter. -RU_AI_Balancer = AI_BALANCER:New( RU_PlanesClientSet, RU_PlanesSpawn ) - --- Create the first polygon zone ... -PatrolZoneGroup1 = GROUP:FindByName( "PatrolZone1" ) -PatrolZone1 = ZONE_POLYGON:New( "PatrolZone1", PatrolZoneGroup1 ) - -function RU_AI_Balancer:OnAfterSpawned( SetGroup, From, Event, To, AIGroup ) - - local Patrol = AI_PATROL_ZONE:New( PatrolZone1, 3000, 6000, 400, 600 ) - Patrol:ManageFuel( 0.2, 60 ) - Patrol:SetControllable( AIGroup ) - Patrol:__Start( 5 ) - -end +-- Name: AIB-005 - Patrol AI and Randomize Zones +-- Author: FlightControl +-- Date Created: 10 Jan 2016 +-- +-- # Situation: +-- +-- For the red coalition, 2 client slots are foreseen. +-- For those players that have not joined the mission, red AI is spawned. +-- You'll notice a lot of AI is being spawned, as there are a lot of slots... +-- If the SPAWN API :InitCleanUp( secs ) is NOT used, you'll notice that the planes block each other on the runway. +-- After a short period of time, nothing will move anymore... +-- The :InitCleanUp( seconds ) API of the SPAWN class ensure that any AI that is parked longer than the +-- specified amount of seconds, is respawned back at the parking position. +-- This frees up the other planes departing, and the airbase is in this way decluttered... +-- +-- # Test cases: +-- +-- 1. Observe the de-cluttering of planes at Krymsk. +-- 2. Play with the InitCleanUp API of the SPAWN class, extende the amount of seconds to find the optimal setting. + +-- Define the SET of CLIENTs from the red coalition. This SET is filled during startup. +RU_PlanesClientSet = SET_CLIENT:New():FilterCountries( "RUSSIA" ):FilterCategories( "plane" ) + +-- Define the SPAWN object for the red AI plane template. +-- We use InitCleanUp to check every 20 seconds, if there are no planes blocked at the airbase, waithing for take-off. +-- If a blocked plane exists, this red plane will be ReSpawned. +RU_PlanesSpawn = SPAWN:New( "AI RU" ):InitCleanUp( 20 ) + +-- Start the AI_BALANCER, using the SET of red CLIENTs, and the SPAWN object as a parameter. +RU_AI_Balancer = AI_BALANCER:New( RU_PlanesClientSet, RU_PlanesSpawn ) + +-- Create the first polygon zone ... +PatrolZoneGroup1 = GROUP:FindByName( "PatrolZone1" ) +PatrolZone1 = ZONE_POLYGON:New( "PatrolZone1", PatrolZoneGroup1 ) + +function RU_AI_Balancer:OnAfterSpawned( SetGroup, From, Event, To, AIGroup ) + + local Patrol = AI_PATROL_ZONE:New( PatrolZone1, 3000, 6000, 400, 600 ) + Patrol:ManageFuel( 0.2, 60 ) + Patrol:SetControllable( AIGroup ) + Patrol:__Start( 5 ) + +end diff --git a/AIB - AI Balancing/AIB-006 - Declutter AI at Airbases/AIB-006 - Declutter AI at Airbases.miz b/AIB - AI Balancing/AIB-006 - Declutter AI at Airbases/AIB-006 - Declutter AI at Airbases.miz index ba14dfd117..2e0bc3fb01 100644 Binary files a/AIB - AI Balancing/AIB-006 - Declutter AI at Airbases/AIB-006 - Declutter AI at Airbases.miz and b/AIB - AI Balancing/AIB-006 - Declutter AI at Airbases/AIB-006 - Declutter AI at Airbases.miz differ diff --git a/AIB - AI Balancing/AIB-007 - All Airports/AIB-007 - AI Balancers For all airports and both coalitions.lua b/AIB - AI Balancing/AIB-007 - All Airports/AIB-007 - AI Balancers For all airports and both coalitions.lua new file mode 100644 index 0000000000..9e3091a6a8 --- /dev/null +++ b/AIB - AI Balancing/AIB-007 - All Airports/AIB-007 - AI Balancers For all airports and both coalitions.lua @@ -0,0 +1,163 @@ +-- Name: AIB-007 - AI Balancers For all airports and both coalitions +-- Author: Delta99 +-- Date Created: 11 Feb 2017 +-- +-- Originally created to solve issues jg7xman (from Moose Slack group) was having in creating +-- AI_BALANCER across multiple airbases. + +-- # Situation: +-- +-- AI_BALANCERS created per airbase for both coalitions. Mutiple patrol zones are created +-- for each side. Each flight that is created by AI_BALANCER will pick a random patrol zone +-- to patrol. + +-- # Test Cases +-- +-- 1. Observe at least 1 flight spawning and taking off from each airbase. +-- 2. Each flight patrols randomly in one of its sides zones. +-- 3. AI will respawn after killed. +-- 4. Additional client slots are available at Sochi. If players don't take a slot there +-- will be more than one AI taking off from Sochi. +-- 5. Batumi contains a flight of 3 units rather than just 1 like most of the rest of the airbases. +-- 6. Watch the coalition AI clash and kill each other. + +-- Create the Red Patrol Zone Array + +-- This zone array will be used in the AI_BALANCER to randomize the patrol +-- zone that each spawned group will patrol + +RedPatrolZone = {} +RedPatrolZone[1] = ZONE:New( "RedPatrolZone1" ) +RedPatrolZone[2] = ZONE:New( "RedPatrolZone2" ) +RedPatrolZone[3] = ZONE:New( "RedPatrolZone3" ) +RedPatrolZone[4] = ZONE:New( "RedPatrolZone4" ) +RedPatrolZone[5] = ZONE:New( "RedPatrolZone5" ) +RedPatrolZone[6] = ZONE:New( "RedPatrolZone6" ) + +-- Russian CAP Aircraft + +-- These are the aircraft created in the mission editor that the AI will spawn +-- with replacing any CLIENT created aircraft in the mission that a human +-- player does not take. + +RU_PlanesSpawn = {} +RU_PlanesSpawn[1] = SPAWN:New( "RU CAP Anapa AB" ):InitCleanUp( 45 ) +RU_PlanesSpawn[2] = SPAWN:New( "RU CAP Beslan AB" ):InitCleanUp( 45 ) +RU_PlanesSpawn[3] = SPAWN:New( "RU CAP Gelendzhik AB" ):InitCleanUp( 45 ) +RU_PlanesSpawn[4] = SPAWN:New( "RU CAP Krasnodar Center AB" ):InitCleanUp( 45 ) +RU_PlanesSpawn[5] = SPAWN:New( "RU CAP Krasnodar Pashkovsky AB" ):InitCleanUp( 45 ) +RU_PlanesSpawn[6] = SPAWN:New( "RU CAP Krymsk AB" ):InitCleanUp( 45 ) +RU_PlanesSpawn[7] = SPAWN:New( "RU CAP Maykop AB" ):InitCleanUp( 45 ) +RU_PlanesSpawn[8] = SPAWN:New( "RU CAP Mineralnye Vody AB" ):InitCleanUp( 45 ) +RU_PlanesSpawn[9] = SPAWN:New( "RU CAP Mozdok AB" ):InitCleanUp( 45 ) +RU_PlanesSpawn[10] = SPAWN:New( "RU CAP Nalchik AB" ):InitCleanUp( 45 ) +RU_PlanesSpawn[11] = SPAWN:New( "RU CAP Novorossiysk AB" ):InitCleanUp( 45 ) + +-- Russian Client Aircraft (via AI_BALANCER, AI will replace these if no human players are in the slot) + +-- If you want more client slots per airbase that you want AI to be able to take control of then +-- name them with the prefixes below and they will be picked up automatically by FilterPrevixes. +-- +-- For example, if you want another Client slot available at Anapa name it "RU CLIENT Anapa AB 2". +-- The code here does not need to be changed. Only an addition in the mission editor. An example +-- of this can be found on the USA side at Sochi AB. + +RU_PlanesClientSet = {} +RU_PlanesClientSet[1] = SET_CLIENT:New():FilterPrefixes("RU CLIENT Anapa AB") +RU_PlanesClientSet[2] = SET_CLIENT:New():FilterPrefixes("RU CLIENT Beslan AB") +RU_PlanesClientSet[3] = SET_CLIENT:New():FilterPrefixes("RU CLIENT Gelendzhik AB") +RU_PlanesClientSet[4] = SET_CLIENT:New():FilterPrefixes("RU CLIENT Krasnodar Center AB") +RU_PlanesClientSet[5] = SET_CLIENT:New():FilterPrefixes("RU CLIENT Krasnodar Pashkovsky AB") +RU_PlanesClientSet[6] = SET_CLIENT:New():FilterPrefixes("RU CLIENT Krymsk AB") +RU_PlanesClientSet[7] = SET_CLIENT:New():FilterPrefixes("RU CLIENT Maykop AB") +RU_PlanesClientSet[8] = SET_CLIENT:New():FilterPrefixes("RU CLIENT Mineralnye Vody AB") +RU_PlanesClientSet[9] = SET_CLIENT:New():FilterPrefixes("RU CLIENT Mozdok AB") +RU_PlanesClientSet[10] = SET_CLIENT:New():FilterPrefixes("RU CLIENT Nalchik AB") +RU_PlanesClientSet[11] = SET_CLIENT:New():FilterPrefixes("RU CLIENT Novorossiysk AB") + +-- We setup an array to store all the AI_BALANCERS that are going to be created. Basically one +-- per airbase. We loop through and create an AI_BALANCER as well as a separate OnAfterSpawned +-- function for each. The Patrol Zone is randomized in the first parameter to AI_PATROL_ZONE:New() +-- call. This is done for each of the AI_BALANCERS. To add more patrol zones, just define them in +-- the mission editor and add into the array above. Code here does not need to be changed. The +-- table.getn(RedPatrolZone) gets the number of elements in the RedPatrolZone array so that all +-- of them are included to pick randomly. + + +RU_AI_Balancer = {} +for i=1, 11 do + RU_AI_Balancer[i] = AI_BALANCER:New(RU_PlanesClientSet[i], RU_PlanesSpawn[i]) + + -- We set a local variable within the for loop to the AI_BALANCER that was just created. + -- I couldn't get RU_AI_BALANCER[i]:OnAfterSpawn to be recognized so this is just pointing + -- curAIBalancer to the relevant RU_AI_BALANCER array item for each loop. + + -- So in this case there are essentially 11 OnAfterSpawned functions defined and handled. + + local curAIBalancer = RU_AI_Balancer[i] + function curAIBalancer:OnAfterSpawned( SetGroup, From, Event, To, AIGroup ) + local Patrol = AI_PATROL_ZONE:New( RedPatrolZone[math.random( 1, table.getn(RedPatrolZone))], 1500, 5500, 700, 1400 ) + Patrol:ManageFuel( 0.2, 60 ) + Patrol:SetControllable( AIGroup ) + Patrol:Start() + end +end + +-- US / Blue side is setup pretty much identically to the RU side above. Same detailed comments +-- above apply here. The main difference here is 10 airbases instead of 11. + +-- Another difference is additional client slots at Sochi and a group defined at Batumi with +-- more than 1 unit per group (flight of 3 units). This is just to show that you can have more +-- client slots per airbase and more units in a single group that the AI will control. I think +-- this will also allow you to fly lead with AI on your wing or you can fly wing with an AI +-- leader. + +-- Create the Blue Patrol Zone Array +BluePatrolZone = {} +BluePatrolZone[1] = ZONE:New( "BluePatrolZone1") +BluePatrolZone[2] = ZONE:New( "BluePatrolZone2") +BluePatrolZone[3] = ZONE:New( "BluePatrolZone3") +BluePatrolZone[4] = ZONE:New( "BluePatrolZone4") +BluePatrolZone[5] = ZONE:New( "BluePatrolZone5") +BluePatrolZone[6] = ZONE:New( "BluePatrolZone6") + +--United States CAP Aircraft (these are used as templates for AI) + +US_PlanesSpawn = {} +US_PlanesSpawn[1] = SPAWN:New( "US CAP Batumi AB" ):InitCleanUp( 45 ) +US_PlanesSpawn[2] = SPAWN:New( "US CAP Gudauta AB" ):InitCleanUp( 45 ) +US_PlanesSpawn[3] = SPAWN:New( "US CAP Kobuleti AB" ):InitCleanUp( 45 ) +US_PlanesSpawn[4] = SPAWN:New( "US CAP Kutaisi AB" ):InitCleanUp( 45 ) +US_PlanesSpawn[5] = SPAWN:New( "US CAP Senaki AB" ):InitCleanUp( 45 ) +US_PlanesSpawn[6] = SPAWN:New( "US CAP Sochi AB" ):InitCleanUp( 45 ) +US_PlanesSpawn[7] = SPAWN:New( "US CAP Soganlug AB" ):InitCleanUp( 45 ) +US_PlanesSpawn[8] = SPAWN:New( "US CAP Sukhumi AB" ):InitCleanUp( 45 ) +US_PlanesSpawn[9] = SPAWN:New( "US CAP Vaziani AB" ):InitCleanUp( 45 ) +US_PlanesSpawn[10] = SPAWN:New( "US CAP Tbilisi AB" ):InitCleanUp( 45 ) + +--United States Client Aircraft (via AI_BALANCER, AI will replace these if no human players are in the slot) + +US_PlanesClientSet = {} +US_PlanesClientSet[1] = SET_CLIENT:New():FilterPrefixes("US CLIENT Batumi AB") +US_PlanesClientSet[2] = SET_CLIENT:New():FilterPrefixes("US CLIENT Gudauta AB") +US_PlanesClientSet[3] = SET_CLIENT:New():FilterPrefixes("US CLIENT Kobuleti AB") +US_PlanesClientSet[4] = SET_CLIENT:New():FilterPrefixes("US CLIENT Kutaisi AB") +US_PlanesClientSet[5] = SET_CLIENT:New():FilterPrefixes("US CLIENT Senaki AB") +US_PlanesClientSet[6] = SET_CLIENT:New():FilterPrefixes("US CLIENT Sochi AB") +US_PlanesClientSet[7] = SET_CLIENT:New():FilterPrefixes("US CLIENT Soganlug AB") +US_PlanesClientSet[8] = SET_CLIENT:New():FilterPrefixes("US CLIENT Sukhumi AB") +US_PlanesClientSet[9] = SET_CLIENT:New():FilterPrefixes("US CLIENT Vaziani AB") +US_PlanesClientSet[10] = SET_CLIENT:New():FilterPrefixes("US CLIENT Tbilisi AB") + +US_AI_Balancer = {} +for i=1, 10 do + US_AI_Balancer[i] = AI_BALANCER:New( US_PlanesClientSet[i], US_PlanesSpawn[i] ) + + local curAIBalancer = US_AI_Balancer[i] + function curAIBalancer:OnAfterSpawned( SetGroup, From, Event, To, AIGroup ) + local Patrol = AI_PATROL_ZONE:New( BluePatrolZone[math.random( 1, table.getn(BluePatrolZone))], 1500, 5500, 700, 1400 ) + Patrol:ManageFuel( 0.2, 60 ) + Patrol:SetControllable( AIGroup ) + Patrol:Start() + end +end diff --git a/AIB - AI Balancing/AIB-007 - All Airports/AIB-007 - All Airports.miz b/AIB - AI Balancing/AIB-007 - All Airports/AIB-007 - All Airports.miz index cc5f61437d..8a5c1cca32 100644 Binary files a/AIB - AI Balancing/AIB-007 - All Airports/AIB-007 - All Airports.miz and b/AIB - AI Balancing/AIB-007 - All Airports/AIB-007 - All Airports.miz differ diff --git a/AIC - AI Cargo/APC - Armoured Personnel Carrier/AIC-APC-000 - APC/AIC-APC-000 - APC.lua b/AIC - AI Cargo/APC - Armoured Personnel Carrier/AIC-APC-000 - APC/AIC-APC-000 - APC.lua index 9c54a2b07c..bda8155a20 100644 --- a/AIC - AI Cargo/APC - Armoured Personnel Carrier/AIC-APC-000 - APC/AIC-APC-000 - APC.lua +++ b/AIC - AI Cargo/APC - Armoured Personnel Carrier/AIC-APC-000 - APC/AIC-APC-000 - APC.lua @@ -1,20 +1,20 @@ ---- --- Name: AIC-APC-000 - APC --- Author: FlightControl --- Date Created: 26 Mar 2018 --- Date Checked: 01 Jan 2021 --- Working example --- --- A demonstration of the AI_CARGO_APC class. --- This simple example transports Infantry. --- The CARGO_GROUP objects are declared within the mission script. - -local Infantry1 = CARGO_GROUP:New( GROUP:FindByName( "Infantry1" ), "Infantry", "Infantry1", 500, 25 ) -local Infantry2 = CARGO_GROUP:New( GROUP:FindByName( "Infantry2" ), "Infantry", "Infantry2", 500, 25 ) -local Infantry3 = CARGO_GROUP:New( GROUP:FindByName( "Infantry3" ), "Infantry", "Infantry3", 500, 25 ) - -local InfantryCargoSet = SET_CARGO:New():FilterTypes( "Infantry" ):FilterStart() -local APC = GROUP:FindByName( "APC" ) -AICargoAPC = AI_CARGO_APC:New( APC, InfantryCargoSet, 500 ) -AICargoAPC:__Pickup( 5 ) - +--- +-- Name: AIC-APC-000 - APC +-- Author: FlightControl +-- Date Created: 26 Mar 2018 +-- Date Checked: 01 Jan 2021 +-- Working example +-- +-- A demonstration of the AI_CARGO_APC class. +-- This simple example transports Infantry. +-- The CARGO_GROUP objects are declared within the mission script. + +local Infantry1 = CARGO_GROUP:New( GROUP:FindByName( "Infantry1" ), "Infantry", "Infantry1", 500, 25 ) +local Infantry2 = CARGO_GROUP:New( GROUP:FindByName( "Infantry2" ), "Infantry", "Infantry2", 500, 25 ) +local Infantry3 = CARGO_GROUP:New( GROUP:FindByName( "Infantry3" ), "Infantry", "Infantry3", 500, 25 ) + +local InfantryCargoSet = SET_CARGO:New():FilterTypes( "Infantry" ):FilterStart() +local APC = GROUP:FindByName( "APC" ) +AICargoAPC = AI_CARGO_APC:New( APC, InfantryCargoSet, 500 ) +AICargoAPC:__Pickup( 5 ) + diff --git a/AIC - AI Cargo/APC - Armoured Personnel Carrier/AIC-APC-000 - APC/AIC-APC-000 - APC.miz b/AIC - AI Cargo/APC - Armoured Personnel Carrier/AIC-APC-000 - APC/AIC-APC-000 - APC.miz index 97b4be2b45..31c964c0f4 100644 Binary files a/AIC - AI Cargo/APC - Armoured Personnel Carrier/AIC-APC-000 - APC/AIC-APC-000 - APC.miz and b/AIC - AI Cargo/APC - Armoured Personnel Carrier/AIC-APC-000 - APC/AIC-APC-000 - APC.miz differ diff --git a/AIC - AI Cargo/APC - Armoured Personnel Carrier/AIC-APC-001 - APC with Cargo declared in ME/AIC-APC-001 - APC with Cargo declared in ME.lua b/AIC - AI Cargo/APC - Armoured Personnel Carrier/AIC-APC-001 - APC with Cargo declared in ME/AIC-APC-001 - APC with Cargo declared in ME.lua index d142a3b7c3..d278c665ad 100644 --- a/AIC - AI Cargo/APC - Armoured Personnel Carrier/AIC-APC-001 - APC with Cargo declared in ME/AIC-APC-001 - APC with Cargo declared in ME.lua +++ b/AIC - AI Cargo/APC - Armoured Personnel Carrier/AIC-APC-001 - APC with Cargo declared in ME/AIC-APC-001 - APC with Cargo declared in ME.lua @@ -1,18 +1,18 @@ ---- --- Name: AIC-APC-001 - APC with Cargo declared in ME --- Author: FlightControl --- Date Created: 26 Mar 2018 --- Date Checked: 01 Dec 2021 --- Changed Cargo auto tag from ~ to #, working example --- --- A demonstration of the AI_CARGO_APC class. --- This simple example transports Infantry. --- The cargo is declared with the #CARGO tag in the mission editor. --- So, within the mission, the infantry groups have the name: --- e.g. Infantry1#CARGO(T=Infantry,RR=2000,NR=25) - -local InfantryCargoSet = SET_CARGO:New():FilterTypes( "Infantry" ):FilterStart() -local APC = GROUP:FindByName( "APC" ) -AICargoAPC = AI_CARGO_APC:New( APC, InfantryCargoSet, 500 ) -AICargoAPC:__Pickup( 5 ) - +--- +-- Name: AIC-APC-001 - APC with Cargo declared in ME +-- Author: FlightControl +-- Date Created: 26 Mar 2018 +-- Date Checked: 01 Dec 2021 +-- Changed Cargo auto tag from ~ to #, working example +-- +-- A demonstration of the AI_CARGO_APC class. +-- This simple example transports Infantry. +-- The cargo is declared with the #CARGO tag in the mission editor. +-- So, within the mission, the infantry groups have the name: +-- e.g. Infantry1#CARGO(T=Infantry,RR=2000,NR=25) + +local InfantryCargoSet = SET_CARGO:New():FilterTypes( "Infantry" ):FilterStart() +local APC = GROUP:FindByName( "APC" ) +AICargoAPC = AI_CARGO_APC:New( APC, InfantryCargoSet, 500 ) +AICargoAPC:__Pickup( 5 ) + diff --git a/AIC - AI Cargo/APC - Armoured Personnel Carrier/AIC-APC-001 - APC with Cargo declared in ME/AIC-APC-001 - APC with Cargo declared in ME.miz b/AIC - AI Cargo/APC - Armoured Personnel Carrier/AIC-APC-001 - APC with Cargo declared in ME/AIC-APC-001 - APC with Cargo declared in ME.miz index bd71ce6967..a733e815d6 100644 Binary files a/AIC - AI Cargo/APC - Armoured Personnel Carrier/AIC-APC-001 - APC with Cargo declared in ME/AIC-APC-001 - APC with Cargo declared in ME.miz and b/AIC - AI Cargo/APC - Armoured Personnel Carrier/AIC-APC-001 - APC with Cargo declared in ME/AIC-APC-001 - APC with Cargo declared in ME.miz differ diff --git a/AIC - AI Cargo/APC - Armoured Personnel Carrier/AIC-APC-002 - APC Move by Game Master/AIC-APC-002 - APC Move by Game Master.lua b/AIC - AI Cargo/APC - Armoured Personnel Carrier/AIC-APC-002 - APC Move by Game Master/AIC-APC-002 - APC Move by Game Master.lua index b52a229504..70deb9f3cf 100644 --- a/AIC - AI Cargo/APC - Armoured Personnel Carrier/AIC-APC-002 - APC Move by Game Master/AIC-APC-002 - APC Move by Game Master.lua +++ b/AIC - AI Cargo/APC - Armoured Personnel Carrier/AIC-APC-002 - APC Move by Game Master/AIC-APC-002 - APC Move by Game Master.lua @@ -1,12 +1,12 @@ ---- --- Name: AIC-APC-002 - APC Move by Game Master --- Author: FlightControl --- Date Created: 26 Mar 2018 --- Date Checked: 01 Jan 2021. Changed ~ to # in ME Group Names. Not sure how this is supposed to work for the Game Master - -local InfantryCargoSet = SET_CARGO:New():FilterTypes( "Infantry" ):FilterStart() - -local CargoCarrier = GROUP:FindByName( "Carrier" ) - -CargoTroops = AI_CARGO_APC:New( CargoCarrier, InfantryCargoSet, 500 ) - +--- +-- Name: AIC-APC-002 - APC Move by Game Master +-- Author: FlightControl +-- Date Created: 26 Mar 2018 +-- Date Checked: 01 Jan 2021. Changed ~ to # in ME Group Names. Not sure how this is supposed to work for the Game Master + +local InfantryCargoSet = SET_CARGO:New():FilterTypes( "Infantry" ):FilterStart() + +local CargoCarrier = GROUP:FindByName( "Carrier" ) + +CargoTroops = AI_CARGO_APC:New( CargoCarrier, InfantryCargoSet, 500 ) + diff --git a/AIC - AI Cargo/APC - Armoured Personnel Carrier/AIC-APC-002 - APC Move by Game Master/AIC-APC-002 - APC Move by Game Master.miz b/AIC - AI Cargo/APC - Armoured Personnel Carrier/AIC-APC-002 - APC Move by Game Master/AIC-APC-002 - APC Move by Game Master.miz index bb59438766..a0b66908a1 100644 Binary files a/AIC - AI Cargo/APC - Armoured Personnel Carrier/AIC-APC-002 - APC Move by Game Master/AIC-APC-002 - APC Move by Game Master.miz and b/AIC - AI Cargo/APC - Armoured Personnel Carrier/AIC-APC-002 - APC Move by Game Master/AIC-APC-002 - APC Move by Game Master.miz differ diff --git a/AIC - AI Cargo/APC - Armoured Personnel Carrier/AIC-APC-003 - APC Troops and Equipment/AIC-APC-003 - APC Troops and Equipment.lua b/AIC - AI Cargo/APC - Armoured Personnel Carrier/AIC-APC-003 - APC Troops and Equipment/AIC-APC-003 - APC Troops and Equipment.lua index 28e0bf17fb..be0fa95840 100644 --- a/AIC - AI Cargo/APC - Armoured Personnel Carrier/AIC-APC-003 - APC Troops and Equipment/AIC-APC-003 - APC Troops and Equipment.lua +++ b/AIC - AI Cargo/APC - Armoured Personnel Carrier/AIC-APC-003 - APC Troops and Equipment/AIC-APC-003 - APC Troops and Equipment.lua @@ -1,15 +1,14 @@ ---- --- Name: AIC-APC-003 - APC Troops and Equipment --- Author: FlightControl --- Date Created: 07 Apr 2018 --- Date Checked: 01 Jan 2021 --- Not sure what the test case is - -local InfantryCargoSet = SET_CARGO:New():FilterTypes( "Infantry" ):FilterStart() - -local CargoCarrier = GROUP:FindByName( "Carrier" ) - -CargoTroops = AI_CARGO_APC:New( CargoCarrier, InfantryCargoSet, 350 ) - - - +--- +-- Name: AIC-APC-003 - APC Troops and Equipment +-- Author: FlightControl +-- Date Created: 07 Apr 2018 +-- Date Checked: 01 Jan 2021 + +local InfantryCargoSet = SET_CARGO:New():FilterTypes( "Infantry" ):FilterStart() + +local CargoCarrier = GROUP:FindByName( "Carrier" ) + +CargoTroops = AI_CARGO_APC:New( CargoCarrier, InfantryCargoSet, 350 ) + + + diff --git a/AIC - AI Cargo/APC - Armoured Personnel Carrier/AIC-APC-003 - APC Troops and Equipment/AIC-APC-003 - APC Troops and Equipment.miz b/AIC - AI Cargo/APC - Armoured Personnel Carrier/AIC-APC-003 - APC Troops and Equipment/AIC-APC-003 - APC Troops and Equipment.miz index 1ceabd1495..a1987e3a81 100644 Binary files a/AIC - AI Cargo/APC - Armoured Personnel Carrier/AIC-APC-003 - APC Troops and Equipment/AIC-APC-003 - APC Troops and Equipment.miz and b/AIC - AI Cargo/APC - Armoured Personnel Carrier/AIC-APC-003 - APC Troops and Equipment/AIC-APC-003 - APC Troops and Equipment.miz differ diff --git a/AIC - AI Cargo/APC - Armoured Personnel Carrier/AIC-APC-004 - APC Pickup/AIC-APC-004 - APC Pickup.lua b/AIC - AI Cargo/APC - Armoured Personnel Carrier/AIC-APC-004 - APC Pickup/AIC-APC-004 - APC Pickup.lua index 9e6b30f8d8..26b4668d61 100644 --- a/AIC - AI Cargo/APC - Armoured Personnel Carrier/AIC-APC-004 - APC Pickup/AIC-APC-004 - APC Pickup.lua +++ b/AIC - AI Cargo/APC - Armoured Personnel Carrier/AIC-APC-004 - APC Pickup/AIC-APC-004 - APC Pickup.lua @@ -1,29 +1,29 @@ ---- --- Name: AIC-APC-004 - APC Pickup --- Author: FlightControl --- Date Created: 23 Apr 2018 --- Date Checked: 01 Jan 2021, working example, changed Deploy to async call - -BASE:TraceClass("AI_CARGO_APC") -BASE:TraceOn() - -local InfantryCargoSet = SET_CARGO:New():FilterTypes( "Infantry" ):FilterStart() -local APC = GROUP:FindByName( "APC" ) -Cargo_APC = AI_CARGO_APC:New( APC, InfantryCargoSet, 350 ) -Cargo_APC:__Pickup( 1, ZONE:New( "Pickup" ):GetCoordinate() ) - - - ---- Loaded Handler OnAfter for Cargo_APC --- @function [parent=#Cargo_APC] OnAfterLoaded --- @param #Cargo_APC self --- @param Wrapper.Group#GROUP APC --- @param #string From --- @param #string Event --- @param #string To -function Cargo_APC:OnAfterLoaded( APC, From, Event, To ) - Cargo_APC:__Deploy( 1, ZONE:New( "Deploy" ):GetCoordinate() ) -end - - - +--- +-- Name: AIC-APC-004 - APC Pickup +-- Author: FlightControl +-- Date Created: 23 Apr 2018 +-- Date Checked: 01 Jan 2021, working example, changed Deploy to async call + +BASE:TraceClass("AI_CARGO_APC") +BASE:TraceOn() + +local InfantryCargoSet = SET_CARGO:New():FilterTypes( "Infantry" ):FilterStart() +local APC = GROUP:FindByName( "APC" ) +Cargo_APC = AI_CARGO_APC:New( APC, InfantryCargoSet, 350 ) +Cargo_APC:__Pickup( 1, ZONE:New( "Pickup" ):GetCoordinate() ) + + + +--- Loaded Handler OnAfter for Cargo_APC +-- @function [parent=#Cargo_APC] OnAfterLoaded +-- @param #Cargo_APC self +-- @param Wrapper.Group#GROUP APC +-- @param #string From +-- @param #string Event +-- @param #string To +function Cargo_APC:OnAfterLoaded( APC, From, Event, To ) + Cargo_APC:__Deploy( 1, ZONE:New( "Deploy" ):GetCoordinate() ) +end + + + diff --git a/AIC - AI Cargo/APC - Armoured Personnel Carrier/AIC-APC-004 - APC Pickup/AIC-APC-004 - APC Pickup.miz b/AIC - AI Cargo/APC - Armoured Personnel Carrier/AIC-APC-004 - APC Pickup/AIC-APC-004 - APC Pickup.miz index 8f0cb17420..fd3fdcaed3 100644 Binary files a/AIC - AI Cargo/APC - Armoured Personnel Carrier/AIC-APC-004 - APC Pickup/AIC-APC-004 - APC Pickup.miz and b/AIC - AI Cargo/APC - Armoured Personnel Carrier/AIC-APC-004 - APC Pickup/AIC-APC-004 - APC Pickup.miz differ diff --git a/AIC - AI Cargo/APC - Armoured Personnel Carrier/AIC-APC-006 - Troops Relocate APC/AIC-APC-001 - Troops Relocate APC.lua b/AIC - AI Cargo/APC - Armoured Personnel Carrier/AIC-APC-006 - Troops Relocate APC/AIC-APC-001 - Troops Relocate APC.lua index abb399f7ef..22c5993c3e 100644 --- a/AIC - AI Cargo/APC - Armoured Personnel Carrier/AIC-APC-006 - Troops Relocate APC/AIC-APC-001 - Troops Relocate APC.lua +++ b/AIC - AI Cargo/APC - Armoured Personnel Carrier/AIC-APC-006 - Troops Relocate APC/AIC-APC-001 - Troops Relocate APC.lua @@ -1,29 +1,29 @@ ---- --- Name: AIC-APC-001 - Troops Relocate APC --- Author: FlightControl --- Date Created: 07 Apr 2018 --- Date Checked: 01 Jan 2021, working --- --- Demonstration of troops relocation when carrier is destroyed... --- Carrier will relocate to the rescue carrier. --- - -BASE:TraceClass("AI_CARGO_APC") - -local InfantryCargoSet = SET_CARGO:New():FilterTypes( "Infantry" ):FilterStart() - -local CargoCarrier = GROUP:FindByName( "Carrier" ) - -CargoTroops = AI_CARGO_APC:New( CargoCarrier, InfantryCargoSet, 500 ) - - -function CargoTroops:OnAfterDestroyed( CargoCarrier ) - CargoTroops:F( { Destroyed = CargoCarrier } ) - -- The coordinate is passed where the carrier is destroyed. - local NewCarrierGroup = self:FindCarrier( CargoCarrier:GetCoordinate(), 1000 ) -- which returns one Carrier GROUP object or nil. - if NewCarrierGroup then - self:SetCarrier( NewCarrierGroup ) - self:__Pickup(1,ZONE:New("Pickup Zone"):GetCoordinate(),30) - end -end - +--- +-- Name: AIC-APC-001 - Troops Relocate APC +-- Author: FlightControl +-- Date Created: 07 Apr 2018 +-- Date Checked: 01 Jan 2021 +-- +-- Demonstration of troops relocation when carrier is destroyed... +-- Carrier will relocate to the rescue carrier. +-- + +BASE:TraceClass("AI_CARGO_APC") + +local InfantryCargoSet = SET_CARGO:New():FilterTypes( "Infantry" ):FilterStart() + +local CargoCarrier = GROUP:FindByName( "Carrier" ) + +CargoTroops = AI_CARGO_APC:New( CargoCarrier, InfantryCargoSet, 500 ) + + +function CargoTroops:OnAfterDestroyed( CargoCarrier ) + CargoTroops:F( { Destroyed = CargoCarrier } ) + -- The coordinate is passed where the carrier is destroyed. + local NewCarrierGroup = self:FindCarrier( CargoCarrier:GetCoordinate(), 1000 ) -- which returns one Carrier GROUP object or nil. + if NewCarrierGroup then + self:SetCarrier( NewCarrierGroup ) + self:__Pickup(1,ZONE:New("Pickup Zone"):GetCoordinate(),30) + end +end + diff --git a/AIC - AI Cargo/APC - Armoured Personnel Carrier/AIC-APC-006 - Troops Relocate APC/AIC-APC-006 - Troops Relocate APC.miz b/AIC - AI Cargo/APC - Armoured Personnel Carrier/AIC-APC-006 - Troops Relocate APC/AIC-APC-006 - Troops Relocate APC.miz index 61b3c0acbd..06eaa34772 100644 Binary files a/AIC - AI Cargo/APC - Armoured Personnel Carrier/AIC-APC-006 - Troops Relocate APC/AIC-APC-006 - Troops Relocate APC.miz and b/AIC - AI Cargo/APC - Armoured Personnel Carrier/AIC-APC-006 - Troops Relocate APC/AIC-APC-006 - Troops Relocate APC.miz differ diff --git a/AIC - AI Cargo/APC - Armoured Personnel Carrier/AIC-APC-010 - Multiple APC/AIC-APC-010 - Multiple APC.lua b/AIC - AI Cargo/APC - Armoured Personnel Carrier/AIC-APC-010 - Multiple APC/AIC-APC-010 - Multiple APC.lua index cea8371396..6adf62c7b8 100644 --- a/AIC - AI Cargo/APC - Armoured Personnel Carrier/AIC-APC-010 - Multiple APC/AIC-APC-010 - Multiple APC.lua +++ b/AIC - AI Cargo/APC - Armoured Personnel Carrier/AIC-APC-010 - Multiple APC/AIC-APC-010 - Multiple APC.lua @@ -1,14 +1,13 @@ ---- --- Name: AIC-APC-010 - Multiple APC --- Author: FlightControl --- Date Created: 24 Apr 2018 --- Date Checked: 01 Jan 2021, working --- - -local InfantrySet = SET_CARGO:New():FilterTypes( "Infantry" ):FilterStart() -local APC = GROUP:FindByName( "APC" ) -Cargo_APC = AI_CARGO_APC:New( APC, InfantrySet, 250 ) -Cargo_APC:__Pickup( 2 ) - - - +--- +-- Name: AIC-APC-010 - Multiple APC +-- Author: FlightControl +-- Date Created: 24 Apr 2018 +-- + +local InfantrySet = SET_CARGO:New():FilterTypes( "Infantry" ):FilterStart() +local APC = GROUP:FindByName( "APC" ) +Cargo_APC = AI_CARGO_APC:New( APC, InfantrySet, 250 ) +Cargo_APC:__Pickup( 2 ) + + + diff --git a/AIC - AI Cargo/APC - Armoured Personnel Carrier/AIC-APC-010 - Multiple APC/AIC-APC-010 - Multiple APC.miz b/AIC - AI Cargo/APC - Armoured Personnel Carrier/AIC-APC-010 - Multiple APC/AIC-APC-010 - Multiple APC.miz index 796168345b..91bbae64b8 100644 Binary files a/AIC - AI Cargo/APC - Armoured Personnel Carrier/AIC-APC-010 - Multiple APC/AIC-APC-010 - Multiple APC.miz and b/AIC - AI Cargo/APC - Armoured Personnel Carrier/AIC-APC-010 - Multiple APC/AIC-APC-010 - Multiple APC.miz differ diff --git a/AIC - AI Cargo/APC - Armoured Personnel Carrier/AIC-APC-011 - APC Pickup and Deploy/AIC-APC-011 - APC Pickup and Deploy.lua b/AIC - AI Cargo/APC - Armoured Personnel Carrier/AIC-APC-011 - APC Pickup and Deploy/AIC-APC-011 - APC Pickup and Deploy.lua index 68ab453837..d76639a944 100644 --- a/AIC - AI Cargo/APC - Armoured Personnel Carrier/AIC-APC-011 - APC Pickup and Deploy/AIC-APC-011 - APC Pickup and Deploy.lua +++ b/AIC - AI Cargo/APC - Armoured Personnel Carrier/AIC-APC-011 - APC Pickup and Deploy/AIC-APC-011 - APC Pickup and Deploy.lua @@ -1,45 +1,42 @@ ---- --- Name: AIC-APC-004 - APC Pickup --- Author: FlightControl --- Date Created: 23 Apr 2018 --- Date Checked: 01 Jan 2021 - -BASE:TraceClass("AI_CARGO_APC") -BASE:TraceOn() - -local InfantryCargoSet = SET_CARGO:New():FilterTypes( "Infantry" ):FilterStart() - -Cargo_APC = {} - -for i = 1, 4 do - Cargo_APC[i] = AI_CARGO_APC:New( GROUP:FindByName( "APC"..i ), InfantryCargoSet, 350 ) - - --- Loaded Handler OnAfter for Cargo_APC - -- @function [parent=#Cargo_APC] OnAfterLoaded - -- @param #Cargo_APC self - -- @param Wrapper.Group#GROUP APC - -- @param #string From - -- @param #string Event - -- @param #string To - Cargo_APC[i].OnAfterLoaded = function( self, APC, From, Event, To ) - self:__Deploy( 5, ZONE:New( "Deploy" ):GetRandomCoordinate( 300, 500 ) ) - end - - --- Unloaded Handler OnAfter for Cargo_APC - -- @function [parent=#Cargo_APC] OnAfterUnloaded - -- @param #Cargo_APC self - -- @param Wrapper.Group#GROUP APC - -- @param #string From - -- @param #string Event - -- @param #string To - Cargo_APC[i].OnAfterUnloaded = function( self, APC, From, Event, To ) - self:Pickup( ZONE:New( "Pickup" ):GetRandomCoordinate( 50, 70 ) ) - end - - Cargo_APC[i]:__Pickup( i * 30, ZONE:New( "Pickup" ):GetRandomCoordinate( 50, 70 ) ) - -end - - - - +--- +-- Name: AIC-APC-004 - APC Pickup +-- Author: FlightControl +-- Date Created: 23 Apr 2018 +-- Date Checked: 01 Jan 2021 + +local InfantryCargoSet = SET_CARGO:New():FilterTypes( "Infantry" ):FilterStart() + +Cargo_APC = {} + +for i = 1, 4 do + Cargo_APC[i] = AI_CARGO_APC:New( GROUP:FindByName( "APC"..i ), InfantryCargoSet, 350 ) + + --- Loaded Handler OnAfter for Cargo_APC + -- @function [parent=#Cargo_APC] OnAfterLoaded + -- @param #Cargo_APC self + -- @param Wrapper.Group#GROUP APC + -- @param #string From + -- @param #string Event + -- @param #string To + Cargo_APC[i].OnAfterLoaded = function( self, APC, From, Event, To ) + self:__Deploy( 5, ZONE:New( "Deploy" ):GetRandomCoordinate( 300, 500 ) ) + end + + --- Unloaded Handler OnAfter for Cargo_APC + -- @function [parent=#Cargo_APC] OnAfterUnloaded + -- @param #Cargo_APC self + -- @param Wrapper.Group#GROUP APC + -- @param #string From + -- @param #string Event + -- @param #string To + Cargo_APC[i].OnAfterUnloaded = function( self, APC, From, Event, To ) + self:Pickup( ZONE:New( "Pickup" ):GetRandomCoordinate( 50, 70 ) ) + end + + Cargo_APC[i]:__Pickup( i * 30, ZONE:New( "Pickup" ):GetRandomCoordinate( 50, 70 ) ) + +end + + + + diff --git a/AIC - AI Cargo/APC - Armoured Personnel Carrier/AIC-APC-011 - APC Pickup and Deploy/AIC-APC-011 - APC Pickup and Deploy.miz b/AIC - AI Cargo/APC - Armoured Personnel Carrier/AIC-APC-011 - APC Pickup and Deploy/AIC-APC-011 - APC Pickup and Deploy.miz index 5a17c736f1..9df1647c36 100644 Binary files a/AIC - AI Cargo/APC - Armoured Personnel Carrier/AIC-APC-011 - APC Pickup and Deploy/AIC-APC-011 - APC Pickup and Deploy.miz and b/AIC - AI Cargo/APC - Armoured Personnel Carrier/AIC-APC-011 - APC Pickup and Deploy/AIC-APC-011 - APC Pickup and Deploy.miz differ diff --git a/AIC - AI Cargo/APC - Armoured Personnel Carrier/AIC-APC-011 - APC Pickup and Deploy/AI_Cargo.lua b/AIC - AI Cargo/APC - Armoured Personnel Carrier/AIC-APC-011 - APC Pickup and Deploy/AI_Cargo.lua new file mode 100644 index 0000000000..bdd9025d41 --- /dev/null +++ b/AIC - AI Cargo/APC - Armoured Personnel Carrier/AIC-APC-011 - APC Pickup and Deploy/AI_Cargo.lua @@ -0,0 +1,583 @@ +--- **AI** -- (R2.4) - Models the intelligent transportation of infantry and other cargo. +-- +-- === +-- +-- ### Author: **FlightControl** +-- +-- === +-- +-- @module AI.AI_Cargo +-- @image Cargo.JPG + +--- @type AI_CARGO +-- @extends Core.Fsm#FSM_CONTROLLABLE + + +--- Base class for the dynamic cargo handling capability for AI groups. +-- +-- Carriers can be mobilized to intelligently transport infantry and other cargo within the simulation. +-- The AI_CARGO module uses the @{Cargo.Cargo} capabilities within the MOOSE framework. +-- CARGO derived objects must be declared within the mission to make the AI_CARGO object recognize the cargo. +-- Please consult the @{Cargo.Cargo} module for more information. +-- +-- The derived classes from this module are: +-- +-- * @{AI.AI_Cargo_APC} - Cargo transportation using APCs and other vehicles between zones. +-- * @{AI.AI_Cargo_Helicopter} - Cargo transportation using helicopters between zones. +-- * @{AI.AI_Cargo_Airplane} - Cargo transportation using airplanes to and from airbases. +-- +-- @field #AI_CARGO +AI_CARGO = { + ClassName = "AI_CARGO", + Coordinate = nil, -- Core.Point#COORDINATE, + Carrier_Cargo = {}, +} + +--- Creates a new AI_CARGO object. +-- @param #AI_CARGO self +-- @param Wrapper.Group#GROUP Carrier +-- @param Core.Set#SET_CARGO CargoSet +-- @param #number CombatRadius +-- @return #AI_CARGO +function AI_CARGO:New( Carrier, CargoSet ) + + local self = BASE:Inherit( self, FSM_CONTROLLABLE:New( Carrier ) ) -- #AI_CARGO + + self.CargoSet = CargoSet -- Core.Set#SET_CARGO + self.CargoCarrier = Carrier -- Wrapper.Group#GROUP + + self:SetStartState( "Unloaded" ) + + self:AddTransition( "Unloaded", "Pickup", "*" ) + self:AddTransition( "Loaded", "Deploy", "*" ) + + self:AddTransition( "*", "Load", "Boarding" ) + self:AddTransition( { "Boarding", "Loaded" }, "Board", "Boarding" ) + self:AddTransition( "Boarding", "Loaded", "Boarding" ) + self:AddTransition( "Boarding", "PickedUp", "Loaded" ) + + self:AddTransition( "Loaded", "Unload", "Unboarding" ) + self:AddTransition( "Unboarding", "Unboard", "Unboarding" ) + self:AddTransition( "Unboarding", "Unloaded", "Unboarding" ) + self:AddTransition( "Unboarding", "Deployed", "Unloaded" ) + + --- Pickup Handler OnBefore for AI_CARGO + -- @function [parent=#AI_CARGO] OnBeforePickup + -- @param #AI_CARGO self + -- @param #string From + -- @param #string Event + -- @param #string To + -- @param Core.Point#COORDINATE Coordinate + -- @param #number Speed Speed in km/h. Default is 50% of max possible speed the group can do. + -- @return #boolean + + --- Pickup Handler OnAfter for AI_CARGO + -- @function [parent=#AI_CARGO] OnAfterPickup + -- @param #AI_CARGO self + -- @param #string From + -- @param #string Event + -- @param #string To + -- @param Core.Point#COORDINATE Coordinate + -- @param #number Speed Speed in km/h. Default is 50% of max possible speed the group can do. + + --- Pickup Trigger for AI_CARGO + -- @function [parent=#AI_CARGO] Pickup + -- @param #AI_CARGO self + -- @param Core.Point#COORDINATE Coordinate + -- @param #number Speed Speed in km/h. Default is 50% of max possible speed the group can do. + + --- Pickup Asynchronous Trigger for AI_CARGO + -- @function [parent=#AI_CARGO] __Pickup + -- @param #AI_CARGO self + -- @param #number Delay + -- @param Core.Point#COORDINATE Coordinate Pickup place. If not given, loading starts at the current location. + -- @param #number Speed Speed in km/h. Default is 50% of max possible speed the group can do. + + --- Deploy Handler OnBefore for AI_CARGO + -- @function [parent=#AI_CARGO] OnBeforeDeploy + -- @param #AI_CARGO self + -- @param #string From + -- @param #string Event + -- @param #string To + -- @param Core.Point#COORDINATE Coordinate + -- @param #number Speed Speed in km/h. Default is 50% of max possible speed the group can do. + -- @return #boolean + + --- Deploy Handler OnAfter for AI_CARGO + -- @function [parent=#AI_CARGO] OnAfterDeploy + -- @param #AI_CARGO self + -- @param #string From + -- @param #string Event + -- @param #string To + -- @param Core.Point#COORDINATE Coordinate + -- @param #number Speed Speed in km/h. Default is 50% of max possible speed the group can do. + + --- Deploy Trigger for AI_CARGO + -- @function [parent=#AI_CARGO] Deploy + -- @param #AI_CARGO self + -- @param Core.Point#COORDINATE Coordinate + -- @param #number Speed Speed in km/h. Default is 50% of max possible speed the group can do. + + --- Deploy Asynchronous Trigger for AI_CARGO + -- @function [parent=#AI_CARGO] __Deploy + -- @param #AI_CARGO self + -- @param #number Delay + -- @param Core.Point#COORDINATE Coordinate + -- @param #number Speed Speed in km/h. Default is 50% of max possible speed the group can do. + + + --- Loaded Handler OnAfter for AI_CARGO + -- @function [parent=#AI_CARGO] OnAfterLoaded + -- @param #AI_CARGO self + -- @param Wrapper.Group#GROUP Carrier + -- @param #string From + -- @param #string Event + -- @param #string To + + --- Unloaded Handler OnAfter for AI_CARGO + -- @function [parent=#AI_CARGO] OnAfterUnloaded + -- @param #AI_CARGO self + -- @param Wrapper.Group#GROUP Carrier + -- @param #string From + -- @param #string Event + -- @param #string To + + --- On after Deployed event. + -- @function [parent=#AI_CARGO] OnAfterDeployed + -- @param #AI_CARGO self + -- @param Wrapper.Group#GROUP Carrier + -- @param #string From From state. + -- @param #string Event Event. + -- @param #string To To state. + -- @param Core.Zone#ZONE DeployZone The zone wherein the cargo is deployed. This can be any zone type, like a ZONE, ZONE_GROUP, ZONE_AIRBASE. + -- @param #boolean Defend Defend for APCs. + + + for _, CarrierUnit in pairs( Carrier:GetUnits() ) do + local CarrierUnit = CarrierUnit -- Wrapper.Unit#UNIT + CarrierUnit:SetCargoBayWeightLimit() + end + + self.Transporting = false + self.Relocating = false + + return self +end + + + +function AI_CARGO:IsTransporting() + + return self.Transporting == true +end + +function AI_CARGO:IsRelocating() + + return self.Relocating == true +end + + +--- On after Pickup event. +-- @param #AI_CARGO self +-- @param Wrapper.Group#GROUP APC +-- @param From +-- @param Event +-- @param To +-- @param Core.Point#COORDINATE Coordinate of the pickup point. +-- @param #number Speed Speed in km/h to drive to the pickup coordinate. Default is 50% of max possible speed the unit can go. +-- @param #number Height Height in meters to move to the home coordinate. +-- @param Core.Zone#ZONE PickupZone (optional) The zone where the cargo will be picked up. The PickupZone can be nil, if there wasn't any PickupZoneSet provided. +function AI_CARGO:onafterPickup( APC, From, Event, To, Coordinate, Speed, Height, PickupZone ) + + self.Transporting = false + self.Relocating = true + +end + + +--- On after Deploy event. +-- @param #AI_CARGO self +-- @param Wrapper.Group#GROUP APC +-- @param From +-- @param Event +-- @param To +-- @param Core.Point#COORDINATE Coordinate Deploy place. +-- @param #number Speed Speed in km/h to drive to the depoly coordinate. Default is 50% of max possible speed the unit can go. +-- @param #number Height Height in meters to move to the deploy coordinate. +-- @param Core.Zone#ZONE DeployZone The zone where the cargo will be deployed. +function AI_CARGO:onafterDeploy( APC, From, Event, To, Coordinate, Speed, Height, DeployZone ) + + self.Relocating = false + self.Transporting = true + +end + +--- On before Load event. +-- @param #AI_CARGO self +-- @param Wrapper.Group#GROUP Carrier +-- @param #string From From state. +-- @param #string Event Event. +-- @param #string To To state. +-- @param Core.Zone#ZONE PickupZone (optional) The zone where the cargo will be picked up. The PickupZone can be nil, if there wasn't any PickupZoneSet provided. +function AI_CARGO:onbeforeLoad( Carrier, From, Event, To, PickupZone ) + self:F( { Carrier, From, Event, To } ) + + local Boarding = false + + local LoadInterval = 2 + local LoadDelay = 1 + local Carrier_List = {} + local Carrier_Weight = {} + + if Carrier and Carrier:IsAlive() then + self.Carrier_Cargo = {} + for _, CarrierUnit in pairs( Carrier:GetUnits() ) do + local CarrierUnit = CarrierUnit -- Wrapper.Unit#UNIT + + local CargoBayFreeWeight = CarrierUnit:GetCargoBayFreeWeight() + self:F({CargoBayFreeWeight=CargoBayFreeWeight}) + + Carrier_List[#Carrier_List+1] = CarrierUnit + Carrier_Weight[CarrierUnit] = CargoBayFreeWeight + end + + local Carrier_Count = #Carrier_List + local Carrier_Index = 1 + + local Loaded = false + + for _, Cargo in UTILS.spairs( self.CargoSet:GetSet(), function( t, a, b ) return t[a]:GetWeight() > t[b]:GetWeight() end ) do + local Cargo = Cargo -- Cargo.Cargo#CARGO + + self:F( { IsUnLoaded = Cargo:IsUnLoaded(), IsDeployed = Cargo:IsDeployed(), Cargo:GetName(), Carrier:GetName() } ) + + -- Try all Carriers, but start from the one according the Carrier_Index + for Carrier_Loop = 1, #Carrier_List do + + local CarrierUnit = Carrier_List[Carrier_Index] -- Wrapper.Unit#UNIT + + -- This counters loop through the available Carriers. + Carrier_Index = Carrier_Index + 1 + if Carrier_Index > Carrier_Count then + Carrier_Index = 1 + end + + if Cargo:IsUnLoaded() and not Cargo:IsDeployed() then + if Cargo:IsInLoadRadius( CarrierUnit:GetCoordinate() ) then + self:F( { "In radius", CarrierUnit:GetName() } ) + + local CargoWeight = Cargo:GetWeight() + local CarrierSpace=Carrier_Weight[CarrierUnit] + + -- Only when there is space within the bay to load the next cargo item! + if CarrierSpace > CargoWeight then + Carrier:RouteStop() + --Cargo:Ungroup() + Cargo:__Board( -LoadDelay, CarrierUnit ) + self:__Board( LoadDelay, Cargo, CarrierUnit, PickupZone ) + + LoadDelay = LoadDelay + Cargo:GetCount() * LoadInterval + + -- So now this CarrierUnit has Cargo that is being loaded. + -- This will be used further in the logic to follow and to check cargo status. + self.Carrier_Cargo[Cargo] = CarrierUnit + Boarding = true + Carrier_Weight[CarrierUnit] = Carrier_Weight[CarrierUnit] - CargoWeight + Loaded = true + + -- Ok, we loaded a cargo, now we can stop the loop. + break + else + self:T(string.format("WARNING: Cargo too heavy for carrier %s. Cargo=%.1f > %.1f free space", tostring(CarrierUnit:GetName()), CargoWeight, CarrierSpace)) + end + end + end + + end + + end + + if not Loaded == true then + -- No loading happened, so we need to pickup something else. + self.Relocating = false + end + end + + return Boarding + +end + + +--- On before Reload event. +-- @param #AI_CARGO self +-- @param Wrapper.Group#GROUP Carrier +-- @param #string From From state. +-- @param #string Event Event. +-- @param #string To To state. +-- @param Core.Zone#ZONE PickupZone (optional) The zone where the cargo will be picked up. The PickupZone can be nil, if there wasn't any PickupZoneSet provided. +function AI_CARGO:onbeforeReload( Carrier, From, Event, To ) + self:F( { Carrier, From, Event, To } ) + + local Boarding = false + + local LoadInterval = 2 + local LoadDelay = 1 + local Carrier_List = {} + local Carrier_Weight = {} + + if Carrier and Carrier:IsAlive() then + for _, CarrierUnit in pairs( Carrier:GetUnits() ) do + local CarrierUnit = CarrierUnit -- Wrapper.Unit#UNIT + + Carrier_List[#Carrier_List+1] = CarrierUnit + end + + local Carrier_Count = #Carrier_List + local Carrier_Index = 1 + + local Loaded = false + + for Cargo, CarrierUnit in pairs( self.Carrier_Cargo ) do + local Cargo = Cargo -- Cargo.Cargo#CARGO + + self:F( { IsUnLoaded = Cargo:IsUnLoaded(), IsDeployed = Cargo:IsDeployed(), Cargo:GetName(), Carrier:GetName() } ) + + -- Try all Carriers, but start from the one according the Carrier_Index + for Carrier_Loop = 1, #Carrier_List do + + local CarrierUnit = Carrier_List[Carrier_Index] -- Wrapper.Unit#UNIT + + -- This counters loop through the available Carriers. + Carrier_Index = Carrier_Index + 1 + if Carrier_Index > Carrier_Count then + Carrier_Index = 1 + end + + if Cargo:IsUnLoaded() and not Cargo:IsDeployed() then + Carrier:RouteStop() + Cargo:__Board( -LoadDelay, CarrierUnit ) + self:__Board( LoadDelay, Cargo, CarrierUnit ) + + LoadDelay = LoadDelay + Cargo:GetCount() * LoadInterval + + -- So now this CarrierUnit has Cargo that is being loaded. + -- This will be used further in the logic to follow and to check cargo status. + self.Carrier_Cargo[Cargo] = CarrierUnit + Boarding = true + Loaded = true + end + + end + + end + + if not Loaded == true then + -- No loading happened, so we need to pickup something else. + self.Relocating = false + end + end + + return Boarding + +end + +--- On after Board event. +-- @param #AI_CARGO self +-- @param Wrapper.Group#GROUP Carrier +-- @param #string From From state. +-- @param #string Event Event. +-- @param #string To To state. +-- @param Cargo.Cargo#CARGO Cargo Cargo object. +-- @param Wrapper.Unit#UNIT CarrierUnit +-- @param Core.Zone#ZONE PickupZone (optional) The zone where the cargo will be picked up. The PickupZone can be nil, if there wasn't any PickupZoneSet provided. +function AI_CARGO:onafterBoard( Carrier, From, Event, To, Cargo, CarrierUnit, PickupZone ) + self:F( { Carrier, From, Event, To, Cargo, CarrierUnit:GetName() } ) + + if Carrier and Carrier:IsAlive() and From == "Boarding" then + self:F({ IsLoaded = Cargo:IsLoaded(), Cargo:GetName(), Carrier:GetName() } ) + if not Cargo:IsLoaded() and not Cargo:IsDestroyed() then + self:__Board( -10, Cargo, CarrierUnit, PickupZone ) + return + end + end + + self:__Loaded( 0.1, Cargo, CarrierUnit, PickupZone ) + +end + +--- On after Loaded event. +-- @param #AI_CARGO self +-- @param Wrapper.Group#GROUP Carrier +-- @param #string From From state. +-- @param #string Event Event. +-- @param #string To To state. +-- @return #boolean Cargo loaded. +-- @param Core.Zone#ZONE PickupZone (optional) The zone where the cargo will be picked up. The PickupZone can be nil, if there wasn't any PickupZoneSet provided. +function AI_CARGO:onafterLoaded( Carrier, From, Event, To, Cargo, PickupZone ) + self:F( { Carrier, From, Event, To } ) + + local Loaded = true + + if Carrier and Carrier:IsAlive() then + for Cargo, CarrierUnit in pairs( self.Carrier_Cargo ) do + local Cargo = Cargo -- Cargo.Cargo#CARGO + self:F( { IsLoaded = Cargo:IsLoaded(), IsDestroyed = Cargo:IsDestroyed(), Cargo:GetName(), Carrier:GetName() } ) + if not Cargo:IsLoaded() and not Cargo:IsDestroyed() then + Loaded = false + end + end + end + + if Loaded then + self:__PickedUp( 0.1, PickupZone ) + end + +end + +--- On after PickedUp event. +-- @param #AI_CARGO self +-- @param Wrapper.Group#GROUP Carrier +-- @param #string From From state. +-- @param #string Event Event. +-- @param #string To To state. +-- @param Core.Zone#ZONE PickupZone (optional) The zone where the cargo will be picked up. The PickupZone can be nil, if there wasn't any PickupZoneSet provided. +function AI_CARGO:onafterPickedUp( Carrier, From, Event, To, PickupZone ) + self:F( { Carrier, From, Event, To } ) + + Carrier:RouteResume() + + local HasCargo = false + if Carrier and Carrier:IsAlive() then + for Cargo, CarrierUnit in pairs( self.Carrier_Cargo ) do + HasCargo = true + break + end + end + + self.Relocating = false + if HasCargo then + self:F( "Transporting" ) + self.Transporting = true + end + +end + + + + +--- On after Unload event. +-- @param #AI_CARGO self +-- @param Wrapper.Group#GROUP Carrier +-- @param #string From From state. +-- @param #string Event Event. +-- @param #string To To state. +-- @param Core.Zone#ZONE DeployZone The zone wherein the cargo is deployed. This can be any zone type, like a ZONE, ZONE_GROUP, ZONE_AIRBASE. +function AI_CARGO:onafterUnload( Carrier, From, Event, To, DeployZone, Defend ) + self:F( { Carrier, From, Event, To, DeployZone, Defend = Defend } ) + + local UnboardInterval = 5 + local UnboardDelay = 5 + + if Carrier and Carrier:IsAlive() then + for _, CarrierUnit in pairs( Carrier:GetUnits() ) do + local CarrierUnit = CarrierUnit -- Wrapper.Unit#UNIT + Carrier:RouteStop() + for _, Cargo in pairs( CarrierUnit:GetCargo() ) do + self:F( { Cargo = Cargo:GetName(), Isloaded = Cargo:IsLoaded() } ) + if Cargo:IsLoaded() then + Cargo:__UnBoard( UnboardDelay ) + UnboardDelay = UnboardDelay + Cargo:GetCount() * UnboardInterval + self:__Unboard( UnboardDelay, Cargo, CarrierUnit, DeployZone, Defend ) + if not Defend == true then + Cargo:SetDeployed( true ) + end + end + end + end + end + +end + +--- On after Unboard event. +-- @param #AI_CARGO self +-- @param Wrapper.Group#GROUP Carrier +-- @param #string From From state. +-- @param #string Event Event. +-- @param #string To To state. +-- @param #string Cargo.Cargo#CARGO Cargo Cargo object. +-- @param Core.Zone#ZONE DeployZone The zone wherein the cargo is deployed. This can be any zone type, like a ZONE, ZONE_GROUP, ZONE_AIRBASE. +function AI_CARGO:onafterUnboard( Carrier, From, Event, To, Cargo, CarrierUnit, DeployZone, Defend ) + self:F( { Carrier, From, Event, To, Cargo:GetName(), DeployZone = DeployZone, Defend = Defend } ) + + if Carrier and Carrier:IsAlive() and From == "Unboarding" then + if not Cargo:IsUnLoaded() then + self:__Unboard( 10, Cargo, CarrierUnit, DeployZone, Defend ) + return + end + end + + self:Unloaded( Cargo, CarrierUnit, DeployZone, Defend ) + +end + +--- On after Unloaded event. +-- @param #AI_CARGO self +-- @param Wrapper.Group#GROUP Carrier +-- @param #string From From state. +-- @param #string Event Event. +-- @param #string To To state. +-- @param #string Cargo.Cargo#CARGO Cargo Cargo object. +-- @param #boolean Deployed Cargo is deployed. +-- @param Core.Zone#ZONE DeployZone The zone wherein the cargo is deployed. This can be any zone type, like a ZONE, ZONE_GROUP, ZONE_AIRBASE. +function AI_CARGO:onafterUnloaded( Carrier, From, Event, To, Cargo, CarrierUnit, DeployZone, Defend ) + self:F( { Carrier, From, Event, To, Cargo:GetName(), DeployZone = DeployZone, Defend = Defend } ) + + local AllUnloaded = true + + --Cargo:Regroup() + + if Carrier and Carrier:IsAlive() then + for _, CarrierUnit in pairs( Carrier:GetUnits() ) do + local CarrierUnit = CarrierUnit -- Wrapper.Unit#UNIT + local IsEmpty = CarrierUnit:IsCargoEmpty() + self:I({ IsEmpty = IsEmpty }) + if not IsEmpty then + AllUnloaded = false + break + end + end + + if AllUnloaded == true then + if DeployZone == true then + self.Carrier_Cargo = {} + end + self.CargoCarrier = Carrier + end + end + + if AllUnloaded == true then + self:__Deployed( 5, DeployZone, Defend ) + end + +end + +--- On after Deployed event. +-- @param #AI_CARGO self +-- @param Wrapper.Group#GROUP Carrier +-- @param #string From From state. +-- @param #string Event Event. +-- @param #string To To state. +-- @param Core.Zone#ZONE DeployZone The zone wherein the cargo is deployed. This can be any zone type, like a ZONE, ZONE_GROUP, ZONE_AIRBASE. +-- @param #boolean Defend Defend for APCs. +function AI_CARGO:onafterDeployed( Carrier, From, Event, To, DeployZone, Defend ) + self:F( { Carrier, From, Event, To, DeployZone = DeployZone, Defend = Defend } ) + + if not Defend == true then + self.Transporting = false + else + self:F( "Defending" ) + + end + +end + diff --git a/AIC - AI Cargo/HEL - Helicopter/AIC-HEL-000 - Helicopter/AIC-HEL-000 - Helicopter.lua b/AIC - AI Cargo/HEL - Helicopter/AIC-HEL-000 - Helicopter/AIC-HEL-000 - Helicopter.lua index eeff770c0e..635f49da3d 100644 --- a/AIC - AI Cargo/HEL - Helicopter/AIC-HEL-000 - Helicopter/AIC-HEL-000 - Helicopter.lua +++ b/AIC - AI Cargo/HEL - Helicopter/AIC-HEL-000 - Helicopter/AIC-HEL-000 - Helicopter.lua @@ -1,38 +1,38 @@ ---- --- Name: AIC-HEL-000 - Helicopter --- Author: FlightControl --- Date Created: 13 Apr 2018 --- Date Checked: 01 Jan 2021 --- Updated Moose, needs fix #1417 to work --- -BASE:TraceClass("AI_CARGO") -BASE:TraceClass("AI_CARGO_HELICOPTER") -BASE:TraceOn() - -WorkerCargoSet = SET_CARGO:New():FilterTypes( "Workers" ):FilterStart() - - -for i = 1, 5 do - local WorkerGroup = GROUP:FindByName( string.format( "Infantry %03d", i ) ) - local WorkersCargo = CARGO_GROUP:New( WorkerGroup, "Workers", string.format( "Infantry %d", i ), 750, 35 ) -end - -local Helicopter = GROUP:FindByName( "Helicopter" ) - -CargoHelicopter = AI_CARGO_HELICOPTER:New( Helicopter, WorkerCargoSet ) - - -PickupZone = ZONE:New( "PickupZone" ) -DeployZones = { ZONE:New( "DeployZone Alpha" ), ZONE:New( "DeployZone Beta" ), ZONE:New( "DeployZone Gamma" ) } - -CargoHelicopter:Pickup( PickupZone:GetRandomCoordinate( 400, 100 ) ) - -function CargoHelicopter:OnAfterLoaded( Helicopter, From, Event, To, Cargo ) - CargoHelicopter:__Deploy(5,DeployZones[math.random( 1, #DeployZones ) ]:GetRandomCoordinate( 500, 100 ), math.random( 50, 250 ) ) -end - - -function CargoHelicopter:OnAfterUnloaded( Helicopter, From, Event, To, Cargo ) - CargoHelicopter:__Pickup( 5,PickupZone:GetRandomCoordinate( 500, 200 ), math.random( 50, 250 ) ) -end - +--- +-- Name: AIC-HEL-000 - Helicopter +-- Author: FlightControl +-- Date Created: 13 Apr 2018 +-- Date Checked: 01 Jan 2021 +-- Updated Moose, needs fix #1417 to work +-- +BASE:TraceClass("AI_CARGO") +BASE:TraceClass("AI_CARGO_HELICOPTER") +BASE:TraceOn() + +WorkerCargoSet = SET_CARGO:New():FilterTypes( "Workers" ):FilterStart() + + +for i = 1, 5 do + local WorkerGroup = GROUP:FindByName( string.format( "Infantry %03d", i ) ) + local WorkersCargo = CARGO_GROUP:New( WorkerGroup, "Workers", string.format( "Infantry %d", i ), 750, 35 ) +end + +local Helicopter = GROUP:FindByName( "Helicopter" ) + +CargoHelicopter = AI_CARGO_HELICOPTER:New( Helicopter, WorkerCargoSet ) + + +PickupZone = ZONE:New( "PickupZone" ) +DeployZones = { ZONE:New( "DeployZone Alpha" ), ZONE:New( "DeployZone Beta" ), ZONE:New( "DeployZone Gamma" ) } + +CargoHelicopter:Pickup( PickupZone:GetRandomCoordinate( 400, 100 ) ) + +function CargoHelicopter:OnAfterLoaded( Helicopter, From, Event, To, Cargo ) + CargoHelicopter:__Deploy(5,DeployZones[math.random( 1, #DeployZones ) ]:GetRandomCoordinate( 500, 100 ), math.random( 50, 250 ) ) +end + + +function CargoHelicopter:OnAfterUnloaded( Helicopter, From, Event, To, Cargo ) + CargoHelicopter:__Pickup( 5,PickupZone:GetRandomCoordinate( 500, 200 ), math.random( 50, 250 ) ) +end + diff --git a/AIC - AI Cargo/HEL - Helicopter/AIC-HEL-000 - Helicopter/AIC-HEL-000 - Helicopter.miz b/AIC - AI Cargo/HEL - Helicopter/AIC-HEL-000 - Helicopter/AIC-HEL-000 - Helicopter.miz index a1bce27ad6..8b82896a7c 100644 Binary files a/AIC - AI Cargo/HEL - Helicopter/AIC-HEL-000 - Helicopter/AIC-HEL-000 - Helicopter.miz and b/AIC - AI Cargo/HEL - Helicopter/AIC-HEL-000 - Helicopter/AIC-HEL-000 - Helicopter.miz differ diff --git a/AIC - AI Cargo/HEL - Helicopter/AIC-HEL-010 - Blue Helicopter/AIC-HEL-000 - Helicopter.lua b/AIC - AI Cargo/HEL - Helicopter/AIC-HEL-010 - Blue Helicopter/AIC-HEL-000 - Helicopter.lua new file mode 100644 index 0000000000..635f49da3d --- /dev/null +++ b/AIC - AI Cargo/HEL - Helicopter/AIC-HEL-010 - Blue Helicopter/AIC-HEL-000 - Helicopter.lua @@ -0,0 +1,38 @@ +--- +-- Name: AIC-HEL-000 - Helicopter +-- Author: FlightControl +-- Date Created: 13 Apr 2018 +-- Date Checked: 01 Jan 2021 +-- Updated Moose, needs fix #1417 to work +-- +BASE:TraceClass("AI_CARGO") +BASE:TraceClass("AI_CARGO_HELICOPTER") +BASE:TraceOn() + +WorkerCargoSet = SET_CARGO:New():FilterTypes( "Workers" ):FilterStart() + + +for i = 1, 5 do + local WorkerGroup = GROUP:FindByName( string.format( "Infantry %03d", i ) ) + local WorkersCargo = CARGO_GROUP:New( WorkerGroup, "Workers", string.format( "Infantry %d", i ), 750, 35 ) +end + +local Helicopter = GROUP:FindByName( "Helicopter" ) + +CargoHelicopter = AI_CARGO_HELICOPTER:New( Helicopter, WorkerCargoSet ) + + +PickupZone = ZONE:New( "PickupZone" ) +DeployZones = { ZONE:New( "DeployZone Alpha" ), ZONE:New( "DeployZone Beta" ), ZONE:New( "DeployZone Gamma" ) } + +CargoHelicopter:Pickup( PickupZone:GetRandomCoordinate( 400, 100 ) ) + +function CargoHelicopter:OnAfterLoaded( Helicopter, From, Event, To, Cargo ) + CargoHelicopter:__Deploy(5,DeployZones[math.random( 1, #DeployZones ) ]:GetRandomCoordinate( 500, 100 ), math.random( 50, 250 ) ) +end + + +function CargoHelicopter:OnAfterUnloaded( Helicopter, From, Event, To, Cargo ) + CargoHelicopter:__Pickup( 5,PickupZone:GetRandomCoordinate( 500, 200 ), math.random( 50, 250 ) ) +end + diff --git a/AIC - AI Cargo/HEL - Helicopter/AIC-HEL-010 - Blue Helicopter/AIC-HEL-010 - Blue Helicopter.miz b/AIC - AI Cargo/HEL - Helicopter/AIC-HEL-010 - Blue Helicopter/AIC-HEL-010 - Blue Helicopter.miz index 4358bbf00c..39d1134747 100644 Binary files a/AIC - AI Cargo/HEL - Helicopter/AIC-HEL-010 - Blue Helicopter/AIC-HEL-010 - Blue Helicopter.miz and b/AIC - AI Cargo/HEL - Helicopter/AIC-HEL-010 - Blue Helicopter/AIC-HEL-010 - Blue Helicopter.miz differ diff --git a/AIC - AI Cargo/PLN - Airplane/AIC-PLN-000 - Airplane/AIC-PLN-000 - Airplane.lua b/AIC - AI Cargo/PLN - Airplane/AIC-PLN-000 - Airplane/AIC-PLN-000 - Airplane.lua index 80c43702af..45228956f0 100644 --- a/AIC - AI Cargo/PLN - Airplane/AIC-PLN-000 - Airplane/AIC-PLN-000 - Airplane.lua +++ b/AIC - AI Cargo/PLN - Airplane/AIC-PLN-000 - Airplane/AIC-PLN-000 - Airplane.lua @@ -1,37 +1,37 @@ ---- --- Name: AIC-PLN-000 - Airplane --- Author: FlightControl --- Date Created: 14 Apr 2018 --- Date Checked: 01 Jan 2021 --- Update to latest Moose, working --- - -VehicleCargoSet = SET_CARGO:New():FilterTypes( "Vehicles" ):FilterStart() - -for i = 1, 10 do - local WorkerGroup = GROUP:FindByName( string.format( "Vehicle #%03d", i ) ) - local WorkersCargo = CARGO_GROUP:New( WorkerGroup, "Vehicles", string.format( "Vehicle %d", i ), 5000, 35 ) - WorkersCargo:SetWeight(10000) -end - -local Airplane = GROUP:FindByName( "Airplane" ) - -CargoAirplane = AI_CARGO_AIRPLANE:New( Airplane, VehicleCargoSet ) - - -PickupAirbase = AIRBASE:FindByName( AIRBASE.Caucasus.Kobuleti ) -DeployAirbases = { AIRBASE:FindByName( AIRBASE.Caucasus.Batumi ), AIRBASE:FindByName( AIRBASE.Caucasus.Gudauta ) } - -CargoAirplane:Pickup( PickupAirbase:GetCoordinate() ) - -function CargoAirplane:OnAfterLoaded( Airplane, From, Event, To, Cargo ) - CargoAirplane:__Deploy(0.2, DeployAirbases[math.random(#DeployAirbases)]:GetCoordinate(), math.random( 500, 750 ) ) -end - - ---function CargoAirplane:OnAfterUnloaded( Airplane, From, Event, To, Cargo ) -function CargoAirplane:OnAfterDeployed(Airplane, From, Event, To, DeployZone) - CargoAirplane:__Pickup(0.2, PickupAirbase:GetCoordinate(), math.random( 500, 750 ) ) -end - - +--- +-- Name: AIC-PLN-000 - Airplane +-- Author: FlightControl +-- Date Created: 14 Apr 2018 +-- Date Checked: 01 Jan 2021 +-- Update to latest Moose, working +-- + +VehicleCargoSet = SET_CARGO:New():FilterTypes( "Vehicles" ):FilterStart() + +for i = 1, 10 do + local WorkerGroup = GROUP:FindByName( string.format( "Vehicle #%03d", i ) ) + local WorkersCargo = CARGO_GROUP:New( WorkerGroup, "Vehicles", string.format( "Vehicle %d", i ), 5000, 35 ) + WorkersCargo:SetWeight(10000) +end + +local Airplane = GROUP:FindByName( "Airplane" ) + +CargoAirplane = AI_CARGO_AIRPLANE:New( Airplane, VehicleCargoSet ) + + +PickupAirbase = AIRBASE:FindByName( AIRBASE.Caucasus.Kobuleti ) +DeployAirbases = { AIRBASE:FindByName( AIRBASE.Caucasus.Batumi ), AIRBASE:FindByName( AIRBASE.Caucasus.Gudauta ) } + +CargoAirplane:Pickup( PickupAirbase:GetCoordinate() ) + +function CargoAirplane:OnAfterLoaded( Airplane, From, Event, To, Cargo ) + CargoAirplane:__Deploy(0.2, DeployAirbases[math.random(#DeployAirbases)]:GetCoordinate(), math.random( 500, 750 ) ) +end + + +--function CargoAirplane:OnAfterUnloaded( Airplane, From, Event, To, Cargo ) +function CargoAirplane:OnAfterDeployed(Airplane, From, Event, To, DeployZone) + CargoAirplane:__Pickup(0.2, PickupAirbase:GetCoordinate(), math.random( 500, 750 ) ) +end + + diff --git a/AIC - AI Cargo/PLN - Airplane/AIC-PLN-000 - Airplane/AIC-PLN-000 - Airplane.miz b/AIC - AI Cargo/PLN - Airplane/AIC-PLN-000 - Airplane/AIC-PLN-000 - Airplane.miz index 26a24e373d..8c62e2d311 100644 Binary files a/AIC - AI Cargo/PLN - Airplane/AIC-PLN-000 - Airplane/AIC-PLN-000 - Airplane.miz and b/AIC - AI Cargo/PLN - Airplane/AIC-PLN-000 - Airplane/AIC-PLN-000 - Airplane.miz differ diff --git a/AID - AI Dispatching/AID-A2A - AI A2A Dispatching API V2/AID-A2A-700 - Sound Check English/AID-A2A-700 - Sound Check English.lua b/AID - AI Dispatching/AID-A2A - AI A2A Dispatching API V2/AID-A2A-700 - Sound Check English/AID-A2A-700 - Sound Check English.lua index c44125af91..9de0b437d3 100644 --- a/AID - AI Dispatching/AID-A2A - AI A2A Dispatching API V2/AID-A2A-700 - Sound Check English/AID-A2A-700 - Sound Check English.lua +++ b/AID - AI Dispatching/AID-A2A - AI A2A Dispatching API V2/AID-A2A-700 - Sound Check English/AID-A2A-700 - Sound Check English.lua @@ -1,142 +1,142 @@ ---- --- Name: AID-A2A-100 - Demonstration --- Author: FlightControl --- Date Created: 30 May 2017 - -local HQ_Group = GROUP:FindByName( "HQ" ) -local HQ_CC = COMMANDCENTER:New( HQ_Group, "HQ" ) - --- Define a SET_GROUP object that builds a collection of groups that define the EWR network. --- Here we build the network with all the groups that have a name starting with DF CCCP AWACS and DF CCCP EWR. -local DetectionSetGroup = SET_GROUP:New() -DetectionSetGroup:FilterPrefixes( { "DF CCCP AWACS", "DF CCCP EWR" } ) -DetectionSetGroup:FilterStart() - -local Detection = DETECTION_AREAS:New( DetectionSetGroup, 30000 ) - --- Setup the A2A dispatcher, and initialize it. -A2ADispatcher = AI_A2A_DISPATCHER:New( Detection ) -A2ADispatcher:SetCommandCenter( HQ_CC ) - --- Enable the tactical display panel. -A2ADispatcher:SetTacticalDisplay( false ) -A2ADispatcher:SetTacticalMenu( "Dispatchers", "A2A" ) - --- Initialize the dispatcher, setting up a border zone. This is a polygon, --- which takes the waypoints of a late activated group with the name CCCP Border as the boundaries of the border area. --- Any enemy crossing this border will be engaged. -CCCPBorderZone = ZONE_POLYGON:New( "CCCP Border", GROUP:FindByName( "CCCP Border" ) ) -A2ADispatcher:SetBorderZone( CCCPBorderZone ) - --- Initialize the dispatcher, setting up a radius of 100km where any airborne friendly --- without an assignment within 100km radius from a detected target, will engage that target. -A2ADispatcher:SetEngageRadius( 120000 ) - --- Setup the squadrons. -A2ADispatcher:SetSquadron( "Mineralnye", AIRBASE.Caucasus.Mineralnye_Vody, { "SQ CCCP SU-27", "SQ CCCP SU-33", "SQ CCCP MIG-23MLD", "SQ CCCP MIG-25PD" }, 16 ) -A2ADispatcher:SetSquadron( "Maykop", AIRBASE.Caucasus.Maykop_Khanskaya, { "SQ CCCP MIG-31" }, 20 ) -A2ADispatcher:SetSquadron( "Mozdok", AIRBASE.Caucasus.Mozdok, { "SQ CCCP MIG-31" }, 16 ) -A2ADispatcher:SetSquadron( "Sochi", AIRBASE.Caucasus.Sochi_Adler, { "SQ CCCP SU-27", "SQ CCCP SU-33", "SQ CCCP MIG-23MLD", "SQ CCCP MIG-25PD", "SQ CCCP SU-34", "SQ CCCP MIG-31", "SQ CCCP MIG-29S" }, 40 ) -A2ADispatcher:SetSquadron( "Novo", AIRBASE.Caucasus.Novorossiysk, { "SQ CCCP SU-27" }, 16 ) - --- Setup the overhead -A2ADispatcher:SetSquadronOverhead( "Mineralnye", 1.2 ) -A2ADispatcher:SetSquadronOverhead( "Maykop", 1 ) -A2ADispatcher:SetSquadronOverhead( "Mozdok", 1 ) -A2ADispatcher:SetSquadronOverhead( "Sochi", 2 ) -A2ADispatcher:SetSquadronOverhead( "Novo", 1.5 ) - --- Setup the Grouping -A2ADispatcher:SetSquadronGrouping( "Mineralnye", 4 ) -A2ADispatcher:SetSquadronGrouping( "Sochi", 2 ) -A2ADispatcher:SetSquadronGrouping( "Novo", 3 ) - --- Setup the Takeoff methods -A2ADispatcher:SetSquadronTakeoff( "Mineralnye", AI_A2A_DISPATCHER.Takeoff.Hot ) -A2ADispatcher:SetSquadronTakeoffFromParkingHot( "Sochi" ) -A2ADispatcher:SetSquadronTakeoffFromRunway( "Mozdok" ) -A2ADispatcher:SetSquadronTakeoffFromParkingCold( "Maykop" ) -A2ADispatcher:SetSquadronTakeoffFromParkingHot( "Novo" ) - --- Setup the Landing methods -A2ADispatcher:SetSquadronLandingAtRunway( "Mineralnye" ) -A2ADispatcher:SetSquadronLandingNearAirbase( "Sochi" ) -A2ADispatcher:SetSquadronLandingAtEngineShutdown( "Mozdok" ) -A2ADispatcher:SetSquadronLandingNearAirbase( "Maykop" ) -A2ADispatcher:SetSquadronLanding( "Novo", AI_A2A_DISPATCHER.Landing.AtRunway ) - - --- CAP Squadron execution. ---CAPZoneEast = ZONE_POLYGON:New( "CAP Zone East", GROUP:FindByName( "CAP Zone East" ) ) ---A2ADispatcher:SetSquadronCap( "Mineralnye", CAPZoneEast, 4000, 10000, 500, 600, 800, 900 ) ---A2ADispatcher:SetSquadronCapInterval( "Mineralnye", 6, 30, 60, 1 ) - ---CAPZoneWest = ZONE_POLYGON:New( "CAP Zone West", GROUP:FindByName( "CAP Zone West" ) ) ---A2ADispatcher:SetSquadronCap( "Sochi", CAPZoneWest, 4000, 8000, 600, 800, 800, 1200, "BARO" ) ---A2ADispatcher:SetSquadronCapInterval( "Sochi", 2, 30, 120, 1 ) - ---CAPZoneMiddle = ZONE:New( "CAP Zone Middle") ---A2ADispatcher:SetSquadronCap( "Maykop", CAPZoneMiddle, 4000, 8000, 600, 800, 800, 1200, "RADIO" ) ---A2ADispatcher:SetSquadronCapInterval( "Sochi", 2, 30, 120, 1 ) - --- GCI Squadron execution. -A2ADispatcher:SetSquadronGci2( "Mozdok", 900, 1200, 100, 100, "RADIO" ) -A2ADispatcher:SetSquadronGci2( "Novo", 900, 2100, 100, 100, "RADIO" ) -A2ADispatcher:SetSquadronGci2( "Maykop", 900, 1200, 200, 200, "RADIO" ) - --- Set the language of the squadrons to Russian. -A2ADispatcher:SetSquadronLanguage( "Mozdok", "RU" ) -A2ADispatcher:SetSquadronLanguage( "Novo", "RU" ) -A2ADispatcher:SetSquadronLanguage( "Maykop", "RU" ) - -A2ADispatcher:SetSquadronRadioFrequency( "Mozdok", 127.5 ) -A2ADispatcher:SetSquadronRadioFrequency( "Novo", 127.5 ) -A2ADispatcher:SetSquadronRadioFrequency( "Maykop", 127.5 ) - - --- Set the squadrons visible before startup. ---A2ADispatcher:SetSquadronVisible( "Mineralnye" ) ---A2ADispatcher:SetSquadronVisible( "Sochi" ) ---A2ADispatcher:SetSquadronVisible( "Mozdok" ) ---A2ADispatcher:SetSquadronVisible( "Maykop" ) ---A2ADispatcher:SetSquadronVisible( "Novo" ) - - ---CleanUp = CLEANUP_AIRBASE:New( { AIRBASE.Caucasus.Novorossiysk } ) - - --- Blue attack simulation -local Frequency = 300 - -BlueSpawn1 = SPAWN - :New( "RT NATO 1" ) - :InitLimit( 2, 10 ) - :InitRandomizeTemplate( { "SQ NATO A-10C", "SQ NATO F-15C", "SQ NATO F-16A", "SQ NATO F/A-18", "SQ NATO F-16C" } ) - :InitRandomizeRoute( 0, 0, 30000 ) - --:InitDelayOn() - :SpawnScheduled( Frequency, 0.4 ) - -BlueSpawn2 = SPAWN - :New( "RT NATO 2" ) - :InitLimit( 2, 10 ) - :InitRandomizeTemplate( { "SQ NATO A-10C", "SQ NATO F-15C", "SQ NATO F-16A", "SQ NATO F/A-18", "SQ NATO F-16C" } ) - :InitRandomizeRoute( 0, 0, 30000 ) - --:InitDelayOn() - :SpawnScheduled( Frequency, 0.4 ) - -BlueSpawn3 = SPAWN - :New( "RT NATO 3" ) - :InitLimit( 2, 10 ) - :InitRandomizeTemplate( { "SQ NATO A-10C", "SQ NATO F-15C", "SQ NATO F-16A", "SQ NATO F/A-18", "SQ NATO F-16C" } ) - :InitRandomizeRoute( 0, 0, 30000 ) - --:InitDelayOn() - :SpawnScheduled( Frequency, 0.4 ) - -BlueSpawn4 = SPAWN - :New( "RT NATO 4" ) - :InitLimit( 2, 10 ) - :InitRandomizeTemplate( { "SQ NATO A-10C", "SQ NATO F-15C", "SQ NATO F-16A", "SQ NATO F/A-18", "SQ NATO F-16C" } ) - :InitRandomizeRoute( 0, 0, 30000 ) - --:InitDelayOn() - :SpawnScheduled( Frequency, 0.4 ) - +--- +-- Name: AID-A2A-100 - Demonstration +-- Author: FlightControl +-- Date Created: 30 May 2017 + +local HQ_Group = GROUP:FindByName( "HQ" ) +local HQ_CC = COMMANDCENTER:New( HQ_Group, "HQ" ) + +-- Define a SET_GROUP object that builds a collection of groups that define the EWR network. +-- Here we build the network with all the groups that have a name starting with DF CCCP AWACS and DF CCCP EWR. +local DetectionSetGroup = SET_GROUP:New() +DetectionSetGroup:FilterPrefixes( { "DF CCCP AWACS", "DF CCCP EWR" } ) +DetectionSetGroup:FilterStart() + +local Detection = DETECTION_AREAS:New( DetectionSetGroup, 30000 ) + +-- Setup the A2A dispatcher, and initialize it. +A2ADispatcher = AI_A2A_DISPATCHER:New( Detection ) +A2ADispatcher:SetCommandCenter( HQ_CC ) + +-- Enable the tactical display panel. +A2ADispatcher:SetTacticalDisplay( false ) +A2ADispatcher:SetTacticalMenu( "Dispatchers", "A2A" ) + +-- Initialize the dispatcher, setting up a border zone. This is a polygon, +-- which takes the waypoints of a late activated group with the name CCCP Border as the boundaries of the border area. +-- Any enemy crossing this border will be engaged. +CCCPBorderZone = ZONE_POLYGON:New( "CCCP Border", GROUP:FindByName( "CCCP Border" ) ) +A2ADispatcher:SetBorderZone( CCCPBorderZone ) + +-- Initialize the dispatcher, setting up a radius of 100km where any airborne friendly +-- without an assignment within 100km radius from a detected target, will engage that target. +A2ADispatcher:SetEngageRadius( 120000 ) + +-- Setup the squadrons. +A2ADispatcher:SetSquadron( "Mineralnye", AIRBASE.Caucasus.Mineralnye_Vody, { "SQ CCCP SU-27", "SQ CCCP SU-33", "SQ CCCP MIG-23MLD", "SQ CCCP MIG-25PD" }, 16 ) +A2ADispatcher:SetSquadron( "Maykop", AIRBASE.Caucasus.Maykop_Khanskaya, { "SQ CCCP MIG-31" }, 20 ) +A2ADispatcher:SetSquadron( "Mozdok", AIRBASE.Caucasus.Mozdok, { "SQ CCCP MIG-31" }, 16 ) +A2ADispatcher:SetSquadron( "Sochi", AIRBASE.Caucasus.Sochi_Adler, { "SQ CCCP SU-27", "SQ CCCP SU-33", "SQ CCCP MIG-23MLD", "SQ CCCP MIG-25PD", "SQ CCCP SU-34", "SQ CCCP MIG-31", "SQ CCCP MIG-29S" }, 40 ) +A2ADispatcher:SetSquadron( "Novo", AIRBASE.Caucasus.Novorossiysk, { "SQ CCCP SU-27" }, 16 ) + +-- Setup the overhead +A2ADispatcher:SetSquadronOverhead( "Mineralnye", 1.2 ) +A2ADispatcher:SetSquadronOverhead( "Maykop", 1 ) +A2ADispatcher:SetSquadronOverhead( "Mozdok", 1 ) +A2ADispatcher:SetSquadronOverhead( "Sochi", 2 ) +A2ADispatcher:SetSquadronOverhead( "Novo", 1.5 ) + +-- Setup the Grouping +A2ADispatcher:SetSquadronGrouping( "Mineralnye", 4 ) +A2ADispatcher:SetSquadronGrouping( "Sochi", 2 ) +A2ADispatcher:SetSquadronGrouping( "Novo", 3 ) + +-- Setup the Takeoff methods +A2ADispatcher:SetSquadronTakeoff( "Mineralnye", AI_A2A_DISPATCHER.Takeoff.Hot ) +A2ADispatcher:SetSquadronTakeoffFromParkingHot( "Sochi" ) +A2ADispatcher:SetSquadronTakeoffFromRunway( "Mozdok" ) +A2ADispatcher:SetSquadronTakeoffFromParkingCold( "Maykop" ) +A2ADispatcher:SetSquadronTakeoffFromParkingHot( "Novo" ) + +-- Setup the Landing methods +A2ADispatcher:SetSquadronLandingAtRunway( "Mineralnye" ) +A2ADispatcher:SetSquadronLandingNearAirbase( "Sochi" ) +A2ADispatcher:SetSquadronLandingAtEngineShutdown( "Mozdok" ) +A2ADispatcher:SetSquadronLandingNearAirbase( "Maykop" ) +A2ADispatcher:SetSquadronLanding( "Novo", AI_A2A_DISPATCHER.Landing.AtRunway ) + + +-- CAP Squadron execution. +--CAPZoneEast = ZONE_POLYGON:New( "CAP Zone East", GROUP:FindByName( "CAP Zone East" ) ) +--A2ADispatcher:SetSquadronCap( "Mineralnye", CAPZoneEast, 4000, 10000, 500, 600, 800, 900 ) +--A2ADispatcher:SetSquadronCapInterval( "Mineralnye", 6, 30, 60, 1 ) + +--CAPZoneWest = ZONE_POLYGON:New( "CAP Zone West", GROUP:FindByName( "CAP Zone West" ) ) +--A2ADispatcher:SetSquadronCap( "Sochi", CAPZoneWest, 4000, 8000, 600, 800, 800, 1200, "BARO" ) +--A2ADispatcher:SetSquadronCapInterval( "Sochi", 2, 30, 120, 1 ) + +--CAPZoneMiddle = ZONE:New( "CAP Zone Middle") +--A2ADispatcher:SetSquadronCap( "Maykop", CAPZoneMiddle, 4000, 8000, 600, 800, 800, 1200, "RADIO" ) +--A2ADispatcher:SetSquadronCapInterval( "Sochi", 2, 30, 120, 1 ) + +-- GCI Squadron execution. +A2ADispatcher:SetSquadronGci2( "Mozdok", 900, 1200, 100, 100, "RADIO" ) +A2ADispatcher:SetSquadronGci2( "Novo", 900, 2100, 100, 100, "RADIO" ) +A2ADispatcher:SetSquadronGci2( "Maykop", 900, 1200, 200, 200, "RADIO" ) + +-- Set the language of the squadrons to Russian. +A2ADispatcher:SetSquadronLanguage( "Mozdok", "RU" ) +A2ADispatcher:SetSquadronLanguage( "Novo", "RU" ) +A2ADispatcher:SetSquadronLanguage( "Maykop", "RU" ) + +A2ADispatcher:SetSquadronRadioFrequency( "Mozdok", 127.5 ) +A2ADispatcher:SetSquadronRadioFrequency( "Novo", 127.5 ) +A2ADispatcher:SetSquadronRadioFrequency( "Maykop", 127.5 ) + + +-- Set the squadrons visible before startup. +--A2ADispatcher:SetSquadronVisible( "Mineralnye" ) +--A2ADispatcher:SetSquadronVisible( "Sochi" ) +--A2ADispatcher:SetSquadronVisible( "Mozdok" ) +--A2ADispatcher:SetSquadronVisible( "Maykop" ) +--A2ADispatcher:SetSquadronVisible( "Novo" ) + + +--CleanUp = CLEANUP_AIRBASE:New( { AIRBASE.Caucasus.Novorossiysk } ) + + +-- Blue attack simulation +local Frequency = 300 + +BlueSpawn1 = SPAWN + :New( "RT NATO 1" ) + :InitLimit( 2, 10 ) + :InitRandomizeTemplate( { "SQ NATO A-10C", "SQ NATO F-15C", "SQ NATO F-16A", "SQ NATO F/A-18", "SQ NATO F-16C" } ) + :InitRandomizeRoute( 0, 0, 30000 ) + --:InitDelayOn() + :SpawnScheduled( Frequency, 0.4 ) + +BlueSpawn2 = SPAWN + :New( "RT NATO 2" ) + :InitLimit( 2, 10 ) + :InitRandomizeTemplate( { "SQ NATO A-10C", "SQ NATO F-15C", "SQ NATO F-16A", "SQ NATO F/A-18", "SQ NATO F-16C" } ) + :InitRandomizeRoute( 0, 0, 30000 ) + --:InitDelayOn() + :SpawnScheduled( Frequency, 0.4 ) + +BlueSpawn3 = SPAWN + :New( "RT NATO 3" ) + :InitLimit( 2, 10 ) + :InitRandomizeTemplate( { "SQ NATO A-10C", "SQ NATO F-15C", "SQ NATO F-16A", "SQ NATO F/A-18", "SQ NATO F-16C" } ) + :InitRandomizeRoute( 0, 0, 30000 ) + --:InitDelayOn() + :SpawnScheduled( Frequency, 0.4 ) + +BlueSpawn4 = SPAWN + :New( "RT NATO 4" ) + :InitLimit( 2, 10 ) + :InitRandomizeTemplate( { "SQ NATO A-10C", "SQ NATO F-15C", "SQ NATO F-16A", "SQ NATO F/A-18", "SQ NATO F-16C" } ) + :InitRandomizeRoute( 0, 0, 30000 ) + --:InitDelayOn() + :SpawnScheduled( Frequency, 0.4 ) + diff --git a/AID - AI Dispatching/AID-A2A - AI A2A Dispatching API V2/AID-A2A-700 - Sound Check English/AID-A2A-700 - Sound Check English.miz b/AID - AI Dispatching/AID-A2A - AI A2A Dispatching API V2/AID-A2A-700 - Sound Check English/AID-A2A-700 - Sound Check English.miz index 4248fdd779..aae0d535f0 100644 Binary files a/AID - AI Dispatching/AID-A2A - AI A2A Dispatching API V2/AID-A2A-700 - Sound Check English/AID-A2A-700 - Sound Check English.miz and b/AID - AI Dispatching/AID-A2A - AI A2A Dispatching API V2/AID-A2A-700 - Sound Check English/AID-A2A-700 - Sound Check English.miz differ diff --git a/AID - AI Dispatching/AID-A2A - AI A2A Dispatching/AID-A2A-008 - CAP Grouping Test/AID-008 - AI_A2A - CAP Grouping Test.lua b/AID - AI Dispatching/AID-A2A - AI A2A Dispatching/AID-A2A-008 - CAP Grouping Test/AID-008 - AI_A2A - CAP Grouping Test.lua new file mode 100644 index 0000000000..759947cc3f --- /dev/null +++ b/AID - AI Dispatching/AID-A2A - AI A2A Dispatching/AID-A2A-008 - CAP Grouping Test/AID-008 - AI_A2A - CAP Grouping Test.lua @@ -0,0 +1,27 @@ +--- +-- Name: AID-008 - AI_A2A - CAP Grouping Test +-- Author: FlightControl +-- Date Created: 06 Aug 2017 + + +-- Define a SET_GROUP object that builds a collection of groups that define the EWR network. +-- Here we build the network with all the groups that have a name starting with DF CCCP AWACS and DF CCCP EWR. +DetectionSetGroup = SET_GROUP:New() +DetectionSetGroup:FilterPrefixes( { "DF CCCP AWACS", "DF CCCP EWR" } ) +DetectionSetGroup:FilterStart() + +Detection = DETECTION_AREAS:New( DetectionSetGroup, 30000 ) + +-- Setup the A2A dispatcher, and initialize it. +A2ADispatcher = AI_A2A_DISPATCHER:New( Detection ) + + +A2ADispatcher:SetTacticalDisplay( true ) + +-- Setup the squadrons. + +A2ADispatcher:SetSquadron( "Sochi", AIRBASE.Caucasus.Sochi_Adler, { "SQ CCCP SU-27" } ) +CAPZoneWest = ZONE_POLYGON:New( "CAP Zone West", GROUP:FindByName( "CAP Zone West" ) ) +A2ADispatcher:SetSquadronCap( "Sochi", CAPZoneWest, 4000, 8000, 600, 800, 800, 1200 ) +A2ADispatcher:SetSquadronCapInterval( "Sochi", 2, 10, 30, 1 ) +A2ADispatcher:SetSquadronGrouping( "Sochi", 2 ) diff --git a/AID - AI Dispatching/AID-A2A - AI A2A Dispatching/AID-A2A-008 - CAP Grouping Test/AID-A2A-008 - CAP Grouping Test.miz b/AID - AI Dispatching/AID-A2A - AI A2A Dispatching/AID-A2A-008 - CAP Grouping Test/AID-A2A-008 - CAP Grouping Test.miz index 48ba97705c..db7f31e658 100644 Binary files a/AID - AI Dispatching/AID-A2A - AI A2A Dispatching/AID-A2A-008 - CAP Grouping Test/AID-A2A-008 - CAP Grouping Test.miz and b/AID - AI Dispatching/AID-A2A - AI A2A Dispatching/AID-A2A-008 - CAP Grouping Test/AID-A2A-008 - CAP Grouping Test.miz differ diff --git a/AID - AI Dispatching/AID-A2A - AI A2A Dispatching/AID-A2A-009 - Border Test/AID-009 - AI_A2A - Border Test.lua b/AID - AI Dispatching/AID-A2A - AI A2A Dispatching/AID-A2A-009 - Border Test/AID-009 - AI_A2A - Border Test.lua new file mode 100644 index 0000000000..3c3088e11a --- /dev/null +++ b/AID - AI Dispatching/AID-A2A - AI A2A Dispatching/AID-A2A-009 - Border Test/AID-009 - AI_A2A - Border Test.lua @@ -0,0 +1,30 @@ +--- +-- Name: AID-009 - AI_A2A - Border Test +-- Author: FlightControl +-- Date Created: 06 Aug 2017 + + +-- Define a SET_GROUP object that builds a collection of groups that define the EWR network. +-- Here we build the network with all the groups that have a name starting with DF CCCP AWACS and DF CCCP EWR. +DetectionSetGroup = SET_GROUP:New() +DetectionSetGroup:FilterPrefixes( { "DF CCCP AWACS", "DF CCCP EWR" } ) +DetectionSetGroup:FilterStart() + +Detection = DETECTION_AREAS:New( DetectionSetGroup, 30000 ) + +-- Setup the A2A dispatcher, and initialize it. +A2ADispatcher = AI_A2A_DISPATCHER:New( Detection ) + +-- Setup the border zone. +-- In this case the border is a POLYGON, +-- which takes the waypoints of a late activated group with the name CCCP Border as the boundaries of the border area. +-- Any enemy crossing this border will be engaged. +CCCPBorderZone = ZONE_POLYGON:New( "CCCP Border", GROUP:FindByName( "CCCP Border" ) ) +A2ADispatcher:SetBorderZone( CCCPBorderZone ) + +A2ADispatcher:SetTacticalDisplay( true ) + +-- Setup the squadrons. + +A2ADispatcher:SetSquadron( "Sochi", AIRBASE.Caucasus.Sochi_Adler, { "SQ CCCP SU-27" } ) +A2ADispatcher:SetSquadronGci( "Sochi", 1000, 1500 ) diff --git a/AID - AI Dispatching/AID-A2A - AI A2A Dispatching/AID-A2A-009 - Border Test/AID-A2A-009 - Border Test.miz b/AID - AI Dispatching/AID-A2A - AI A2A Dispatching/AID-A2A-009 - Border Test/AID-A2A-009 - Border Test.miz index 4d13c69f39..ac336f5420 100644 Binary files a/AID - AI Dispatching/AID-A2A - AI A2A Dispatching/AID-A2A-009 - Border Test/AID-A2A-009 - Border Test.miz and b/AID - AI Dispatching/AID-A2A - AI A2A Dispatching/AID-A2A-009 - Border Test/AID-A2A-009 - Border Test.miz differ diff --git a/AID - AI Dispatching/AID-A2A - AI A2A Dispatching/AID-A2A-010 - RTB and ReEngage/AID-010 - AI_A2A - RTB and ReEngage.lua b/AID - AI Dispatching/AID-A2A - AI A2A Dispatching/AID-A2A-010 - RTB and ReEngage/AID-010 - AI_A2A - RTB and ReEngage.lua new file mode 100644 index 0000000000..1170c6d005 --- /dev/null +++ b/AID - AI Dispatching/AID-A2A - AI A2A Dispatching/AID-A2A-010 - RTB and ReEngage/AID-010 - AI_A2A - RTB and ReEngage.lua @@ -0,0 +1,50 @@ +--- +-- Name: AID-010 - AI_A2A - RTB and ReEngage +-- Author: FlightControl +-- Date Created: 30 May 2017 + + +-- Define a SET_GROUP object that builds a collection of groups that define the EWR network. +-- Here we build the network with all the groups that have a name starting with DF CCCP AWACS and DF CCCP EWR. +DetectionSetGroup = SET_GROUP:New() +DetectionSetGroup:FilterPrefixes( { "DF CCCP AWACS", "DF CCCP EWR" } ) +DetectionSetGroup:FilterStart() + +Detection = DETECTION_AREAS:New( DetectionSetGroup, 30000 ) + +-- Setup the A2A dispatcher, and initialize it. +A2ADispatcher = AI_A2A_DISPATCHER:New( Detection ) + +-- Initialize the dispatcher, setting up a border zone. This is a polygon, +-- which takes the waypoints of a late activated group with the name CCCP Border as the boundaries of the border area. +-- Any enemy crossing this border will be engaged. +CCCPBorderZone = ZONE_POLYGON:New( "CCCP Border", GROUP:FindByName( "CCCP Border" ) ) +--A2ADispatcher:SetBorderZone( CCCPBorderZone ) + +-- Initialize the dispatcher, setting up a radius of 100km where any airborne friendly +-- without an assignment within 100km radius from a detected target, will engage that target. +A2ADispatcher:SetEngageRadius( 200000 ) + +A2ADispatcher:SetTacticalDisplay( true ) + + +-- Setup the squadrons. + +A2ADispatcher:SetSquadron( "Sochi", AIRBASE.Caucasus.Sochi_Adler, { "SQ CCCP SU-27" }, 20 ) +A2ADispatcher:SetSquadronGci( "Sochi", 900, 1200 ) + +A2ADispatcher:SetDefaultTakeoffFromParkingCold() +A2ADispatcher:SetDefaultLandingAtEngineShutdown() + +-- Blue attack simulation + +local Frequency = 180 + +BlueSpawn2 = SPAWN + :New( "RT NATO 2" ) + :InitLimit( 8, 40 ) + :InitRandomizeTemplate( { "SQ NATO A-10C", "SQ NATO F-15C", "SQ NATO F-16A", "SQ NATO F/A-18", "SQ NATO F-16C" } ) + :InitRandomizeRoute( 0, 0, 30000 ) + :InitDelayOn() + :SpawnScheduled( Frequency, 0.5 ) + diff --git a/AID - AI Dispatching/AID-A2A - AI A2A Dispatching/AID-A2A-010 - RTB and ReEngage/AID-A2A-010 - RTB and ReEngage.miz b/AID - AI Dispatching/AID-A2A - AI A2A Dispatching/AID-A2A-010 - RTB and ReEngage/AID-A2A-010 - RTB and ReEngage.miz index 5306b71a38..0cf4057496 100644 Binary files a/AID - AI Dispatching/AID-A2A - AI A2A Dispatching/AID-A2A-010 - RTB and ReEngage/AID-A2A-010 - RTB and ReEngage.miz and b/AID - AI Dispatching/AID-A2A - AI A2A Dispatching/AID-A2A-010 - RTB and ReEngage/AID-A2A-010 - RTB and ReEngage.miz differ diff --git a/AID - AI Dispatching/AID-A2A - AI A2A Dispatching/AID-A2A-011 - RTB Fuel Treshold test/AID-011 - AI_A2A - RTB Fuel Treshold test.lua b/AID - AI Dispatching/AID-A2A - AI A2A Dispatching/AID-A2A-011 - RTB Fuel Treshold test/AID-011 - AI_A2A - RTB Fuel Treshold test.lua new file mode 100644 index 0000000000..b619f66c84 --- /dev/null +++ b/AID - AI Dispatching/AID-A2A - AI A2A Dispatching/AID-A2A-011 - RTB Fuel Treshold test/AID-011 - AI_A2A - RTB Fuel Treshold test.lua @@ -0,0 +1,51 @@ +--- +-- Name: AID-011 - AI_A2A - RTB Fuel Threshold test +-- Author: FlightControl +-- Date Created: 30 Jul 2017 + + +-- Define a SET_GROUP object that builds a collection of groups that define the EWR network. +-- Here we build the network with all the groups that have a name starting with DF CCCP AWACS and DF CCCP EWR. +DetectionSetGroup = SET_GROUP:New() +DetectionSetGroup:FilterPrefixes( { "DF CCCP AWACS", "DF CCCP EWR" } ) +DetectionSetGroup:FilterStart() + +Detection = DETECTION_AREAS:New( DetectionSetGroup, 30000 ) + +-- Setup the A2A dispatcher, and initialize it. +A2ADispatcher = AI_A2A_DISPATCHER:New( Detection ) + +-- Initialize the dispatcher, setting up a border zone. This is a polygon, +-- which takes the waypoints of a late activated group with the name CCCP Border as the boundaries of the border area. +-- Any enemy crossing this border will be engaged. +CCCPBorderZone = ZONE_POLYGON:New( "CCCP Border", GROUP:FindByName( "CCCP Border" ) ) +--A2ADispatcher:SetBorderZone( CCCPBorderZone ) + +-- Initialize the dispatcher, setting up a radius of 100km where any airborne friendly +-- without an assignment within 100km radius from a detected target, will engage that target. +A2ADispatcher:SetEngageRadius( 200000 ) + + +A2ADispatcher:SetTacticalDisplay( true ) + +-- Set the fuel treshold to 40%. Airplanes will return when only 40% of fuel left in the tank. +A2ADispatcher:SetDefaultFuelThreshold( 0.4 ) + +-- Setup the squadrons. + +A2ADispatcher:SetSquadron( "Sochi", AIRBASE.Caucasus.Sochi_Adler, { "SQ CCCP SU-27" }, 20 ) +A2ADispatcher:SetSquadronOverhead( "Sochi", 1 ) +A2ADispatcher:SetSquadronGrouping( "Sochi", 2 ) + +-- CAP Squadron execution. + +CAPZoneWest = ZONE_POLYGON:New( "CAP Zone West", GROUP:FindByName( "CAP Zone West" ) ) +A2ADispatcher:SetSquadronCap( "Sochi", CAPZoneWest, 4000, 8000, 600, 800, 800, 1200, "BARO" ) +A2ADispatcher:SetSquadronCapInterval( "Sochi", 2, 30, 120, 1 ) + +A2ADispatcher:SetSquadronGci( "Sochi", 900, 1200 ) + +A2ADispatcher:SetSquadronTakeoffFromParkingHot("Sochi") +A2ADispatcher:SetSquadronLandingAtEngineShutdown("Sochi") + + diff --git a/AID - AI Dispatching/AID-A2A - AI A2A Dispatching/AID-A2A-011 - RTB Fuel Treshold test/AID-A2A-011 - RTB Fuel Treshold test.miz b/AID - AI Dispatching/AID-A2A - AI A2A Dispatching/AID-A2A-011 - RTB Fuel Treshold test/AID-A2A-011 - RTB Fuel Treshold test.miz index 917814b9e9..45c56ecbcc 100644 Binary files a/AID - AI Dispatching/AID-A2A - AI A2A Dispatching/AID-A2A-011 - RTB Fuel Treshold test/AID-A2A-011 - RTB Fuel Treshold test.miz and b/AID - AI Dispatching/AID-A2A - AI A2A Dispatching/AID-A2A-011 - RTB Fuel Treshold test/AID-A2A-011 - RTB Fuel Treshold test.miz differ diff --git a/AID - AI Dispatching/AID-A2A - AI A2A Dispatching/AID-A2A-012 - CAP Time Interval Test/AID-012 - AI_A2A - CAP Time Interval Test.lua b/AID - AI Dispatching/AID-A2A - AI A2A Dispatching/AID-A2A-012 - CAP Time Interval Test/AID-012 - AI_A2A - CAP Time Interval Test.lua new file mode 100644 index 0000000000..47005e4104 --- /dev/null +++ b/AID - AI Dispatching/AID-A2A - AI A2A Dispatching/AID-A2A-012 - CAP Time Interval Test/AID-012 - AI_A2A - CAP Time Interval Test.lua @@ -0,0 +1,51 @@ +--- +-- Name: AID-012 - AI_A2A - CAP Time Interval Test +-- Author: FlightControl +-- Date Created: 30 Jul 2017 + + +-- Define a SET_GROUP object that builds a collection of groups that define the EWR network. +-- Here we build the network with all the groups that have a name starting with DF CCCP AWACS and DF CCCP EWR. +DetectionSetGroup = SET_GROUP:New() +DetectionSetGroup:FilterPrefixes( { "DF CCCP AWACS", "DF CCCP EWR" } ) +DetectionSetGroup:FilterStart() + +Detection = DETECTION_AREAS:New( DetectionSetGroup, 30000 ) + +-- Setup the A2A dispatcher, and initialize it. +A2ADispatcher = AI_A2A_DISPATCHER:New( Detection ) + +-- Initialize the dispatcher, setting up a border zone. This is a polygon, +-- which takes the waypoints of a late activated group with the name CCCP Border as the boundaries of the border area. +-- Any enemy crossing this border will be engaged. +CCCPBorderZone = ZONE_POLYGON:New( "CCCP Border", GROUP:FindByName( "CCCP Border" ) ) +--A2ADispatcher:SetBorderZone( CCCPBorderZone ) + +-- Initialize the dispatcher, setting up a radius of 100km where any airborne friendly +-- without an assignment within 100km radius from a detected target, will engage that target. +A2ADispatcher:SetEngageRadius( 200000 ) + + +A2ADispatcher:SetTacticalDisplay( true ) + +A2ADispatcher:SetDefaultCapLimit( 2 ) +A2ADispatcher:SetDefaultCapTimeInterval( 300, 300 ) -- Spawn each 5 minutes. + +-- Setup the squadrons. + +A2ADispatcher:SetSquadron( "Sochi", AIRBASE.Caucasus.Sochi_Adler, { "SQ CCCP SU-27" }, 20 ) +A2ADispatcher:SetSquadronOverhead( "Sochi", 1 ) +A2ADispatcher:SetSquadronGrouping( "Sochi", 2 ) + +-- CAP Squadron execution. + +CAPZoneWest = ZONE_POLYGON:New( "CAP Zone West", GROUP:FindByName( "CAP Zone West" ) ) +A2ADispatcher:SetSquadronCap( "Sochi", CAPZoneWest, 4000, 8000, 600, 800, 800, 1200, "BARO" ) + + +A2ADispatcher:SetSquadronGci( "Sochi", 900, 1200 ) + +A2ADispatcher:SetSquadronTakeoffFromParkingHot("Sochi") +A2ADispatcher:SetSquadronLandingAtEngineShutdown("Sochi") + + diff --git a/AID - AI Dispatching/AID-A2A - AI A2A Dispatching/AID-A2A-012 - CAP Time Interval Test/AID-A2A-012 - CAP Time Interval Test.miz b/AID - AI Dispatching/AID-A2A - AI A2A Dispatching/AID-A2A-012 - CAP Time Interval Test/AID-A2A-012 - CAP Time Interval Test.miz index 861e2eaaea..99319f29f6 100644 Binary files a/AID - AI Dispatching/AID-A2A - AI A2A Dispatching/AID-A2A-012 - CAP Time Interval Test/AID-A2A-012 - CAP Time Interval Test.miz and b/AID - AI Dispatching/AID-A2A - AI A2A Dispatching/AID-A2A-012 - CAP Time Interval Test/AID-A2A-012 - CAP Time Interval Test.miz differ diff --git a/AID - AI Dispatching/AID-A2A - AI A2A Dispatching/AID-A2A-013 - Intercept Test/AID-A2A-013 - Intercept Test.lua b/AID - AI Dispatching/AID-A2A - AI A2A Dispatching/AID-A2A-013 - Intercept Test/AID-A2A-013 - Intercept Test.lua index 5812b35678..c61df867a5 100644 --- a/AID - AI Dispatching/AID-A2A - AI A2A Dispatching/AID-A2A-013 - Intercept Test/AID-A2A-013 - Intercept Test.lua +++ b/AID - AI Dispatching/AID-A2A - AI A2A Dispatching/AID-A2A-013 - Intercept Test/AID-A2A-013 - Intercept Test.lua @@ -1,47 +1,47 @@ ---- --- Name: AID-A2A-013 - Intercept Test --- Author: FlightControl --- Date Created: 31 Jul 2017 - - --- Define a SET_GROUP object that builds a collection of groups that define the EWR network. --- Here we build the network with all the groups that have a name starting with DF CCCP AWACS and DF CCCP EWR. -DetectionSetGroup = SET_GROUP:New() -DetectionSetGroup:FilterPrefixes( { "DF CCCP AWACS", "DF CCCP EWR" } ) -DetectionSetGroup:FilterStart() - -Detection = DETECTION_AREAS:New( DetectionSetGroup, 30000 ) - --- Setup the A2A dispatcher, and initialize it. -A2ADispatcher = AI_A2A_DISPATCHER:New( Detection ) - --- Initialize the dispatcher, setting up a border zone. This is a polygon, --- which takes the waypoints of a late activated group with the name CCCP Border as the boundaries of the border area. --- Any enemy crossing this border will be engaged. -CCCPBorderZone = ZONE_POLYGON:New( "CCCP Border", GROUP:FindByName( "CCCP Border" ) ) ---A2ADispatcher:SetBorderZone( CCCPBorderZone ) - --- Initialize the dispatcher, setting up a radius of 100km where any airborne friendly --- without an assignment within 100km radius from a detected target, will engage that target. -A2ADispatcher:SetEngageRadius( 200000 ) - - -A2ADispatcher:SetTacticalDisplay( true ) - --- Test intercept. -A2ADispatcher:SetIntercept( 450 ) - --- Setup the squadrons. - -A2ADispatcher:SetSquadron( "Sochi", AIRBASE.Caucasus.Sochi_Adler, { "SQ CCCP MIG-31" }, 20 ) -A2ADispatcher:SetSquadronGci( "Sochi", 900, 1200 ) -A2ADispatcher:SetSquadronTakeoffFromParkingCold( "Sochi" ) -A2ADispatcher:SetSquadronLandingAtEngineShutdown( "Sochi" ) - -A2ADispatcher:SetSquadron( "Gelend", AIRBASE.Caucasus.Gelendzhik, { "SQ CCCP SU-27" }, 20 ) -A2ADispatcher:SetSquadronGci( "Gelend", 800, 1200 ) -A2ADispatcher:SetSquadronTakeoffFromParkingCold( "Gelend" ) -A2ADispatcher:SetSquadronLandingAtEngineShutdown( "Gelend" ) - -A2ADispatcher:Start() - +--- +-- Name: AID-A2A-013 - Intercept Test +-- Author: FlightControl +-- Date Created: 31 Jul 2017 + + +-- Define a SET_GROUP object that builds a collection of groups that define the EWR network. +-- Here we build the network with all the groups that have a name starting with DF CCCP AWACS and DF CCCP EWR. +DetectionSetGroup = SET_GROUP:New() +DetectionSetGroup:FilterPrefixes( { "DF CCCP AWACS", "DF CCCP EWR" } ) +DetectionSetGroup:FilterStart() + +Detection = DETECTION_AREAS:New( DetectionSetGroup, 30000 ) + +-- Setup the A2A dispatcher, and initialize it. +A2ADispatcher = AI_A2A_DISPATCHER:New( Detection ) + +-- Initialize the dispatcher, setting up a border zone. This is a polygon, +-- which takes the waypoints of a late activated group with the name CCCP Border as the boundaries of the border area. +-- Any enemy crossing this border will be engaged. +CCCPBorderZone = ZONE_POLYGON:New( "CCCP Border", GROUP:FindByName( "CCCP Border" ) ) +--A2ADispatcher:SetBorderZone( CCCPBorderZone ) + +-- Initialize the dispatcher, setting up a radius of 100km where any airborne friendly +-- without an assignment within 100km radius from a detected target, will engage that target. +A2ADispatcher:SetEngageRadius( 200000 ) + + +A2ADispatcher:SetTacticalDisplay( true ) + +-- Test intercept. +A2ADispatcher:SetIntercept( 450 ) + +-- Setup the squadrons. + +A2ADispatcher:SetSquadron( "Sochi", AIRBASE.Caucasus.Sochi_Adler, { "SQ CCCP MIG-31" }, 20 ) +A2ADispatcher:SetSquadronGci( "Sochi", 900, 1200 ) +A2ADispatcher:SetSquadronTakeoffFromParkingCold( "Sochi" ) +A2ADispatcher:SetSquadronLandingAtEngineShutdown( "Sochi" ) + +A2ADispatcher:SetSquadron( "Gelend", AIRBASE.Caucasus.Gelendzhik, { "SQ CCCP SU-27" }, 20 ) +A2ADispatcher:SetSquadronGci( "Gelend", 800, 1200 ) +A2ADispatcher:SetSquadronTakeoffFromParkingCold( "Gelend" ) +A2ADispatcher:SetSquadronLandingAtEngineShutdown( "Gelend" ) + +A2ADispatcher:Start() + diff --git a/AID - AI Dispatching/AID-A2A - AI A2A Dispatching/AID-A2A-013 - Intercept Test/AID-A2A-013 - Intercept Test.miz b/AID - AI Dispatching/AID-A2A - AI A2A Dispatching/AID-A2A-013 - Intercept Test/AID-A2A-013 - Intercept Test.miz index 55c7beab4f..0193fd80f1 100644 Binary files a/AID - AI Dispatching/AID-A2A - AI A2A Dispatching/AID-A2A-013 - Intercept Test/AID-A2A-013 - Intercept Test.miz and b/AID - AI Dispatching/AID-A2A - AI A2A Dispatching/AID-A2A-013 - Intercept Test/AID-A2A-013 - Intercept Test.miz differ diff --git a/AID - AI Dispatching/AID-A2A - AI A2A Dispatching/AID-A2A-014 - DisengageRange Test/AID-014 - AI_A2A - DisengageRange Test.lua b/AID - AI Dispatching/AID-A2A - AI A2A Dispatching/AID-A2A-014 - DisengageRange Test/AID-014 - AI_A2A - DisengageRange Test.lua new file mode 100644 index 0000000000..86e6d1f4b5 --- /dev/null +++ b/AID - AI Dispatching/AID-A2A - AI A2A Dispatching/AID-A2A-014 - DisengageRange Test/AID-014 - AI_A2A - DisengageRange Test.lua @@ -0,0 +1,48 @@ +--- +-- Name: AID-014 - AI_A2A - DisengageRange Test +-- Author: FlightControl +-- Date Created: 31 Jul 2017 + + +-- Define a SET_GROUP object that builds a collection of groups that define the EWR network. +-- Here we build the network with all the groups that have a name starting with DF CCCP AWACS and DF CCCP EWR. +DetectionSetGroup = SET_GROUP:New() +DetectionSetGroup:FilterPrefixes( { "DF CCCP AWACS", "DF CCCP EWR" } ) +DetectionSetGroup:FilterStart() + +Detection = DETECTION_AREAS:New( DetectionSetGroup, 30000 ) + +-- Setup the A2A dispatcher, and initialize it. +A2ADispatcher = AI_A2A_DISPATCHER:New( Detection ) + +-- Initialize the dispatcher, setting up a border zone. This is a polygon, +-- which takes the waypoints of a late activated group with the name CCCP Border as the boundaries of the border area. +-- Any enemy crossing this border will be engaged. +CCCPBorderZone = ZONE_POLYGON:New( "CCCP Border", GROUP:FindByName( "CCCP Border" ) ) +--A2ADispatcher:SetBorderZone( CCCPBorderZone ) + +-- Initialize the dispatcher, setting up a radius of 100km where any airborne friendly +-- without an assignment within 100km radius from a detected target, will engage that target. +A2ADispatcher:SetEngageRadius( 200000 ) + + +A2ADispatcher:SetTacticalDisplay( true ) + +-- Test intercept. +A2ADispatcher:SetIntercept( 450 ) + +-- Test an other disengage radius. +A2ADispatcher:SetDisengageRadius( 150000 ) + +-- Setup the squadrons. + +A2ADispatcher:SetSquadron( "Sochi", AIRBASE.Caucasus.Sochi_Adler, { "SQ CCCP MIG-31" }, 20 ) +A2ADispatcher:SetSquadronGci( "Sochi", 900, 1200 ) +A2ADispatcher:SetSquadronTakeoffFromParkingCold( "Sochi" ) + + +A2ADispatcher:SetSquadron( "Gelend", AIRBASE.Caucasus.Gelendzhik, { "SQ CCCP SU-27" }, 20 ) +A2ADispatcher:SetSquadronGci( "Gelend", 800, 1200 ) +A2ADispatcher:SetSquadronTakeoffFromParkingCold( "Gelend" ) + + diff --git a/AID - AI Dispatching/AID-A2A - AI A2A Dispatching/AID-A2A-014 - DisengageRange Test/AID-A2A-014 - DisengageRange Test.miz b/AID - AI Dispatching/AID-A2A - AI A2A Dispatching/AID-A2A-014 - DisengageRange Test/AID-A2A-014 - DisengageRange Test.miz index da89045056..bfdcb5039b 100644 Binary files a/AID - AI Dispatching/AID-A2A - AI A2A Dispatching/AID-A2A-014 - DisengageRange Test/AID-A2A-014 - DisengageRange Test.miz and b/AID - AI Dispatching/AID-A2A - AI A2A Dispatching/AID-A2A-014 - DisengageRange Test/AID-A2A-014 - DisengageRange Test.miz differ diff --git a/AID - AI Dispatching/AID-A2A - AI A2A Dispatching/AID-A2A-015 - Takeoff Test/AID-015 - AI_A2A - Takeoff Test.lua b/AID - AI Dispatching/AID-A2A - AI A2A Dispatching/AID-A2A-015 - Takeoff Test/AID-015 - AI_A2A - Takeoff Test.lua new file mode 100644 index 0000000000..cb7aea1b09 --- /dev/null +++ b/AID - AI Dispatching/AID-A2A - AI A2A Dispatching/AID-A2A-015 - Takeoff Test/AID-015 - AI_A2A - Takeoff Test.lua @@ -0,0 +1,53 @@ +--- +-- Name: AID-015 - AI_A2A - Takeoff Test +-- Author: FlightControl +-- Date Created: 01 Aug 2017 + + +-- Define a SET_GROUP object that builds a collection of groups that define the EWR network. +-- Here we build the network with all the groups that have a name starting with DF CCCP AWACS and DF CCCP EWR. +DetectionSetGroup = SET_GROUP:New() +DetectionSetGroup:FilterPrefixes( { "DF CCCP AWACS", "DF CCCP EWR" } ) +DetectionSetGroup:FilterStart() + +Detection = DETECTION_AREAS:New( DetectionSetGroup, 30000 ) + +-- Setup the A2A dispatcher, and initialize it. +A2ADispatcher = AI_A2A_DISPATCHER:New( Detection ) + +-- Initialize the dispatcher, setting up a border zone. This is a polygon, +-- which takes the waypoints of a late activated group with the name CCCP Border as the boundaries of the border area. +-- Any enemy crossing this border will be engaged. +CCCPBorderZone = ZONE_POLYGON:New( "CCCP Border", GROUP:FindByName( "CCCP Border" ) ) +--A2ADispatcher:SetBorderZone( CCCPBorderZone ) + +-- Initialize the dispatcher, setting up a radius of 100km where any airborne friendly +-- without an assignment within 100km radius from a detected target, will engage that target. +A2ADispatcher:SetEngageRadius( 200000 ) + + +A2ADispatcher:SetTacticalDisplay( true ) + +-- Test intercept. +A2ADispatcher:SetIntercept( 450 ) + +-- Test an other disengage radius. +A2ADispatcher:SetDisengageRadius( 20000 ) + +-- Setup the squadrons. + +A2ADispatcher:SetSquadron( "Sochi", AIRBASE.Caucasus.Sochi_Adler, { "SQ CCCP MIG-31" }, 20 ) +A2ADispatcher:SetSquadronGci( "Sochi", 900, 1200 ) +A2ADispatcher:SetSquadronTakeoffFromParkingCold( "Sochi" ) + +A2ADispatcher:SetSquadron( "Gelend", AIRBASE.Caucasus.Gelendzhik, { "SQ CCCP SU-27" }, 20 ) +A2ADispatcher:SetSquadronGci( "Gelend", 800, 1200 ) +A2ADispatcher:SetSquadronTakeoffFromRunway( "Gelend" ) + +A2ADispatcher:SetSquadron( "Anapa", AIRBASE.Caucasus.Anapa_Vityazevo, { "SQ CCCP SU-27" }, 20 ) +A2ADispatcher:SetSquadronGci( "Anapa", 800, 1200 ) +A2ADispatcher:SetSquadronTakeoffInAir( "Anapa" ) + +A2ADispatcher:SetSquadron( "Novo", AIRBASE.Caucasus.Novorossiysk, { "SQ CCCP SU-27" }, 20 ) +A2ADispatcher:SetSquadronGci( "Novo", 800, 1200 ) +A2ADispatcher:SetSquadronTakeoffFromParkingHot( "Novo" ) diff --git a/AID - AI Dispatching/AID-A2A - AI A2A Dispatching/AID-A2A-015 - Takeoff Test/AID-A2A-015 - Takeoff Test.miz b/AID - AI Dispatching/AID-A2A - AI A2A Dispatching/AID-A2A-015 - Takeoff Test/AID-A2A-015 - Takeoff Test.miz index f38cc3e6ab..4af4ddbb9d 100644 Binary files a/AID - AI Dispatching/AID-A2A - AI A2A Dispatching/AID-A2A-015 - Takeoff Test/AID-A2A-015 - Takeoff Test.miz and b/AID - AI Dispatching/AID-A2A - AI A2A Dispatching/AID-A2A-015 - Takeoff Test/AID-A2A-015 - Takeoff Test.miz differ diff --git a/AID - AI Dispatching/AID-A2A - AI A2A Dispatching/AID-A2A-016 - Refuel Tanker Test/AID-016 - AI_A2A - Refuel Tanker Test.lua b/AID - AI Dispatching/AID-A2A - AI A2A Dispatching/AID-A2A-016 - Refuel Tanker Test/AID-016 - AI_A2A - Refuel Tanker Test.lua new file mode 100644 index 0000000000..42ceeccfc8 --- /dev/null +++ b/AID - AI Dispatching/AID-A2A - AI A2A Dispatching/AID-A2A-016 - Refuel Tanker Test/AID-016 - AI_A2A - Refuel Tanker Test.lua @@ -0,0 +1,50 @@ +--- +-- Name: AID-016 - AI_A2A - Refuel Tanker Test +-- Author: FlightControl +-- Date Created: 01 Aug 2017 + + +-- Define a SET_GROUP object that builds a collection of groups that define the EWR network. +-- Here we build the network with all the groups that have a name starting with DF CCCP AWACS and DF CCCP EWR. +DetectionSetGroup = SET_GROUP:New() +DetectionSetGroup:FilterPrefixes( { "DF CCCP AWACS", "DF CCCP EWR" } ) +DetectionSetGroup:FilterStart() + +Detection = DETECTION_AREAS:New( DetectionSetGroup, 30000 ) + +-- Setup the A2A dispatcher, and initialize it. +A2ADispatcher = AI_A2A_DISPATCHER:New( Detection ) + + +-- Initialize the dispatcher, setting up a radius of 100km where any airborne friendly +-- without an assignment within 100km radius from a detected target, will engage that target. +A2ADispatcher:SetEngageRadius( 200000 ) + + +A2ADispatcher:SetTacticalDisplay( true ) + +-- Test intercept. +A2ADispatcher:SetIntercept( 450 ) + + +-- Setup the squadrons. + +A2ADispatcher:SetSquadron( "Sochi", AIRBASE.Caucasus.Sochi_Adler, { "SQ CCCP SU-34" }, 20 ) +A2ADispatcher:SetSquadronCap( "Sochi", ZONE:New( "PatrolZone" ), 4000, 8000, 600, 800, 1000, 1300 ) +A2ADispatcher:SetSquadronCapInterval("Sochi", 2, 30, 600, 1 ) +A2ADispatcher:SetSquadronGci( "Sochi", 900, 1200 ) + + +A2ADispatcher:SetDefaultFuelThreshold( 0.9 ) +A2ADispatcher:SetDefaultTanker( "Tanker" ) + + +A2ADispatcher:SetSquadron( "Gelend", AIRBASE.Caucasus.Gelendzhik, { "SQ CCCP SU-30" }, 20 ) +A2ADispatcher:SetSquadronCap( "Gelend", ZONE:New( "PatrolZoneGelend" ), 4000, 8000, 600, 800, 1000, 1300 ) +A2ADispatcher:SetSquadronCapInterval( "Gelend", 2, 30, 600, 1 ) +A2ADispatcher:SetSquadronGci( "Gelend", 900, 1200 ) + +A2ADispatcher:SetSquadronFuelThreshold( "Gelend", 0.8 ) +A2ADispatcher:SetSquadronTanker( "Gelend", "TankerGelend" ) + + diff --git a/AID - AI Dispatching/AID-A2A - AI A2A Dispatching/AID-A2A-016 - Refuel Tanker Test/AID-A2A-016 - Refuel Tanker Test.miz b/AID - AI Dispatching/AID-A2A - AI A2A Dispatching/AID-A2A-016 - Refuel Tanker Test/AID-A2A-016 - Refuel Tanker Test.miz index 142f0f4e30..94dcc2fcf6 100644 Binary files a/AID - AI Dispatching/AID-A2A - AI A2A Dispatching/AID-A2A-016 - Refuel Tanker Test/AID-A2A-016 - Refuel Tanker Test.miz and b/AID - AI Dispatching/AID-A2A - AI A2A Dispatching/AID-A2A-016 - Refuel Tanker Test/AID-A2A-016 - Refuel Tanker Test.miz differ diff --git a/AID - AI Dispatching/AID-A2A - AI A2A Dispatching/AID-A2A-017 - Spawn Altitude Test/AID-017 - AI_A2A - Spawn Altitude Test.lua b/AID - AI Dispatching/AID-A2A - AI A2A Dispatching/AID-A2A-017 - Spawn Altitude Test/AID-017 - AI_A2A - Spawn Altitude Test.lua new file mode 100644 index 0000000000..6f536f82ec --- /dev/null +++ b/AID - AI Dispatching/AID-A2A - AI A2A Dispatching/AID-A2A-017 - Spawn Altitude Test/AID-017 - AI_A2A - Spawn Altitude Test.lua @@ -0,0 +1,44 @@ +--- +-- Name: AID-017 - AI_A2A - Spawn Altitude Test +-- Author: FlightControl +-- Date Created: 05 Aug 2017 + + +-- Define a SET_GROUP object that builds a collection of groups that define the EWR network. +-- Here we build the network with all the groups that have a name starting with DF CCCP AWACS and DF CCCP EWR. +DetectionSetGroup = SET_GROUP:New() +DetectionSetGroup:FilterPrefixes( { "DF CCCP AWACS", "DF CCCP EWR" } ) +DetectionSetGroup:FilterStart() + +Detection = DETECTION_AREAS:New( DetectionSetGroup, 30000 ) + +-- Setup the A2A dispatcher, and initialize it. +A2ADispatcher = AI_A2A_DISPATCHER:New( Detection ) + +A2ADispatcher:SetTacticalDisplay( true ) + +-- Set the default takeoff method in the air. +A2ADispatcher:SetDefaultTakeoffInAir() + +-- Set the default takeoff altitude at 2000 meters. +A2ADispatcher:SetDefaultTakeoffInAirAltitude( 2000 ) -- Takeoff by default at 2000 meters. + + +-- Spawn for Sochi airbase. +A2ADispatcher:SetSquadron( "Sochi", AIRBASE.Caucasus.Sochi_Adler, { "SQ CCCP SU-34" }, 20 ) +A2ADispatcher:SetSquadronCap( "Sochi", ZONE:New( "PatrolZone" ), 4000, 8000, 600, 800, 1000, 1300 ) +A2ADispatcher:SetSquadronCapInterval("Sochi", 2, 30, 600, 1 ) +A2ADispatcher:SetSquadronGci( "Sochi", 900, 1200 ) + + +-- Spawn for Gelend airbase. +A2ADispatcher:SetSquadron( "Gelend", AIRBASE.Caucasus.Gelendzhik, { "SQ CCCP SU-30" }, 20 ) +A2ADispatcher:SetSquadronCap( "Gelend", ZONE:New( "PatrolZoneGelend" ), 4000, 8000, 600, 800, 1000, 1300 ) +A2ADispatcher:SetSquadronCapInterval( "Gelend", 2, 30, 600, 1 ) +A2ADispatcher:SetSquadronGci( "Gelend", 900, 1200 ) + +-- Let Gelend squadron take off in the air at 4000 meters. +A2ADispatcher:SetSquadronTakeoffInAir( "Gelend", 4000 ) -- Takeoff in Gelend at 4000 meters. + + +-- Run the mission and observe the spawning altitudes. diff --git a/AID - AI Dispatching/AID-A2A - AI A2A Dispatching/AID-A2A-017 - Spawn Altitude Test/AID-A2A-017 - Spawn Altitude Test.miz b/AID - AI Dispatching/AID-A2A - AI A2A Dispatching/AID-A2A-017 - Spawn Altitude Test/AID-A2A-017 - Spawn Altitude Test.miz index 6378d398f3..3298ca17c5 100644 Binary files a/AID - AI Dispatching/AID-A2A - AI A2A Dispatching/AID-A2A-017 - Spawn Altitude Test/AID-A2A-017 - Spawn Altitude Test.miz and b/AID - AI Dispatching/AID-A2A - AI A2A Dispatching/AID-A2A-017 - Spawn Altitude Test/AID-A2A-017 - Spawn Altitude Test.miz differ diff --git a/AID - AI Dispatching/AID-A2A - AI A2A Dispatching/AID-A2A-018 - Unlimited Resources Test/AID-018 - AI_A2A - Unlimited Resources Test.lua b/AID - AI Dispatching/AID-A2A - AI A2A Dispatching/AID-A2A-018 - Unlimited Resources Test/AID-018 - AI_A2A - Unlimited Resources Test.lua new file mode 100644 index 0000000000..e1f5e88b02 --- /dev/null +++ b/AID - AI Dispatching/AID-A2A - AI A2A Dispatching/AID-A2A-018 - Unlimited Resources Test/AID-018 - AI_A2A - Unlimited Resources Test.lua @@ -0,0 +1,45 @@ +--- +-- Name: AID-018 - AI_A2A - Unlimited Resources Test +-- Author: FlightControl +-- Date Created: 05 Aug 2017 + + +-- Define a SET_GROUP object that builds a collection of groups that define the EWR network. +-- Here we build the network with all the groups that have a name starting with DF CCCP AWACS and DF CCCP EWR. +DetectionSetGroup = SET_GROUP:New() +DetectionSetGroup:FilterPrefixes( { "DF CCCP AWACS", "DF CCCP EWR" } ) +DetectionSetGroup:FilterStart() + +Detection = DETECTION_AREAS:New( DetectionSetGroup, 30000 ) + +-- Setup the A2A dispatcher, and initialize it. +A2ADispatcher = AI_A2A_DISPATCHER:New( Detection ) + +-- Initialize the dispatcher, setting up a border zone. This is a polygon, +-- which takes the waypoints of a late activated group with the name CCCP Border as the boundaries of the border area. +-- Any enemy crossing this border will be engaged. +CCCPBorderZone = ZONE_POLYGON:New( "CCCP Border", GROUP:FindByName( "CCCP Border" ) ) +--A2ADispatcher:SetBorderZone( CCCPBorderZone ) + + +A2ADispatcher:SetTacticalDisplay( true ) + +-- Setup the squadrons. +-- Unlimited resources, as the Resources parameter of the :SetSquadron method is not given. + +A2ADispatcher:SetSquadron( "Sochi", AIRBASE.Caucasus.Sochi_Adler, { "SQ CCCP MIG-31" } ) +A2ADispatcher:SetSquadronGci( "Sochi", 900, 1200 ) +A2ADispatcher:SetSquadronTakeoffFromParkingCold( "Sochi" ) + +A2ADispatcher:SetSquadron( "Gelend", AIRBASE.Caucasus.Gelendzhik, { "SQ CCCP SU-27" } ) +A2ADispatcher:SetSquadronGci( "Gelend", 800, 1200 ) +A2ADispatcher:SetSquadronTakeoffFromRunway( "Gelend" ) + +A2ADispatcher:SetSquadron( "Anapa", AIRBASE.Caucasus.Anapa_Vityazevo, { "SQ CCCP SU-27" } ) +A2ADispatcher:SetSquadronGci( "Anapa", 800, 1200 ) +A2ADispatcher:SetSquadronTakeoffFromRunway( "Anapa" ) + +A2ADispatcher:SetSquadron( "Novo", AIRBASE.Caucasus.Novorossiysk, { "SQ CCCP SU-27" } ) +A2ADispatcher:SetSquadronGci( "Novo", 800, 1200 ) +A2ADispatcher:SetSquadronTakeoffFromRunway( "Novo" ) + diff --git a/AID - AI Dispatching/AID-A2A - AI A2A Dispatching/AID-A2A-018 - Unlimited Resources Test/AID-A2A-018 - Unlimited Resources Test.miz b/AID - AI Dispatching/AID-A2A - AI A2A Dispatching/AID-A2A-018 - Unlimited Resources Test/AID-A2A-018 - Unlimited Resources Test.miz index 53e82374ba..24d0c31fc8 100644 Binary files a/AID - AI Dispatching/AID-A2A - AI A2A Dispatching/AID-A2A-018 - Unlimited Resources Test/AID-A2A-018 - Unlimited Resources Test.miz and b/AID - AI Dispatching/AID-A2A - AI A2A Dispatching/AID-A2A-018 - Unlimited Resources Test/AID-A2A-018 - Unlimited Resources Test.miz differ diff --git a/AID - AI Dispatching/AID-A2A - AI A2A Dispatching/AID-A2A-019 - Engage Range Test/AID-019 - AI_A2A - Engage Range Test.lua b/AID - AI Dispatching/AID-A2A - AI A2A Dispatching/AID-A2A-019 - Engage Range Test/AID-019 - AI_A2A - Engage Range Test.lua new file mode 100644 index 0000000000..5c576b2e18 --- /dev/null +++ b/AID - AI Dispatching/AID-A2A - AI A2A Dispatching/AID-A2A-019 - Engage Range Test/AID-019 - AI_A2A - Engage Range Test.lua @@ -0,0 +1,31 @@ +--- +-- Name: AID-019 - AI_A2A - Engage Range Test +-- Author: FlightControl +-- Date Created: 06 Aug 2017 + + +-- Define a SET_GROUP object that builds a collection of groups that define the EWR network. +-- Here we build the network with all the groups that have a name starting with DF CCCP AWACS and DF CCCP EWR. +DetectionSetGroup = SET_GROUP:New() +DetectionSetGroup:FilterPrefixes( { "DF CCCP AWACS", "DF CCCP EWR" } ) +DetectionSetGroup:FilterStart() + +Detection = DETECTION_AREAS:New( DetectionSetGroup, 30000 ) + +-- Setup the A2A dispatcher, and initialize it. +A2ADispatcher = AI_A2A_DISPATCHER:New( Detection ) + +-- Initialize the dispatcher, setting up a radius of 50km where any airborne friendly +-- without an assignment within 50km radius from a detected target, will engage that target. +A2ADispatcher:SetEngageRadius( 50000 ) + +A2ADispatcher:SetTacticalDisplay( true ) + + +-- Setup the squadrons. + +A2ADispatcher:SetSquadron( "Sochi", AIRBASE.Caucasus.Sochi_Adler, { "SQ CCCP SU-27" } ) +CAPZoneWest = ZONE_POLYGON:New( "CAP Zone West", GROUP:FindByName( "CAP Zone West" ) ) +A2ADispatcher:SetSquadronCap( "Sochi", CAPZoneWest, 4000, 8000, 600, 800, 800, 1200 ) +A2ADispatcher:SetSquadronCapInterval( "Sochi", 2, 10, 30, 1 ) + diff --git a/AID - AI Dispatching/AID-A2A - AI A2A Dispatching/AID-A2A-019 - Engage Range Test/AID-A2A-019 - Engage Range Test.miz b/AID - AI Dispatching/AID-A2A - AI A2A Dispatching/AID-A2A-019 - Engage Range Test/AID-A2A-019 - Engage Range Test.miz index 2fd469fc56..1690f3c479 100644 Binary files a/AID - AI Dispatching/AID-A2A - AI A2A Dispatching/AID-A2A-019 - Engage Range Test/AID-A2A-019 - Engage Range Test.miz and b/AID - AI Dispatching/AID-A2A - AI A2A Dispatching/AID-A2A-019 - Engage Range Test/AID-A2A-019 - Engage Range Test.miz differ diff --git a/AID - AI Dispatching/AID-A2A - AI A2A Dispatching/AID-A2A-020 - GCI RTB and ReEngage/AID-A2A-020 - GCI RTB and ReEngage.lua b/AID - AI Dispatching/AID-A2A - AI A2A Dispatching/AID-A2A-020 - GCI RTB and ReEngage/AID-A2A-020 - GCI RTB and ReEngage.lua index 958046a556..36229dbafa 100644 --- a/AID - AI Dispatching/AID-A2A - AI A2A Dispatching/AID-A2A-020 - GCI RTB and ReEngage/AID-A2A-020 - GCI RTB and ReEngage.lua +++ b/AID - AI Dispatching/AID-A2A - AI A2A Dispatching/AID-A2A-020 - GCI RTB and ReEngage/AID-A2A-020 - GCI RTB and ReEngage.lua @@ -1,60 +1,60 @@ ---- --- Name: AID-A2A-020 - GCI RTB and ReEngage --- Author: FlightControl --- Date Created: 30 May 2017 - - --- Define a SET_GROUP object that builds a collection of groups that define the EWR network. --- Here we build the network with all the groups that have a name starting with DF CCCP AWACS and DF CCCP EWR. -DetectionSetGroup = SET_GROUP:New() -DetectionSetGroup:FilterPrefixes( { "DF CCCP AWACS", "DF CCCP EWR" } ) -DetectionSetGroup:FilterStart() - -Detection = DETECTION_AREAS:New( DetectionSetGroup, 30000 ) - --- Setup the A2A dispatcher, and initialize it. -A2ADispatcher = AI_A2A_DISPATCHER:New( Detection ) - --- Initialize the dispatcher, setting up a border zone. This is a polygon, --- which takes the waypoints of a late activated group with the name CCCP Border as the boundaries of the border area. --- Any enemy crossing this border will be engaged. -CCCPBorderZone = ZONE_POLYGON:New( "CCCP Border", GROUP:FindByName( "CCCP Border" ) ) ---A2ADispatcher:SetBorderZone( CCCPBorderZone ) - --- Initialize the dispatcher, setting up a radius of 100km where any airborne friendly --- without an assignment within 100km radius from a detected target, will engage that target. -A2ADispatcher:SetEngageRadius( 200000 ) - -A2ADispatcher:SetTacticalDisplay( true ) - - --- Setup the squadrons. - -A2ADispatcher:SetSquadron( "Kras1", AIRBASE.Caucasus.Krasnodar_Center, { "SQ CCCP SU-27" } ) -A2ADispatcher:SetSquadronGci( "Kras1", 900, 1200 ) - -A2ADispatcher:SetSquadron( "Kras2", AIRBASE.Caucasus.Krasnodar_Pashkovsky, { "SQ CCCP SU-27" } ) -A2ADispatcher:SetSquadronGci( "Kras2", 900, 1200 ) - -A2ADispatcher:SetSquadron( "May", AIRBASE.Caucasus.Maykop_Khanskaya, { "SQ CCCP SU-27" } ) -A2ADispatcher:SetSquadronGci( "May", 900, 1200 ) - - - -A2ADispatcher:SetDefaultTakeoffInAir() -A2ADispatcher:SetDefaultLandingNearAirbase() - -A2ADispatcher:Start() - --- Blue attack simulation - -local Frequency = 300 - -BlueSpawn2 = SPAWN - :New( "RT NATO 2" ) - :InitLimit( 8, 40 ) - :InitRandomizeTemplate( { "SQ NATO A-10C", "SQ NATO F-15C", "SQ NATO F-16A", "SQ NATO F/A-18", "SQ NATO F-16C" } ) - :InitRandomizeRoute( 0, 0, 30000 ) - :InitDelayOn() - :SpawnScheduled( Frequency, 0.5 ) - +--- +-- Name: AID-A2A-020 - GCI RTB and ReEngage +-- Author: FlightControl +-- Date Created: 30 May 2017 + + +-- Define a SET_GROUP object that builds a collection of groups that define the EWR network. +-- Here we build the network with all the groups that have a name starting with DF CCCP AWACS and DF CCCP EWR. +DetectionSetGroup = SET_GROUP:New() +DetectionSetGroup:FilterPrefixes( { "DF CCCP AWACS", "DF CCCP EWR" } ) +DetectionSetGroup:FilterStart() + +Detection = DETECTION_AREAS:New( DetectionSetGroup, 30000 ) + +-- Setup the A2A dispatcher, and initialize it. +A2ADispatcher = AI_A2A_DISPATCHER:New( Detection ) + +-- Initialize the dispatcher, setting up a border zone. This is a polygon, +-- which takes the waypoints of a late activated group with the name CCCP Border as the boundaries of the border area. +-- Any enemy crossing this border will be engaged. +CCCPBorderZone = ZONE_POLYGON:New( "CCCP Border", GROUP:FindByName( "CCCP Border" ) ) +--A2ADispatcher:SetBorderZone( CCCPBorderZone ) + +-- Initialize the dispatcher, setting up a radius of 100km where any airborne friendly +-- without an assignment within 100km radius from a detected target, will engage that target. +A2ADispatcher:SetEngageRadius( 200000 ) + +A2ADispatcher:SetTacticalDisplay( true ) + + +-- Setup the squadrons. + +A2ADispatcher:SetSquadron( "Kras1", AIRBASE.Caucasus.Krasnodar_Center, { "SQ CCCP SU-27" } ) +A2ADispatcher:SetSquadronGci( "Kras1", 900, 1200 ) + +A2ADispatcher:SetSquadron( "Kras2", AIRBASE.Caucasus.Krasnodar_Pashkovsky, { "SQ CCCP SU-27" } ) +A2ADispatcher:SetSquadronGci( "Kras2", 900, 1200 ) + +A2ADispatcher:SetSquadron( "May", AIRBASE.Caucasus.Maykop_Khanskaya, { "SQ CCCP SU-27" } ) +A2ADispatcher:SetSquadronGci( "May", 900, 1200 ) + + + +A2ADispatcher:SetDefaultTakeoffInAir() +A2ADispatcher:SetDefaultLandingNearAirbase() + +A2ADispatcher:Start() + +-- Blue attack simulation + +local Frequency = 300 + +BlueSpawn2 = SPAWN + :New( "RT NATO 2" ) + :InitLimit( 8, 40 ) + :InitRandomizeTemplate( { "SQ NATO A-10C", "SQ NATO F-15C", "SQ NATO F-16A", "SQ NATO F/A-18", "SQ NATO F-16C" } ) + :InitRandomizeRoute( 0, 0, 30000 ) + :InitDelayOn() + :SpawnScheduled( Frequency, 0.5 ) + diff --git a/AID - AI Dispatching/AID-A2A - AI A2A Dispatching/AID-A2A-020 - GCI RTB and ReEngage/AID-A2A-020 - GCI RTB and ReEngage.miz b/AID - AI Dispatching/AID-A2A - AI A2A Dispatching/AID-A2A-020 - GCI RTB and ReEngage/AID-A2A-020 - GCI RTB and ReEngage.miz index f287010aae..6714128c4d 100644 Binary files a/AID - AI Dispatching/AID-A2A - AI A2A Dispatching/AID-A2A-020 - GCI RTB and ReEngage/AID-A2A-020 - GCI RTB and ReEngage.miz and b/AID - AI Dispatching/AID-A2A - AI A2A Dispatching/AID-A2A-020 - GCI RTB and ReEngage/AID-A2A-020 - GCI RTB and ReEngage.miz differ diff --git a/AID - AI Dispatching/AID-A2A - AI A2A Dispatching/AID-A2A-021 - GCI Radius Test/AID-021 - AI_A2A - GCI Radius Test.lua b/AID - AI Dispatching/AID-A2A - AI A2A Dispatching/AID-A2A-021 - GCI Radius Test/AID-021 - AI_A2A - GCI Radius Test.lua new file mode 100644 index 0000000000..9f04adff59 --- /dev/null +++ b/AID - AI Dispatching/AID-A2A - AI A2A Dispatching/AID-A2A-021 - GCI Radius Test/AID-021 - AI_A2A - GCI Radius Test.lua @@ -0,0 +1,42 @@ +--- +-- Name: AID-021 - AI_A2A - GCI Radius Test +-- Author: FlightControl +-- Date Created: 30 May 2017 + + +-- Define a SET_GROUP object that builds a collection of groups that define the EWR network. +-- Here we build the network with all the groups that have a name starting with DF CCCP AWACS and DF CCCP EWR. +DetectionSetGroup = SET_GROUP:New() +DetectionSetGroup:FilterPrefixes( { "DF CCCP AWACS", "DF CCCP EWR" } ) +DetectionSetGroup:FilterStart() + +Detection = DETECTION_AREAS:New( DetectionSetGroup, 30000 ) + +-- Setup the A2A dispatcher, and initialize it. +A2ADispatcher = AI_A2A_DISPATCHER:New( Detection ) + +-- Initialize the dispatcher, setting up a radius of 100km where any airborne friendly +-- without an assignment within 100km radius from a detected target, will engage that target. +A2ADispatcher:SetEngageRadius( 200000 ) + +A2ADispatcher:SetGciRadius( 100000 ) + +A2ADispatcher:SetTacticalDisplay( true ) + + +-- Setup the squadrons. + +A2ADispatcher:SetSquadron( "Kras1", AIRBASE.Caucasus.Krasnodar_Center, { "SQ CCCP SU-27" } ) +A2ADispatcher:SetSquadronGci( "Kras1", 900, 1200 ) + +A2ADispatcher:SetSquadron( "Kras2", AIRBASE.Caucasus.Krasnodar_Pashkovsky, { "SQ CCCP SU-27" } ) +A2ADispatcher:SetSquadronGci( "Kras2", 900, 1200 ) + +A2ADispatcher:SetSquadron( "May", AIRBASE.Caucasus.Maykop_Khanskaya, { "SQ CCCP SU-27" } ) +A2ADispatcher:SetSquadronGci( "May", 900, 1200 ) + + + +A2ADispatcher:SetDefaultTakeoffInAir() +A2ADispatcher:SetDefaultLandingNearAirbase() + diff --git a/AID - AI Dispatching/AID-A2A - AI A2A Dispatching/AID-A2A-021 - GCI Radius Test/AID-A2A-021 - GCI Radius Test.miz b/AID - AI Dispatching/AID-A2A - AI A2A Dispatching/AID-A2A-021 - GCI Radius Test/AID-A2A-021 - GCI Radius Test.miz index 36b0af200d..269ba172c8 100644 Binary files a/AID - AI Dispatching/AID-A2A - AI A2A Dispatching/AID-A2A-021 - GCI Radius Test/AID-A2A-021 - GCI Radius Test.miz and b/AID - AI Dispatching/AID-A2A - AI A2A Dispatching/AID-A2A-021 - GCI Radius Test/AID-A2A-021 - GCI Radius Test.miz differ diff --git a/AID - AI Dispatching/AID-A2A - AI A2A Dispatching/AID-A2A-022 - GCI Overhead/AID-022 - AI_A2A - GCI Overhead.lua b/AID - AI Dispatching/AID-A2A - AI A2A Dispatching/AID-A2A-022 - GCI Overhead/AID-022 - AI_A2A - GCI Overhead.lua new file mode 100644 index 0000000000..d635243097 --- /dev/null +++ b/AID - AI Dispatching/AID-A2A - AI A2A Dispatching/AID-A2A-022 - GCI Overhead/AID-022 - AI_A2A - GCI Overhead.lua @@ -0,0 +1,49 @@ +--- +-- Name: AID-022 - AI_A2A - GCI Overhead +-- Author: FlightControl +-- Date Created: 05 Sep 2017 + + +-- Define a SET_GROUP object that builds a collection of groups that define the EWR network. +-- Here we build the network with all the groups that have a name starting with DF CCCP AWACS and DF CCCP EWR. +DetectionSetGroup = SET_GROUP:New() +DetectionSetGroup:FilterPrefixes( { "DF CCCP AWACS", "DF CCCP EWR" } ) +DetectionSetGroup:FilterStart() + +Detection = DETECTION_AREAS:New( DetectionSetGroup, 30000 ) + +-- Setup the A2A dispatcher, and initialize it. +A2ADispatcher = AI_A2A_DISPATCHER:New( Detection ) + +-- Initialize the dispatcher, setting up a radius of 100km where any airborne friendly +-- without an assignment within 100km radius from a detected target, will engage that target. +A2ADispatcher:SetEngageRadius( 200000 ) + +A2ADispatcher:SetTacticalDisplay( true ) + + +-- Setup the squadrons. + +A2ADispatcher:SetSquadron( "May", AIRBASE.Caucasus.Maykop_Khanskaya, { "SQ CCCP SU-27" } ) +A2ADispatcher:SetSquadronGci( "May", 900, 1200 ) +A2ADispatcher:SetSquadronOverhead( "May", 0.25 ) + +A2ADispatcher:SetSquadron( "Kras", AIRBASE.Caucasus.Krasnodar_Center, { "SQ CCCP SU-27" } ) +A2ADispatcher:SetSquadronGci( "Kras", 900, 1200 ) +A2ADispatcher:SetSquadronOverhead( "Kras", 1.5 ) + +A2ADispatcher:SetDefaultTakeoffInAir() +A2ADispatcher:SetDefaultLandingNearAirbase() + +-- Blue attack simulation + +local Frequency = 30 + +BlueSpawn2 = SPAWN + :New( "RT NATO" ) + :InitLimit( 1, 40 ) + :InitRandomizeTemplate( { "SQ NATO A-10C", "SQ NATO F-15C", "SQ NATO F-16A", "SQ NATO F/A-18", "SQ NATO F-16C" } ) + :InitRandomizeRoute( 0, 0, 30000 ) + :InitDelayOn() + :SpawnScheduled( Frequency, 0.5 ) + diff --git a/AID - AI Dispatching/AID-A2A - AI A2A Dispatching/AID-A2A-022 - GCI Overhead/AID-A2A-022 - GCI Overhead.miz b/AID - AI Dispatching/AID-A2A - AI A2A Dispatching/AID-A2A-022 - GCI Overhead/AID-A2A-022 - GCI Overhead.miz index 5a6d78b46f..4f8d1f8947 100644 Binary files a/AID - AI Dispatching/AID-A2A - AI A2A Dispatching/AID-A2A-022 - GCI Overhead/AID-A2A-022 - GCI Overhead.miz and b/AID - AI Dispatching/AID-A2A - AI A2A Dispatching/AID-A2A-022 - GCI Overhead/AID-A2A-022 - GCI Overhead.miz differ diff --git a/AID - AI Dispatching/AID-A2A - AI A2A Dispatching/AID-A2A-030 - CAP RTB and ReEngage/AID-A2A-030 - CAP RTB and ReEngage.lua b/AID - AI Dispatching/AID-A2A - AI A2A Dispatching/AID-A2A-030 - CAP RTB and ReEngage/AID-A2A-030 - CAP RTB and ReEngage.lua index c737f8b2cd..897aa41b2a 100644 --- a/AID - AI Dispatching/AID-A2A - AI A2A Dispatching/AID-A2A-030 - CAP RTB and ReEngage/AID-A2A-030 - CAP RTB and ReEngage.lua +++ b/AID - AI Dispatching/AID-A2A - AI A2A Dispatching/AID-A2A-030 - CAP RTB and ReEngage/AID-A2A-030 - CAP RTB and ReEngage.lua @@ -1,54 +1,54 @@ ---- --- Name: AID-A2A-030 - CAP RTB and ReEngage --- Author: FlightControl --- Date Created: 30 May 2017 - - --- Define a SET_GROUP object that builds a collection of groups that define the EWR network. --- Here we build the network with all the groups that have a name starting with DF CCCP AWACS and DF CCCP EWR. -DetectionSetGroup = SET_GROUP:New() -DetectionSetGroup:FilterPrefixes( { "DF CCCP AWACS", "DF CCCP EWR" } ) -DetectionSetGroup:FilterStart() - -Detection = DETECTION_AREAS:New( DetectionSetGroup, 30000 ) ---Detection:BoundDetectedZones() - --- Setup the A2A dispatcher, and initialize it. -A2ADispatcher = AI_A2A_DISPATCHER:New( Detection ) - --- Initialize the dispatcher, setting up a radius of 100km where any airborne friendly --- without an assignment within 100km radius from a detected target, will engage that target. -A2ADispatcher:SetEngageRadius( 200000 ) - -A2ADispatcher:SetDisengageRadius( 200000 ) - -A2ADispatcher:SetTacticalDisplay( true ) - - --- Setup the squadrons. - -A2ADispatcher:SetSquadron( "Kras1", AIRBASE.Caucasus.Krasnodar_Pashkovsky, { "SQ CCCP SU-27" }, 20 ) -CAPZoneWest = ZONE_POLYGON:New( "CAP Zone West", GROUP:FindByName( "CAP Zone West" ) ) -A2ADispatcher:SetSquadronCap( "Kras1", 800, 1200, 4000, 8000, CAPZoneWest, 600, 800, 4000, 8000, "BARO" ) -A2ADispatcher:SetSquadronCapInterval( "Kras1", 4, 30, 120, 1 ) - -A2ADispatcher:SetSquadron( "May", AIRBASE.Caucasus.Maykop_Khanskaya, { "SQ CCCP SU-27" }, 20 ) -CAPZoneWest = ZONE_POLYGON:New( "CAP Zone West", GROUP:FindByName( "CAP Zone West" ) ) -A2ADispatcher:SetSquadronCapV2( "May", 800, 1200, 400, 500, "RADIO", CAPZoneWest, 600, 800, 4000, 8000, "BARO" ) -A2ADispatcher:SetSquadronCapInterval( "May", 1, 30, 120, 1 ) - -A2ADispatcher:SetDefaultTakeoffInAir() -A2ADispatcher:SetDefaultLandingNearAirbase() - --- Blue attack simulation - -local Frequency = 150 - -BlueSpawn2 = SPAWN - :New( "RT NATO 2" ) - :InitLimit( 6, 40 ) - :InitRandomizeTemplate( { "SQ NATO A-10C", "SQ NATO F-15C", "SQ NATO F-16A", "SQ NATO F/A-18", "SQ NATO F-16C" } ) - :InitRandomizeRoute( 0, 0, 30000 ) - :InitDelayOn() - :SpawnScheduled( Frequency, 0.5 ) - +--- +-- Name: AID-A2A-030 - CAP RTB and ReEngage +-- Author: FlightControl +-- Date Created: 30 May 2017 + + +-- Define a SET_GROUP object that builds a collection of groups that define the EWR network. +-- Here we build the network with all the groups that have a name starting with DF CCCP AWACS and DF CCCP EWR. +DetectionSetGroup = SET_GROUP:New() +DetectionSetGroup:FilterPrefixes( { "DF CCCP AWACS", "DF CCCP EWR" } ) +DetectionSetGroup:FilterStart() + +Detection = DETECTION_AREAS:New( DetectionSetGroup, 30000 ) +--Detection:BoundDetectedZones() + +-- Setup the A2A dispatcher, and initialize it. +A2ADispatcher = AI_A2A_DISPATCHER:New( Detection ) + +-- Initialize the dispatcher, setting up a radius of 100km where any airborne friendly +-- without an assignment within 100km radius from a detected target, will engage that target. +A2ADispatcher:SetEngageRadius( 200000 ) + +A2ADispatcher:SetDisengageRadius( 200000 ) + +A2ADispatcher:SetTacticalDisplay( true ) + + +-- Setup the squadrons. + +A2ADispatcher:SetSquadron( "Kras1", AIRBASE.Caucasus.Krasnodar_Pashkovsky, { "SQ CCCP SU-27" }, 20 ) +CAPZoneWest = ZONE_POLYGON:New( "CAP Zone West", GROUP:FindByName( "CAP Zone West" ) ) +A2ADispatcher:SetSquadronCap( "Kras1", 800, 1200, 4000, 8000, CAPZoneWest, 600, 800, 4000, 8000, "BARO" ) +A2ADispatcher:SetSquadronCapInterval( "Kras1", 4, 30, 120, 1 ) + +A2ADispatcher:SetSquadron( "May", AIRBASE.Caucasus.Maykop_Khanskaya, { "SQ CCCP SU-27" }, 20 ) +CAPZoneWest = ZONE_POLYGON:New( "CAP Zone West", GROUP:FindByName( "CAP Zone West" ) ) +A2ADispatcher:SetSquadronCapV2( "May", 800, 1200, 400, 500, "RADIO", CAPZoneWest, 600, 800, 4000, 8000, "BARO" ) +A2ADispatcher:SetSquadronCapInterval( "May", 1, 30, 120, 1 ) + +A2ADispatcher:SetDefaultTakeoffInAir() +A2ADispatcher:SetDefaultLandingNearAirbase() + +-- Blue attack simulation + +local Frequency = 150 + +BlueSpawn2 = SPAWN + :New( "RT NATO 2" ) + :InitLimit( 6, 40 ) + :InitRandomizeTemplate( { "SQ NATO A-10C", "SQ NATO F-15C", "SQ NATO F-16A", "SQ NATO F/A-18", "SQ NATO F-16C" } ) + :InitRandomizeRoute( 0, 0, 30000 ) + :InitDelayOn() + :SpawnScheduled( Frequency, 0.5 ) + diff --git a/AID - AI Dispatching/AID-A2A - AI A2A Dispatching/AID-A2A-030 - CAP RTB and ReEngage/AID-A2A-030 - CAP RTB and ReEngage.miz b/AID - AI Dispatching/AID-A2A - AI A2A Dispatching/AID-A2A-030 - CAP RTB and ReEngage/AID-A2A-030 - CAP RTB and ReEngage.miz index a28992f329..2f3a1a8020 100644 Binary files a/AID - AI Dispatching/AID-A2A - AI A2A Dispatching/AID-A2A-030 - CAP RTB and ReEngage/AID-A2A-030 - CAP RTB and ReEngage.miz and b/AID - AI Dispatching/AID-A2A - AI A2A Dispatching/AID-A2A-030 - CAP RTB and ReEngage/AID-A2A-030 - CAP RTB and ReEngage.miz differ diff --git a/AID - AI Dispatching/AID-A2A - AI A2A Dispatching/AID-A2A-031 - CAP out of fuel/AID-A2A-031 - CAP out of fuel.lua b/AID - AI Dispatching/AID-A2A - AI A2A Dispatching/AID-A2A-031 - CAP out of fuel/AID-A2A-031 - CAP out of fuel.lua index 86e23456f0..4f834949f4 100644 --- a/AID - AI Dispatching/AID-A2A - AI A2A Dispatching/AID-A2A-031 - CAP out of fuel/AID-A2A-031 - CAP out of fuel.lua +++ b/AID - AI Dispatching/AID-A2A - AI A2A Dispatching/AID-A2A-031 - CAP out of fuel/AID-A2A-031 - CAP out of fuel.lua @@ -1,35 +1,35 @@ ---- --- Name: AID-A2A-031 - CAP out of fuel --- Author: FlightControl --- Date Created: 30 Aug 2017 - - --- Define a SET_GROUP object that builds a collection of groups that define the EWR network. --- Here we build the network with all the groups that have a name starting with DF CCCP AWACS and DF CCCP EWR. -DetectionSetGroup = SET_GROUP:New() -DetectionSetGroup:FilterPrefixes( { "DF CCCP AWACS", "DF CCCP EWR" } ) -DetectionSetGroup:FilterStart() - -Detection = DETECTION_AREAS:New( DetectionSetGroup, 30000 ) - --- Setup the A2A dispatcher, and initialize it. -A2ADispatcher = AI_A2A_DISPATCHER:New( Detection ) - -A2ADispatcher:SetTacticalDisplay( true ) - - --- Setup the squadrons. - -A2ADispatcher:SetSquadron( "Kras1", AIRBASE.Caucasus.Krasnodar_Pashkovsky, { "SQ CCCP SU-27" }, 20 ) -CAPZoneWest = ZONE_POLYGON:New( "CAP Zone West", GROUP:FindByName( "CAP Zone West" ) ) -A2ADispatcher:SetSquadronCap( "Kras1", CAPZoneWest, 4000, 8000, 600, 800, 800, 1200, "BARO" ) -A2ADispatcher:SetSquadronCapInterval( "Kras1", 1, 30, 120, 1 ) - -A2ADispatcher:SetSquadron( "May", AIRBASE.Caucasus.Maykop_Khanskaya, { "SQ CCCP SU-27" }, 20 ) -CAPZoneWest = ZONE_POLYGON:New( "CAP Zone West", GROUP:FindByName( "CAP Zone West" ) ) -A2ADispatcher:SetSquadronCapV2( "May", 1000, 1200, 30, 30, "RADIO", CAPZoneWest, 600, 800, 4000, 8000, "BARO" ) -A2ADispatcher:SetSquadronCapInterval( "May", 1, 30, 120, 1 ) - -A2ADispatcher:SetDefaultTakeoffInAir() -A2ADispatcher:SetDefaultLandingNearAirbase() - +--- +-- Name: AID-A2A-031 - CAP out of fuel +-- Author: FlightControl +-- Date Created: 30 Aug 2017 + + +-- Define a SET_GROUP object that builds a collection of groups that define the EWR network. +-- Here we build the network with all the groups that have a name starting with DF CCCP AWACS and DF CCCP EWR. +DetectionSetGroup = SET_GROUP:New() +DetectionSetGroup:FilterPrefixes( { "DF CCCP AWACS", "DF CCCP EWR" } ) +DetectionSetGroup:FilterStart() + +Detection = DETECTION_AREAS:New( DetectionSetGroup, 30000 ) + +-- Setup the A2A dispatcher, and initialize it. +A2ADispatcher = AI_A2A_DISPATCHER:New( Detection ) + +A2ADispatcher:SetTacticalDisplay( true ) + + +-- Setup the squadrons. + +A2ADispatcher:SetSquadron( "Kras1", AIRBASE.Caucasus.Krasnodar_Pashkovsky, { "SQ CCCP SU-27" }, 20 ) +CAPZoneWest = ZONE_POLYGON:New( "CAP Zone West", GROUP:FindByName( "CAP Zone West" ) ) +A2ADispatcher:SetSquadronCap( "Kras1", CAPZoneWest, 4000, 8000, 600, 800, 800, 1200, "BARO" ) +A2ADispatcher:SetSquadronCapInterval( "Kras1", 1, 30, 120, 1 ) + +A2ADispatcher:SetSquadron( "May", AIRBASE.Caucasus.Maykop_Khanskaya, { "SQ CCCP SU-27" }, 20 ) +CAPZoneWest = ZONE_POLYGON:New( "CAP Zone West", GROUP:FindByName( "CAP Zone West" ) ) +A2ADispatcher:SetSquadronCapV2( "May", 1000, 1200, 30, 30, "RADIO", CAPZoneWest, 600, 800, 4000, 8000, "BARO" ) +A2ADispatcher:SetSquadronCapInterval( "May", 1, 30, 120, 1 ) + +A2ADispatcher:SetDefaultTakeoffInAir() +A2ADispatcher:SetDefaultLandingNearAirbase() + diff --git a/AID - AI Dispatching/AID-A2A - AI A2A Dispatching/AID-A2A-031 - CAP out of fuel/AID-A2A-031 - CAP out of fuel.miz b/AID - AI Dispatching/AID-A2A - AI A2A Dispatching/AID-A2A-031 - CAP out of fuel/AID-A2A-031 - CAP out of fuel.miz index c9b32e97cb..ba0b1938e6 100644 Binary files a/AID - AI Dispatching/AID-A2A - AI A2A Dispatching/AID-A2A-031 - CAP out of fuel/AID-A2A-031 - CAP out of fuel.miz and b/AID - AI Dispatching/AID-A2A - AI A2A Dispatching/AID-A2A-031 - CAP out of fuel/AID-A2A-031 - CAP out of fuel.miz differ diff --git a/AID - AI Dispatching/AID-A2A - AI A2A Dispatching/AID-A2A-032 - CAP Damage/AID-032 - AI_A2A - CAP Damage.lua b/AID - AI Dispatching/AID-A2A - AI A2A Dispatching/AID-A2A-032 - CAP Damage/AID-032 - AI_A2A - CAP Damage.lua new file mode 100644 index 0000000000..bc8ac1a207 --- /dev/null +++ b/AID - AI Dispatching/AID-A2A - AI A2A Dispatching/AID-A2A-032 - CAP Damage/AID-032 - AI_A2A - CAP Damage.lua @@ -0,0 +1,46 @@ +--- +-- Name: AID-032 - AI_A2A - CAP Damage +-- Author: FlightControl +-- Date Created: 29 Oct 2017 + + +-- Define a SET_GROUP object that builds a collection of groups that define the EWR network. +-- Here we build the network with all the groups that have a name starting with DF CCCP AWACS and DF CCCP EWR. +DetectionSetGroup = SET_GROUP:New() +DetectionSetGroup:FilterPrefixes( { "DF CCCP AWACS", "DF CCCP EWR" } ) +DetectionSetGroup:FilterStart() + +Detection = DETECTION_AREAS:New( DetectionSetGroup, 30000 ) + +-- Setup the A2A dispatcher, and initialize it. +A2ADispatcher = AI_A2A_DISPATCHER:New( Detection ) + +A2ADispatcher:SetTacticalDisplay( true ) + + +-- Setup the squadrons. + +A2ADispatcher:SetSquadron( "Kras1", AIRBASE.Caucasus.Krasnodar_Pashkovsky, { "SQ CCCP MIG-31" }, 20 ) +CAPZoneWest = ZONE_POLYGON:New( "CAP Zone West", GROUP:FindByName( "CAP Zone West" ) ) +A2ADispatcher:SetSquadronCap( "Kras1", CAPZoneWest, 4000, 8000, 600, 800, 800, 1200, "BARO" ) +A2ADispatcher:SetSquadronCapInterval( "Kras1", 2, 30, 120, 1 ) + +--A2ADispatcher:SetSquadron( "May", AIRBASE.Caucasus.Maykop_Khanskaya, { "SQ CCCP SU-27" }, 20 ) +--CAPZoneWest = ZONE_POLYGON:New( "CAP Zone West", GROUP:FindByName( "CAP Zone West" ) ) +--A2ADispatcher:SetSquadronCap( "May", CAPZoneWest, 4000, 8000, 600, 800, 800, 1200, "BARO" ) +--A2ADispatcher:SetSquadronCapInterval( "May", 1, 30, 120, 1 ) + +A2ADispatcher:SetDefaultTakeoffInAir() +A2ADispatcher:SetDefaultLandingAtEngineShutdown() + +-- Blue attack simulation + +local Frequency = 300 + +BlueSpawn2 = SPAWN + :New( "RT NATO 2" ) + :InitLimit( 6, 40 ) + :InitRandomizeTemplate( { "SQ NATO A-10C", "SQ NATO F-15C", "SQ NATO F-16A", "SQ NATO F/A-18", "SQ NATO F-16C" } ) + :InitRandomizeRoute( 0, 0, 30000 ) + :InitDelayOn() + :SpawnScheduled( Frequency, 0.5 ) diff --git a/AID - AI Dispatching/AID-A2A - AI A2A Dispatching/AID-A2A-032 - CAP Damage/AID-A2A-032 - CAP Damage.miz b/AID - AI Dispatching/AID-A2A - AI A2A Dispatching/AID-A2A-032 - CAP Damage/AID-A2A-032 - CAP Damage.miz index 8d9e53109d..40f3525943 100644 Binary files a/AID - AI Dispatching/AID-A2A - AI A2A Dispatching/AID-A2A-032 - CAP Damage/AID-A2A-032 - CAP Damage.miz and b/AID - AI Dispatching/AID-A2A - AI A2A Dispatching/AID-A2A-032 - CAP Damage/AID-A2A-032 - CAP Damage.miz differ diff --git a/AID - AI Dispatching/AID-A2A - AI A2A Dispatching/AID-A2A-040 - CAP Independent Detection in EWR/AID-040 - AI_A2A - CAP Independent Detection in EWR.lua b/AID - AI Dispatching/AID-A2A - AI A2A Dispatching/AID-A2A-040 - CAP Independent Detection in EWR/AID-040 - AI_A2A - CAP Independent Detection in EWR.lua new file mode 100644 index 0000000000..2446a50124 --- /dev/null +++ b/AID - AI Dispatching/AID-A2A - AI A2A Dispatching/AID-A2A-040 - CAP Independent Detection in EWR/AID-040 - AI_A2A - CAP Independent Detection in EWR.lua @@ -0,0 +1,47 @@ +--- +-- Name: AID-040 - AI_A2A - CAP Independent Detection in EWR +-- Author: FlightControl +-- Date Created: 30 Aug 2017 + + +-- Define a SET_GROUP object that builds a collection of groups that define the EWR network. +-- Here we build the network with all the groups that have a name starting with DF CCCP AWACS and DF CCCP EWR. +DetectionSetGroup = SET_GROUP:New() +DetectionSetGroup:FilterPrefixes( { "DF CCCP AWACS", "DF CCCP EWR" } ) +DetectionSetGroup:FilterStart() + +Detection = DETECTION_AREAS:New( DetectionSetGroup, 30000 ) + +-- Setup the A2A dispatcher, and initialize it. +A2ADispatcher = AI_A2A_DISPATCHER:New( Detection ) + +A2ADispatcher:SetTacticalDisplay( true ) + + +A2ADispatcher:SetEngageRadius( 90000 ) +-- Setup the squadrons. + +A2ADispatcher:SetSquadron( "Kras1", AIRBASE.Caucasus.Krasnodar_Pashkovsky, { "SQ CCCP SU-27" } ) +CAPZoneWest = ZONE_POLYGON:New( "CAP Zone West", GROUP:FindByName( "CAP Zone West" ) ) +A2ADispatcher:SetSquadronCap( "Kras1", CAPZoneWest, 4000, 8000, 600, 800, 800, 1200, "BARO" ) +A2ADispatcher:SetSquadronCapInterval( "Kras1", 4, 30, 120 ) + +--A2ADispatcher:SetSquadron( "May", AIRBASE.Caucasus.Maykop_Khanskaya, { "SQ CCCP SU-27" }, 20 ) +--CAPZoneWest = ZONE_POLYGON:New( "CAP Zone West", GROUP:FindByName( "CAP Zone West" ) ) +--A2ADispatcher:SetSquadronCap( "May", CAPZoneWest, 4000, 8000, 600, 800, 800, 1200, "BARO" ) +--A2ADispatcher:SetSquadronCapInterval( "May", 1, 30, 120 ) + +A2ADispatcher:SetDefaultTakeoffInAir() +A2ADispatcher:SetDefaultLandingNearAirbase() + +-- Blue attack simulation + +local Frequency = 180 + +BlueSpawn2 = SPAWN + :New( "RT NATO" ) + :InitLimit( 2, 40 ) + :InitRandomizeTemplate( { "SQ NATO A-10C", "SQ NATO F-15C", "SQ NATO F-16A", "SQ NATO F/A-18", "SQ NATO F-16C" } ) + :InitRandomizeRoute( 0, 0, 30000 ) + :InitDelayOn() + :SpawnScheduled( Frequency, 0.5 ) diff --git a/AID - AI Dispatching/AID-A2A - AI A2A Dispatching/AID-A2A-040 - CAP Independent Detection in EWR/AID-A2A-040 - CAP Independent Detection in EWR.miz b/AID - AI Dispatching/AID-A2A - AI A2A Dispatching/AID-A2A-040 - CAP Independent Detection in EWR/AID-A2A-040 - CAP Independent Detection in EWR.miz index 7e59b61b06..1a5d53fdc7 100644 Binary files a/AID - AI Dispatching/AID-A2A - AI A2A Dispatching/AID-A2A-040 - CAP Independent Detection in EWR/AID-A2A-040 - CAP Independent Detection in EWR.miz and b/AID - AI Dispatching/AID-A2A - AI A2A Dispatching/AID-A2A-040 - CAP Independent Detection in EWR/AID-A2A-040 - CAP Independent Detection in EWR.miz differ diff --git a/AID - AI Dispatching/AID-A2A - AI A2A Dispatching/AID-A2A-041 - CAP Independent Detection in EWR with Clients/AID-040 - AI_A2A - CAP Independent Detection in EWR.lua b/AID - AI Dispatching/AID-A2A - AI A2A Dispatching/AID-A2A-041 - CAP Independent Detection in EWR with Clients/AID-040 - AI_A2A - CAP Independent Detection in EWR.lua new file mode 100644 index 0000000000..2446a50124 --- /dev/null +++ b/AID - AI Dispatching/AID-A2A - AI A2A Dispatching/AID-A2A-041 - CAP Independent Detection in EWR with Clients/AID-040 - AI_A2A - CAP Independent Detection in EWR.lua @@ -0,0 +1,47 @@ +--- +-- Name: AID-040 - AI_A2A - CAP Independent Detection in EWR +-- Author: FlightControl +-- Date Created: 30 Aug 2017 + + +-- Define a SET_GROUP object that builds a collection of groups that define the EWR network. +-- Here we build the network with all the groups that have a name starting with DF CCCP AWACS and DF CCCP EWR. +DetectionSetGroup = SET_GROUP:New() +DetectionSetGroup:FilterPrefixes( { "DF CCCP AWACS", "DF CCCP EWR" } ) +DetectionSetGroup:FilterStart() + +Detection = DETECTION_AREAS:New( DetectionSetGroup, 30000 ) + +-- Setup the A2A dispatcher, and initialize it. +A2ADispatcher = AI_A2A_DISPATCHER:New( Detection ) + +A2ADispatcher:SetTacticalDisplay( true ) + + +A2ADispatcher:SetEngageRadius( 90000 ) +-- Setup the squadrons. + +A2ADispatcher:SetSquadron( "Kras1", AIRBASE.Caucasus.Krasnodar_Pashkovsky, { "SQ CCCP SU-27" } ) +CAPZoneWest = ZONE_POLYGON:New( "CAP Zone West", GROUP:FindByName( "CAP Zone West" ) ) +A2ADispatcher:SetSquadronCap( "Kras1", CAPZoneWest, 4000, 8000, 600, 800, 800, 1200, "BARO" ) +A2ADispatcher:SetSquadronCapInterval( "Kras1", 4, 30, 120 ) + +--A2ADispatcher:SetSquadron( "May", AIRBASE.Caucasus.Maykop_Khanskaya, { "SQ CCCP SU-27" }, 20 ) +--CAPZoneWest = ZONE_POLYGON:New( "CAP Zone West", GROUP:FindByName( "CAP Zone West" ) ) +--A2ADispatcher:SetSquadronCap( "May", CAPZoneWest, 4000, 8000, 600, 800, 800, 1200, "BARO" ) +--A2ADispatcher:SetSquadronCapInterval( "May", 1, 30, 120 ) + +A2ADispatcher:SetDefaultTakeoffInAir() +A2ADispatcher:SetDefaultLandingNearAirbase() + +-- Blue attack simulation + +local Frequency = 180 + +BlueSpawn2 = SPAWN + :New( "RT NATO" ) + :InitLimit( 2, 40 ) + :InitRandomizeTemplate( { "SQ NATO A-10C", "SQ NATO F-15C", "SQ NATO F-16A", "SQ NATO F/A-18", "SQ NATO F-16C" } ) + :InitRandomizeRoute( 0, 0, 30000 ) + :InitDelayOn() + :SpawnScheduled( Frequency, 0.5 ) diff --git a/AID - AI Dispatching/AID-A2A - AI A2A Dispatching/AID-A2A-041 - CAP Independent Detection in EWR with Clients/AID-041 - AI_A2A - CAP Independent Detection in EWR with Clients.lua b/AID - AI Dispatching/AID-A2A - AI A2A Dispatching/AID-A2A-041 - CAP Independent Detection in EWR with Clients/AID-041 - AI_A2A - CAP Independent Detection in EWR with Clients.lua new file mode 100644 index 0000000000..2fa9bb138a --- /dev/null +++ b/AID - AI Dispatching/AID-A2A - AI A2A Dispatching/AID-A2A-041 - CAP Independent Detection in EWR with Clients/AID-041 - AI_A2A - CAP Independent Detection in EWR with Clients.lua @@ -0,0 +1,49 @@ +--- +-- Name: AID-041 - AI_A2A - CAP Independent Detection in EWR with Clients +-- Author: FlightControl +-- Date Created: 01 Sep 2017 + + +-- Define a SET_GROUP object that builds a collection of groups that define the EWR network. +-- Here we build the network with all the groups that have a name starting with DF CCCP AWACS and DF CCCP EWR. +DetectionSetGroup = SET_GROUP:New() +DetectionSetGroup:FilterPrefixes( { "DF CCCP AWACS", "DF CCCP EWR" } ) +DetectionSetGroup:FilterStart() + +Detection = DETECTION_AREAS:New( DetectionSetGroup, 30000 ) +Detection:SetRefreshTimeInterval( 10 ) + +-- Setup the A2A dispatcher, and initialize it. +A2ADispatcher = AI_A2A_DISPATCHER:New( Detection ) + +A2ADispatcher:SetTacticalDisplay( true ) +A2ADispatcher:SetRefreshTimeInterval( 10 ) + + +A2ADispatcher:SetEngageRadius( 90000 ) +-- Setup the squadrons. + +A2ADispatcher:SetSquadron( "Kras1", AIRBASE.Caucasus.Krasnodar_Pashkovsky, { "SQ CCCP SU-27" } ) +CAPZoneWest = ZONE_POLYGON:New( "CAP Zone West", GROUP:FindByName( "CAP Zone West" ) ) +A2ADispatcher:SetSquadronCap( "Kras1", CAPZoneWest, 4000, 8000, 600, 800, 800, 1200, "BARO" ) +A2ADispatcher:SetSquadronCapInterval( "Kras1", 2, 30, 120 ) + +A2ADispatcher:SetSquadron( "May", AIRBASE.Caucasus.Maykop_Khanskaya, { "SQ CCCP SU-27" }, 20 ) +CAPZoneWest = ZONE_POLYGON:New( "CAP Zone West", GROUP:FindByName( "CAP Zone West" ) ) +A2ADispatcher:SetSquadronCap( "May", CAPZoneWest, 4000, 8000, 600, 800, 800, 1200, "BARO" ) +A2ADispatcher:SetSquadronCapInterval( "May", 2, 30, 120 ) + +A2ADispatcher:SetDefaultTakeoffInAir() +A2ADispatcher:SetDefaultLandingNearAirbase() + +-- Blue attack simulation + +--local Frequency = 600 +-- +--BlueSpawn2 = SPAWN +-- :New( "RT NATO" ) +-- :InitLimit( 2, 40 ) +-- :InitRandomizeTemplate( { "SQ NATO A-10C", "SQ NATO F-15C", "SQ NATO F-16A", "SQ NATO F/A-18", "SQ NATO F-16C" } ) +-- :InitRandomizeRoute( 0, 0, 30000 ) +-- :InitDelayOn() +-- :SpawnScheduled( Frequency, 0.5 ) diff --git a/AID - AI Dispatching/AID-A2A - AI A2A Dispatching/AID-A2A-041 - CAP Independent Detection in EWR with Clients/AID-A2A-041 - CAP Independent Detection in EWR with Clients.miz b/AID - AI Dispatching/AID-A2A - AI A2A Dispatching/AID-A2A-041 - CAP Independent Detection in EWR with Clients/AID-A2A-041 - CAP Independent Detection in EWR with Clients.miz index f5f22f5f8a..f0ba088fa8 100644 Binary files a/AID - AI Dispatching/AID-A2A - AI A2A Dispatching/AID-A2A-041 - CAP Independent Detection in EWR with Clients/AID-A2A-041 - CAP Independent Detection in EWR with Clients.miz and b/AID - AI Dispatching/AID-A2A - AI A2A Dispatching/AID-A2A-041 - CAP Independent Detection in EWR with Clients/AID-A2A-041 - CAP Independent Detection in EWR with Clients.miz differ diff --git a/AID - AI Dispatching/AID-A2A - AI A2A Dispatching/AID-A2A-050 - Resources/AID-A2A-050 - Resources.lua b/AID - AI Dispatching/AID-A2A - AI A2A Dispatching/AID-A2A-050 - Resources/AID-A2A-050 - Resources.lua index 0187eec441..f6b136402f 100644 --- a/AID - AI Dispatching/AID-A2A - AI A2A Dispatching/AID-A2A-050 - Resources/AID-A2A-050 - Resources.lua +++ b/AID - AI Dispatching/AID-A2A - AI A2A Dispatching/AID-A2A-050 - Resources/AID-A2A-050 - Resources.lua @@ -1,68 +1,68 @@ ---- --- Name: AID-A2A-050 - Resources --- Author: FlightControl --- Date Created: 21 Sep 2017 - - --- Define a SET_GROUP object that builds a collection of groups that define the EWR network. --- Here we build the network with all the groups that have a name starting with DF CCCP AWACS and DF CCCP EWR. -DetectionSetGroup = SET_GROUP:New() -DetectionSetGroup:FilterPrefixes( { "DF CCCP AWACS", "DF CCCP EWR" } ) -DetectionSetGroup:FilterStart() - -Detection = DETECTION_AREAS:New( DetectionSetGroup, 30000 ) - --- Setup the A2A dispatcher, and initialize it. -A2ADispatcher = AI_A2A_DISPATCHER:New( Detection ) - --- Enable the tactical display panel. -A2ADispatcher:SetTacticalDisplay( true ) - --- Initialize the dispatcher, setting up a border zone. This is a polygon, --- which takes the waypoints of a late activated group with the name CCCP Border as the boundaries of the border area. --- Any enemy crossing this border will be engaged. -CCCPBorderZone = ZONE_POLYGON:New( "CCCP Border", GROUP:FindByName( "CCCP Border" ) ) -A2ADispatcher:SetBorderZone( CCCPBorderZone ) - --- Initialize the dispatcher, setting up a radius of 100km where any airborne friendly --- without an assignment within 100km radius from a detected target, will engage that target. -A2ADispatcher:SetEngageRadius( 250000 ) - --- Setup the squadrons. -A2ADispatcher:SetSquadron( "Mineralnye", AIRBASE.Caucasus.Mineralnye_Vody, { "SQ CCCP SU-27" }, 6 ) - --- Setup the overhead -A2ADispatcher:SetSquadronOverhead( "Mineralnye", 1.2 ) - --- Setup the Grouping -A2ADispatcher:SetSquadronGrouping( "Mineralnye", 1 ) - --- Setup the Takeoff methods -A2ADispatcher:SetSquadronTakeoff( "Mineralnye", AI_A2A_DISPATCHER.Takeoff.Hot ) - --- Setup the Landing methods -A2ADispatcher:SetSquadronLandingAtEngineShutdown( "Mineralnye" ) - - --- Setup the visibility before start. -A2ADispatcher:SetSquadronVisible( "Mineralnye" ) - --- CAP Squadron execution. -CAPZoneEast = ZONE_POLYGON:New( "CAP Zone East", GROUP:FindByName( "CAP Zone East" ) ) -A2ADispatcher:SetSquadronCap( "Mineralnye", CAPZoneEast, 4000, 10000, 500, 600, 800, 900 ) -A2ADispatcher:SetSquadronCapInterval( "Mineralnye", 1, 30, 60, 1 ) -A2ADispatcher:SetSquadronFuelThreshold( "Mineralnye", 0.20 ) - --- GCI Squadron execution. ---A2ADispatcher:SetSquadronGci( "Mineralnye", 900, 1200 ) - --- Blue attack simulation -local Frequency = 60 - ---BlueSpawn1 = SPAWN --- :New( "RT NATO 1" ) --- :InitLimit( 2, 10 ) --- :InitRandomizeTemplate( { "SQ NATO A-10C", "SQ NATO F-15C", "SQ NATO F-16A", "SQ NATO F/A-18", "SQ NATO F-16C" } ) --- :InitRandomizeRoute( 0, 0, 30000 ) --- --:InitDelayOn() --- :SpawnScheduled( Frequency, 0.4 ) +--- +-- Name: AID-A2A-050 - Resources +-- Author: FlightControl +-- Date Created: 21 Sep 2017 + + +-- Define a SET_GROUP object that builds a collection of groups that define the EWR network. +-- Here we build the network with all the groups that have a name starting with DF CCCP AWACS and DF CCCP EWR. +DetectionSetGroup = SET_GROUP:New() +DetectionSetGroup:FilterPrefixes( { "DF CCCP AWACS", "DF CCCP EWR" } ) +DetectionSetGroup:FilterStart() + +Detection = DETECTION_AREAS:New( DetectionSetGroup, 30000 ) + +-- Setup the A2A dispatcher, and initialize it. +A2ADispatcher = AI_A2A_DISPATCHER:New( Detection ) + +-- Enable the tactical display panel. +A2ADispatcher:SetTacticalDisplay( true ) + +-- Initialize the dispatcher, setting up a border zone. This is a polygon, +-- which takes the waypoints of a late activated group with the name CCCP Border as the boundaries of the border area. +-- Any enemy crossing this border will be engaged. +CCCPBorderZone = ZONE_POLYGON:New( "CCCP Border", GROUP:FindByName( "CCCP Border" ) ) +A2ADispatcher:SetBorderZone( CCCPBorderZone ) + +-- Initialize the dispatcher, setting up a radius of 100km where any airborne friendly +-- without an assignment within 100km radius from a detected target, will engage that target. +A2ADispatcher:SetEngageRadius( 250000 ) + +-- Setup the squadrons. +A2ADispatcher:SetSquadron( "Mineralnye", AIRBASE.Caucasus.Mineralnye_Vody, { "SQ CCCP SU-27" }, 6 ) + +-- Setup the overhead +A2ADispatcher:SetSquadronOverhead( "Mineralnye", 1.2 ) + +-- Setup the Grouping +A2ADispatcher:SetSquadronGrouping( "Mineralnye", 1 ) + +-- Setup the Takeoff methods +A2ADispatcher:SetSquadronTakeoff( "Mineralnye", AI_A2A_DISPATCHER.Takeoff.Hot ) + +-- Setup the Landing methods +A2ADispatcher:SetSquadronLandingAtEngineShutdown( "Mineralnye" ) + + +-- Setup the visibility before start. +A2ADispatcher:SetSquadronVisible( "Mineralnye" ) + +-- CAP Squadron execution. +CAPZoneEast = ZONE_POLYGON:New( "CAP Zone East", GROUP:FindByName( "CAP Zone East" ) ) +A2ADispatcher:SetSquadronCap( "Mineralnye", CAPZoneEast, 4000, 10000, 500, 600, 800, 900 ) +A2ADispatcher:SetSquadronCapInterval( "Mineralnye", 1, 30, 60, 1 ) +A2ADispatcher:SetSquadronFuelThreshold( "Mineralnye", 0.20 ) + +-- GCI Squadron execution. +--A2ADispatcher:SetSquadronGci( "Mineralnye", 900, 1200 ) + +-- Blue attack simulation +local Frequency = 60 + +--BlueSpawn1 = SPAWN +-- :New( "RT NATO 1" ) +-- :InitLimit( 2, 10 ) +-- :InitRandomizeTemplate( { "SQ NATO A-10C", "SQ NATO F-15C", "SQ NATO F-16A", "SQ NATO F/A-18", "SQ NATO F-16C" } ) +-- :InitRandomizeRoute( 0, 0, 30000 ) +-- --:InitDelayOn() +-- :SpawnScheduled( Frequency, 0.4 ) diff --git a/AID - AI Dispatching/AID-A2A - AI A2A Dispatching/AID-A2A-050 - Resources/AID-A2A-050 - Resources.miz b/AID - AI Dispatching/AID-A2A - AI A2A Dispatching/AID-A2A-050 - Resources/AID-A2A-050 - Resources.miz index f6fe18c744..022c223d81 100644 Binary files a/AID - AI Dispatching/AID-A2A - AI A2A Dispatching/AID-A2A-050 - Resources/AID-A2A-050 - Resources.miz and b/AID - AI Dispatching/AID-A2A - AI A2A Dispatching/AID-A2A-050 - Resources/AID-A2A-050 - Resources.miz differ diff --git a/AID - AI Dispatching/AID-A2A - AI A2A Dispatching/AID-A2A-051 - Airbase Capture/AID-A2A-051 - Airbase Capture.lua b/AID - AI Dispatching/AID-A2A - AI A2A Dispatching/AID-A2A-051 - Airbase Capture/AID-A2A-051 - Airbase Capture.lua index ef5461079d..7feefb7dbe 100644 --- a/AID - AI Dispatching/AID-A2A - AI A2A Dispatching/AID-A2A-051 - Airbase Capture/AID-A2A-051 - Airbase Capture.lua +++ b/AID - AI Dispatching/AID-A2A - AI A2A Dispatching/AID-A2A-051 - Airbase Capture/AID-A2A-051 - Airbase Capture.lua @@ -1,67 +1,67 @@ ---- --- Name: AID-A2A-050 - Resources --- Author: FlightControl --- Date Created: 21 Sep 2017 - - --- Define a SET_GROUP object that builds a collection of groups that define the EWR network. --- Here we build the network with all the groups that have a name starting with DF CCCP AWACS and DF CCCP EWR. -DetectionSetGroup = SET_GROUP:New() -DetectionSetGroup:FilterPrefixes( { "DF CCCP AWACS", "DF CCCP EWR" } ) -DetectionSetGroup:FilterStart() - -Detection = DETECTION_AREAS:New( DetectionSetGroup, 30000 ) - --- Setup the A2A dispatcher, and initialize it. -A2ADispatcher = AI_A2A_DISPATCHER:New( Detection ) - --- Enable the tactical display panel. -A2ADispatcher:SetTacticalDisplay( true ) - --- Initialize the dispatcher, setting up a border zone. This is a polygon, --- which takes the waypoints of a late activated group with the name CCCP Border as the boundaries of the border area. --- Any enemy crossing this border will be engaged. -CCCPBorderZone = ZONE_POLYGON:New( "CCCP Border", GROUP:FindByName( "CCCP Border" ) ) -A2ADispatcher:SetBorderZone( CCCPBorderZone ) - --- Initialize the dispatcher, setting up a radius of 100km where any airborne friendly --- without an assignment within 100km radius from a detected target, will engage that target. -A2ADispatcher:SetEngageRadius( 250000 ) - --- Setup the squadrons. -A2ADispatcher:SetSquadron( "Mineralnye", AIRBASE.Caucasus.Mineralnye_Vody, { "SQ CCCP SU-27" }, 30 ) - --- Setup the overhead -A2ADispatcher:SetSquadronOverhead( "Mineralnye", 1.2 ) - --- Setup the Grouping -A2ADispatcher:SetSquadronGrouping( "Mineralnye", 1 ) - --- Setup the Takeoff methods -A2ADispatcher:SetSquadronTakeoff( "Mineralnye", AI_A2A_DISPATCHER.Takeoff.Air ) - --- Setup the Landing methods -A2ADispatcher:SetSquadronLandingAtRunway( "Mineralnye" ) - - --- CAP Squadron execution. ---CAPZoneEast = ZONE_POLYGON:New( "CAP Zone East", GROUP:FindByName( "CAP Zone East" ) ) ---A2ADispatcher:SetSquadronCap( "Mineralnye", CAPZoneEast, 4000, 10000, 500, 600, 800, 900 ) ---A2ADispatcher:SetSquadronCapInterval( "Mineralnye", 2, 30, 60, 1 ) - --- GCI Squadron execution. -A2ADispatcher:SetSquadronGci( "Mineralnye", 900, 1200 ) - -CleanUp = CLEANUP_AIRBASE:New( { AIRBASE.Caucasus.Novorossiysk } ) - - --- Blue attack simulation -local Frequency = 60 - -BlueSpawn1 = SPAWN - :New( "RT NATO 1" ) - :InitLimit( 2, 10 ) - :InitRandomizeTemplate( { "SQ NATO A-10C", "SQ NATO F-15C", "SQ NATO F-16A", "SQ NATO F/A-18", "SQ NATO F-16C" } ) - :InitRandomizeRoute( 0, 0, 30000 ) - --:InitDelayOn() - :SpawnScheduled( Frequency, 0.4 ) +--- +-- Name: AID-A2A-050 - Resources +-- Author: FlightControl +-- Date Created: 21 Sep 2017 + + +-- Define a SET_GROUP object that builds a collection of groups that define the EWR network. +-- Here we build the network with all the groups that have a name starting with DF CCCP AWACS and DF CCCP EWR. +DetectionSetGroup = SET_GROUP:New() +DetectionSetGroup:FilterPrefixes( { "DF CCCP AWACS", "DF CCCP EWR" } ) +DetectionSetGroup:FilterStart() + +Detection = DETECTION_AREAS:New( DetectionSetGroup, 30000 ) + +-- Setup the A2A dispatcher, and initialize it. +A2ADispatcher = AI_A2A_DISPATCHER:New( Detection ) + +-- Enable the tactical display panel. +A2ADispatcher:SetTacticalDisplay( true ) + +-- Initialize the dispatcher, setting up a border zone. This is a polygon, +-- which takes the waypoints of a late activated group with the name CCCP Border as the boundaries of the border area. +-- Any enemy crossing this border will be engaged. +CCCPBorderZone = ZONE_POLYGON:New( "CCCP Border", GROUP:FindByName( "CCCP Border" ) ) +A2ADispatcher:SetBorderZone( CCCPBorderZone ) + +-- Initialize the dispatcher, setting up a radius of 100km where any airborne friendly +-- without an assignment within 100km radius from a detected target, will engage that target. +A2ADispatcher:SetEngageRadius( 250000 ) + +-- Setup the squadrons. +A2ADispatcher:SetSquadron( "Mineralnye", AIRBASE.Caucasus.Mineralnye_Vody, { "SQ CCCP SU-27" }, 30 ) + +-- Setup the overhead +A2ADispatcher:SetSquadronOverhead( "Mineralnye", 1.2 ) + +-- Setup the Grouping +A2ADispatcher:SetSquadronGrouping( "Mineralnye", 1 ) + +-- Setup the Takeoff methods +A2ADispatcher:SetSquadronTakeoff( "Mineralnye", AI_A2A_DISPATCHER.Takeoff.Air ) + +-- Setup the Landing methods +A2ADispatcher:SetSquadronLandingAtRunway( "Mineralnye" ) + + +-- CAP Squadron execution. +--CAPZoneEast = ZONE_POLYGON:New( "CAP Zone East", GROUP:FindByName( "CAP Zone East" ) ) +--A2ADispatcher:SetSquadronCap( "Mineralnye", CAPZoneEast, 4000, 10000, 500, 600, 800, 900 ) +--A2ADispatcher:SetSquadronCapInterval( "Mineralnye", 2, 30, 60, 1 ) + +-- GCI Squadron execution. +A2ADispatcher:SetSquadronGci( "Mineralnye", 900, 1200 ) + +CleanUp = CLEANUP_AIRBASE:New( { AIRBASE.Caucasus.Novorossiysk } ) + + +-- Blue attack simulation +local Frequency = 60 + +BlueSpawn1 = SPAWN + :New( "RT NATO 1" ) + :InitLimit( 2, 10 ) + :InitRandomizeTemplate( { "SQ NATO A-10C", "SQ NATO F-15C", "SQ NATO F-16A", "SQ NATO F/A-18", "SQ NATO F-16C" } ) + :InitRandomizeRoute( 0, 0, 30000 ) + --:InitDelayOn() + :SpawnScheduled( Frequency, 0.4 ) diff --git a/AID - AI Dispatching/AID-A2A - AI A2A Dispatching/AID-A2A-051 - Airbase Capture/AID-A2A-051 - Airbase Capture.miz b/AID - AI Dispatching/AID-A2A - AI A2A Dispatching/AID-A2A-051 - Airbase Capture/AID-A2A-051 - Airbase Capture.miz index 3563e5c3cf..83098e9e1f 100644 Binary files a/AID - AI Dispatching/AID-A2A - AI A2A Dispatching/AID-A2A-051 - Airbase Capture/AID-A2A-051 - Airbase Capture.miz and b/AID - AI Dispatching/AID-A2A - AI A2A Dispatching/AID-A2A-051 - Airbase Capture/AID-A2A-051 - Airbase Capture.miz differ diff --git a/AID - AI Dispatching/AID-A2A - AI A2A Dispatching/AID-A2A-060 - Takeoff From Runway Test/AID-060 - AI_A2A - Takeoff From Runway Test.lua b/AID - AI Dispatching/AID-A2A - AI A2A Dispatching/AID-A2A-060 - Takeoff From Runway Test/AID-060 - AI_A2A - Takeoff From Runway Test.lua new file mode 100644 index 0000000000..f7ffb75693 --- /dev/null +++ b/AID - AI Dispatching/AID-A2A - AI A2A Dispatching/AID-A2A-060 - Takeoff From Runway Test/AID-060 - AI_A2A - Takeoff From Runway Test.lua @@ -0,0 +1,67 @@ +--- +-- Name: AID-060 - AI_A2A - Takeoff From Runway Test +-- Author: FlightControl +-- Date Created: 21 Sep 2017 + + +-- Define a SET_GROUP object that builds a collection of groups that define the EWR network. +-- Here we build the network with all the groups that have a name starting with DF CCCP AWACS and DF CCCP EWR. +DetectionSetGroup = SET_GROUP:New() +DetectionSetGroup:FilterPrefixes( { "DF CCCP AWACS", "DF CCCP EWR" } ) +DetectionSetGroup:FilterStart() + +Detection = DETECTION_AREAS:New( DetectionSetGroup, 30000 ) + +-- Setup the A2A dispatcher, and initialize it. +A2ADispatcher = AI_A2A_DISPATCHER:New( Detection ) + +-- Enable the tactical display panel. +A2ADispatcher:SetTacticalDisplay( true ) + +-- Initialize the dispatcher, setting up a border zone. This is a polygon, +-- which takes the waypoints of a late activated group with the name CCCP Border as the boundaries of the border area. +-- Any enemy crossing this border will be engaged. +CCCPBorderZone = ZONE_POLYGON:New( "CCCP Border", GROUP:FindByName( "CCCP Border" ) ) +A2ADispatcher:SetBorderZone( CCCPBorderZone ) + +-- Initialize the dispatcher, setting up a radius of 100km where any airborne friendly +-- without an assignment within 100km radius from a detected target, will engage that target. +A2ADispatcher:SetEngageRadius( 250000 ) + +-- Setup the squadrons. +A2ADispatcher:SetSquadron( "Mineralnye", AIRBASE.Caucasus.Mineralnye_Vody, { "SQ CCCP SU-27" }, 20 ) + +-- Setup the overhead +A2ADispatcher:SetSquadronOverhead( "Mineralnye", 1.2 ) + +-- Setup the Grouping +A2ADispatcher:SetSquadronGrouping( "Mineralnye", 1 ) + +-- Setup the Takeoff methods +A2ADispatcher:SetSquadronTakeoff( "Mineralnye", AI_A2A_DISPATCHER.Takeoff.Runway ) + +-- Setup the Landing methods +A2ADispatcher:SetSquadronLandingAtRunway( "Mineralnye" ) + + +-- CAP Squadron execution. +--CAPZoneEast = ZONE_POLYGON:New( "CAP Zone East", GROUP:FindByName( "CAP Zone East" ) ) +--A2ADispatcher:SetSquadronCap( "Mineralnye", CAPZoneEast, 4000, 10000, 500, 600, 800, 900 ) +--A2ADispatcher:SetSquadronCapInterval( "Mineralnye", 2, 30, 60, 1 ) + +-- GCI Squadron execution. +A2ADispatcher:SetSquadronGci( "Mineralnye", 900, 1200 ) + +CleanUp = CLEANUP_AIRBASE:New( { AIRBASE.Caucasus.Novorossiysk } ) + + +-- Blue attack simulation +local Frequency = 60 + +BlueSpawn1 = SPAWN + :New( "RT NATO 1" ) + :InitLimit( 2, 10 ) + :InitRandomizeTemplate( { "SQ NATO A-10C", "SQ NATO F-15C", "SQ NATO F-16A", "SQ NATO F/A-18", "SQ NATO F-16C" } ) + :InitRandomizeRoute( 0, 0, 30000 ) + --:InitDelayOn() + :SpawnScheduled( Frequency, 0.4 ) diff --git a/AID - AI Dispatching/AID-A2A - AI A2A Dispatching/AID-A2A-060 - Takeoff From Runway Test/AID-A2A-060 - Takeoff From Runway Test.miz b/AID - AI Dispatching/AID-A2A - AI A2A Dispatching/AID-A2A-060 - Takeoff From Runway Test/AID-A2A-060 - Takeoff From Runway Test.miz index f360fd2ff8..85667276b5 100644 Binary files a/AID - AI Dispatching/AID-A2A - AI A2A Dispatching/AID-A2A-060 - Takeoff From Runway Test/AID-A2A-060 - Takeoff From Runway Test.miz and b/AID - AI Dispatching/AID-A2A - AI A2A Dispatching/AID-A2A-060 - Takeoff From Runway Test/AID-A2A-060 - Takeoff From Runway Test.miz differ diff --git a/AID - AI Dispatching/AID-A2A - AI A2A Dispatching/AID-A2A-061 - Takeoff From Ship Runway Test/AID-061 - AI_A2A - Takeoff From Ship Runway Test.lua b/AID - AI Dispatching/AID-A2A - AI A2A Dispatching/AID-A2A-061 - Takeoff From Ship Runway Test/AID-061 - AI_A2A - Takeoff From Ship Runway Test.lua new file mode 100644 index 0000000000..c0bb328de6 --- /dev/null +++ b/AID - AI Dispatching/AID-A2A - AI A2A Dispatching/AID-A2A-061 - Takeoff From Ship Runway Test/AID-061 - AI_A2A - Takeoff From Ship Runway Test.lua @@ -0,0 +1,61 @@ +--- +-- Name: AID-061 - AI_A2A - Takeoff From Ship Runway Test +-- Author: FlightControl +-- Date Created: 21 Sep 2017 + + +-- Define a SET_GROUP object that builds a collection of groups that define the EWR network. +-- Here we build the network with all the groups that have a name starting with DF CCCP AWACS and DF CCCP EWR. +DetectionSetGroup = SET_GROUP:New() +DetectionSetGroup:FilterPrefixes( { "DF CCCP AWACS", "DF CCCP EWR" } ) +DetectionSetGroup:FilterStart() + +Detection = DETECTION_AREAS:New( DetectionSetGroup, 30000 ) + +-- Setup the A2A dispatcher, and initialize it. +A2ADispatcher = AI_A2A_DISPATCHER:New( Detection ) + +-- Enable the tactical display panel. +A2ADispatcher:SetTacticalDisplay( true ) + +-- Initialize the dispatcher, setting up a radius of 100km where any airborne friendly +-- without an assignment within 100km radius from a detected target, will engage that target. +A2ADispatcher:SetEngageRadius( 250000 ) + +-- Setup the squadrons. +A2ADispatcher:SetSquadron( "Kuznetsov", "Kuznetsov", { "SQ CCCP SU-33" }, 20 ) + +-- Setup the overhead +A2ADispatcher:SetSquadronOverhead( "Kuznetsov", 1.2 ) + +-- Setup the Grouping +A2ADispatcher:SetSquadronGrouping( "Kuznetsov", 1 ) + +-- Setup the Takeoff methods +A2ADispatcher:SetSquadronTakeoff( "Kuznetsov", AI_A2A_DISPATCHER.Takeoff.Runway ) + +-- Setup the Landing methods +A2ADispatcher:SetSquadronLandingAtRunway( "Kuznetsov" ) + + +-- CAP Squadron execution. +--CAPZoneEast = ZONE_POLYGON:New( "CAP Zone East", GROUP:FindByName( "CAP Zone East" ) ) +--A2ADispatcher:SetSquadronCap( "Mineralnye", CAPZoneEast, 4000, 10000, 500, 600, 800, 900 ) +--A2ADispatcher:SetSquadronCapInterval( "Mineralnye", 2, 30, 60, 1 ) + +-- GCI Squadron execution. +A2ADispatcher:SetSquadronGci( "Kuznetsov", 900, 1200 ) + +CleanUp = CLEANUP_AIRBASE:New( { AIRBASE.Caucasus.Novorossiysk } ) + + +-- Blue attack simulation +local Frequency = 60 + +BlueSpawn1 = SPAWN + :New( "RT NATO 1" ) + :InitLimit( 2, 10 ) + :InitRandomizeTemplate( { "SQ NATO A-10C", "SQ NATO F-15C", "SQ NATO F-16A", "SQ NATO F/A-18", "SQ NATO F-16C" } ) + :InitRandomizeRoute( 0, 0, 30000 ) + --:InitDelayOn() + :SpawnScheduled( Frequency, 0.4 ) diff --git a/AID - AI Dispatching/AID-A2A - AI A2A Dispatching/AID-A2A-061 - Takeoff From Ship Runway Test/AID-A2A-061 - Takeoff From Ship Runway Test.miz b/AID - AI Dispatching/AID-A2A - AI A2A Dispatching/AID-A2A-061 - Takeoff From Ship Runway Test/AID-A2A-061 - Takeoff From Ship Runway Test.miz index 447e30ce25..f19905abb5 100644 Binary files a/AID - AI Dispatching/AID-A2A - AI A2A Dispatching/AID-A2A-061 - Takeoff From Ship Runway Test/AID-A2A-061 - Takeoff From Ship Runway Test.miz and b/AID - AI Dispatching/AID-A2A - AI A2A Dispatching/AID-A2A-061 - Takeoff From Ship Runway Test/AID-A2A-061 - Takeoff From Ship Runway Test.miz differ diff --git a/AID - AI Dispatching/AID-A2A - AI A2A Dispatching/AID-A2A-070 - CAP - Player Exit/AID-070 - AI_A2A - CAP - Player Exit.lua b/AID - AI Dispatching/AID-A2A - AI A2A Dispatching/AID-A2A-070 - CAP - Player Exit/AID-070 - AI_A2A - CAP - Player Exit.lua new file mode 100644 index 0000000000..b5bd26d0f7 --- /dev/null +++ b/AID - AI Dispatching/AID-A2A - AI A2A Dispatching/AID-A2A-070 - CAP - Player Exit/AID-070 - AI_A2A - CAP - Player Exit.lua @@ -0,0 +1,39 @@ +--- +-- Name: AID-070 - AI_A2A - CAP - Player Exit +-- Author: FlightControl +-- Date Created: 30 Oct 2017 +-- +-- Test Scenario(s): +-- +-- Now take a seat in the client plane as a player. +-- Do the following tests after the plane has been spawned. +-- 1. Immediately exit the plane. +-- 2. Only exit the plane once the defender is engaged. +-- 3. Let the defender shoot you. +-- In all these scenarios, observe if the defender is continuing its patrol. + + +-- Define a SET_GROUP object that builds a collection of groups that define the EWR network. +-- Here we build the network with all the groups that have a name starting with DF CCCP AWACS and DF CCCP EWR. +DetectionSetGroup = SET_GROUP:New() +DetectionSetGroup:FilterPrefixes( { "DF CCCP AWACS", "DF CCCP EWR" } ) +DetectionSetGroup:FilterStart() + +Detection = DETECTION_AREAS:New( DetectionSetGroup, 30000 ) + +-- Setup the A2A dispatcher, and initialize it. +A2ADispatcher = AI_A2A_DISPATCHER:New( Detection ) + +A2ADispatcher:SetTacticalDisplay( true ) + + +-- Setup the squadrons. + +A2ADispatcher:SetSquadron( "Kras1", AIRBASE.Caucasus.Krasnodar_Pashkovsky, { "SQ CCCP SU-27" }, 20 ) +CAPZoneWest = ZONE_POLYGON:New( "CAP Zone West", GROUP:FindByName( "CAP Zone West" ) ) +A2ADispatcher:SetSquadronCap( "Kras1", CAPZoneWest, 4000, 8000, 600, 800, 800, 1200, "BARO" ) +A2ADispatcher:SetSquadronCapInterval( "Kras1", 1, 30, 120, 1 ) + +A2ADispatcher:SetDefaultTakeoffInAir() +A2ADispatcher:SetDefaultLandingNearAirbase() + diff --git a/AID - AI Dispatching/AID-A2A - AI A2A Dispatching/AID-A2A-070 - CAP - Player Exit/AID-A2A-070 - CAP - Player Exit.miz b/AID - AI Dispatching/AID-A2A - AI A2A Dispatching/AID-A2A-070 - CAP - Player Exit/AID-A2A-070 - CAP - Player Exit.miz index 605911bf86..874375155e 100644 Binary files a/AID - AI Dispatching/AID-A2A - AI A2A Dispatching/AID-A2A-070 - CAP - Player Exit/AID-A2A-070 - CAP - Player Exit.miz and b/AID - AI Dispatching/AID-A2A - AI A2A Dispatching/AID-A2A-070 - CAP - Player Exit/AID-A2A-070 - CAP - Player Exit.miz differ diff --git a/AID - AI Dispatching/AID-A2A - AI A2A Dispatching/AID-A2A-071 - GCI - Player Exit/AID-071 - AI_A2A - GCI - Player Exit.lua b/AID - AI Dispatching/AID-A2A - AI A2A Dispatching/AID-A2A-071 - GCI - Player Exit/AID-071 - AI_A2A - GCI - Player Exit.lua new file mode 100644 index 0000000000..0cb00283b4 --- /dev/null +++ b/AID - AI Dispatching/AID-A2A - AI A2A Dispatching/AID-A2A-071 - GCI - Player Exit/AID-071 - AI_A2A - GCI - Player Exit.lua @@ -0,0 +1,37 @@ +--- +-- Name: AID-071 - AI_A2A - GCI - Player Exit +-- Author: FlightControl +-- Date Created: 30 Oct 2017 +-- +-- Test Scenario(s): +-- +-- Now take a seat in the client plane as a player. +-- Do the following tests after the plane has been spawned. +-- 1. Immediately exit the plane. +-- 2. Only exit the plane once the defender is engaged. +-- 3. Let the defender shoot you. +-- In all these scenarios, observe if the defender is returning to base. + + +-- Define a SET_GROUP object that builds a collection of groups that define the EWR network. +-- Here we build the network with all the groups that have a name starting with DF CCCP AWACS and DF CCCP EWR. +DetectionSetGroup = SET_GROUP:New() +DetectionSetGroup:FilterPrefixes( { "DF CCCP AWACS", "DF CCCP EWR" } ) +DetectionSetGroup:FilterStart() + +Detection = DETECTION_AREAS:New( DetectionSetGroup, 30000 ) + +-- Setup the A2A dispatcher, and initialize it. +A2ADispatcher = AI_A2A_DISPATCHER:New( Detection ) + +A2ADispatcher:SetTacticalDisplay( true ) + + +-- Setup the squadrons. + +A2ADispatcher:SetSquadron( "Kras1", AIRBASE.Caucasus.Krasnodar_Pashkovsky, { "SQ CCCP SU-27" }, 20 ) +A2ADispatcher:SetSquadronGci( "Kras1", 800, 1200 ) + +A2ADispatcher:SetDefaultTakeoffInAir() +A2ADispatcher:SetDefaultLandingNearAirbase() + diff --git a/AID - AI Dispatching/AID-A2A - AI A2A Dispatching/AID-A2A-071 - GCI - Player Exit/AID-A2A-071 - GCI - Player Exit.miz b/AID - AI Dispatching/AID-A2A - AI A2A Dispatching/AID-A2A-071 - GCI - Player Exit/AID-A2A-071 - GCI - Player Exit.miz index 94188fac21..4ac42e0dbd 100644 Binary files a/AID - AI Dispatching/AID-A2A - AI A2A Dispatching/AID-A2A-071 - GCI - Player Exit/AID-A2A-071 - GCI - Player Exit.miz and b/AID - AI Dispatching/AID-A2A - AI A2A Dispatching/AID-A2A-071 - GCI - Player Exit/AID-A2A-071 - GCI - Player Exit.miz differ diff --git a/AID - AI Dispatching/AID-A2A - AI A2A Dispatching/AID-A2A-100 - Demonstration/AID-A2A-100 - Demonstration.lua b/AID - AI Dispatching/AID-A2A - AI A2A Dispatching/AID-A2A-100 - Demonstration/AID-A2A-100 - Demonstration.lua index 56550090d8..69280c1a0f 100644 --- a/AID - AI Dispatching/AID-A2A - AI A2A Dispatching/AID-A2A-100 - Demonstration/AID-A2A-100 - Demonstration.lua +++ b/AID - AI Dispatching/AID-A2A - AI A2A Dispatching/AID-A2A-100 - Demonstration/AID-A2A-100 - Demonstration.lua @@ -1,128 +1,128 @@ ---- --- Name: AID-A2A-100 - Demonstration --- Author: FlightControl --- Date Created: 30 May 2017 - - --- Define a SET_GROUP object that builds a collection of groups that define the EWR network. --- Here we build the network with all the groups that have a name starting with DF CCCP AWACS and DF CCCP EWR. -DetectionSetGroup = SET_GROUP:New() -DetectionSetGroup:FilterPrefixes( { "DF CCCP AWACS", "DF CCCP EWR" } ) -DetectionSetGroup:FilterStart() - -Detection = DETECTION_AREAS:New( DetectionSetGroup, 30000 ) - --- Setup the A2A dispatcher, and initialize it. -A2ADispatcher = AI_A2A_DISPATCHER:New( Detection ) - --- Enable the tactical display panel. -A2ADispatcher:SetTacticalDisplay( true ) - --- Initialize the dispatcher, setting up a border zone. This is a polygon, --- which takes the waypoints of a late activated group with the name CCCP Border as the boundaries of the border area. --- Any enemy crossing this border will be engaged. -CCCPBorderZone = ZONE_POLYGON:New( "CCCP Border", GROUP:FindByName( "CCCP Border" ) ) -A2ADispatcher:SetBorderZone( CCCPBorderZone ) - --- Initialize the dispatcher, setting up a radius of 100km where any airborne friendly --- without an assignment within 100km radius from a detected target, will engage that target. -A2ADispatcher:SetEngageRadius( 120000 ) - --- Setup the squadrons. -A2ADispatcher:SetSquadron( "Mineralnye", AIRBASE.Caucasus.Mineralnye_Vody, { "SQ CCCP SU-27", "SQ CCCP SU-33", "SQ CCCP MIG-23MLD", "SQ CCCP MIG-25PD" }, 16 ) -A2ADispatcher:SetSquadron( "Maykop", AIRBASE.Caucasus.Maykop_Khanskaya, { "SQ CCCP MIG-31" }, 20 ) -A2ADispatcher:SetSquadron( "Mozdok", AIRBASE.Caucasus.Mozdok, { "SQ CCCP MIG-31" }, 16 ) -A2ADispatcher:SetSquadron( "Sochi", AIRBASE.Caucasus.Sochi_Adler, { "SQ CCCP SU-27", "SQ CCCP SU-33", "SQ CCCP MIG-23MLD", "SQ CCCP MIG-25PD", "SQ CCCP SU-34", "SQ CCCP MIG-31", "SQ CCCP MIG-29S" }, 40 ) -A2ADispatcher:SetSquadron( "Novo", AIRBASE.Caucasus.Novorossiysk, { "SQ CCCP SU-27" }, 16 ) - --- Setup the overhead -A2ADispatcher:SetSquadronOverhead( "Mineralnye", 1.2 ) -A2ADispatcher:SetSquadronOverhead( "Maykop", 1 ) -A2ADispatcher:SetSquadronOverhead( "Mozdok", 1 ) -A2ADispatcher:SetSquadronOverhead( "Sochi", 2 ) -A2ADispatcher:SetSquadronOverhead( "Novo", 1.5 ) - --- Setup the Grouping -A2ADispatcher:SetSquadronGrouping( "Mineralnye", 4 ) -A2ADispatcher:SetSquadronGrouping( "Sochi", 2 ) -A2ADispatcher:SetSquadronGrouping( "Novo", 3 ) - --- Setup the Takeoff methods -A2ADispatcher:SetSquadronTakeoff( "Mineralnye", AI_A2A_DISPATCHER.Takeoff.Hot ) -A2ADispatcher:SetSquadronTakeoffFromParkingHot( "Sochi" ) -A2ADispatcher:SetSquadronTakeoffFromRunway( "Mozdok" ) -A2ADispatcher:SetSquadronTakeoffFromParkingCold( "Maykop" ) -A2ADispatcher:SetSquadronTakeoffFromParkingHot( "Novo" ) - --- Setup the Landing methods -A2ADispatcher:SetSquadronLandingAtRunway( "Mineralnye" ) -A2ADispatcher:SetSquadronLandingNearAirbase( "Sochi" ) -A2ADispatcher:SetSquadronLandingAtEngineShutdown( "Mozdok" ) -A2ADispatcher:SetSquadronLandingNearAirbase( "Maykop" ) -A2ADispatcher:SetSquadronLanding( "Novo", AI_A2A_DISPATCHER.Landing.AtRunway ) - - --- CAP Squadron execution. -CAPZoneEast = ZONE_POLYGON:New( "CAP Zone East", GROUP:FindByName( "CAP Zone East" ) ) -A2ADispatcher:SetSquadronCap( "Mineralnye", CAPZoneEast, 4000, 10000, 500, 600, 800, 900 ) -A2ADispatcher:SetSquadronCapInterval( "Mineralnye", 6, 30, 60, 1 ) - -CAPZoneWest = ZONE_POLYGON:New( "CAP Zone West", GROUP:FindByName( "CAP Zone West" ) ) -A2ADispatcher:SetSquadronCap( "Sochi", CAPZoneWest, 4000, 8000, 600, 800, 800, 1200, "BARO" ) -A2ADispatcher:SetSquadronCapInterval( "Sochi", 2, 30, 120, 1 ) - -CAPZoneMiddle = ZONE:New( "CAP Zone Middle") -A2ADispatcher:SetSquadronCap( "Maykop", CAPZoneMiddle, 4000, 8000, 600, 800, 800, 1200, "RADIO" ) -A2ADispatcher:SetSquadronCapInterval( "Sochi", 2, 30, 120, 1 ) - --- GCI Squadron execution. -A2ADispatcher:SetSquadronGci( "Mozdok", 900, 1200 ) -A2ADispatcher:SetSquadronGci( "Novo", 900, 2100 ) -A2ADispatcher:SetSquadronGci( "Maykop", 900, 1200 ) - --- Set the squadrons visible before startup. -A2ADispatcher:SetSquadronVisible( "Mineralnye" ) -A2ADispatcher:SetSquadronVisible( "Sochi" ) -A2ADispatcher:SetSquadronVisible( "Mozdok" ) -A2ADispatcher:SetSquadronVisible( "Maykop" ) ---A2ADispatcher:SetSquadronVisible( "Novo" ) - - ---CleanUp = CLEANUP_AIRBASE:New( { AIRBASE.Caucasus.Novorossiysk } ) - - --- Blue attack simulation -local Frequency = 300 - -BlueSpawn1 = SPAWN - :New( "RT NATO 1" ) - :InitLimit( 2, 10 ) - :InitRandomizeTemplate( { "SQ NATO A-10C", "SQ NATO F-15C", "SQ NATO F-16A", "SQ NATO F/A-18", "SQ NATO F-16C" } ) - :InitRandomizeRoute( 0, 0, 30000 ) - --:InitDelayOn() - :SpawnScheduled( Frequency, 0.4 ) - -BlueSpawn2 = SPAWN - :New( "RT NATO 2" ) - :InitLimit( 2, 10 ) - :InitRandomizeTemplate( { "SQ NATO A-10C", "SQ NATO F-15C", "SQ NATO F-16A", "SQ NATO F/A-18", "SQ NATO F-16C" } ) - :InitRandomizeRoute( 0, 0, 30000 ) - --:InitDelayOn() - :SpawnScheduled( Frequency, 0.4 ) - -BlueSpawn3 = SPAWN - :New( "RT NATO 3" ) - :InitLimit( 2, 10 ) - :InitRandomizeTemplate( { "SQ NATO A-10C", "SQ NATO F-15C", "SQ NATO F-16A", "SQ NATO F/A-18", "SQ NATO F-16C" } ) - :InitRandomizeRoute( 0, 0, 30000 ) - --:InitDelayOn() - :SpawnScheduled( Frequency, 0.4 ) - -BlueSpawn4 = SPAWN - :New( "RT NATO 4" ) - :InitLimit( 2, 10 ) - :InitRandomizeTemplate( { "SQ NATO A-10C", "SQ NATO F-15C", "SQ NATO F-16A", "SQ NATO F/A-18", "SQ NATO F-16C" } ) - :InitRandomizeRoute( 0, 0, 30000 ) - --:InitDelayOn() - :SpawnScheduled( Frequency, 0.4 ) - +--- +-- Name: AID-A2A-100 - Demonstration +-- Author: FlightControl +-- Date Created: 30 May 2017 + + +-- Define a SET_GROUP object that builds a collection of groups that define the EWR network. +-- Here we build the network with all the groups that have a name starting with DF CCCP AWACS and DF CCCP EWR. +DetectionSetGroup = SET_GROUP:New() +DetectionSetGroup:FilterPrefixes( { "DF CCCP AWACS", "DF CCCP EWR" } ) +DetectionSetGroup:FilterStart() + +Detection = DETECTION_AREAS:New( DetectionSetGroup, 30000 ) + +-- Setup the A2A dispatcher, and initialize it. +A2ADispatcher = AI_A2A_DISPATCHER:New( Detection ) + +-- Enable the tactical display panel. +A2ADispatcher:SetTacticalDisplay( true ) + +-- Initialize the dispatcher, setting up a border zone. This is a polygon, +-- which takes the waypoints of a late activated group with the name CCCP Border as the boundaries of the border area. +-- Any enemy crossing this border will be engaged. +CCCPBorderZone = ZONE_POLYGON:New( "CCCP Border", GROUP:FindByName( "CCCP Border" ) ) +A2ADispatcher:SetBorderZone( CCCPBorderZone ) + +-- Initialize the dispatcher, setting up a radius of 100km where any airborne friendly +-- without an assignment within 100km radius from a detected target, will engage that target. +A2ADispatcher:SetEngageRadius( 120000 ) + +-- Setup the squadrons. +A2ADispatcher:SetSquadron( "Mineralnye", AIRBASE.Caucasus.Mineralnye_Vody, { "SQ CCCP SU-27", "SQ CCCP SU-33", "SQ CCCP MIG-23MLD", "SQ CCCP MIG-25PD" }, 16 ) +A2ADispatcher:SetSquadron( "Maykop", AIRBASE.Caucasus.Maykop_Khanskaya, { "SQ CCCP MIG-31" }, 20 ) +A2ADispatcher:SetSquadron( "Mozdok", AIRBASE.Caucasus.Mozdok, { "SQ CCCP MIG-31" }, 16 ) +A2ADispatcher:SetSquadron( "Sochi", AIRBASE.Caucasus.Sochi_Adler, { "SQ CCCP SU-27", "SQ CCCP SU-33", "SQ CCCP MIG-23MLD", "SQ CCCP MIG-25PD", "SQ CCCP SU-34", "SQ CCCP MIG-31", "SQ CCCP MIG-29S" }, 40 ) +A2ADispatcher:SetSquadron( "Novo", AIRBASE.Caucasus.Novorossiysk, { "SQ CCCP SU-27" }, 16 ) + +-- Setup the overhead +A2ADispatcher:SetSquadronOverhead( "Mineralnye", 1.2 ) +A2ADispatcher:SetSquadronOverhead( "Maykop", 1 ) +A2ADispatcher:SetSquadronOverhead( "Mozdok", 1 ) +A2ADispatcher:SetSquadronOverhead( "Sochi", 2 ) +A2ADispatcher:SetSquadronOverhead( "Novo", 1.5 ) + +-- Setup the Grouping +A2ADispatcher:SetSquadronGrouping( "Mineralnye", 4 ) +A2ADispatcher:SetSquadronGrouping( "Sochi", 2 ) +A2ADispatcher:SetSquadronGrouping( "Novo", 3 ) + +-- Setup the Takeoff methods +A2ADispatcher:SetSquadronTakeoff( "Mineralnye", AI_A2A_DISPATCHER.Takeoff.Hot ) +A2ADispatcher:SetSquadronTakeoffFromParkingHot( "Sochi" ) +A2ADispatcher:SetSquadronTakeoffFromRunway( "Mozdok" ) +A2ADispatcher:SetSquadronTakeoffFromParkingCold( "Maykop" ) +A2ADispatcher:SetSquadronTakeoffFromParkingHot( "Novo" ) + +-- Setup the Landing methods +A2ADispatcher:SetSquadronLandingAtRunway( "Mineralnye" ) +A2ADispatcher:SetSquadronLandingNearAirbase( "Sochi" ) +A2ADispatcher:SetSquadronLandingAtEngineShutdown( "Mozdok" ) +A2ADispatcher:SetSquadronLandingNearAirbase( "Maykop" ) +A2ADispatcher:SetSquadronLanding( "Novo", AI_A2A_DISPATCHER.Landing.AtRunway ) + + +-- CAP Squadron execution. +CAPZoneEast = ZONE_POLYGON:New( "CAP Zone East", GROUP:FindByName( "CAP Zone East" ) ) +A2ADispatcher:SetSquadronCap( "Mineralnye", CAPZoneEast, 4000, 10000, 500, 600, 800, 900 ) +A2ADispatcher:SetSquadronCapInterval( "Mineralnye", 6, 30, 60, 1 ) + +CAPZoneWest = ZONE_POLYGON:New( "CAP Zone West", GROUP:FindByName( "CAP Zone West" ) ) +A2ADispatcher:SetSquadronCap( "Sochi", CAPZoneWest, 4000, 8000, 600, 800, 800, 1200, "BARO" ) +A2ADispatcher:SetSquadronCapInterval( "Sochi", 2, 30, 120, 1 ) + +CAPZoneMiddle = ZONE:New( "CAP Zone Middle") +A2ADispatcher:SetSquadronCap( "Maykop", CAPZoneMiddle, 4000, 8000, 600, 800, 800, 1200, "RADIO" ) +A2ADispatcher:SetSquadronCapInterval( "Sochi", 2, 30, 120, 1 ) + +-- GCI Squadron execution. +A2ADispatcher:SetSquadronGci( "Mozdok", 900, 1200 ) +A2ADispatcher:SetSquadronGci( "Novo", 900, 2100 ) +A2ADispatcher:SetSquadronGci( "Maykop", 900, 1200 ) + +-- Set the squadrons visible before startup. +A2ADispatcher:SetSquadronVisible( "Mineralnye" ) +A2ADispatcher:SetSquadronVisible( "Sochi" ) +A2ADispatcher:SetSquadronVisible( "Mozdok" ) +A2ADispatcher:SetSquadronVisible( "Maykop" ) +--A2ADispatcher:SetSquadronVisible( "Novo" ) + + +--CleanUp = CLEANUP_AIRBASE:New( { AIRBASE.Caucasus.Novorossiysk } ) + + +-- Blue attack simulation +local Frequency = 300 + +BlueSpawn1 = SPAWN + :New( "RT NATO 1" ) + :InitLimit( 2, 10 ) + :InitRandomizeTemplate( { "SQ NATO A-10C", "SQ NATO F-15C", "SQ NATO F-16A", "SQ NATO F/A-18", "SQ NATO F-16C" } ) + :InitRandomizeRoute( 0, 0, 30000 ) + --:InitDelayOn() + :SpawnScheduled( Frequency, 0.4 ) + +BlueSpawn2 = SPAWN + :New( "RT NATO 2" ) + :InitLimit( 2, 10 ) + :InitRandomizeTemplate( { "SQ NATO A-10C", "SQ NATO F-15C", "SQ NATO F-16A", "SQ NATO F/A-18", "SQ NATO F-16C" } ) + :InitRandomizeRoute( 0, 0, 30000 ) + --:InitDelayOn() + :SpawnScheduled( Frequency, 0.4 ) + +BlueSpawn3 = SPAWN + :New( "RT NATO 3" ) + :InitLimit( 2, 10 ) + :InitRandomizeTemplate( { "SQ NATO A-10C", "SQ NATO F-15C", "SQ NATO F-16A", "SQ NATO F/A-18", "SQ NATO F-16C" } ) + :InitRandomizeRoute( 0, 0, 30000 ) + --:InitDelayOn() + :SpawnScheduled( Frequency, 0.4 ) + +BlueSpawn4 = SPAWN + :New( "RT NATO 4" ) + :InitLimit( 2, 10 ) + :InitRandomizeTemplate( { "SQ NATO A-10C", "SQ NATO F-15C", "SQ NATO F-16A", "SQ NATO F/A-18", "SQ NATO F-16C" } ) + :InitRandomizeRoute( 0, 0, 30000 ) + --:InitDelayOn() + :SpawnScheduled( Frequency, 0.4 ) + diff --git a/AID - AI Dispatching/AID-A2A - AI A2A Dispatching/AID-A2A-100 - Demonstration/AID-A2A-100 - Demonstration.miz b/AID - AI Dispatching/AID-A2A - AI A2A Dispatching/AID-A2A-100 - Demonstration/AID-A2A-100 - Demonstration.miz index 8603fc1438..c0a18cafbf 100644 Binary files a/AID - AI Dispatching/AID-A2A - AI A2A Dispatching/AID-A2A-100 - Demonstration/AID-A2A-100 - Demonstration.miz and b/AID - AI Dispatching/AID-A2A - AI A2A Dispatching/AID-A2A-100 - Demonstration/AID-A2A-100 - Demonstration.miz differ diff --git a/AID - AI Dispatching/AID-A2A - AI A2A Dispatching/AID-A2A-190 - Communication/AID-A2A-190 - Communication.lua b/AID - AI Dispatching/AID-A2A - AI A2A Dispatching/AID-A2A-190 - Communication/AID-A2A-190 - Communication.lua index 6125a776c1..1fe69b2467 100644 --- a/AID - AI Dispatching/AID-A2A - AI A2A Dispatching/AID-A2A-190 - Communication/AID-A2A-190 - Communication.lua +++ b/AID - AI Dispatching/AID-A2A - AI A2A Dispatching/AID-A2A-190 - Communication/AID-A2A-190 - Communication.lua @@ -1,131 +1,131 @@ ---- --- Name: AID-A2A-100 - Demonstration --- Author: FlightControl --- Date Created: 30 May 2017 - - -local CommandCenter = COMMANDCENTER:New( GROUP:FindByName( "HQ" ), "HQ" ) - --- Define a SET_GROUP object that builds a collection of groups that define the EWR network. --- Here we build the network with all the groups that have a name starting with DF CCCP AWACS and DF CCCP EWR. -DetectionSetGroup = SET_GROUP:New() -DetectionSetGroup:FilterPrefixes( { "DF CCCP AWACS", "DF CCCP EWR" } ) -DetectionSetGroup:FilterStart() - -Detection = DETECTION_AREAS:New( DetectionSetGroup, 30000 ) - --- Setup the A2A dispatcher, and initialize it. -A2ADispatcher = AI_A2A_DISPATCHER:New( Detection ) -A2ADispatcher:SetCommandCenter(CommandCenter) - --- Enable the tactical display panel. -A2ADispatcher:SetTacticalDisplay( true ) - --- Initialize the dispatcher, setting up a border zone. This is a polygon, --- which takes the waypoints of a late activated group with the name CCCP Border as the boundaries of the border area. --- Any enemy crossing this border will be engaged. -CCCPBorderZone = ZONE_POLYGON:New( "CCCP Border", GROUP:FindByName( "CCCP Border" ) ) -A2ADispatcher:SetBorderZone( CCCPBorderZone ) - --- Initialize the dispatcher, setting up a radius of 100km where any airborne friendly --- without an assignment within 100km radius from a detected target, will engage that target. -A2ADispatcher:SetEngageRadius( 120000 ) - --- Setup the squadrons. -A2ADispatcher:SetSquadron( "Mineralnye", AIRBASE.Caucasus.Mineralnye_Vody, { "SQ CCCP SU-27", "SQ CCCP SU-33", "SQ CCCP MIG-23MLD", "SQ CCCP MIG-25PD" }, 16 ) -A2ADispatcher:SetSquadron( "Maykop", AIRBASE.Caucasus.Maykop_Khanskaya, { "SQ CCCP MIG-31" }, 20 ) -A2ADispatcher:SetSquadron( "Mozdok", AIRBASE.Caucasus.Mozdok, { "SQ CCCP MIG-31" }, 16 ) -A2ADispatcher:SetSquadron( "Sochi", AIRBASE.Caucasus.Sochi_Adler, { "SQ CCCP SU-27", "SQ CCCP SU-33", "SQ CCCP MIG-23MLD", "SQ CCCP MIG-25PD", "SQ CCCP SU-34", "SQ CCCP MIG-31", "SQ CCCP MIG-29S" }, 40 ) -A2ADispatcher:SetSquadron( "Novo", AIRBASE.Caucasus.Novorossiysk, { "SQ CCCP SU-27" }, 16 ) - --- Setup the overhead -A2ADispatcher:SetSquadronOverhead( "Mineralnye", 1.2 ) -A2ADispatcher:SetSquadronOverhead( "Maykop", 1 ) -A2ADispatcher:SetSquadronOverhead( "Mozdok", 1 ) -A2ADispatcher:SetSquadronOverhead( "Sochi", 2 ) -A2ADispatcher:SetSquadronOverhead( "Novo", 1.5 ) - --- Setup the Grouping -A2ADispatcher:SetSquadronGrouping( "Mineralnye", 4 ) -A2ADispatcher:SetSquadronGrouping( "Sochi", 2 ) -A2ADispatcher:SetSquadronGrouping( "Novo", 3 ) - --- Setup the Takeoff methods -A2ADispatcher:SetSquadronTakeoff( "Mineralnye", AI_A2A_DISPATCHER.Takeoff.Hot ) -A2ADispatcher:SetSquadronTakeoffFromParkingHot( "Sochi" ) -A2ADispatcher:SetSquadronTakeoffFromRunway( "Mozdok" ) -A2ADispatcher:SetSquadronTakeoffFromParkingCold( "Maykop" ) -A2ADispatcher:SetSquadronTakeoffFromParkingHot( "Novo" ) - --- Setup the Landing methods -A2ADispatcher:SetSquadronLandingAtRunway( "Mineralnye" ) -A2ADispatcher:SetSquadronLandingNearAirbase( "Sochi" ) -A2ADispatcher:SetSquadronLandingAtEngineShutdown( "Mozdok" ) -A2ADispatcher:SetSquadronLandingNearAirbase( "Maykop" ) -A2ADispatcher:SetSquadronLanding( "Novo", AI_A2A_DISPATCHER.Landing.AtRunway ) - - --- CAP Squadron execution. ---CAPZoneEast = ZONE_POLYGON:New( "CAP Zone East", GROUP:FindByName( "CAP Zone East" ) ) ---A2ADispatcher:SetSquadronCap( "Mineralnye", CAPZoneEast, 4000, 10000, 500, 600, 800, 900 ) ---A2ADispatcher:SetSquadronCapInterval( "Mineralnye", 6, 30, 60, 1 ) - ---CAPZoneWest = ZONE_POLYGON:New( "CAP Zone West", GROUP:FindByName( "CAP Zone West" ) ) ---A2ADispatcher:SetSquadronCap( "Sochi", CAPZoneWest, 4000, 8000, 600, 800, 800, 1200, "BARO" ) ---A2ADispatcher:SetSquadronCapInterval( "Sochi", 2, 30, 120, 1 ) - ---CAPZoneMiddle = ZONE:New( "CAP Zone Middle") ---A2ADispatcher:SetSquadronCap( "Maykop", CAPZoneMiddle, 4000, 8000, 600, 800, 800, 1200, "RADIO" ) ---A2ADispatcher:SetSquadronCapInterval( "Sochi", 2, 30, 120, 1 ) - --- GCI Squadron execution. -A2ADispatcher:SetSquadronGci( "Mozdok", 900, 1200 ) -A2ADispatcher:SetSquadronGci( "Novo", 900, 2100 ) -A2ADispatcher:SetSquadronGci( "Maykop", 900, 1200 ) - --- Set the squadrons visible before startup. ---A2ADispatcher:SetSquadronVisible( "Mineralnye" ) ---A2ADispatcher:SetSquadronVisible( "Sochi" ) ---A2ADispatcher:SetSquadronVisible( "Mozdok" ) ---A2ADispatcher:SetSquadronVisible( "Maykop" ) ---A2ADispatcher:SetSquadronVisible( "Novo" ) - - ---CleanUp = CLEANUP_AIRBASE:New( { AIRBASE.Caucasus.Novorossiysk } ) - - --- Blue attack simulation -local Frequency = 300 - -BlueSpawn1 = SPAWN - :New( "RT NATO 1" ) - :InitLimit( 2, 10 ) - :InitRandomizeTemplate( { "SQ NATO A-10C", "SQ NATO F-15C", "SQ NATO F-16A", "SQ NATO F/A-18", "SQ NATO F-16C" } ) - :InitRandomizeRoute( 0, 0, 30000 ) - --:InitDelayOn() - :SpawnScheduled( Frequency, 0.4 ) - -BlueSpawn2 = SPAWN - :New( "RT NATO 2" ) - :InitLimit( 2, 10 ) - :InitRandomizeTemplate( { "SQ NATO A-10C", "SQ NATO F-15C", "SQ NATO F-16A", "SQ NATO F/A-18", "SQ NATO F-16C" } ) - :InitRandomizeRoute( 0, 0, 30000 ) - --:InitDelayOn() - :SpawnScheduled( Frequency, 0.4 ) - -BlueSpawn3 = SPAWN - :New( "RT NATO 3" ) - :InitLimit( 2, 10 ) - :InitRandomizeTemplate( { "SQ NATO A-10C", "SQ NATO F-15C", "SQ NATO F-16A", "SQ NATO F/A-18", "SQ NATO F-16C" } ) - :InitRandomizeRoute( 0, 0, 30000 ) - --:InitDelayOn() - :SpawnScheduled( Frequency, 0.4 ) - -BlueSpawn4 = SPAWN - :New( "RT NATO 4" ) - :InitLimit( 2, 10 ) - :InitRandomizeTemplate( { "SQ NATO A-10C", "SQ NATO F-15C", "SQ NATO F-16A", "SQ NATO F/A-18", "SQ NATO F-16C" } ) - :InitRandomizeRoute( 0, 0, 30000 ) - --:InitDelayOn() - :SpawnScheduled( Frequency, 0.4 ) - +--- +-- Name: AID-A2A-100 - Demonstration +-- Author: FlightControl +-- Date Created: 30 May 2017 + + +local CommandCenter = COMMANDCENTER:New( GROUP:FindByName( "HQ" ), "HQ" ) + +-- Define a SET_GROUP object that builds a collection of groups that define the EWR network. +-- Here we build the network with all the groups that have a name starting with DF CCCP AWACS and DF CCCP EWR. +DetectionSetGroup = SET_GROUP:New() +DetectionSetGroup:FilterPrefixes( { "DF CCCP AWACS", "DF CCCP EWR" } ) +DetectionSetGroup:FilterStart() + +Detection = DETECTION_AREAS:New( DetectionSetGroup, 30000 ) + +-- Setup the A2A dispatcher, and initialize it. +A2ADispatcher = AI_A2A_DISPATCHER:New( Detection ) +A2ADispatcher:SetCommandCenter(CommandCenter) + +-- Enable the tactical display panel. +A2ADispatcher:SetTacticalDisplay( true ) + +-- Initialize the dispatcher, setting up a border zone. This is a polygon, +-- which takes the waypoints of a late activated group with the name CCCP Border as the boundaries of the border area. +-- Any enemy crossing this border will be engaged. +CCCPBorderZone = ZONE_POLYGON:New( "CCCP Border", GROUP:FindByName( "CCCP Border" ) ) +A2ADispatcher:SetBorderZone( CCCPBorderZone ) + +-- Initialize the dispatcher, setting up a radius of 100km where any airborne friendly +-- without an assignment within 100km radius from a detected target, will engage that target. +A2ADispatcher:SetEngageRadius( 120000 ) + +-- Setup the squadrons. +A2ADispatcher:SetSquadron( "Mineralnye", AIRBASE.Caucasus.Mineralnye_Vody, { "SQ CCCP SU-27", "SQ CCCP SU-33", "SQ CCCP MIG-23MLD", "SQ CCCP MIG-25PD" }, 16 ) +A2ADispatcher:SetSquadron( "Maykop", AIRBASE.Caucasus.Maykop_Khanskaya, { "SQ CCCP MIG-31" }, 20 ) +A2ADispatcher:SetSquadron( "Mozdok", AIRBASE.Caucasus.Mozdok, { "SQ CCCP MIG-31" }, 16 ) +A2ADispatcher:SetSquadron( "Sochi", AIRBASE.Caucasus.Sochi_Adler, { "SQ CCCP SU-27", "SQ CCCP SU-33", "SQ CCCP MIG-23MLD", "SQ CCCP MIG-25PD", "SQ CCCP SU-34", "SQ CCCP MIG-31", "SQ CCCP MIG-29S" }, 40 ) +A2ADispatcher:SetSquadron( "Novo", AIRBASE.Caucasus.Novorossiysk, { "SQ CCCP SU-27" }, 16 ) + +-- Setup the overhead +A2ADispatcher:SetSquadronOverhead( "Mineralnye", 1.2 ) +A2ADispatcher:SetSquadronOverhead( "Maykop", 1 ) +A2ADispatcher:SetSquadronOverhead( "Mozdok", 1 ) +A2ADispatcher:SetSquadronOverhead( "Sochi", 2 ) +A2ADispatcher:SetSquadronOverhead( "Novo", 1.5 ) + +-- Setup the Grouping +A2ADispatcher:SetSquadronGrouping( "Mineralnye", 4 ) +A2ADispatcher:SetSquadronGrouping( "Sochi", 2 ) +A2ADispatcher:SetSquadronGrouping( "Novo", 3 ) + +-- Setup the Takeoff methods +A2ADispatcher:SetSquadronTakeoff( "Mineralnye", AI_A2A_DISPATCHER.Takeoff.Hot ) +A2ADispatcher:SetSquadronTakeoffFromParkingHot( "Sochi" ) +A2ADispatcher:SetSquadronTakeoffFromRunway( "Mozdok" ) +A2ADispatcher:SetSquadronTakeoffFromParkingCold( "Maykop" ) +A2ADispatcher:SetSquadronTakeoffFromParkingHot( "Novo" ) + +-- Setup the Landing methods +A2ADispatcher:SetSquadronLandingAtRunway( "Mineralnye" ) +A2ADispatcher:SetSquadronLandingNearAirbase( "Sochi" ) +A2ADispatcher:SetSquadronLandingAtEngineShutdown( "Mozdok" ) +A2ADispatcher:SetSquadronLandingNearAirbase( "Maykop" ) +A2ADispatcher:SetSquadronLanding( "Novo", AI_A2A_DISPATCHER.Landing.AtRunway ) + + +-- CAP Squadron execution. +--CAPZoneEast = ZONE_POLYGON:New( "CAP Zone East", GROUP:FindByName( "CAP Zone East" ) ) +--A2ADispatcher:SetSquadronCap( "Mineralnye", CAPZoneEast, 4000, 10000, 500, 600, 800, 900 ) +--A2ADispatcher:SetSquadronCapInterval( "Mineralnye", 6, 30, 60, 1 ) + +--CAPZoneWest = ZONE_POLYGON:New( "CAP Zone West", GROUP:FindByName( "CAP Zone West" ) ) +--A2ADispatcher:SetSquadronCap( "Sochi", CAPZoneWest, 4000, 8000, 600, 800, 800, 1200, "BARO" ) +--A2ADispatcher:SetSquadronCapInterval( "Sochi", 2, 30, 120, 1 ) + +--CAPZoneMiddle = ZONE:New( "CAP Zone Middle") +--A2ADispatcher:SetSquadronCap( "Maykop", CAPZoneMiddle, 4000, 8000, 600, 800, 800, 1200, "RADIO" ) +--A2ADispatcher:SetSquadronCapInterval( "Sochi", 2, 30, 120, 1 ) + +-- GCI Squadron execution. +A2ADispatcher:SetSquadronGci( "Mozdok", 900, 1200 ) +A2ADispatcher:SetSquadronGci( "Novo", 900, 2100 ) +A2ADispatcher:SetSquadronGci( "Maykop", 900, 1200 ) + +-- Set the squadrons visible before startup. +--A2ADispatcher:SetSquadronVisible( "Mineralnye" ) +--A2ADispatcher:SetSquadronVisible( "Sochi" ) +--A2ADispatcher:SetSquadronVisible( "Mozdok" ) +--A2ADispatcher:SetSquadronVisible( "Maykop" ) +--A2ADispatcher:SetSquadronVisible( "Novo" ) + + +--CleanUp = CLEANUP_AIRBASE:New( { AIRBASE.Caucasus.Novorossiysk } ) + + +-- Blue attack simulation +local Frequency = 300 + +BlueSpawn1 = SPAWN + :New( "RT NATO 1" ) + :InitLimit( 2, 10 ) + :InitRandomizeTemplate( { "SQ NATO A-10C", "SQ NATO F-15C", "SQ NATO F-16A", "SQ NATO F/A-18", "SQ NATO F-16C" } ) + :InitRandomizeRoute( 0, 0, 30000 ) + --:InitDelayOn() + :SpawnScheduled( Frequency, 0.4 ) + +BlueSpawn2 = SPAWN + :New( "RT NATO 2" ) + :InitLimit( 2, 10 ) + :InitRandomizeTemplate( { "SQ NATO A-10C", "SQ NATO F-15C", "SQ NATO F-16A", "SQ NATO F/A-18", "SQ NATO F-16C" } ) + :InitRandomizeRoute( 0, 0, 30000 ) + --:InitDelayOn() + :SpawnScheduled( Frequency, 0.4 ) + +BlueSpawn3 = SPAWN + :New( "RT NATO 3" ) + :InitLimit( 2, 10 ) + :InitRandomizeTemplate( { "SQ NATO A-10C", "SQ NATO F-15C", "SQ NATO F-16A", "SQ NATO F/A-18", "SQ NATO F-16C" } ) + :InitRandomizeRoute( 0, 0, 30000 ) + --:InitDelayOn() + :SpawnScheduled( Frequency, 0.4 ) + +BlueSpawn4 = SPAWN + :New( "RT NATO 4" ) + :InitLimit( 2, 10 ) + :InitRandomizeTemplate( { "SQ NATO A-10C", "SQ NATO F-15C", "SQ NATO F-16A", "SQ NATO F/A-18", "SQ NATO F-16C" } ) + :InitRandomizeRoute( 0, 0, 30000 ) + --:InitDelayOn() + :SpawnScheduled( Frequency, 0.4 ) + diff --git a/AID - AI Dispatching/AID-A2A - AI A2A Dispatching/AID-A2A-190 - Communication/AID-A2A-190 - Communication.miz b/AID - AI Dispatching/AID-A2A - AI A2A Dispatching/AID-A2A-190 - Communication/AID-A2A-190 - Communication.miz index 9eb9d3b216..95977f010a 100644 Binary files a/AID - AI Dispatching/AID-A2A - AI A2A Dispatching/AID-A2A-190 - Communication/AID-A2A-190 - Communication.miz and b/AID - AI Dispatching/AID-A2A - AI A2A Dispatching/AID-A2A-190 - Communication/AID-A2A-190 - Communication.miz differ diff --git a/AID - AI Dispatching/AID-A2A - AI A2A Dispatching/AID-A2A-200 - GCICAP Demonstration/AID-A2A-200 - GCICAP Demonstration.lua b/AID - AI Dispatching/AID-A2A - AI A2A Dispatching/AID-A2A-200 - GCICAP Demonstration/AID-A2A-200 - GCICAP Demonstration.lua index aa673655d9..792429dff1 100644 --- a/AID - AI Dispatching/AID-A2A - AI A2A Dispatching/AID-A2A-200 - GCICAP Demonstration/AID-A2A-200 - GCICAP Demonstration.lua +++ b/AID - AI Dispatching/AID-A2A - AI A2A Dispatching/AID-A2A-200 - GCICAP Demonstration/AID-A2A-200 - GCICAP Demonstration.lua @@ -1,75 +1,75 @@ ---- --- Name: AID-A2A-200 - GCICAP Demonstration --- Author: FlightControl --- Date Created: 05 July 2017 - - --- Setup the A2A dispatcher, and initialize it. -A2ADispatcher = AI_A2A_GCICAP:New( { "DF CCCP" }, { "SQ CCCP" }, { "CAP Zone" }, 2 ) - --- Enable the tactical display panel. -A2ADispatcher:SetTacticalDisplay( true ) - --- Initialize the dispatcher, setting up a border zone. This is a polygon, --- which takes the waypoints of a late activated group with the name CCCP Border as the boundaries of the border area. --- Any enemy crossing this border will be engaged. -CCCPBorderZone = ZONE_POLYGON:New( "CCCP Border", GROUP:FindByName( "CCCP Border" ) ) -A2ADispatcher:SetBorderZone( CCCPBorderZone ) - - - -A2ADispatcher:SetDefaultTakeoffFromParkingCold() -A2ADispatcher:SetDefaultLandingAtEngineShutdown() -A2ADispatcher:SetDefaultFuelThreshold( 0.20 ) -A2ADispatcher:SetIntercept( 100 ) -A2ADispatcher:SetDisengageRadius( 100000 ) -A2ADispatcher:SetEngageRadius( 50000 ) -A2ADispatcher:SetGciRadius( 100000 ) - -A2ADispatcher:Start() - -------------------------------- - - - - - - - - - --- Blue attack simulation -local Frequency = 600 - -BlueSpawn1 = SPAWN - :New( "RT NATO 1" ) - :InitLimit( 2, 3 ) - :InitRandomizeTemplate( { "SQ NATO A-10C", "SQ NATO F-15C", "SQ NATO F-16A", "SQ NATO F/A-18", "SQ NATO F-16C" } ) - :InitRandomizeRoute( 0, 0, 30000 ) - --:InitDelayOn() - :SpawnScheduled( Frequency, 0.4 ) - -BlueSpawn2 = SPAWN - :New( "RT NATO 2" ) - :InitLimit( 2, 3 ) - :InitRandomizeTemplate( { "SQ NATO A-10C", "SQ NATO F-15C", "SQ NATO F-16A", "SQ NATO F/A-18", "SQ NATO F-16C" } ) - :InitRandomizeRoute( 0, 0, 30000 ) - --:InitDelayOn() - :SpawnScheduled( Frequency, 0.4 ) - -BlueSpawn3 = SPAWN - :New( "RT NATO 3" ) - :InitLimit( 2, 3 ) - :InitRandomizeTemplate( { "SQ NATO A-10C", "SQ NATO F-15C", "SQ NATO F-16A", "SQ NATO F/A-18", "SQ NATO F-16C" } ) - :InitRandomizeRoute( 0, 0, 30000 ) - --:InitDelayOn() - :SpawnScheduled( Frequency, 0.4 ) - -BlueSpawn4 = SPAWN - :New( "RT NATO 4" ) - :InitLimit( 2, 3 ) - :InitRandomizeTemplate( { "SQ NATO A-10C", "SQ NATO F-15C", "SQ NATO F-16A", "SQ NATO F/A-18", "SQ NATO F-16C" } ) - :InitRandomizeRoute( 0, 0, 30000 ) - --:InitDelayOn() - :SpawnScheduled( Frequency, 0.4 ) - +--- +-- Name: AID-A2A-200 - GCICAP Demonstration +-- Author: FlightControl +-- Date Created: 05 July 2017 + + +-- Setup the A2A dispatcher, and initialize it. +A2ADispatcher = AI_A2A_GCICAP:New( { "DF CCCP" }, { "SQ CCCP" }, { "CAP Zone" }, 2 ) + +-- Enable the tactical display panel. +A2ADispatcher:SetTacticalDisplay( true ) + +-- Initialize the dispatcher, setting up a border zone. This is a polygon, +-- which takes the waypoints of a late activated group with the name CCCP Border as the boundaries of the border area. +-- Any enemy crossing this border will be engaged. +CCCPBorderZone = ZONE_POLYGON:New( "CCCP Border", GROUP:FindByName( "CCCP Border" ) ) +A2ADispatcher:SetBorderZone( CCCPBorderZone ) + + + +A2ADispatcher:SetDefaultTakeoffFromParkingCold() +A2ADispatcher:SetDefaultLandingAtEngineShutdown() +A2ADispatcher:SetDefaultFuelThreshold( 0.20 ) +A2ADispatcher:SetIntercept( 100 ) +A2ADispatcher:SetDisengageRadius( 100000 ) +A2ADispatcher:SetEngageRadius( 50000 ) +A2ADispatcher:SetGciRadius( 100000 ) + +A2ADispatcher:Start() + +------------------------------- + + + + + + + + + +-- Blue attack simulation +local Frequency = 600 + +BlueSpawn1 = SPAWN + :New( "RT NATO 1" ) + :InitLimit( 2, 3 ) + :InitRandomizeTemplate( { "SQ NATO A-10C", "SQ NATO F-15C", "SQ NATO F-16A", "SQ NATO F/A-18", "SQ NATO F-16C" } ) + :InitRandomizeRoute( 0, 0, 30000 ) + --:InitDelayOn() + :SpawnScheduled( Frequency, 0.4 ) + +BlueSpawn2 = SPAWN + :New( "RT NATO 2" ) + :InitLimit( 2, 3 ) + :InitRandomizeTemplate( { "SQ NATO A-10C", "SQ NATO F-15C", "SQ NATO F-16A", "SQ NATO F/A-18", "SQ NATO F-16C" } ) + :InitRandomizeRoute( 0, 0, 30000 ) + --:InitDelayOn() + :SpawnScheduled( Frequency, 0.4 ) + +BlueSpawn3 = SPAWN + :New( "RT NATO 3" ) + :InitLimit( 2, 3 ) + :InitRandomizeTemplate( { "SQ NATO A-10C", "SQ NATO F-15C", "SQ NATO F-16A", "SQ NATO F/A-18", "SQ NATO F-16C" } ) + :InitRandomizeRoute( 0, 0, 30000 ) + --:InitDelayOn() + :SpawnScheduled( Frequency, 0.4 ) + +BlueSpawn4 = SPAWN + :New( "RT NATO 4" ) + :InitLimit( 2, 3 ) + :InitRandomizeTemplate( { "SQ NATO A-10C", "SQ NATO F-15C", "SQ NATO F-16A", "SQ NATO F/A-18", "SQ NATO F-16C" } ) + :InitRandomizeRoute( 0, 0, 30000 ) + --:InitDelayOn() + :SpawnScheduled( Frequency, 0.4 ) + diff --git a/AID - AI Dispatching/AID-A2A - AI A2A Dispatching/AID-A2A-200 - GCICAP Demonstration/AID-A2A-200 - GCICAP Demonstration.miz b/AID - AI Dispatching/AID-A2A - AI A2A Dispatching/AID-A2A-200 - GCICAP Demonstration/AID-A2A-200 - GCICAP Demonstration.miz index 482dd355ca..3bfbb114bc 100644 Binary files a/AID - AI Dispatching/AID-A2A - AI A2A Dispatching/AID-A2A-200 - GCICAP Demonstration/AID-A2A-200 - GCICAP Demonstration.miz and b/AID - AI Dispatching/AID-A2A - AI A2A Dispatching/AID-A2A-200 - GCICAP Demonstration/AID-A2A-200 - GCICAP Demonstration.miz differ diff --git a/AID - AI Dispatching/AID-A2A - AI A2A Dispatching/AID-A2A-210 - GCICAP Demonstration/AID-210 - NTTR AI_A2A_GCICAP Demonstration.lua b/AID - AI Dispatching/AID-A2A - AI A2A Dispatching/AID-A2A-210 - GCICAP Demonstration/AID-210 - NTTR AI_A2A_GCICAP Demonstration.lua new file mode 100644 index 0000000000..4bf78b201f --- /dev/null +++ b/AID - AI Dispatching/AID-A2A - AI A2A Dispatching/AID-A2A-210 - GCICAP Demonstration/AID-210 - NTTR AI_A2A_GCICAP Demonstration.lua @@ -0,0 +1,54 @@ + + +-- RED + +--- Setup the Red Coalition A2A GCICAP dispatcher, and initialize it. +A2A_GCICAP_Red = AI_A2A_GCICAP:New( { "RED EWR" }, { "4477th" }, { }, 2 ) + +A2A_GCICAP_Red:SetBorderZone( ZONE_POLYGON:New( "Red Border", GROUP:FindByName( "Red Border" ) ) ) + +-- Enable the tactical display panel. This is to see what this dispatcher is doing. +--A2A_GCICAP_Red:SetTacticalDisplay( true ) + + +-- Initialize the dispatcher, setting up a radius of 150km where any airborne friendly +-- without an assignment within 150km radius from a detected target, will engage that target. +A2A_GCICAP_Red:SetEngageRadius( 150000 ) + +-- The default take-off method is planes takeoff right in the air. +-- Here we specify to take off from a parking space, with engines already running. +A2A_GCICAP_Red:SetSquadronTakeoffFromParkingHot( AIRBASE.Nevada.Tonopah_Test_Range_Airfield ) +--A2A_GCICAP_Red:SetSquadronTakeoffFromParkingHot( "Groom Lake AFB" ) + + +-- BLUE + + +--- Setup the Red Coalition A2A GCICAP dispatcher, and initialize it. +-- EWR network groups start with BLUE EWR. +-- Squadron templates which are placed above the colored airbase, start with 104th or 105th or 106th. +-- Perform CAP in a polygon zone placed near 104th, which is Nellis. +-- Perform 2 CAP. +A2A_GCICAP_Blue = AI_A2A_GCICAP:New( { "BLUE EWR" }, { "104th", "105th", "106th" }, { "104th CAP" }, 2 ) + +A2A_GCICAP_Blue:SetBorderZone( ZONE_POLYGON:New( "Blue Border", GROUP:FindByName( "Blue Border" ) ) ) + +-- Enable the tactical display panel. This is to see what this dispatcher is doing. +--A2A_GCICAP_Blue:SetTacticalDisplay( true ) + + +-- Initialize the dispatcher, setting up a radius of 150km where any airborne friendly +-- without an assignment within 150km radius from a detected target, will engage that target. +A2A_GCICAP_Blue:SetEngageRadius( 150000 ) + +-- The default take-off method is planes takeoff right in the air. +-- Here we specify other take off options. +A2A_GCICAP_Blue:SetSquadronTakeoffFromRunway( AIRBASE.Nevada.Boulder_City_Airport ) -- Takeoff from the runway. +A2A_GCICAP_Blue:SetSquadronTakeoffFromParkingCold( AIRBASE.Nevada.McCarran_International_Airport ) -- Takeoff from parking spot, with engines shut off. +--A2A_GCICAP_Blue:SetSquadronTakeoffFromParkingHot( AIRBASE.Nevada.Nellis_AFB ) -- Takaeoff from parking spot, engines running. + +-- The Nellis airbase contains a squadron that flies an F-5... Less modern airplane. +-- So it needs a stronger "overhead". +A2A_GCICAP_Blue:SetSquadronOverhead( AIRBASE.Nevada.Nellis_AFB, 2 ) -- When 2 airplanes are attacking, we spawn 4 airplanes for defense. +A2A_GCICAP_Blue:SetSquadronGrouping( AIRBASE.Nevada.Nellis_AFB, 2 ) -- We group the spawned defence airplanes per 2 units. + diff --git a/AID - AI Dispatching/AID-A2A - AI A2A Dispatching/AID-A2A-210 - GCICAP Demonstration/AID-A2A-210 - GCICAP Demonstration.miz b/AID - AI Dispatching/AID-A2A - AI A2A Dispatching/AID-A2A-210 - GCICAP Demonstration/AID-A2A-210 - GCICAP Demonstration.miz index 1c3b3ca5c7..39d73aae19 100644 Binary files a/AID - AI Dispatching/AID-A2A - AI A2A Dispatching/AID-A2A-210 - GCICAP Demonstration/AID-A2A-210 - GCICAP Demonstration.miz and b/AID - AI Dispatching/AID-A2A - AI A2A Dispatching/AID-A2A-210 - GCICAP Demonstration/AID-A2A-210 - GCICAP Demonstration.miz differ diff --git a/AID - AI Dispatching/AID-A2A - AI A2A Dispatching/AID-A2A-210 - GCICAP Demonstration/NTTR AI_A2A_GCICAP Test.lua b/AID - AI Dispatching/AID-A2A - AI A2A Dispatching/AID-A2A-210 - GCICAP Demonstration/NTTR AI_A2A_GCICAP Test.lua new file mode 100644 index 0000000000..4bf78b201f --- /dev/null +++ b/AID - AI Dispatching/AID-A2A - AI A2A Dispatching/AID-A2A-210 - GCICAP Demonstration/NTTR AI_A2A_GCICAP Test.lua @@ -0,0 +1,54 @@ + + +-- RED + +--- Setup the Red Coalition A2A GCICAP dispatcher, and initialize it. +A2A_GCICAP_Red = AI_A2A_GCICAP:New( { "RED EWR" }, { "4477th" }, { }, 2 ) + +A2A_GCICAP_Red:SetBorderZone( ZONE_POLYGON:New( "Red Border", GROUP:FindByName( "Red Border" ) ) ) + +-- Enable the tactical display panel. This is to see what this dispatcher is doing. +--A2A_GCICAP_Red:SetTacticalDisplay( true ) + + +-- Initialize the dispatcher, setting up a radius of 150km where any airborne friendly +-- without an assignment within 150km radius from a detected target, will engage that target. +A2A_GCICAP_Red:SetEngageRadius( 150000 ) + +-- The default take-off method is planes takeoff right in the air. +-- Here we specify to take off from a parking space, with engines already running. +A2A_GCICAP_Red:SetSquadronTakeoffFromParkingHot( AIRBASE.Nevada.Tonopah_Test_Range_Airfield ) +--A2A_GCICAP_Red:SetSquadronTakeoffFromParkingHot( "Groom Lake AFB" ) + + +-- BLUE + + +--- Setup the Red Coalition A2A GCICAP dispatcher, and initialize it. +-- EWR network groups start with BLUE EWR. +-- Squadron templates which are placed above the colored airbase, start with 104th or 105th or 106th. +-- Perform CAP in a polygon zone placed near 104th, which is Nellis. +-- Perform 2 CAP. +A2A_GCICAP_Blue = AI_A2A_GCICAP:New( { "BLUE EWR" }, { "104th", "105th", "106th" }, { "104th CAP" }, 2 ) + +A2A_GCICAP_Blue:SetBorderZone( ZONE_POLYGON:New( "Blue Border", GROUP:FindByName( "Blue Border" ) ) ) + +-- Enable the tactical display panel. This is to see what this dispatcher is doing. +--A2A_GCICAP_Blue:SetTacticalDisplay( true ) + + +-- Initialize the dispatcher, setting up a radius of 150km where any airborne friendly +-- without an assignment within 150km radius from a detected target, will engage that target. +A2A_GCICAP_Blue:SetEngageRadius( 150000 ) + +-- The default take-off method is planes takeoff right in the air. +-- Here we specify other take off options. +A2A_GCICAP_Blue:SetSquadronTakeoffFromRunway( AIRBASE.Nevada.Boulder_City_Airport ) -- Takeoff from the runway. +A2A_GCICAP_Blue:SetSquadronTakeoffFromParkingCold( AIRBASE.Nevada.McCarran_International_Airport ) -- Takeoff from parking spot, with engines shut off. +--A2A_GCICAP_Blue:SetSquadronTakeoffFromParkingHot( AIRBASE.Nevada.Nellis_AFB ) -- Takaeoff from parking spot, engines running. + +-- The Nellis airbase contains a squadron that flies an F-5... Less modern airplane. +-- So it needs a stronger "overhead". +A2A_GCICAP_Blue:SetSquadronOverhead( AIRBASE.Nevada.Nellis_AFB, 2 ) -- When 2 airplanes are attacking, we spawn 4 airplanes for defense. +A2A_GCICAP_Blue:SetSquadronGrouping( AIRBASE.Nevada.Nellis_AFB, 2 ) -- We group the spawned defence airplanes per 2 units. + diff --git a/AID - AI Dispatching/AID-A2A - AI A2A Dispatching/AID-A2A-210 - GCICAP Demonstration/TAC_NTTR_V.2A_GCICAP_SCRIPT.lua b/AID - AI Dispatching/AID-A2A - AI A2A Dispatching/AID-A2A-210 - GCICAP Demonstration/TAC_NTTR_V.2A_GCICAP_SCRIPT.lua new file mode 100644 index 0000000000..1e9fb1e07b --- /dev/null +++ b/AID - AI Dispatching/AID-A2A - AI A2A Dispatching/AID-A2A-210 - GCICAP Demonstration/TAC_NTTR_V.2A_GCICAP_SCRIPT.lua @@ -0,0 +1,1748 @@ +--[[ +Copyright (c) 2016 Snafu, Stonehouse, Rivvern, Chameleon Silk, lukrop. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute copies of the Software, +and to permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software and the Software shall not be +included in whole or part in any sort of paid for software or paid for downloadable +content (DLC) without the express permission of the copyright holders. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +]] + +--[[-- +## Overview +Autonomous GCI and CAP script for DCS: World. +The script provides an autonomous model of combat air patrols and ground controlled +interceptors for use with DCS World by mission builders. + +After minimal setup the script will automatically spawn CAP and GCI flights for two +sides and give them patrol and intercept tasks as well as returning them to base when +threats cease to be detected. + +Originally created by Snafu, enhanced and further modified by Stonehouse, +Rivvern, Chameleon Silk. + +Rewritten by lukrop. + +## Links + +Github repository: + +@script GCICAP +@author Snafu +@author Stonehouse +@author Rivvern +@author Chameleon Silk +@author lukrop +@copyright 2016 Snafu, Stonehouse, Rivvern, Chameleon Silk, lukrop. +@license Modified MIT. See LICENSE file. +]] + +gcicap = {} +gcicap.red = {} +gcicap.red.gci = {} +gcicap.red.cap = {} +gcicap.blue = {} +gcicap.blue.gci = {} +gcicap.blue.cap = {} +gcicap.cap = {} +gcicap.gci = {} + +--- Sets how verbose the log output will be. +-- Possible values are "none", "info", "warning" and "error". +-- I recommend "error" for production. +gcicap.log_level = "error" + +--- Interval, in seconds, of main function. +-- Default 30 seconds. +gcicap.interval = 30 + +--- Interval, in seconds, GCI flights get vectors on targets. +-- AI GCI flights don't use their radar, to be as stealth as +-- possible, relying on those vectors. +-- Default 15 seconds. +gcicap.vector_interval = 15 + +--- How far does a target have to move before an intercept is revectored +gcicap.revector_threshold = 15000 + +--- Initial spawn delay between CAPs +-- Default 30 seconds. +gcicap.initial_spawn_delay = 30 + +--- Enable/disable borders for the red side. +-- CAP units only engage if enemy units intrude their airspace +gcicap.red.borders_enabled = true + +--- Enable/disable borders for the blue side. +-- CAP units only engage if enemy units intrude their airspace +gcicap.blue.borders_enabled = true + +--- CAP minimum altitudes in meters. +-- Default 4500 +gcicap.cap.min_alt = 6100 + +--- CAP maximum altitudes in meters. +-- Default 7500 +gcicap.cap.max_alt = 10500 + +--- Speed for CAP flights on their CAP route. +-- speed is in m/s. Default 220. +gcicap.cap.speed = 220 + +--- Speed for GCI flights on intercept +-- speed is in m/s. Default 300. +gcicap.gci.speed = 300 + +--- Maximum engage distance for CAP flights as long as they are on patrol. +-- this might be overruled by an intercept vector given from +-- ground control (EWR). Default 15000. +gcicap.cap.max_engage_distance = 15000 + +--- Minimum red CAP VUL time in minutes. +-- Minimum time the red CAP flight will orbit on station. +gcicap.red.cap.vul_time_min = 25 + +--- Maximum red CAP VUL time in minutes. +-- Maximum time the red CAP flight will orbit on station. +gcicap.red.cap.vul_time_max = 40 + +--- Minimum blue CAP VUL time in minutes. +gcicap.blue.cap.vul_time_min = 25 + +--- Maximum blue CAP VUL time in minutes. +gcicap.blue.cap.vul_time_max = 30 + +--- Use race-track orbit for CAP flights +-- If true CAPs will use a race-track pattern for orbit +-- between two points in the CAP zone. +gcicap.cap.race_track_orbit = false + +--[[ INOP at the time +--- Minimum leg length for red CAP orbits in meters. +gcicap.red.cap.leg_min = 10000 + +--- Maximum leg length for red CAP orbits in meters. +gcicap.red.cap.leg_min = 20000 + +--- Minimum leg length for blue CAP orbits in meters. +gcicap.blue.cap.leg_min = 10000 + +--- Maximum leg length for blue CAP orbits in meters. +gcicap.blue.cap.leg_min = 20000 +]]-- + +--- Enable/disable red CAP flights airborne start. +-- set to true for CAP flight to start airborne at script initialisation +-- (mission start), false for taking off from the airfield. +-- Default true. +gcicap.red.cap.start_airborne = false + +--- Enable/disable blue CAP flights airborne start. +gcicap.blue.cap.start_airborne = false + +--- Amount of red CAP zones. +-- placed with triggerzones in the ME. +gcicap.red.cap.zones_count = 4 + +--- Amount of blue CAP zones. +gcicap.blue.cap.zones_count = 4 + +--- Amount of red CAP groups concurrently in the air. +gcicap.red.cap.groups_count = 3 + +--- Amount of blue CAP groups concurrently in the air. +gcicap.blue.cap.groups_count = 2 + +--- Group size of red CAP flights. +-- Can be "2", "4" or "randomized" +-- +-- If "2" it consists of 2 planes, if "4" it consists of 4 planes +-- if "randomized", the CAP groups consist of either 2 or 4 planes +gcicap.red.cap.group_size = "randomized" + +--- Group size of blue CAP flights. +-- See @{gcicap.red.cap.group_size} +gcicap.blue.cap.group_size = "4" + +--- Maximum amount of concurrent red intercepts. +gcicap.red.gci.groups_count = 3 + +--- Maximum amount of concurrent blue intercepts. +gcicap.blue.gci.groups_count = 2 + +--- Group size of red GCI flights. +-- Can be "2", "4" or "dynamic" +-- +-- If "2" it consists of 2 planes, if "4" it consists of 4 planes +-- if "dynamic", the GCI groups consist of as much aircrafts +-- as the intruder group. +gcicap.red.gci.group_size = "dynamic" + +--- Group size of blue GCI flights. +-- See @{gcicap.red.gci.group_size} +gcicap.blue.gci.group_size = "dynamic" + +--- Enable/disable GCI messages for red +gcicap.red.gci.messages = false + +--- Enable/disable GCI messages for blue +gcicap.blue.gci.messages = false + +--- How long a GCI message will be shown in seconds. +gcicap.gci.message_time = 5 + +--- Display GCI messages with metric measurment for red. +-- If false the imperial system is used. +gcicap.red.gci.messages_metric = true + +--- Display GCI messages with metric measurment for blue. +-- If false the imperial system is used. +gcicap.blue.gci.messages_metric = false + +--- Names of red groups which will receive GCI messages. +-- Leave blank for all groups of coalition +-- @usage gcicap.red.gci.messages_to = { "my group 1", "GCI Flight" } +gcicap.red.gci.messages_to = {} + +--- Names of blue groups which will receive GCI messages. +-- See @{gcicap.red.gci.messages_to} for format. +gcicap.blue.gci.messages_to = {} + +--- How red CAP flights are spawned. +-- can be "parking", "takeoff" or "air" and defines the way the fighters spawn +-- takeoff is NOT RECOMMENDED currently since their occur timing issues with tasking +-- if a flight is queued for takeoff and not already in the game world while getting tasked +-- +-- Default 'parking' +gcicap.red.cap.spawn_mode = "parking" + +--- How red GCI flights are spawned. +-- @see gcicap.red.cap.spawn_mode +gcicap.red.gci.spawn_mode = "parking" + +--- How blue CAP flights are spawned. +-- @see gcicap.red.cap.spawn_mode +gcicap.blue.cap.spawn_mode = "parking" + +--- How blue GCI flights are spawned. +-- @see gcicap.red.cap.spawn_mode +gcicap.blue.gci.spawn_mode = "parking" + +--- Hide or reveal blue air units in the mission. +gcicap.blue.hide_groups = false + +--- Hide or reveal red air units in the mission. +gcicap.red.hide_groups = false + +--- Enable/disable red CAP flights. +gcicap.red.cap.enabled = true + +--- Enable/disable blue CAP flights. +gcicap.blue.cap.enabled = true + +--- Enable/disable red GCI flights. +gcicap.red.gci.enabled = true + +--- Enable/disable blue GCI flights. +gcicap.blue.gci.enabled = true + +--- Enabel/disable resource limitation for red. +-- If set to true limits the amount of groups a side can spawn. +gcicap.red.limit_resources = false + +--- Enabel/disable resource limitation for blue. +-- @see gcicap.red.limit_resources +gcicap.blue.limit_resources = false + +--- Amount of groups(!) red has at it's disposal. +-- In other words how many Groups of airplanes +-- this side can spawn. +gcicap.red.supply = 24 + +--- Amount of groups(!) red has at it's disposal. +-- @see gcicap.red.supply +gcicap.blue.supply = 24 + +--- Name of the trigger zone which defines red CAP zones. +-- This will be postfixed with the number of +-- the zone. e.g. "redCAPzone3" or "blueCAPzone1". +-- +-- Default: 'redCAPzone'. +gcicap.red.cap.zone_name = 'redCAPzone' + +--- Name of the trigger zone which defines blue CAP zones. +-- Default: 'blueCAPzone'. +-- @see gcicap.red.cap.zone_name +gcicap.blue.cap.zone_name = 'blueCAPzone' + +--- Name of group which waypoints define the red border. +-- Default: 'redborder'. +gcicap.red.border_group = 'redborder' + +--- Name of group which waypoints define the blue border. +-- Default: 'blueborder'. +gcicap.blue.border_group = 'blueborder' + +--- GCI template unit's names prefix. +gcicap.gci.template_prefix = '__GCI__' + +--- CAP template unit's names prefix. +gcicap.cap.template_prefix = '__CAP__' + +--- Count of template units. +-- Remember that this means you need that many +-- template units for each type. E.g. if the template_count is 2 you +-- would need two GCI and two CAP template units for each side. +gcicap.template_count = 4 + +--- Wether red will also acquire targets by AWACS aircraft. +-- This is is currently broken since isTargetDetected doesn't +-- seem to work with AWACS airplanes. Needs a workaround. +-- +-- Default false. +gcicap.red.awacs = false + +--- Wether blue will also acquire targets by AWACS aircraft. +-- @see gcicap.red.awacs +gcicap.blue.awacs = true + +--- Garbage collector move timeout +-- If a unit (aircraft) is on the ground and didn't move +-- since this timeout, in seconds, it will be removed. +-- This applies only to aircraft spawned by GCICAP. +gcicap.move_timeout = 300 + +-- shortcut to the bullseye +gcicap.red.bullseye = coalition.getMainRefPoint(coalition.side.RED) +gcicap.blue.bullseye = coalition.getMainRefPoint(coalition.side.BLUE) + +gcicap.sides = { "red", "blue" } +gcicap.tasks = { "cap", "gci" } + +gcicap.log = mist.Logger:new("GCICAP", gcicap.log_level) + +do + --- Flight class. + -- @type gcicap.Flight + gcicap.Flight = {} + + local function getFlightIndex(group) + if type(group) ~= "string" then + if group:getName() then + group = group:getName() + else + return false + end + end + for i, side in pairs(gcicap.sides) do + for j, task in pairs(gcicap.tasks) do + for n = 1, #gcicap[side][task].flights do + if gcicap[side][task].flights[n].group_name == group then + return {side = side, task = task, index = n} + end + end + end + end + return false + end + + --- Returns the flight for the given group. + -- @tparam string|Group group this can be a Group object + -- or the group name. + -- @treturn gcicap.Flight the flight for the given group. + function gcicap.Flight.getFlight(group) + f = getFlightIndex(group) + if f then + return gcicap[f.side][f.task].flights[f.index] + else + return false + end + end + + --- Creates a new flight. + -- @tparam Group group group of the flight. + -- @tparam Airbase airbase homplate of the new flight. + -- @tparam string task task of the new flight. Can be "cap" or "gci". + -- @param param task parameter. This can be a zone table if it's a + -- CAP flight or it could be a target unit if it's a GCI flight. + function gcicap.Flight:new(group, airbase, task, param) + if group:isExist() then + local side = gcicap.coalitionToSide(group:getCoalition()) + local f = {} + f.side = side + f.give_up = false + f.group = group + f.group_name = group:getName() + f.airbase = airbase + f.task = task + -- is the flight RTB? + f.rtb = false + f.in_zone = false + + if task == "cap" then + f.zone = param + f.zone_name = param.name + f.intercepting = false + f.vul_time = math.random(gcicap[side].cap.vul_time_min, + gcicap[side].cap.vul_time_max) + else -- task should be "gci" + f.target = param + f.target_group = param.group + f.intercepting = true + f.intercept_point = { x = 0, y = 0, z = 0 } + end + + -- get current timestamp + local timestamp = timer.getAbsTime() + f.units_moved = {} + -- set timestamp for each unit + -- this is later used for garbage collection checks + for u, unit in pairs(group:getUnits()) do + f.units_moved[u] = {} + f.units_moved[u].unit = unit + f.units_moved[u].last_moved = timestamp + f.units_moved[u].spawned_at = timestamp + end + + setmetatable(f, self) + self.__index = self + + table.insert(gcicap[side][task].flights, f) + gcicap.log:info("Registered flight: $1", f.group_name) + + return f + else + return nil + end + end + + --- Removes the flight + -- @tparam gcicap.Flight self flight object + function gcicap.Flight:remove() + if self.zone then + -- if we didn't already leave the zone do it now. + self:leaveCAPZone() + end + local f = getFlightIndex(self.group_name) + local r = table.remove(gcicap[f.side][f.task].flights, f.index) + if r then + gcicap.log:info("Removing flight $1 with index $2", r.group_name, f.index) + end + end + + --- Decreases active flights counter in this flights zone. + -- Actually just decreases the active flights + -- counter of a zone. Does NOT task the flight itself. + function gcicap.Flight:leaveCAPZone() + if self.in_zone then + local zone = self.zone + if zone.patrol_count <= 1 then + zone.patrol_count = 0 + else + zone.patrol_count = zone.patrol_count - 1 + end + self.in_zone = false + + -- get current time + local time_now = timer.getAbsTime() + -- get time on station by substracting vul start time from current time + -- and convert it to minutes + local time_on_station = 0 + if self.vul_start then + time_on_station = (time_now - self.vul_start) / 60 + end + local vul_diff = self.vul_time - time_on_station + -- set new vul time only if more than 5 minutes + if vul_diff > 5 then + self.vul_time = vul_diff + else + self.vul_time = 0 + end + end + end + + --- Increases active flights counter in this flights zone. + -- Actually just increases the active flights + -- counter of a zone. Does NOT task the flight itself. + function gcicap.Flight:enterCAPZone() + if not self.in_zone then + self.intercepting = false + self.in_zone = true + local zone = self.zone + zone.patrol_count = zone.patrol_count + 1 + end + end + + --- Tasks the flight to search and engage the target. + -- @tparam Unit intruder target unit. + -- @tparam[opt] boolean cold whether the flight should not destroy + -- the target and just follow it. Default false. + function gcicap.Flight:vectorToTarget(intruder, cold) + local target = nil + if intruder.group then + target = gcicap.getFirstActiveUnit(intruder.group) + end + if target == nil or intruder.group == nil then return end + + -- check if interceptor even still exists + if self.group:isExist() then + if target:isExist() and target:inAir() and self.give_up ~= true then + local target_pos = target:getPoint() + local ctl = self.group:getController() + + local gci_task = { + id = 'Mission', + params = { + route = { + points = { + [1] = { + alt = target_pos.y, + x = target_pos.x, + y = target_pos.z, + speed = gcicap.gci.speed, + action = "Turning Point", + type = "Turning Point", + task = { + id = "ComboTask", + params = { + tasks = { + [1] = { + number = 1, + key = "CAP", + id = "EngageTargets", + enabled = true, + auto = true, + params = { + targetTypes = { [1] = "Air" }, + priority = 0 + } + } + } + } + } + }, + [2] = { + alt = target_pos.y, + x = target_pos.x, + y = target_pos.z, + speed = gcicap.gci.speed, + action = "Turning Point", + type = "Turning Point", + task = { + -- i don't really like this WrappedAction but it's needed in + -- the case the CGI completes this waypoint because of lack/loss + -- of target + id = 'WrappedAction', + params = { + action = { + id = 'Script', + params = { + command = "local group = ...\ + local flight = gcicap.Flight.getFlight(group)\ + if flight then\ + flight.give_up = true\ + if flight.zone then\ + if flight.intercepting then\ + flight:taskWithCAP()\ + end\ + else\ + if not flight.target then\ + flight:taskWithRTB()\ + end\ + end\ + else\ + gcicap.log:error('Could not find flight')\ + end" + } + } + } + } + } + } + } + } + } + + -- checkout of the patrol zone + if self.zone and not self.intercepting then + self:leaveCAPZone() + end + + intruder.intercepted = true + -- only set/reset the task if the target has moved significantly since last GCI update + if mist.utils.get3DDist( target_pos, self.intercept_point ) > gcicap.revector_threshold then + -- if there's still an EWR detecting or we are responding to the initial call + -- then set the target position. do not allow revectoring if no EWR is detecting us now + if (Unit.isExist(intruder.detected_by) and intruder.detected_by:isActive()) then + self.give_up = false + self.intercept_point = mist.utils.deepCopy(target_pos) + ctl:setTask(gci_task) + gcicap.log:info("Vectoring $1 to $2 ($3)", self.group:getName(), + intruder.group:getName(), target:getName()) + + else + gcicap.log:info("Cannot revector $1 to $2 because no longer detecting",self.group:getName(),intruder.group:getName()) + end + end + self.intercepting = true + + -- taskEngageGroup provides omniscient knowledge of where the group to be attacked is, which sucks + if not cold then + --gcicap.taskEngageGroup(self.group, intruder.group) + gcicap.taskEngage(self.group, 15000) + end + + -- reschedule function until either the interceptor or the intruder is dead + mist.scheduleFunction(gcicap.Flight.vectorToTarget, {self, intruder, cold}, + timer.getTime() + gcicap.vector_interval) + + else -- the target is dead or we had to give up, resume CAP or RTB + if self.zone then + -- send CAP back to work only if still intercepting + if self.intercepting then + self:taskWithCAP() + end + else + self.intercepting = false + -- send GCI back to homeplate + self:taskWithRTB() + end + end + else + -- our interceptor group is dead let's see if the + -- intruder is still there and set him to not beeing intercepted anymore + if target:isExist() then + intruder.intercepted = false + end + end + end + + --- Tasks flight with combat air patrol. + -- Creates waypoints inside it's assigned zone and tasks + -- the flight with patroling along the route. + -- @tparam[opt] boolean cold If set to true the flight won't + -- engage any enemy unit's it detects by itself. Default false. + function gcicap.Flight:taskWithCAP(cold) + -- only task with CAP if ther is still vul time left + if self.vul_time == 0 then + -- send flight RTB if no vul time left. + gcicap.log:info("No vul time left for $1", self.group_name) + self:taskWithRTB() + else + local group = self.group + local ctl = group:getController() + local side = gcicap.coalitionToSide(group:getCoalition()) + local start_pos = gcicap.getFirstActiveUnit(group):getPoint() + local leg_dist = math.random(gcicap[side].cap.leg_min, gcicap[side].cap.leg_max) + local cap_route = gcicap.buildCAPRoute(start_pos, self.zone.name, self.vul_time, leg_dist) + local cap_task = { + id = 'Mission', + params = { + route = cap_route + } + } + + self.intercepting = false + self.intercept_point = { x = 0, y = 0, z = 0 } + ctl:setTask(cap_task) + self:enterCAPZone() + ctl:setOption(AI.Option.Air.id.RADAR_USING, AI.Option.Air.val.RADAR_USING.FOR_SEARCH_IF_REQUIRED) + + if not cold then + gcicap.taskEngage(group) + end + gcicap.log:info("Tasking $1 with CAP in zone $2", group:getName(), self.zone.name) + end + end + + --- Tasks the flight to return to it's homeplate. + -- @tparam[opt] Airbase airbase optionally use this as homeplate/airbase + -- to return to. + -- @tparam[opt] boolean cold If set to true the flight won't + -- engage any targets it detects on the way back to base. + -- Default false. + function gcicap.Flight:taskWithRTB(airbase, cold) + if not airbase then + airbase = self.airbase + end + + if self.zone then + self:leaveCAPZone() + local side = self.side + -- let's try to spawn a new CAP flight as soon as the current one is tasked with RTB. + -- never spawn more than 2 x the groups_count, to prevent spam in case something ever goes wrong. + if (not gcicap[side].limit_resources or + (gcicap[side].limit_resources and gcicap[side].supply > 0)) + and #gcicap[side].cap.flights < gcicap[side].cap.groups_count * 2 then + gcicap.spawnCAP(side, self.zone, gcicap[side].cap.spawn_mode) + end + end + self.rtb = true + local group = self.group + local ctl = group:getController() + local af_pos = mist.utils.makeVec2(airbase:getPoint()) + local af_id = airbase:getID() + local rtb_task = { + id = 'Mission', + params = { + route = { + points = { + [1] = { + alt = gcicap.cap.min_alt, + alt_type = "BARO", + speed = gcicap.cap.speed, + x = af_pos.x, + y = af_pos.y, + aerodromeId = af_id, + type = "Land", + action = "Landing", + } + } + } + } + } + + ctl:setTask(rtb_task) + + if not cold then + -- only engage if enemy is inside of 10km of the leg + gcicap.taskEngage(group, 10000) + end + + gcicap.log:info("Tasking $1 with RTB to $2", group:getName(), airbase:getName()) + end + + --- Functions + -- @section gcicap + + --- Clean up inactive/stuck flights. + local function garbageCollector(side) + local timestamp = timer.getAbsTime() + for t, task in pairs(gcicap.tasks) do + for f, flight in pairs(gcicap[side][task].flights) do + if flight.group then + if flight.group:isExist() then + for u = 1, #flight.units_moved do + local unit = flight.units_moved[u].unit + -- check if unit exists + if unit then + if unit:isExist() then + -- if unit is in air we won't do anything + if not unit:inAir() then + -- check if unit is moving + local mag = mist.vec.mag(unit:getVelocity()) + if mag == 0 then + -- get the last time the unit moved + local last_moved = flight.units_moved[u].last_moved + if timestamp - last_moved > gcicap.move_timeout then + gcicap.log:info("Cleaning up $1", flight.group:getName()) + flight.group:destroy() + flight:remove() + end + else + flight.units_moved[u].last_moved = timestamp + end + end + end + end + end + else + flight:remove() + end + else + flight:remove() + end + end + end + end + + local function checkForTemplateUnits(side) + if gcicap[side].gci.enabled then + for i = 1, gcicap.template_count do + local unit = gcicap.gci.template_prefix..side..i + if not Unit.getByName(unit) then + gcicap.log:alert("GCI template unit missing: $1", unit) + return false + end + end + end + if gcicap[side].cap.enabled then + for i = 1, gcicap.template_count do + local unit = gcicap.cap.template_prefix..side..i + if not Unit.getByName(unit) then + gcicap.log:alert("CAP template unit missing: $1", unit) + return false + end + end + end + if gcicap[side].borders_enabled then + if not Group.getByName(gcicap[side].border_group) then + gcicap.log:alert("Border group is missing: $1", gcicap[side].border_group) + return false + end + end + return true + end + + local function checkForTriggerZones(side) + for i = 1, gcicap[side].cap.zones_count do + local zone_name = gcicap[side].cap.zone_name..i + if not trigger.misc.getZone(zone_name) then + gcicap.log:alert("CAP trigger zone is missing: $1", zone_name) + return false + end + end + return true + end + + local function manageCAP(side) + local patroled_zones = 0 + + for i = 1, #gcicap[side].cap.zones do + local zone = gcicap[side].cap.zones[i] + gcicap.log:info("Zone $1 has $2 patrols", zone.name, zone.patrol_count) + + -- see if we can send a new CAP into the zone + if zone.patrol_count <= 0 then + -- first check if we already hit the maximum amounts of routine CAP groups + if #gcicap[side].cap.flights < gcicap[side].cap.groups_count then + -- check if we limit resources and if we have enough supplies + -- if we don't limit resource or have enough supplies we spawn + if not gcicap[side].limit_resources or + (gcicap[side].limit_resources and gcicap[side].supply > 0) then + -- finally spawn it + gcicap.spawnCAP(side, gcicap[side].cap.zones[i], gcicap[side].cap.spawn_mode) + end + end + else + patroled_zones = patroled_zones + 1 + end + end + -- if all zones are patroled and we still have cap groups left + -- send them to a random zone + if #gcicap[side].cap.flights < gcicap[side].cap.groups_count then + if not gcicap[side].limit_resources or + (gcicap[side].limit_resources and gcicap[side].supply > 0) then + local random_zone = math.random(1, #gcicap[side].cap.zones) + gcicap.spawnCAP(side, gcicap[side].cap.zones[random_zone], gcicap[side].cap.spawn_mode) + end + end + gcicap.log:info("$1 patrols in $2/$3 zones with $4 flights", + side, patroled_zones, gcicap[side].cap.zones_count, #gcicap[side].cap.flights) + end + + local function handleIntrusion(side) + for i = 1, #gcicap[side].intruders do + local intruder = gcicap[side].intruders[i] + if intruder.group then + if intruder.group:isExist() then + -- check if we need to do something about him + if not intruder.intercepted then + -- first check if we have something to work with + if #gcicap[side].cap.flights > 0 + or #gcicap[side].gci.flights > 0 + or #gcicap[side].gci.flights < gcicap[side].gci.groups_count then + -- get closest flight to intruder if there is any + local closest = nil + local intruder_unit = gcicap.getFirstActiveUnit(intruder.group) + local closest_flights = gcicap.getClosestFlightsToUnit(side, intruder_unit) + -- we found close flights + local flight_avail = false + if closest_flights then + for j = 1, #closest_flights do + closest = closest_flights[j] + --fligh_avail = (not closest.flight.rtb) and (not closest.flight.intercepting) + flight_avail = (not closest.flight.intercepting) + if flight_avail then + gcicap.log:info("Found flight $1 which is avaliable for tasking.", + closest.flight.group:getName()) + break + end + end + end + if flight_avail then + -- check if we have a airfield which is closer to the unit than the closest flight + -- but add some distance to the airfield since it takes time for a potential spawned + -- flight to take-off + local closest_af, af_distance = gcicap.getClosestAirfieldToUnit(side, intruder_unit) + af_distance = af_distance + 15000 -- add 15km + if closest.distance < af_distance or af_distance == -1 then + -- task flight with intercept + closest.flight.give_up = false + closest.flight:vectorToTarget(intruder) + return + end + if (not gcicap[side].limit_resources + or (gcicap[side].limit_resources and gcicap[side].supply > 0)) + and #gcicap[side].gci.flights < gcicap[side].gci.groups_count + and gcicap[side].gci.enabled then + -- spawn CGI + gcicap.log:info("Airfield closer to intruder than flight or no flight available. Spawning GCI") + local gci = gcicap.spawnGCI(side, intruder) + end + else + if (not gcicap[side].limit_resources + or (gcicap[side].limit_resources and gcicap[side].supply > 0)) + and #gcicap[side].gci.flights < gcicap[side].gci.groups_count + and gcicap[side].gci.enabled then + -- spawn CGI + gcicap.log:info("No CAP flights or already airborne GCI. Spawning GCI") + local gci = gcicap.spawnGCI(side, intruder) + end + end + end + end + end + else + -- the intruder group doesn't exist (anymore) remove it + table.remove(gcicap[side].intruders, i) + end + end + end + + -- returns airfields of given side which are marked with + -- triggerzones (triggerzone name is exactly the same as airfield name). + local function getAirfields(side) + local coal_airfields = coalition.getAirbases(gcicap.sideToCoalition(side)) + local gcicap_airfields = {} + + -- loop over all coalition airfields + for i = 1, #coal_airfields do + -- get name of airfield + local af_name = coal_airfields[i]:getName() + if not string.match(af_name, "FARP") then + -- check if a triggerzone exists with that exact name + if mist.DBs.zonesByName[af_name] then + -- add it to our airfield list for gcicap + gcicap_airfields[#gcicap_airfields + 1] = coal_airfields[i] + end + end + end + + if #gcicap_airfields == 0 then + gcicap.log:warn("No airbase for $1 found", side) + end + return gcicap_airfields + end + + -- returns all currently active aircraft of the given side + -- parameter side has to be "red" or "blue" + local function getAllActiveAircrafts(side) + local filter = { "[" .. side .. "][plane]", "[" .. side .. "][helicopter]"} + local all_aircraft = mist.makeUnitTable(filter) + local active_aircraft = {} + + for i = 1, #all_aircraft do + local ac = Unit.getByName(all_aircraft[i]) + if ac ~= nil then + if Unit.isActive(ac) then + table.insert(active_aircraft, ac) + end + end + end + if #active_aircraft == 0 then + gcicap.log:warn("No active aircraft for $1 found", side) + end + return active_aircraft + end + + -- returns all currently active EWR and AWACS units of the given side + -- parameter side has to be "red" or "blue" + local function getAllActiveEWR(side) + local filter = { "[" .. side .. "][plane]", "[" .. side .. "][vehicle]", "[" .. side .. "][ship]"} + local all_vecs = mist.makeUnitTable(filter) + local active_ewr = {} + + for i = 1, #all_vecs do + local vec = Unit.getByName(all_vecs[i]) + if vec ~= nil then + if Unit.isActive(vec) then + local vec_type = Unit.getTypeName(vec) + if vec_type == "55G6 EWR" + or vec_type == "1L13 EWR" + or vec_type == "Hawk sr" + or vec_type == "Patriot str" then + table.insert(active_ewr, { unit = vec, is_awacs = false} ) + end + -- ED has a bug; the E-2D vehicle has type E-2C + if (vec_type == "A-50" and gcicap[side].awacs) + or (vec_type == "E-2C" and gcicap[side].awacs) + or (vec_type == "E-3A" and gcicap[side].awacs) then + table.insert(active_ewr, { unit = vec, is_awacs = true} ) + end + end + end + end + if #active_ewr == 0 then + gcicap.log:warn("No active EWR for $1 found", side) + end + return active_ewr + end + + local function checkForAirspaceIntrusion(side) + -- init some local vars + local border = gcicap[side].border + local active_ewr = gcicap[side].active_ewr + local intruder_count = 0 + local intruder_side = "" + local toremove = {} + if side == "red" then + -- set the side of the intruder + intruder_side = "blue" + elseif side == "blue" then + intruder_side = "red" + end + local active_ac = gcicap[intruder_side].active_aircraft + + -- only do something if we have active ewr and active aircraft + if #active_ac > 0 and #active_ewr > 0 then + -- loop over all aircraft + for i = 1, #active_ac do + local ac = active_ac[i] + local ac_detected = false + local ac_intruded = false + local ac_pos = {} + local ac_group = nil + local intruder_num = 0 + local ewr = nil + if ac ~= nil then + ac_group = ac:getGroup() + if ac_group:isExist() then + ac_pos = ac:getPoint() + + -- now loop over all ewr units + for n = 1, #active_ewr do + local ewr_controller = nil + if active_ewr[n].is_awacs then + ewr_controller = active_ewr[n].unit:getController() + else + ewr_controller = active_ewr[n].unit:getGroup():getController() + end + -- and check if the EWR detected the aircraft + if ewr_controller:isTargetDetected(ac, RADAR) then + ewr = active_ewr[n].unit + ac_detected = true + -- stop once it was detected by one EWR + break + end + end + + if ac_detected then + -- do we check borders? + if gcicap[side].borders_enabled then + ac_intruded = mist.pointInPolygon(ac_pos, border) + else + -- if not the aircarft is always intruding + ac_intruded = true + end + + if ac_intruded then + local in_list = false + -- check if we already know about the intruder + for j = 1, #gcicap[side].intruders do + if gcicap[side].intruders[j].name == ac_group:getName() then + in_list = true + intruder_num = j + break + end + end + if not in_list then + intruder_count = intruder_count + 1 + + gcicap.log:info("$1 ($2) intruded airspace of $3 detected by $4 ($5)", + ac_group:getName(), ac:getName(), side, + ewr:getGroup():getName(), ewr:getName()) + + intruder = { + name = ac_group:getName(), + --unit = ac, + group = ac_group, + detected_by = ewr, + --groupID = ac_group:getID(), + --unitID = ac:getID(), + --unitType = ac:getTypeName(), + size = ac_group:getSize(), + intercepted = false, + } + table.insert(gcicap[side].intruders, intruder) + intruder_num = #gcicap[side].intruders + end + + -- send message to all units of coalition or some specified groups + -- that we have a intruder + if gcicap[side].gci.messages then + local par = { + units = { ac:getName() }, + ref = gcicap[side].bullseye, + alt = ac_pos.y, + } + -- do we want to display in metric units? + if gcicap[side].gci.messages_metric then + par.metric = true + end + + local msg_for = {} + -- if groups are specified find their units names and add them to the list + if #gcicap[side].gci.messages_to > 0 then + msg_for.units = {} + for g, group_name in pairs(gcicap[side].gci.messages_to) do + group = Group.getByName(group_name) + if group ~= nil then + for u, unit in pairs(group:getUnits()) do + table.insert(msg_for.units, unit:getName()) + end + end + end + else + msg_for.coa = { side } + end + -- get the bearing, range and altitude from bullseye to intruder + local bra = mist.getBRString(par) + local bra_string = "Airpsace intrusion! BRA from bullseye "..bra + local msg = { + text = bra_string, + displayTime = gcicap.gci.message_time, + msgFor = msg_for, + name = "gcicap.gci.msg"..intruder_num, + } + -- finally send the message + mist.message.add(msg) + end + end -- if ac_intruded + else + -- the ac is _not_ intruding so we should remove it from the intruders list + + local in_list = false + local intruder_num = 0 + -- check if we already know about the intruder + for j = 1, #gcicap[side].intruders do + if gcicap[side].intruders[j].name == ac_group:getName() then + in_list = true + intruder_num = j + break + end + end + if in_list then toremove[#toremove + 1] = intruder_num end + end -- if ac_detected + end -- if ac_group is existing + end -- if ac ~= nil + end -- for #active_ac + end -- if active_ac > 0 and active_ewr > 0 + + -- we need to remove intruders from outside the loop + if #toremove > 0 then + for i = 1,#toremove do + intruder_count = intruder_count - 1 + gcicap.log:info("Aircraft "..gcicap[side].intruders[i].name.." no longer intruding") + table.remove(gcicap[side].intruders,i) + end + end + if intruder_count > 0 then + return true + else + return false + end + --return gcicap[side].intruders + end + + -- returns a random airfield for the given side + local function getRandomAirfield(side) + local rand = math.random(1, #gcicap[side].airfields) + return gcicap[side].airfields[rand] + end + + local function buildFirstWp(airbase, spawn_mode) + local airbase_pos = airbase:getPoint() + local airbase_id = airbase:getID() + local wp = mist.fixedWing.buildWP(airbase_pos) + + if spawn_mode == "parking" then -- start from parking area + wp.airdromeId = airbase_id + wp.type = "TakeOffParking" + wp.action = "From Parking Area" + elseif spawn_mode == "takeoff" then -- or start from runway + wp.airdromeId = airbase_id + wp.type = "TakeOff" + wp.action = "From Runway" + elseif spawn_mode == "air" then + -- randomize spawn position a little bit in case of air start + wp.x = wp.x + (50 * math.sin(math.random(10))) + wp.y = wp.y + (50 * math.sin(math.random(10))) + end + + return wp + end + + --- Converts coaltion number to side string. + -- 0 = "neutral", 1 = "red", 2 = "blue" + -- @tparam number coal coaltion number. + -- @treturn string side + function gcicap.coalitionToSide(coal) + if coal == coalition.side.NEUTRAL then return "neutral" + elseif coal == coalition.side.RED then return "red" + elseif coal == coalition.side.BLUE then return "blue" + end + end + + --- Converts side string to coaltion number. + -- 0 = "neutral", 1 = "red", 2 = "blue" + -- @tparam string side side string. + -- @treturn number coalition number. + -- @see coalitionToSide + function gcicap.sideToCoalition(side) + if side == "neutral" then return coalition.side.NEUTRAL + elseif side == "red" then return coalition.side.RED + elseif side == "blue" then return coalition.side.BLUE + end + end + + --- Returns first active unit of a group. + -- @tparam Group group group whose first active + -- unit to return. + -- @treturn Unit first active unit of group. + function gcicap.getFirstActiveUnit(group) + if group ~= nil then + -- engrish mast0r isExistsingsed + if not group:isExist() then return nil end + local units = group:getUnits() + for i = 1, group:getSize() do + if units[i] then + return units[i] + end + end + return nil + else + return nil + end + end + + --- Returns the closest airfield to unit. + -- Returned airfield is controlled by given side. This function + -- also returns the distance to the unit. + -- @tparam string side side string, either "red" or "blue". + -- The airfield returned has to be controlled by this side. + -- @tparam Unit unit unit to use as reference. + -- @treturn table @{closestAirfieldReturn} + function gcicap.getClosestAirfieldToUnit(side, unit) + if not unit then + gcicap.log:error("Couldn't find unit.") + return + end + local airfields = gcicap[side].airfields + + if #airfields == 0 then + gcicap.log:warn("There are no airfields of side $1", side) + return nil + end + + local unit_pos = mist.utils.makeVec2(unit:getPoint()) + local min_distance = -1 + local closest_af = nil + + for i = 1, #airfields do + local af = airfields[i] + local af_pos = mist.utils.makeVec2(af:getPoint()) + local distance = mist.utils.get2DDist(unit_pos, af_pos) + + if distance < min_distance or min_distance == -1 then + min_distance = distance + closest_af = af + end + end + + --- Table returned by getClosestAirfieldToUnit. + -- @table closestAirfieldReturn + -- @tfield Airbase airfield the Airbase object + -- @tfield number distance the distance in meters + -- to the unit. + --return {airfield = closest_af, distance = min_distance} + return closest_af, min_distance + end + + --- Returns the closest flights to the given unit. + -- Flights returned are of given side. This function also returns + -- their distance to the unit. The returned flights are sorted + -- by distance. First is the closest. + -- @tparam string side side whose flights to search. + -- @tparam Unit unit unit object used as reference. + -- @treturn table Array sorted by distance + -- containing @{closestFlightsReturn} tables. + function gcicap.getClosestFlightsToUnit(side, unit) + if not unit then + gcicap.log:error("Couldn't find unit.") + return + end + local closest_flights = {} + if #gcicap[side].cap.flights == 0 and #gcicap[side].gci.flights == 0 then + gcicap.log:info("No CAP or GCI flights of side $1 active", side) + return nil + else + local unit_pos = mist.utils.makeVec2(unit:getPoint()) + local min_distance = -1 + for t, task in pairs(gcicap.tasks) do + local flights = gcicap[side][task].flights + for i = 1, #flights do + if flights[i].group then + local u = gcicap.getFirstActiveUnit(flights[i].group) + if u then + local u_pos = mist.utils.makeVec2(u:getPoint()) + local distance = mist.utils.get2DDist(unit_pos, u_pos) + table.insert(closest_flights, {flight = flights[i], distance = distance }) + else + break + end + end + end + end + + -- sort closest flights + table.sort(closest_flights, function(a,b) + if a.distance < b.distance then + return true + else + return false + end + end) + + --- Table returned by getClosestFlightsToUnit. + -- @table closestFlightsReturn + -- @tfield gcicap.Flight flight object + -- @tfield number distance distance in meters from + -- the unit. + return closest_flights + end + end + + --- Returns a table containting a CAP route. + -- Route originating from given airbase, waypoints + -- are placed randomly inside given zone. Optionally + -- you can specify the amount of waypoints inside the zone. + -- @tparam string zone trigger zone name + -- @tparam number vul_time time on station + -- @tparam number leg_distance leg distance for race-track pattern orbit. + function gcicap.buildCAPRoute(start_pos, zone, vul_time, leg_distance) + local points = {} + -- make altitude consistent for the whole route. + local alt = math.random(gcicap.cap.min_alt, gcicap.cap.max_alt) + + local start_vul_script = "local group = ...\ + local flight = gcicap.Flight.getFlight(group)\ + if flight then\ + gcicap.log:info('$1 starting vul time $2 at $3',\ + flight.group_name, flight.vul_time, flight.zone.name)\ + flight.vul_start = timer.getAbsTime()\ + else\ + gcicap.log:error('Could not find flight')\ + end" + + local end_vul_script = "local group = ...\ + local flight = gcicap.Flight.getFlight(group)\ + if flight then\ + gcicap.log:info('$1 vul time over at $2',\ + flight.group_name, flight.zone.name)\ + flight:taskWithRTB()\ + else\ + gcicap.log:error('Could not find flight')\ + end" + + -- build orbit start waypoint + local orbit_start_point = mist.getRandomPointInZone(zone) + -- add a bogus waypoint so the start vul time script block + -- isn't executed instantly after tasking + points[1] = mist.fixedWing.buildWP(start_pos) + points[2] = mist.fixedWing.buildWP(orbit_start_point) + points[2].task = {} + points[2].task.id = 'ComboTask' + points[2].task.params = {} + points[2].task.params.tasks = {} + points[2].task.params.tasks[1] = { + number = 1, + auto = false, + id = 'WrappedAction', + enabled = true, + params = { + action = { + id = 'Script', + params = { + command = start_vul_script + } + } + } + } + points[2].task.params.tasks[2] = { + number = 2, + auto = false, + id = 'ControlledTask', + enabled = true, + params = { + task = { + id = 'Orbit', + params = { + altitude = alt, + pattern = 'Race-Track', + speed = gcicap.cap.speed + } + }, + stopCondition = { + duration = vul_time * 60 + } + } + } + + -- if we don't use the race-track pattern we'll add the vul end time + -- waypoint right where the start waypoint is and use the 'Circle' pattern. + local orbit_end_point + if not gcicap.cap.race_track_orbit then + points[2].task.params.tasks[2].params.task.params.pattern = 'Circle' + orbit_end_point = start_pos + else + -- build second waypoint (leg end waypoint) + --local orbit_end_point = mist.getRandPointInCircle(orbit_start_point, leg_distance, leg_distance) + orbit_end_point = mist.getRandomPointInZone(zone) + end + + points[3] = mist.fixedWing.buildWP(orbit_end_point) + points[3].task = { + id = 'WrappedAction', + params = { + action = { + id = 'Script', + params = { + command = end_vul_script + } + } + } + } + + for i = 1, 3 do + points[i].speed = gcicap.cap.speed + points[i].alt = alt + end + + -- local ground_level = land.getHeight(point) + -- -- avoid crashing into hills + -- if (alt - 100) < ground_level then + -- alt = alt + ground_level + -- end + + gcicap.log:info("Built CAP route with $1 min vul time at $2 meters in $3", vul_time, alt, zone) + + local route = {} + route.points = points + return route + end + + --- Tasks group to automatically engage any spotted targets. + -- @tparam Group group group to task. + -- @tparam[opt] number max_dist maximum engagment distance. + -- Targets further out (from the route) won't be engaged. + function gcicap.taskEngage(group, max_dist) + if not max_dist then + max_dist = gcicap.cap.max_engage_distance + end + local ctl = group:getController() + local engage = { + id = 'EngageTargets', + params = { + maxDist = max_dist, + maxDistEnabled = true, + targetTypes = { [1] = "Air" }, + priority = 0 + } + } + ctl:pushTask(engage) + end + + --- Tasks group to engage a group. + -- @tparam Group group group to task. + -- @tparam Group target group that should be engaged by + -- given group. + function gcicap.taskEngageGroup(group, target) + local ctl = group:getController() + local engage_group = { + id = 'EngageGroup', + params = { + groupId = target:getID(), + directionEnabled = false, + priority = 0, + altittudeEnabled = false, + } + } + ctl:pushTask(engage_group) + end + + --- Spawns a fighter group. + -- @tparam string side side of the newly created group. + -- Can be "red" or "blue". + -- @tparam string name new group name. + -- @tparam number size count of aircraft in the new group. + -- @tparam Airbase airbase home plate of the new group. + -- @tparam string spawn_mode How the new group will be spawned. + -- Can be 'parking' or 'air'. 'parking' will spawn them at the ramp + -- wit engines turned off. 'air' will spawn them in the air already + -- flying. + -- @tparam string task Task of the new group. Can either be 'cap', + -- for combat air patrol, or 'gci', for ground controlled intercept. + -- @tparam[opt] string zone zone name in which to spawn the unit. This only is + -- taken into account if spawn_mode is "in-zone". + -- @tparam[opt] boolean cold if set to true the newly group won't engage + -- any enemys until tasked otherwise. Default false. + -- @treturn Group|nil newly spawned group or nil on failure. + function gcicap.spawnFighterGroup(side, name, size, airbase, spawn_mode, task, zone, cold) + local template_unit_name = gcicap[task].template_prefix..side..math.random(1, gcicap.template_count) + local template_unit = Unit.getByName(template_unit_name) + if not template_unit then + gcicap.log:error("Can't find template unit $1. This should never happen.\ + Somehow the template unit got deleted.", template_unit_name) + return nil + end + local template_group = mist.getGroupData(template_unit:getGroup():getName()) + local template_unit_data = template_group.units[1] + local airbase_pos = airbase:getPoint() + local group_data = {} + local unit_data = {} + local onboard_num = template_unit_data.onboard_num - 1 + local route = {} + + local rand_point = {} + if spawn_mode == "in-zone" then + rand_point = mist.getRandomPointInZone(zone) + end + + for i = 1, size do + unit_data[i] = {} + unit_data[i].type = template_unit_data.type + unit_data[i].name = name.." Pilot "..i + if spawn_mode == "in-zone" then + unit_data[i].x = rand_point.x + (50 * math.sin(math.random(10))) + unit_data[i].y = rand_point.y + (50 * math.sin(math.random(10))) + else + unit_data[i].x = airbase_pos.x + (50 * math.sin(math.random(10))) + unit_data[i].y = airbase_pos.z + (50 * math.sin(math.random(10))) + end + unit_data[i].alt = gcicap[side].cap.min_alt + unit_data[i].onboard_num = onboard_num + i + unit_data[i].groupName = name + unit_data[i].payload = template_unit_data.payload + unit_data[i].skill = template_unit_data.skill + unit_data[i].livery_id = template_unit_data.livery_id + if side == 'blue' then + unit_data[i].callsign = {} + unit_data[i].callsign[1] = 4 -- Colt + unit_data[i].callsign[2] = gcicap[side].cap.flight_num + unit_data[i].callsign[3] = i + else + unit_data[i].callsign = 600 + gcicap[side].cap.flight_num + i + end + end + + group_data.units = unit_data + group_data.groupName = name + group_data.hidden = gcicap[side].hide_groups + --group_data.country = template_group.country + group_data.country = template_unit:getCountry() + group_data.category = template_group.category + group_data.task = "CAP" + + route.points = {} + if spawn_mode == "in-zone" then + route.points[1] = mist.fixedWing.buildWP(rand_point) + route.points[1].alt = gcicap[side].cap.min_alt + route.points[1].speed = gcicap[side].cap.speed + else + route.points[1] = buildFirstWp(airbase, spawn_mode) + end + group_data.route = route + + if mist.groupTableCheck(group_data) then + local spawn_pos = airbase:getName() + if spawn_mode == "in-zone" then + spawn_pos = zone + end + gcicap.log:info("Spawning fighter group $1 at $2", name, spawn_pos) + mist.dynAdd(group_data) + else + gcicap.log:error("Couldn't spawn group with following groupTable: $1", group_data) + end + + return Group.getByName(name) + end + + --- Spawns a CAP flight. + -- @tparam string side side for the new CAP. + -- @tparam string zone CAP zone (trigger zone) name. + -- @tparam string spawn_mode how the new CAP will be spawned. + -- Can be 'parking' or 'air'. + function gcicap.spawnCAP(side, zone, spawn_mode) + -- increase flight number + gcicap[side].cap.flight_num = gcicap[side].cap.flight_num + 1 + -- select random airbase (for now) TODO: choose closest airfield + local airbase = getRandomAirfield(side) + local group_name = "CAP "..side.." "..gcicap[side].cap.flight_num + -- define size of the flight + local size = gcicap[side].cap.group_size + if size == "randomized" then + size = math.random(1,2)*2 + else + size = tonumber(size) + end + -- actually spawn something + local group = gcicap.spawnFighterGroup(side, group_name, size, airbase, spawn_mode, "cap", zone.name) + --local ctl = group:getController() + --ctl:setOption(AI.Option.Air.id.RADAR_USING, AI.Option.Air.val.RADAR_USING.FOR_ATTACK_ONLY) + gcicap[side].supply = gcicap[side].supply - 1 + -- keep track of the flight + local flight = gcicap.Flight:new(group, airbase, "cap", zone) + -- task the group, for some odd reason we have to wait until we use setTask + -- on a freshly spawned group. + mist.scheduleFunction(gcicap.Flight.taskWithCAP, {flight}, timer.getTime() + 5) + return group + end + + --- Spawns a GCI flight. + -- @tparam string side side for the new GCI. + -- @tparam Unit intruder unit to intercept. + -- @tparam Airbase airbase airbase at which to spawn the GCI flight. + function gcicap.spawnGCI(side, intruder, airbase) + -- increase flight number + gcicap[side].gci.flight_num = gcicap[side].gci.flight_num + 1 + -- select closest airfield to unit + local intruder_unit = gcicap.getFirstActiveUnit(intruder.group) + local closest_af = gcicap.getClosestAirfieldToUnit(side, intruder_unit) + if closest_af then + airbase = closest_af + else + gcicap.log:warn("Couldn't find close airfield for GCI. Choosing one at random.") + airbase = getRandomAirfield(side) + end + local tgt_units = intruder.group:getUnits() + local group_name = "GCI "..side.." "..gcicap[side].gci.flight_num + -- define size of the flight + local size = gcicap[side].gci.group_size + if size == "randomized" then + size = math.random(1,2)*2 + elseif size == "dynamic" then + size = #tgt_units + else + size = tonumber(size) + end + -- actually spawn something + local group = gcicap.spawnFighterGroup(side, group_name, size, airbase, gcicap[side].gci.spawn_mode, "gci") + local ctl = group:getController() + -- make the GCI units only use their radar for attacking + ctl:setOption(AI.Option.Air.id.RADAR_USING, AI.Option.Air.val.RADAR_USING.FOR_ATTACK_ONLY) + gcicap[side].supply = gcicap[side].supply - 1 + -- keep track of the flight + local flight = gcicap.Flight:new(group, airbase, "gci", intruder) + -- vector the interceptor group on the target the first time. + mist.scheduleFunction(gcicap.Flight.vectorToTarget, {flight, intruder}, timer.getTime() + 5) + return group + end + + --- Initialization function + -- Checks if all template units are present. Creates + -- border polygons if borders enabled. + -- @todo complete documentation. + function gcicap.init() + for i, side in pairs(gcicap.sides) do + if not (checkForTemplateUnits(side) and checkForTriggerZones(side)) then + return false + end + if gcicap[side].borders_enabled then + gcicap[side].border = mist.getGroupPoints(gcicap[side].border_group) + end + gcicap[side].intruders = {} + gcicap[side].cap.zones = {} + gcicap[side].cap.flights = {} + gcicap[side].gci.flights = {} + gcicap[side].cap.flight_num = 0 + gcicap[side].gci.flight_num = 0 + gcicap[side].airfields = getAirfields(side) + + if gcicap[side].cap.enabled then + -- loop through all zones + for i = 1, gcicap[side].cap.zones_count do + local zone_name = gcicap[side].cap.zone_name..i + local point = trigger.misc.getZone(zone_name).point + local size = trigger.misc.getZone(zone_name).radius + + -- create zone table + gcicap[side].cap.zones[i] = { + name = zone_name, + pos = point, + radius = size, + patrol_count = 0, + } + end + + for i = 1, gcicap[side].cap.groups_count do + local spawn_mode = "parking" + if gcicap[side].cap.start_airborne then + spawn_mode = "in-zone" + end + -- try to fill all zones + local zone = gcicap[side].cap.zones[i] + -- if we have more flights than zones we select one random zone + if zone == nil then + zone = gcicap[side].cap.zones[math.random(1, gcicap[side].cap.zones_count)] + end + -- actually spawn the group + --local grp = gcicap.spawnCAP(side, zone, spawn_mode) + -- delay the spawn by gcicap interval seconds after one another + local spawn_delay = (i - 1) * gcicap.initial_spawn_delay + mist.scheduleFunction(gcicap.spawnCAP, {side, zone, spawn_mode}, timer.getTime() + spawn_delay) + end + end + end + -- add event handler managing despawns + return true + end + + --- Main function. + -- Run approx. every @{gcicap.interval} sconds. A random amount + -- of 0 to 2 seconds is added for declustering. + -- @todo do the "declustering" at a different level. Probably + -- more efficient. + function gcicap.main() + for i, side in pairs(gcicap.sides) do + -- update list of occupied airfields + gcicap[side].airfields = getAirfields(side) + -- update list of all aircraft + gcicap[side].active_aircraft = getAllActiveAircrafts(side) + -- update list of all EWR + gcicap[side].active_ewr = getAllActiveEWR(side) + end + + -- check for airspace intrusions after updating all the lists + for i, side in pairs(gcicap.sides) do + if gcicap[side].cap.enabled then + manageCAP(side) + end + checkForAirspaceIntrusion(side) + handleIntrusion(side) + garbageCollector(side) + end + end + +end + +if gcicap.init() then + local start_delay = gcicap.initial_spawn_delay * math.max(gcicap.red.cap.groups_count, gcicap.blue.cap.groups_count) + mist.scheduleFunction(gcicap.main, {}, timer.getTime() + start_delay, gcicap.interval) +end + +-- vim: sw=2:ts=2 diff --git a/AID - AI Dispatching/AID-A2A - AI A2A Dispatching/AID-A2A-220 - GCICAP Demonstration/AID-220 - NORMANDY AI_A2A_GCICAP Demonstration.lua b/AID - AI Dispatching/AID-A2A - AI A2A Dispatching/AID-A2A-220 - GCICAP Demonstration/AID-220 - NORMANDY AI_A2A_GCICAP Demonstration.lua new file mode 100644 index 0000000000..7b0f9433d3 --- /dev/null +++ b/AID - AI Dispatching/AID-A2A - AI A2A Dispatching/AID-A2A-220 - GCICAP Demonstration/AID-220 - NORMANDY AI_A2A_GCICAP Demonstration.lua @@ -0,0 +1,27 @@ + + +-- RED + +--- Setup the Red Coalition A2A GCICAP dispatcher, and initialize it. +-- EWR network groups start with RED EWR, which are ships and patrols. +-- Squadron templates which are placed above the colored airbases, start with TR SQ. +-- Perform CAP, the zone for CAP starts with TR CAP, send minimal 10 groups of planes in the air. +A2A_GCICAP_Red = AI_A2A_GCICAP:New( { "TR SQ"}, { "TR SQ" }, { "TR CAP" }, 10 ) + +A2A_GCICAP_Red:SetBorderZone( ZONE_POLYGON:New( "Red Border", GROUP:FindByName( "Red Border" ) ) ) + +-- Enable the tactical display panel. This is to see what this dispatcher is doing. +--A2A_GCICAP_Red:SetTacticalDisplay( true ) + +-- BLUE + +--- Setup the Red Coalition A2A GCICAP dispatcher, and initialize it. +-- EWR network groups start with BLUE EWR. +-- Squadron templates which are placed above the colored airbases, start with UK SQ. +-- Perform no CAP. +A2A_GCICAP_Blue = AI_A2A_GCICAP:New( { "BLUE EWR" }, { "UK SQ" }, { }, 2 ) + +A2A_GCICAP_Blue:SetBorderZone( ZONE_POLYGON:New( "Blue Border", GROUP:FindByName( "Blue Border" ) ) ) + + + diff --git a/AID - AI Dispatching/AID-A2A - AI A2A Dispatching/AID-A2A-220 - GCICAP Demonstration/AID-A2A-220 - GCICAP Demonstration.miz b/AID - AI Dispatching/AID-A2A - AI A2A Dispatching/AID-A2A-220 - GCICAP Demonstration/AID-A2A-220 - GCICAP Demonstration.miz index 4263a692e0..ed1ab83a4a 100644 Binary files a/AID - AI Dispatching/AID-A2A - AI A2A Dispatching/AID-A2A-220 - GCICAP Demonstration/AID-A2A-220 - GCICAP Demonstration.miz and b/AID - AI Dispatching/AID-A2A - AI A2A Dispatching/AID-A2A-220 - GCICAP Demonstration/AID-A2A-220 - GCICAP Demonstration.miz differ diff --git a/AID - AI Dispatching/AID-A2G - AI A2G Dispatching API V2/AID-A2G-001 - Detection and Engage/AID-A2G-001 - Detection and Engage.lua b/AID - AI Dispatching/AID-A2G - AI A2G Dispatching API V2/AID-A2G-001 - Detection and Engage/AID-A2G-001 - Detection and Engage.lua index 15e4dcc26c..4f1264ed40 100644 --- a/AID - AI Dispatching/AID-A2G - AI A2G Dispatching API V2/AID-A2G-001 - Detection and Engage/AID-A2G-001 - Detection and Engage.lua +++ b/AID - AI Dispatching/AID-A2G - AI A2G Dispatching API V2/AID-A2G-001 - Detection and Engage/AID-A2G-001 - Detection and Engage.lua @@ -1,56 +1,56 @@ ---- Detect and attack a set of enemy units. --- Name: AID-A2G-001 - Detection and Attack Helicopters --- Author: FlightControl --- Date Created: 02 Nov 2018 - --- Define a SET_GROUP object that builds a collection of groups that define the recce network. --- Here we build the network with all the groups that have a name starting with CCCP Recce. -local DetectionSetGroup = SET_GROUP:New() -DetectionSetGroup:FilterPrefixes( { "CCCP Recce" } ) -DetectionSetGroup:FilterStart() - -local Detection = DETECTION_AREAS:New( DetectionSetGroup, 5000 ) - --- Setup the A2A dispatcher, and initialize it. -A2GDispatcher = AI_A2G_DISPATCHER:New( Detection ) - --- The Command Center (HQ) is the defense point and will also handle the communication to the coalition. -local HQ_Group = GROUP:FindByName( "HQ" ) -local HQ_CC = COMMANDCENTER:New( HQ_Group, "HQ" ) - --- The HQ is the defense point, so this point will be defended. -A2GDispatcher:AddDefenseCoordinate( "HQ", HQ_Group:GetCoordinate() ) -A2GDispatcher:SetDefenseReactivityHigh() -- High defense reactivity. So far proximity of a threat will trigger a defense action. -A2GDispatcher:SetDefenseRadius( 200000 ) -- Defense radius wide enough to also trigger defenses far away. - --- Communication to the players within the coalition. The HQ services the communication of the defense actions. -A2GDispatcher:SetCommandCenter( HQ_CC ) - --- Show a tactical display. -A2GDispatcher:SetTacticalDisplay( true ) - - --- Setup the squadrons. - -A2GDispatcher:SetSquadron( "Maykop CAS", "CAS", { "CCCP KA-50" }, 10 ) -A2GDispatcher:SetSquadronCas2( "Maykop CAS", 200, 250, 300, 500, "RADIO" ) -A2GDispatcher:SetSquadronTakeoffFromParkingHot( "Maykop CAS" ) -A2GDispatcher:SetSquadronOverhead( "Maykop CAS", 0.25 ) - -A2GDispatcher:SetSquadron( "Maykop BAI", "BAI", { "CCCP MIL-8MTV" }, 10 ) -A2GDispatcher:SetSquadronBai2( "Maykop BAI", 200, 250, 300, 500, "RADIO" ) -A2GDispatcher:SetSquadronTakeoffFromParkingHot( "Maykop BAI" ) -A2GDispatcher:SetSquadronOverhead( "Maykop BAI", 0.25 ) - -A2GDispatcher:SetSquadron( "Krasnodar", AIRBASE.Caucasus.Krasnodar_Pashkovsky, { "CCCP SU-25TM" }, 10 ) -A2GDispatcher:SetSquadronSead2( "Krasnodar", 600, 800, 2000, 2000, "RADIO" ) -A2GDispatcher:SetSquadronTakeoffFromParkingHot( "Krasnodar" ) -A2GDispatcher:SetSquadronOverhead( "Krasnodar", 0.2 ) - - --- We set for each squadron a takeoff interval, as each helicopter will launch from a FARP. --- This to prevent helicopters to clutter. --- Each helicopter group is taking off the FARP in hot start. -A2GDispatcher:SetSquadronTakeoffInterval( "Krasnodar", 10 ) -A2GDispatcher:SetSquadronTakeoffInterval( "Maykop CAS", 60 ) -A2GDispatcher:SetSquadronTakeoffInterval( "Maykop BAI", 60 ) +--- Detect and attack a set of enemy units. +-- Name: AID-A2G-001 - Detection and Attack Helicopters +-- Author: FlightControl +-- Date Created: 02 Nov 2018 + +-- Define a SET_GROUP object that builds a collection of groups that define the recce network. +-- Here we build the network with all the groups that have a name starting with CCCP Recce. +local DetectionSetGroup = SET_GROUP:New() +DetectionSetGroup:FilterPrefixes( { "CCCP Recce" } ) +DetectionSetGroup:FilterStart() + +local Detection = DETECTION_AREAS:New( DetectionSetGroup, 5000 ) + +-- Setup the A2A dispatcher, and initialize it. +A2GDispatcher = AI_A2G_DISPATCHER:New( Detection ) + +-- The Command Center (HQ) is the defense point and will also handle the communication to the coalition. +local HQ_Group = GROUP:FindByName( "HQ" ) +local HQ_CC = COMMANDCENTER:New( HQ_Group, "HQ" ) + +-- The HQ is the defense point, so this point will be defended. +A2GDispatcher:AddDefenseCoordinate( "HQ", HQ_Group:GetCoordinate() ) +A2GDispatcher:SetDefenseReactivityHigh() -- High defense reactivity. So far proximity of a threat will trigger a defense action. +A2GDispatcher:SetDefenseRadius( 200000 ) -- Defense radius wide enough to also trigger defenses far away. + +-- Communication to the players within the coalition. The HQ services the communication of the defense actions. +A2GDispatcher:SetCommandCenter( HQ_CC ) + +-- Show a tactical display. +A2GDispatcher:SetTacticalDisplay( true ) + + +-- Setup the squadrons. + +A2GDispatcher:SetSquadron( "Maykop CAS", "CAS", { "CCCP KA-50" }, 10 ) +A2GDispatcher:SetSquadronCas2( "Maykop CAS", 200, 250, 300, 500, "RADIO" ) +A2GDispatcher:SetSquadronTakeoffFromParkingHot( "Maykop CAS" ) +A2GDispatcher:SetSquadronOverhead( "Maykop CAS", 0.25 ) + +A2GDispatcher:SetSquadron( "Maykop BAI", "BAI", { "CCCP KA-50" }, 10 ) +A2GDispatcher:SetSquadronBai2( "Maykop BAI", 200, 250, 300, 500, "RADIO" ) +A2GDispatcher:SetSquadronTakeoffFromParkingHot( "Maykop BAI" ) +A2GDispatcher:SetSquadronOverhead( "Maykop BAI", 0.25 ) + +A2GDispatcher:SetSquadron( "Krasnodar", AIRBASE.Caucasus.Krasnodar_Pashkovsky, { "CCCP SU-25TM" }, 10 ) +A2GDispatcher:SetSquadronSead2( "Krasnodar", 600, 800, 2000, 2000, "RADIO" ) +A2GDispatcher:SetSquadronTakeoffFromParkingHot( "Krasnodar" ) +A2GDispatcher:SetSquadronOverhead( "Krasnodar", 0.2 ) + + +-- We set for each squadron a takeoff interval, as each helicopter will launch from a FARP. +-- This to prevent helicopters to clutter. +-- Each helicopter group is taking off the FARP in hot start. +A2GDispatcher:SetSquadronTakeoffInterval( "Krasnodar", 10 ) +A2GDispatcher:SetSquadronTakeoffInterval( "Maykop CAS", 60 ) +A2GDispatcher:SetSquadronTakeoffInterval( "Maykop BAI", 60 ) diff --git a/AID - AI Dispatching/AID-A2G - AI A2G Dispatching API V2/AID-A2G-001 - Detection and Engage/AID-A2G-001 - Detection and Engage.miz b/AID - AI Dispatching/AID-A2G - AI A2G Dispatching API V2/AID-A2G-001 - Detection and Engage/AID-A2G-001 - Detection and Engage.miz index 1fe0fc3431..2f78e1ed45 100644 Binary files a/AID - AI Dispatching/AID-A2G - AI A2G Dispatching API V2/AID-A2G-001 - Detection and Engage/AID-A2G-001 - Detection and Engage.miz and b/AID - AI Dispatching/AID-A2G - AI A2G Dispatching API V2/AID-A2G-001 - Detection and Engage/AID-A2G-001 - Detection and Engage.miz differ diff --git a/AID - AI Dispatching/AID-A2G - AI A2G Dispatching API V2/AID-A2G-002 - Patrol during Detection and Engage/AID-A2G-002 - Patrol during Detection and Engage.lua b/AID - AI Dispatching/AID-A2G - AI A2G Dispatching API V2/AID-A2G-002 - Patrol during Detection and Engage/AID-A2G-002 - Patrol during Detection and Engage.lua index 19dbf086bd..029cf33756 100644 --- a/AID - AI Dispatching/AID-A2G - AI A2G Dispatching API V2/AID-A2G-002 - Patrol during Detection and Engage/AID-A2G-002 - Patrol during Detection and Engage.lua +++ b/AID - AI Dispatching/AID-A2G - AI A2G Dispatching API V2/AID-A2G-002 - Patrol during Detection and Engage/AID-A2G-002 - Patrol during Detection and Engage.lua @@ -1,66 +1,66 @@ ---- Detect and attack a set of enemy units using helicopters. --- Name: AID-A2G-001 - Detection and Attack Helicopters --- Author: FlightControl --- Date Created: 02 Nov 2018 - --- Define a SET_GROUP object that builds a collection of groups that define the recce network. --- Here we build the network with all the groups that have a name starting with CCCP Recce. -local DetectionSetGroup = SET_GROUP:New() -DetectionSetGroup:FilterPrefixes( { "CCCP Recce" } ) -DetectionSetGroup:FilterStart() - -local Detection = DETECTION_AREAS:New( DetectionSetGroup, 1000 ) - --- Setup the A2A dispatcher, and initialize it. -A2GDispatcher = AI_A2G_DISPATCHER:New( Detection ) - --- The Command Center (HQ) is the defense point and will also handle the communication to the coalition. -local HQ_Group = GROUP:FindByName( "HQ" ) -local HQ_CC = COMMANDCENTER:New( HQ_Group, "HQ" ) - --- Add defense coordinates. -A2GDispatcher:AddDefenseCoordinate( "HQ", HQ_Group:GetCoordinate() ) -A2GDispatcher:SetDefenseReactivityHigh() -- High defense reactivity. So far proximity of a threat will trigger a defense action. -A2GDispatcher:SetDefenseRadius( 200000 ) -- Defense radius wide enough to also trigger defenses far away. - --- Communication to the players within the coalition. The HQ services the communication of the defense actions. -A2GDispatcher:SetCommandCenter( HQ_CC ) - --- Show a tactical display. -A2GDispatcher:SetTacticalDisplay( true ) - - --- Setup the patrols. - --- The patrol zone. -local PatrolZone = ZONE:New( "PatrolZone" ) - - --- SEADing from Krasnodar. -A2GDispatcher:SetSquadron( "Krasnodar", AIRBASE.Caucasus.Krasnodar_Pashkovsky, { "CCCP SU-25TM" }, 10 ) -A2GDispatcher:SetSquadronSeadPatrol2( "Krasnodar", PatrolZone, 500, 550, 2000, 2000, "BARO", 750, 800, 30, 30, "RADIO" ) -- New API -A2GDispatcher:SetSquadronSeadPatrolInterval( "Krasnodar", 2, 30, 60, 1 ) -A2GDispatcher:SetSquadronTakeoffFromParkingHot( "Krasnodar" ) -A2GDispatcher:SetSquadronOverhead( "Krasnodar", 0.2 ) - - --- Close Air Support from the CAS farp. -A2GDispatcher:SetSquadron( "Maykop CAS", "CAS", { "CCCP KA-50" }, 10 ) -A2GDispatcher:SetSquadronCasPatrol2( "Maykop CAS", PatrolZone, 50, 80, 600, 700, "BARO", 200, 230, 30, 30, "RADIO" ) -- New API -A2GDispatcher:SetSquadronCasPatrolInterval( "Maykop CAS", 2, 30, 60, 1 ) -A2GDispatcher:SetSquadronTakeoffFromParkingHot( "Maykop CAS" ) -A2GDispatcher:SetSquadronOverhead( "Maykop CAS", 0.25 ) - --- Battlefield Air Interdiction from the BAI farp. -A2GDispatcher:SetSquadron( "Maykop BAI", "BAI", { "CCCP MIL-8MTV" }, 10 ) -A2GDispatcher:SetSquadronBaiPatrol2( "Maykop BAI", PatrolZone, 50, 80, 600, 700, "BARO", 200, 230, 800, 900, "RADIO" ) -- New API -A2GDispatcher:SetSquadronBaiPatrolInterval( "Maykop BAI", 5, 30, 60, 1 ) -A2GDispatcher:SetSquadronTakeoffFromParkingHot( "Maykop BAI" ) -A2GDispatcher:SetSquadronOverhead( "Maykop BAI", 0.75 ) - --- We set for each squadron a takeoff interval, as each helicopter will launch from a FARP. --- This to prevent helicopters to clutter. --- Each helicopter group is taking off the FARP in hot start. -A2GDispatcher:SetSquadronTakeoffInterval( "Krasnodar", 10 ) -A2GDispatcher:SetSquadronTakeoffInterval( "Maykop CAS", 60 ) -A2GDispatcher:SetSquadronTakeoffInterval( "Maykop BAI", 60 ) +--- Detect and attack a set of enemy units using helicopters. +-- Name: AID-A2G-001 - Detection and Attack Helicopters +-- Author: FlightControl +-- Date Created: 02 Nov 2018 + +-- Define a SET_GROUP object that builds a collection of groups that define the recce network. +-- Here we build the network with all the groups that have a name starting with CCCP Recce. +local DetectionSetGroup = SET_GROUP:New() +DetectionSetGroup:FilterPrefixes( { "CCCP Recce" } ) +DetectionSetGroup:FilterStart() + +local Detection = DETECTION_AREAS:New( DetectionSetGroup, 1000 ) + +-- Setup the A2A dispatcher, and initialize it. +A2GDispatcher = AI_A2G_DISPATCHER:New( Detection ) + +-- The Command Center (HQ) is the defense point and will also handle the communication to the coalition. +local HQ_Group = GROUP:FindByName( "HQ" ) +local HQ_CC = COMMANDCENTER:New( HQ_Group, "HQ" ) + +-- Add defense coordinates. +A2GDispatcher:AddDefenseCoordinate( "HQ", HQ_Group:GetCoordinate() ) +A2GDispatcher:SetDefenseReactivityHigh() -- High defense reactivity. So far proximity of a threat will trigger a defense action. +A2GDispatcher:SetDefenseRadius( 200000 ) -- Defense radius wide enough to also trigger defenses far away. + +-- Communication to the players within the coalition. The HQ services the communication of the defense actions. +A2GDispatcher:SetCommandCenter( HQ_CC ) + +-- Show a tactical display. +A2GDispatcher:SetTacticalDisplay( true ) + + +-- Setup the patrols. + +-- The patrol zone. +local PatrolZone = ZONE:New( "PatrolZone" ) + + +-- SEADing from Krasnodar. +A2GDispatcher:SetSquadron( "Krasnodar", AIRBASE.Caucasus.Krasnodar_Pashkovsky, { "CCCP SU-25TM" }, 10 ) +A2GDispatcher:SetSquadronSeadPatrol2( "Krasnodar", PatrolZone, 500, 550, 2000, 2000, "BARO", 750, 800, 30, 30, "RADIO" ) -- New API +A2GDispatcher:SetSquadronSeadPatrolInterval( "Krasnodar", 2, 30, 60, 1 ) +A2GDispatcher:SetSquadronTakeoffFromParkingHot( "Krasnodar" ) +A2GDispatcher:SetSquadronOverhead( "Krasnodar", 0.2 ) + + +-- Close Air Support from the CAS farp. +A2GDispatcher:SetSquadron( "Maykop CAS", "CAS", { "CCCP KA-50" }, 10 ) +A2GDispatcher:SetSquadronCasPatrol2( "Maykop CAS", PatrolZone, 50, 80, 600, 700, "BARO", 200, 230, 30, 30, "RADIO" ) -- New API +A2GDispatcher:SetSquadronCasPatrolInterval( "Maykop CAS", 2, 30, 60, 1 ) +A2GDispatcher:SetSquadronTakeoffFromParkingHot( "Maykop CAS" ) +A2GDispatcher:SetSquadronOverhead( "Maykop CAS", 0.25 ) + +-- Battlefield Air Interdiction from the BAI farp. +A2GDispatcher:SetSquadron( "Maykop BAI", "BAI", { "CCCP MIL-8MTV" }, 10 ) +A2GDispatcher:SetSquadronBaiPatrol2( "Maykop BAI", PatrolZone, 50, 80, 600, 700, "BARO", 200, 230, 800, 900, "RADIO" ) -- New API +A2GDispatcher:SetSquadronBaiPatrolInterval( "Maykop BAI", 5, 30, 60, 1 ) +A2GDispatcher:SetSquadronTakeoffFromParkingHot( "Maykop BAI" ) +A2GDispatcher:SetSquadronOverhead( "Maykop BAI", 0.75 ) + +-- We set for each squadron a takeoff interval, as each helicopter will launch from a FARP. +-- This to prevent helicopters to clutter. +-- Each helicopter group is taking off the FARP in hot start. +A2GDispatcher:SetSquadronTakeoffInterval( "Krasnodar", 10 ) +A2GDispatcher:SetSquadronTakeoffInterval( "Maykop CAS", 60 ) +A2GDispatcher:SetSquadronTakeoffInterval( "Maykop BAI", 60 ) diff --git a/AID - AI Dispatching/AID-A2G - AI A2G Dispatching API V2/AID-A2G-002 - Patrol during Detection and Engage/AID-A2G-002 - Patrol during Detection and Engage.miz b/AID - AI Dispatching/AID-A2G - AI A2G Dispatching API V2/AID-A2G-002 - Patrol during Detection and Engage/AID-A2G-002 - Patrol during Detection and Engage.miz index 7e09a67cca..3ad4b6ff87 100644 Binary files a/AID - AI Dispatching/AID-A2G - AI A2G Dispatching API V2/AID-A2G-002 - Patrol during Detection and Engage/AID-A2G-002 - Patrol during Detection and Engage.miz and b/AID - AI Dispatching/AID-A2G - AI A2G Dispatching API V2/AID-A2G-002 - Patrol during Detection and Engage/AID-A2G-002 - Patrol during Detection and Engage.miz differ diff --git a/AID - AI Dispatching/AID-A2G - AI A2G Dispatching/AID-A2G-001 - Detection and Attack Helicopters/AID-A2G-001 - Detection and Attack Helicopters.lua b/AID - AI Dispatching/AID-A2G - AI A2G Dispatching/AID-A2G-001 - Detection and Attack Helicopters/AID-A2G-001 - Detection and Attack Helicopters.lua index 5118b7fdf8..d42ce59951 100644 --- a/AID - AI Dispatching/AID-A2G - AI A2G Dispatching/AID-A2G-001 - Detection and Attack Helicopters/AID-A2G-001 - Detection and Attack Helicopters.lua +++ b/AID - AI Dispatching/AID-A2G - AI A2G Dispatching/AID-A2G-001 - Detection and Attack Helicopters/AID-A2G-001 - Detection and Attack Helicopters.lua @@ -1,48 +1,48 @@ ---- Detect and attack a set of enemy units using helicopters. --- Name: AID-A2G-001 - Detection and Attack Helicopters --- Author: FlightControl --- Date Created: 02 Nov 2018 - --- Define a SET_GROUP object that builds a collection of groups that define the recce network. --- Here we build the network with all the groups that have a name starting with CCCP Recce. -DetectionSetGroup = SET_GROUP:New() -DetectionSetGroup:FilterPrefixes( { "CCCP Recce" } ) -DetectionSetGroup:FilterStart() - -Detection = DETECTION_AREAS:New( DetectionSetGroup, 5000 ) - --- Setup the A2A dispatcher, and initialize it. -A2GDispatcher = AI_A2G_DISPATCHER:New( Detection ) - --- Add defense coordinates. -A2GDispatcher:AddDefenseCoordinate( "HQ", GROUP:FindByName( "HQ" ):GetCoordinate() ) - -A2GDispatcher:SetDefenseReactivityHigh() - -A2GDispatcher:SetDefenseRadius( 200000 ) - -A2GDispatcher:SetTacticalDisplay( true ) - --- Setup the squadrons. - -A2GDispatcher:SetSquadron( "Maykop SEAD", AIRBASE.Caucasus.Maykop_Khanskaya, { "CCCP SU-25T" }, 10 ) -A2GDispatcher:SetSquadronSead( "Maykop SEAD", 120, 250 ) -A2GDispatcher:SetSquadronTakeoffFromParkingHot( "Maykop SEAD" ) -A2GDispatcher:SetSquadronOverhead( "Maykop SEAD", 0.2 ) - -A2GDispatcher:SetSquadron( "Maykop CAS", "CAS", { "CCCP KA-50" }, 10 ) -A2GDispatcher:SetSquadronCas( "Maykop CAS", 120, 250 ) -A2GDispatcher:SetSquadronTakeoffFromParkingHot( "Maykop CAS" ) -A2GDispatcher:SetSquadronOverhead( "Maykop CAS", 0.25 ) - -A2GDispatcher:SetSquadron( "Maykop BAI", "BAI", { "CCCP KA-50" }, 10 ) -A2GDispatcher:SetSquadronBai( "Maykop BAI", 120, 250 ) -A2GDispatcher:SetSquadronTakeoffFromParkingHot( "Maykop BAI" ) -A2GDispatcher:SetSquadronOverhead( "Maykop BAI", 0.25 ) - --- We set for each squadron a takeoff interval, as each helicopter will launch from a FARP. --- This to prevent helicopters to clutter. --- Each helicopter group is taking off the FARP in hot start. -A2GDispatcher:SetSquadronTakeoffInterval( "Maykop SEAD", 60 ) -A2GDispatcher:SetSquadronTakeoffInterval( "Maykop CAS", 60 ) -A2GDispatcher:SetSquadronTakeoffInterval( "Maykop BAI", 60 ) +--- Detect and attack a set of enemy units using helicopters. +-- Name: AID-A2G-001 - Detection and Attack Helicopters +-- Author: FlightControl +-- Date Created: 02 Nov 2018 + +-- Define a SET_GROUP object that builds a collection of groups that define the recce network. +-- Here we build the network with all the groups that have a name starting with CCCP Recce. +DetectionSetGroup = SET_GROUP:New() +DetectionSetGroup:FilterPrefixes( { "CCCP Recce" } ) +DetectionSetGroup:FilterStart() + +Detection = DETECTION_AREAS:New( DetectionSetGroup, 5000 ) + +-- Setup the A2A dispatcher, and initialize it. +A2GDispatcher = AI_A2G_DISPATCHER:New( Detection ) + +-- Add defense coordinates. +A2GDispatcher:AddDefenseCoordinate( "HQ", GROUP:FindByName( "HQ" ):GetCoordinate() ) + +A2GDispatcher:SetDefenseReactivityHigh() + +A2GDispatcher:SetDefenseRadius( 200000 ) + +A2GDispatcher:SetTacticalDisplay( true ) + +-- Setup the squadrons. + +A2GDispatcher:SetSquadron( "Maykop SEAD", AIRBASE.Caucasus.Maykop_Khanskaya, { "CCCP SU-25T" }, 10 ) +A2GDispatcher:SetSquadronSead( "Maykop SEAD", 120, 250 ) +A2GDispatcher:SetSquadronTakeoffFromParkingHot( "Maykop SEAD" ) +A2GDispatcher:SetSquadronOverhead( "Maykop SEAD", 0.2 ) + +A2GDispatcher:SetSquadron( "Maykop CAS", "CAS", { "CCCP KA-50" }, 10 ) +A2GDispatcher:SetSquadronCas( "Maykop CAS", 120, 250 ) +A2GDispatcher:SetSquadronTakeoffFromParkingHot( "Maykop CAS" ) +A2GDispatcher:SetSquadronOverhead( "Maykop CAS", 0.25 ) + +A2GDispatcher:SetSquadron( "Maykop BAI", "BAI", { "CCCP KA-50" }, 10 ) +A2GDispatcher:SetSquadronBai( "Maykop BAI", 120, 250 ) +A2GDispatcher:SetSquadronTakeoffFromParkingHot( "Maykop BAI" ) +A2GDispatcher:SetSquadronOverhead( "Maykop BAI", 0.25 ) + +-- We set for each squadron a takeoff interval, as each helicopter will launch from a FARP. +-- This to prevent helicopters to clutter. +-- Each helicopter group is taking off the FARP in hot start. +A2GDispatcher:SetSquadronTakeoffInterval( "Maykop SEAD", 60 ) +A2GDispatcher:SetSquadronTakeoffInterval( "Maykop CAS", 60 ) +A2GDispatcher:SetSquadronTakeoffInterval( "Maykop BAI", 60 ) diff --git a/AID - AI Dispatching/AID-A2G - AI A2G Dispatching/AID-A2G-001 - Detection and Attack Helicopters/AID-A2G-001 - Detection and Attack Helicopters.miz b/AID - AI Dispatching/AID-A2G - AI A2G Dispatching/AID-A2G-001 - Detection and Attack Helicopters/AID-A2G-001 - Detection and Attack Helicopters.miz index ff1e9430d5..eb0ac2a342 100644 Binary files a/AID - AI Dispatching/AID-A2G - AI A2G Dispatching/AID-A2G-001 - Detection and Attack Helicopters/AID-A2G-001 - Detection and Attack Helicopters.miz and b/AID - AI Dispatching/AID-A2G - AI A2G Dispatching/AID-A2G-001 - Detection and Attack Helicopters/AID-A2G-001 - Detection and Attack Helicopters.miz differ diff --git a/AID - AI Dispatching/AID-A2G - AI A2G Dispatching/AID-A2G-002 - Patrol and Engage Helicopters/AID-A2G-002 - Patrol and Engage Helicopters.lua b/AID - AI Dispatching/AID-A2G - AI A2G Dispatching/AID-A2G-002 - Patrol and Engage Helicopters/AID-A2G-002 - Patrol and Engage Helicopters.lua index 82403dd4df..d5cc27230c 100644 --- a/AID - AI Dispatching/AID-A2G - AI A2G Dispatching/AID-A2G-002 - Patrol and Engage Helicopters/AID-A2G-002 - Patrol and Engage Helicopters.lua +++ b/AID - AI Dispatching/AID-A2G - AI A2G Dispatching/AID-A2G-002 - Patrol and Engage Helicopters/AID-A2G-002 - Patrol and Engage Helicopters.lua @@ -1,52 +1,52 @@ ---- Detect and attack a set of enemy units using helicopters. --- Name: AID-A2G-001 - Detection and Attack Helicopters --- Author: FlightControl --- Date Created: 02 Nov 2018 - --- Define a SET_GROUP object that builds a collection of groups that define the recce network. --- Here we build the network with all the groups that have a name starting with CCCP Recce. -DetectionSetGroup = SET_GROUP:New() -DetectionSetGroup:FilterPrefixes( { "CCCP Recce" } ) -DetectionSetGroup:FilterStart() - -Detection = DETECTION_AREAS:New( DetectionSetGroup, 1000 ) - --- Setup the A2A dispatcher, and initialize it. -A2GDispatcher = AI_A2G_DISPATCHER:New( Detection ) - --- Add defense coordinates. -A2GDispatcher:AddDefenseCoordinate( "HQ", GROUP:FindByName( "HQ" ):GetCoordinate() ) - -A2GDispatcher:SetDefenseReactivityHigh() - -A2GDispatcher:SetDefenseRadius( 100000 ) - -A2GDispatcher:SetTacticalDisplay( true ) - -local PatrolZone = ZONE:New( "PatrolZone" ) - --- Setup the squadrons. -A2GDispatcher:SetSquadron( "Maykop SEAD", "SEAD", { "CCCP KA-50" }, 10 ) -A2GDispatcher:SetSquadronSeadPatrol( "Maykop SEAD", PatrolZone, 300, 500, 50, 80, 250, 300 ) -A2GDispatcher:SetSquadronPatrolInterval( "Maykop SEAD", 2, 30, 60, 1, "SEAD" ) -A2GDispatcher:SetSquadronTakeoffFromParkingHot( "Maykop SEAD" ) -A2GDispatcher:SetSquadronOverhead( "Maykop SEAD", 0.25 ) - -A2GDispatcher:SetSquadron( "Maykop CAS", "CAS", { "CCCP KA-50" }, 10 ) -A2GDispatcher:SetSquadronCasPatrol( "Maykop CAS", PatrolZone, 600, 700, 50, 80, 250, 300 ) -A2GDispatcher:SetSquadronPatrolInterval( "Maykop CAS", 2, 30, 60, 1, "CAS" ) -A2GDispatcher:SetSquadronTakeoffFromParkingHot( "Maykop CAS" ) -A2GDispatcher:SetSquadronOverhead( "Maykop CAS", 0.25 ) - -A2GDispatcher:SetSquadron( "Maykop BAI", "BAI", { "CCCP KA-50" }, 10 ) -A2GDispatcher:SetSquadronBaiPatrol( "Maykop BAI", PatrolZone, 800, 900, 50, 80, 250, 300 ) -A2GDispatcher:SetSquadronPatrolInterval( "Maykop BAI", 2, 30, 60, 1, "BAI" ) -A2GDispatcher:SetSquadronTakeoffFromParkingHot( "Maykop BAI" ) -A2GDispatcher:SetSquadronOverhead( "Maykop BAI", 0.25 ) - --- We set for each squadron a takeoff interval, as each helicopter will launch from a FARP. --- This to prevent helicopters to clutter. --- Each helicopter group is taking off the FARP in hot start. -A2GDispatcher:SetSquadronTakeoffInterval( "Maykop SEAD", 60 ) -A2GDispatcher:SetSquadronTakeoffInterval( "Maykop CAS", 60 ) +--- Detect and attack a set of enemy units using helicopters. +-- Name: AID-A2G-001 - Detection and Attack Helicopters +-- Author: FlightControl +-- Date Created: 02 Nov 2018 + +-- Define a SET_GROUP object that builds a collection of groups that define the recce network. +-- Here we build the network with all the groups that have a name starting with CCCP Recce. +DetectionSetGroup = SET_GROUP:New() +DetectionSetGroup:FilterPrefixes( { "CCCP Recce" } ) +DetectionSetGroup:FilterStart() + +Detection = DETECTION_AREAS:New( DetectionSetGroup, 1000 ) + +-- Setup the A2A dispatcher, and initialize it. +A2GDispatcher = AI_A2G_DISPATCHER:New( Detection ) + +-- Add defense coordinates. +A2GDispatcher:AddDefenseCoordinate( "HQ", GROUP:FindByName( "HQ" ):GetCoordinate() ) + +A2GDispatcher:SetDefenseReactivityHigh() + +A2GDispatcher:SetDefenseRadius( 100000 ) + +A2GDispatcher:SetTacticalDisplay( true ) + +local PatrolZone = ZONE:New( "PatrolZone" ) + +-- Setup the squadrons. +A2GDispatcher:SetSquadron( "Maykop SEAD", "SEAD", { "CCCP KA-50" }, 10 ) +A2GDispatcher:SetSquadronSeadPatrol( "Maykop SEAD", PatrolZone, 300, 500, 50, 80, 250, 300 ) +A2GDispatcher:SetSquadronPatrolInterval( "Maykop SEAD", 2, 30, 60, 1, "SEAD" ) +A2GDispatcher:SetSquadronTakeoffFromParkingHot( "Maykop SEAD" ) +A2GDispatcher:SetSquadronOverhead( "Maykop SEAD", 0.25 ) + +A2GDispatcher:SetSquadron( "Maykop CAS", "CAS", { "CCCP KA-50" }, 10 ) +A2GDispatcher:SetSquadronCasPatrol( "Maykop CAS", PatrolZone, 600, 700, 50, 80, 250, 300 ) +A2GDispatcher:SetSquadronPatrolInterval( "Maykop CAS", 2, 30, 60, 1, "CAS" ) +A2GDispatcher:SetSquadronTakeoffFromParkingHot( "Maykop CAS" ) +A2GDispatcher:SetSquadronOverhead( "Maykop CAS", 0.25 ) + +A2GDispatcher:SetSquadron( "Maykop BAI", "BAI", { "CCCP KA-50" }, 10 ) +A2GDispatcher:SetSquadronBaiPatrol( "Maykop BAI", PatrolZone, 800, 900, 50, 80, 250, 300 ) +A2GDispatcher:SetSquadronPatrolInterval( "Maykop BAI", 2, 30, 60, 1, "BAI" ) +A2GDispatcher:SetSquadronTakeoffFromParkingHot( "Maykop BAI" ) +A2GDispatcher:SetSquadronOverhead( "Maykop BAI", 0.25 ) + +-- We set for each squadron a takeoff interval, as each helicopter will launch from a FARP. +-- This to prevent helicopters to clutter. +-- Each helicopter group is taking off the FARP in hot start. +A2GDispatcher:SetSquadronTakeoffInterval( "Maykop SEAD", 60 ) +A2GDispatcher:SetSquadronTakeoffInterval( "Maykop CAS", 60 ) A2GDispatcher:SetSquadronTakeoffInterval( "Maykop BAI", 60 ) \ No newline at end of file diff --git a/AID - AI Dispatching/AID-A2G - AI A2G Dispatching/AID-A2G-002 - Patrol and Engage Helicopters/AID-A2G-002 - Patrol and Engage Helicopters.miz b/AID - AI Dispatching/AID-A2G - AI A2G Dispatching/AID-A2G-002 - Patrol and Engage Helicopters/AID-A2G-002 - Patrol and Engage Helicopters.miz index c82691d824..214f3817ed 100644 Binary files a/AID - AI Dispatching/AID-A2G - AI A2G Dispatching/AID-A2G-002 - Patrol and Engage Helicopters/AID-A2G-002 - Patrol and Engage Helicopters.miz and b/AID - AI Dispatching/AID-A2G - AI A2G Dispatching/AID-A2G-002 - Patrol and Engage Helicopters/AID-A2G-002 - Patrol and Engage Helicopters.miz differ diff --git a/AID - AI Dispatching/AID-A2G - AI A2G Dispatching/AID-A2G-003 - Detection and Attack one Group Helicopters/AID-A2G-003 - Detection and Attack one Group Helicopters.lua b/AID - AI Dispatching/AID-A2G - AI A2G Dispatching/AID-A2G-003 - Detection and Attack one Group Helicopters/AID-A2G-003 - Detection and Attack one Group Helicopters.lua index 75ce3f01a0..c4b7fff895 100644 --- a/AID - AI Dispatching/AID-A2G - AI A2G Dispatching/AID-A2G-003 - Detection and Attack one Group Helicopters/AID-A2G-003 - Detection and Attack one Group Helicopters.lua +++ b/AID - AI Dispatching/AID-A2G - AI A2G Dispatching/AID-A2G-003 - Detection and Attack one Group Helicopters/AID-A2G-003 - Detection and Attack one Group Helicopters.lua @@ -1,52 +1,52 @@ ---- Detect and attack a set of enemy units using helicopters. --- Name: AID-A2G-001 - Detection and Attack Helicopters --- Author: FlightControl --- Date Created: 02 Nov 2018 - - -CC = COMMANDCENTER:New( GROUP:FindByName( "HQ" ), "HQ" ) - --- Define a SET_GROUP object that builds a collection of groups that define the recce network. --- Here we build the network with all the groups that have a name starting with CCCP Recce. -DetectionSetGroup = SET_GROUP:New() -DetectionSetGroup:FilterPrefixes( { "CCCP Recce" } ) -DetectionSetGroup:FilterStart() - -Detection = DETECTION_AREAS:New( DetectionSetGroup, 1000 ) - --- Setup the A2A dispatcher, and initialize it. -A2GDispatcher = AI_A2G_DISPATCHER:New( Detection ) -A2GDispatcher:SetCommandCenter( CC ) - --- Add defense coordinates. -A2GDispatcher:AddDefenseCoordinate( "HQ", GROUP:FindByName( "HQ" ):GetCoordinate() ) - -A2GDispatcher:SetDefenseReactivityHigh() - -A2GDispatcher:SetDefenseRadius( 200000 ) - -A2GDispatcher:SetTacticalDisplay( true ) - --- Setup the squadrons. - -A2GDispatcher:SetSquadron( "Maykop SEAD", AIRBASE.Caucasus.Maykop_Khanskaya, { "CCCP SU-25T" }, 10 ) -A2GDispatcher:SetSquadronSead( "Maykop SEAD", 120, 250 ) -A2GDispatcher:SetSquadronTakeoffFromParkingHot( "Maykop SEAD" ) -A2GDispatcher:SetSquadronOverhead( "Maykop SEAD", 0.2 ) - -A2GDispatcher:SetSquadron( "Maykop CAS", "CAS", { "CCCP KA-50" }, 10 ) -A2GDispatcher:SetSquadronCas( "Maykop CAS", 120, 250 ) -A2GDispatcher:SetSquadronTakeoffFromParkingHot( "Maykop CAS" ) -A2GDispatcher:SetSquadronOverhead( "Maykop CAS", 0.25 ) - -A2GDispatcher:SetSquadron( "Maykop BAI", "BAI", { "CCCP KA-50" }, 10 ) -A2GDispatcher:SetSquadronBai( "Maykop BAI", 120, 250 ) -A2GDispatcher:SetSquadronTakeoffFromParkingHot( "Maykop BAI" ) -A2GDispatcher:SetSquadronOverhead( "Maykop BAI", 0.25 ) - --- We set for each squadron a takeoff interval, as each helicopter will launch from a FARP. --- This to prevent helicopters to clutter. --- Each helicopter group is taking off the FARP in hot start. -A2GDispatcher:SetSquadronTakeoffInterval( "Maykop SEAD", 60 ) -A2GDispatcher:SetSquadronTakeoffInterval( "Maykop CAS", 60 ) -A2GDispatcher:SetSquadronTakeoffInterval( "Maykop BAI", 60 ) +--- Detect and attack a set of enemy units using helicopters. +-- Name: AID-A2G-001 - Detection and Attack Helicopters +-- Author: FlightControl +-- Date Created: 02 Nov 2018 + + +CC = COMMANDCENTER:New( GROUP:FindByName("HQ"),"HQ") + +-- Define a SET_GROUP object that builds a collection of groups that define the recce network. +-- Here we build the network with all the groups that have a name starting with CCCP Recce. +DetectionSetGroup = SET_GROUP:New() +DetectionSetGroup:FilterPrefixes( { "CCCP Recce" } ) +DetectionSetGroup:FilterStart() + +Detection = DETECTION_AREAS:New( DetectionSetGroup, 1000 ) + +-- Setup the A2A dispatcher, and initialize it. +A2GDispatcher = AI_A2G_DISPATCHER:New( Detection ) +A2GDispatcher:SetCommandCenter( CC ) + +-- Add defense coordinates. +A2GDispatcher:AddDefenseCoordinate( "HQ", GROUP:FindByName( "HQ" ):GetCoordinate() ) + +A2GDispatcher:SetDefenseReactivityHigh() + +A2GDispatcher:SetDefenseRadius( 200000 ) + +A2GDispatcher:SetTacticalDisplay( true ) + +-- Setup the squadrons. + +A2GDispatcher:SetSquadron( "Maykop SEAD", AIRBASE.Caucasus.Maykop_Khanskaya, { "CCCP SU-25T" }, 10 ) +A2GDispatcher:SetSquadronSead( "Maykop SEAD", 120, 250 ) +A2GDispatcher:SetSquadronTakeoffFromParkingHot( "Maykop SEAD" ) +A2GDispatcher:SetSquadronOverhead( "Maykop SEAD", 0.2 ) + +A2GDispatcher:SetSquadron( "Maykop CAS", "CAS", { "CCCP KA-50" }, 10 ) +A2GDispatcher:SetSquadronCas( "Maykop CAS", 120, 250 ) +A2GDispatcher:SetSquadronTakeoffFromParkingHot( "Maykop CAS" ) +A2GDispatcher:SetSquadronOverhead( "Maykop CAS", 0.25 ) + +A2GDispatcher:SetSquadron( "Maykop BAI", "BAI", { "CCCP KA-50" }, 10 ) +A2GDispatcher:SetSquadronBai( "Maykop BAI", 120, 250 ) +A2GDispatcher:SetSquadronTakeoffFromParkingHot( "Maykop BAI" ) +A2GDispatcher:SetSquadronOverhead( "Maykop BAI", 0.25 ) + +-- We set for each squadron a takeoff interval, as each helicopter will launch from a FARP. +-- This to prevent helicopters to clutter. +-- Each helicopter group is taking off the FARP in hot start. +A2GDispatcher:SetSquadronTakeoffInterval( "Maykop SEAD", 60 ) +A2GDispatcher:SetSquadronTakeoffInterval( "Maykop CAS", 60 ) +A2GDispatcher:SetSquadronTakeoffInterval( "Maykop BAI", 60 ) diff --git a/AID - AI Dispatching/AID-A2G - AI A2G Dispatching/AID-A2G-003 - Detection and Attack one Group Helicopters/AID-A2G-003 - Detection and Attack one Group Helicopters.miz b/AID - AI Dispatching/AID-A2G - AI A2G Dispatching/AID-A2G-003 - Detection and Attack one Group Helicopters/AID-A2G-003 - Detection and Attack one Group Helicopters.miz index 79a42f8ec0..28ae8d59ad 100644 Binary files a/AID - AI Dispatching/AID-A2G - AI A2G Dispatching/AID-A2G-003 - Detection and Attack one Group Helicopters/AID-A2G-003 - Detection and Attack one Group Helicopters.miz and b/AID - AI Dispatching/AID-A2G - AI A2G Dispatching/AID-A2G-003 - Detection and Attack one Group Helicopters/AID-A2G-003 - Detection and Attack one Group Helicopters.miz differ diff --git a/AID - AI Dispatching/AID-A2G - AI A2G Dispatching/AID-A2G-004 - Detection and attack close defense point Helicopters/AID-A2G-003 - Detection and Attack one Group Helicopters.lua b/AID - AI Dispatching/AID-A2G - AI A2G Dispatching/AID-A2G-004 - Detection and attack close defense point Helicopters/AID-A2G-003 - Detection and Attack one Group Helicopters.lua new file mode 100644 index 0000000000..c4b7fff895 --- /dev/null +++ b/AID - AI Dispatching/AID-A2G - AI A2G Dispatching/AID-A2G-004 - Detection and attack close defense point Helicopters/AID-A2G-003 - Detection and Attack one Group Helicopters.lua @@ -0,0 +1,52 @@ +--- Detect and attack a set of enemy units using helicopters. +-- Name: AID-A2G-001 - Detection and Attack Helicopters +-- Author: FlightControl +-- Date Created: 02 Nov 2018 + + +CC = COMMANDCENTER:New( GROUP:FindByName("HQ"),"HQ") + +-- Define a SET_GROUP object that builds a collection of groups that define the recce network. +-- Here we build the network with all the groups that have a name starting with CCCP Recce. +DetectionSetGroup = SET_GROUP:New() +DetectionSetGroup:FilterPrefixes( { "CCCP Recce" } ) +DetectionSetGroup:FilterStart() + +Detection = DETECTION_AREAS:New( DetectionSetGroup, 1000 ) + +-- Setup the A2A dispatcher, and initialize it. +A2GDispatcher = AI_A2G_DISPATCHER:New( Detection ) +A2GDispatcher:SetCommandCenter( CC ) + +-- Add defense coordinates. +A2GDispatcher:AddDefenseCoordinate( "HQ", GROUP:FindByName( "HQ" ):GetCoordinate() ) + +A2GDispatcher:SetDefenseReactivityHigh() + +A2GDispatcher:SetDefenseRadius( 200000 ) + +A2GDispatcher:SetTacticalDisplay( true ) + +-- Setup the squadrons. + +A2GDispatcher:SetSquadron( "Maykop SEAD", AIRBASE.Caucasus.Maykop_Khanskaya, { "CCCP SU-25T" }, 10 ) +A2GDispatcher:SetSquadronSead( "Maykop SEAD", 120, 250 ) +A2GDispatcher:SetSquadronTakeoffFromParkingHot( "Maykop SEAD" ) +A2GDispatcher:SetSquadronOverhead( "Maykop SEAD", 0.2 ) + +A2GDispatcher:SetSquadron( "Maykop CAS", "CAS", { "CCCP KA-50" }, 10 ) +A2GDispatcher:SetSquadronCas( "Maykop CAS", 120, 250 ) +A2GDispatcher:SetSquadronTakeoffFromParkingHot( "Maykop CAS" ) +A2GDispatcher:SetSquadronOverhead( "Maykop CAS", 0.25 ) + +A2GDispatcher:SetSquadron( "Maykop BAI", "BAI", { "CCCP KA-50" }, 10 ) +A2GDispatcher:SetSquadronBai( "Maykop BAI", 120, 250 ) +A2GDispatcher:SetSquadronTakeoffFromParkingHot( "Maykop BAI" ) +A2GDispatcher:SetSquadronOverhead( "Maykop BAI", 0.25 ) + +-- We set for each squadron a takeoff interval, as each helicopter will launch from a FARP. +-- This to prevent helicopters to clutter. +-- Each helicopter group is taking off the FARP in hot start. +A2GDispatcher:SetSquadronTakeoffInterval( "Maykop SEAD", 60 ) +A2GDispatcher:SetSquadronTakeoffInterval( "Maykop CAS", 60 ) +A2GDispatcher:SetSquadronTakeoffInterval( "Maykop BAI", 60 ) diff --git a/AID - AI Dispatching/AID-A2G - AI A2G Dispatching/AID-A2G-004 - Detection and attack close defense point Helicopters/AID-A2G-004 - Detection and attack close defense point Helicopters.miz b/AID - AI Dispatching/AID-A2G - AI A2G Dispatching/AID-A2G-004 - Detection and attack close defense point Helicopters/AID-A2G-004 - Detection and attack close defense point Helicopters.miz index ad1e50ab12..28ae8d59ad 100644 Binary files a/AID - AI Dispatching/AID-A2G - AI A2G Dispatching/AID-A2G-004 - Detection and attack close defense point Helicopters/AID-A2G-004 - Detection and attack close defense point Helicopters.miz and b/AID - AI Dispatching/AID-A2G - AI A2G Dispatching/AID-A2G-004 - Detection and attack close defense point Helicopters/AID-A2G-004 - Detection and attack close defense point Helicopters.miz differ diff --git a/AID - AI Dispatching/AID-A2G - AI A2G Dispatching/AID-A2G-100 - DefenseRadius/AID-A2G-100 - DefenseRadius.lua b/AID - AI Dispatching/AID-A2G - AI A2G Dispatching/AID-A2G-100 - DefenseRadius/AID-A2G-100 - DefenseRadius.lua index 3354a20382..9af5a5eebc 100644 --- a/AID - AI Dispatching/AID-A2G - AI A2G Dispatching/AID-A2G-100 - DefenseRadius/AID-A2G-100 - DefenseRadius.lua +++ b/AID - AI Dispatching/AID-A2G - AI A2G Dispatching/AID-A2G-100 - DefenseRadius/AID-A2G-100 - DefenseRadius.lua @@ -1,50 +1,50 @@ ---- Test the defense radius. --- Defenses should pickup targets within the defense radius, but not outside of it! --- Defenses should engage targets closer to the HQ with higher probability than targets at longer distance from the HQ. --- The tests are with SEAD only. --- Name: AID-A2G-003 - DefenseRadius --- Author: FlightControl --- Date Created: 11 Nov 2018 - --- Define a SET_GROUP object that builds a collection of groups that define the recce network. --- Here we build the network with all the groups that have a name starting with CCCP Recce. -DetectionSetGroup = SET_GROUP:New() -- Defene a set of group objects, caled DetectionSetGroup. - -DetectionSetGroup:FilterPrefixes( { "CCCP Recce" } ) -- The DetectionSetGroup will search for groups that start with the name "CCCP Recce". - --- This command will start the dynamic filtering, so when groups spawn in or are destroyed, --- which have a group name starting with "CCCP Recce", then these will be automatically added or removed from the set. -DetectionSetGroup:FilterStart() - --- This command defines the reconnaissance network. --- It will group any detected ground enemy targets within a radius of 1km. --- It uses the DetectionSetGroup, which defines the set of reconnaissance groups to detect for enemy ground targets. -Detection = DETECTION_AREAS:New( DetectionSetGroup, 1000 ) - --- Setup the A2A dispatcher, and initialize it. -A2GDispatcher = AI_A2G_DISPATCHER:New( Detection ) - --- Add defense coordinates. -A2GDispatcher:AddDefenseCoordinate( "HQ", GROUP:FindByName( "HQ" ):GetCoordinate() ) - -A2GDispatcher:SetDefenseReactivityHigh() - -A2GDispatcher:SetDefenseRadius( 100000 ) - -A2GDispatcher:SetTacticalDisplay( true ) - -local PatrolZone = ZONE:New( "PatrolZone" ) - --- Setup the SEAD squadrons. -A2GDispatcher:SetSquadron( "Maykop SEAD", AIRBASE.Caucasus.Maykop_Khanskaya, { "CCCP SU-25T SEAD" }, 10 ) -A2GDispatcher:SetSquadronSeadPatrol( "Maykop SEAD", PatrolZone, 1000, 2500, 400, 600, 1100, 1500 ) -A2GDispatcher:SetSquadronSeadPatrolInterval( "Maykop SEAD", 1, 30, 60, 1 ) -A2GDispatcher:SetSquadronTakeoffInAir( "Maykop SEAD" ) -A2GDispatcher:SetSquadronOverhead( "Maykop SEAD", 0.25 ) - --- Setup the CAS squadrons. -A2GDispatcher:SetSquadron( "Maykop CAS", AIRBASE.Caucasus.Maykop_Khanskaya, { "CCCP SU-25T CAS" }, 10 ) -A2GDispatcher:SetSquadronCasPatrol( "Maykop CAS", PatrolZone, 1000, 2500, 400, 600, 1100, 1500 ) -A2GDispatcher:SetSquadronCasPatrolInterval( "Maykop CAS", 1, 30, 60, 1 ) -A2GDispatcher:SetSquadronTakeoffInAir( "Maykop CAS" ) -A2GDispatcher:SetSquadronOverhead( "Maykop CAS", 0.25 ) +--- Test the defense radius. +-- Defenses should pickup targets within the defense radius, but not outside of it! +-- Defenses should engage targets closer to the HQ with higher probability than targets at longer distance from the HQ. +-- The tests are with SEAD only. +-- Name: AID-A2G-003 - DefenseRadius +-- Author: FlightControl +-- Date Created: 11 Nov 2018 + +-- Define a SET_GROUP object that builds a collection of groups that define the recce network. +-- Here we build the network with all the groups that have a name starting with CCCP Recce. +DetectionSetGroup = SET_GROUP:New() -- Defene a set of group objects, caled DetectionSetGroup. + +DetectionSetGroup:FilterPrefixes( { "CCCP Recce" } ) -- The DetectionSetGroup will search for groups that start with the name "CCCP Recce". + +-- This command will start the dynamic filtering, so when groups spawn in or are destroyed, +-- which have a group name starting with "CCCP Recce", then these will be automatically added or removed from the set. +DetectionSetGroup:FilterStart() + +-- This command defines the reconnaissance network. +-- It will group any detected ground enemy targets within a radius of 1km. +-- It uses the DetectionSetGroup, which defines the set of reconnaissance groups to detect for enemy ground targets. +Detection = DETECTION_AREAS:New( DetectionSetGroup, 1000 ) + +-- Setup the A2A dispatcher, and initialize it. +A2GDispatcher = AI_A2G_DISPATCHER:New( Detection ) + +-- Add defense coordinates. +A2GDispatcher:AddDefenseCoordinate( "HQ", GROUP:FindByName( "HQ" ):GetCoordinate() ) + +A2GDispatcher:SetDefenseReactivityHigh() + +A2GDispatcher:SetDefenseRadius( 100000 ) + +A2GDispatcher:SetTacticalDisplay( true ) + +local PatrolZone = ZONE:New( "PatrolZone" ) + +-- Setup the SEAD squadrons. +A2GDispatcher:SetSquadron( "Maykop SEAD", AIRBASE.Caucasus.Maykop_Khanskaya, { "CCCP SU-25T SEAD" }, 10 ) +A2GDispatcher:SetSquadronSeadPatrol( "Maykop SEAD", PatrolZone, 1000, 2500, 400, 600, 1100, 1500 ) +A2GDispatcher:SetSquadronSeadPatrolInterval( "Maykop SEAD", 1, 30, 60, 1 ) +A2GDispatcher:SetSquadronTakeoffInAir( "Maykop SEAD" ) +A2GDispatcher:SetSquadronOverhead( "Maykop SEAD", 0.25 ) + +-- Setup the CAS squadrons. +A2GDispatcher:SetSquadron( "Maykop CAS", AIRBASE.Caucasus.Maykop_Khanskaya, { "CCCP SU-25T CAS" }, 10 ) +A2GDispatcher:SetSquadronCasPatrol( "Maykop CAS", PatrolZone, 1000, 2500, 400, 600, 1100, 1500 ) +A2GDispatcher:SetSquadronCasPatrolInterval( "Maykop CAS", 1, 30, 60, 1 ) +A2GDispatcher:SetSquadronTakeoffInAir( "Maykop CAS" ) +A2GDispatcher:SetSquadronOverhead( "Maykop CAS", 0.25 ) diff --git a/AID - AI Dispatching/AID-A2G - AI A2G Dispatching/AID-A2G-100 - DefenseRadius/AID-A2G-100 - DefenseRadius.miz b/AID - AI Dispatching/AID-A2G - AI A2G Dispatching/AID-A2G-100 - DefenseRadius/AID-A2G-100 - DefenseRadius.miz index bd88f2c58e..5624505f99 100644 Binary files a/AID - AI Dispatching/AID-A2G - AI A2G Dispatching/AID-A2G-100 - DefenseRadius/AID-A2G-100 - DefenseRadius.miz and b/AID - AI Dispatching/AID-A2G - AI A2G Dispatching/AID-A2G-100 - DefenseRadius/AID-A2G-100 - DefenseRadius.miz differ diff --git a/AID - AI Dispatching/AID-A2G - AI A2G Dispatching/AID-A2G-110 - Default Engage Limit/AID-A2G-110 - Default Engage Limit.lua b/AID - AI Dispatching/AID-A2G - AI A2G Dispatching/AID-A2G-110 - Default Engage Limit/AID-A2G-110 - Default Engage Limit.lua index 4b77c7493b..e85099b8b9 100644 --- a/AID - AI Dispatching/AID-A2G - AI A2G Dispatching/AID-A2G-110 - Default Engage Limit/AID-A2G-110 - Default Engage Limit.lua +++ b/AID - AI Dispatching/AID-A2G - AI A2G Dispatching/AID-A2G-110 - Default Engage Limit/AID-A2G-110 - Default Engage Limit.lua @@ -1,45 +1,45 @@ ---- Test the default engage limit. --- Defenses should engage enemy units, but not more defenses than the defense limit! --- Name: AID-A2G-110 - Default DefenseLimit --- Author: FlightControl --- Date Created: 15 Nov 2018 - --- Define a SET_GROUP object that builds a collection of groups that define the recce network. --- Here we build the network with all the groups that have a name starting with CCCP Recce. -DetectionSetGroup = SET_GROUP:New() -- Defene a set of group objects, caled DetectionSetGroup. - -DetectionSetGroup:FilterPrefixes( { "CCCP Recce" } ) -- The DetectionSetGroup will search for groups that start with the name "CCCP Recce". - --- This command will start the dynamic filtering, so when groups spawn in or are destroyed, --- which have a group name starting with "CCCP Recce", then these will be automatically added or removed from the set. -DetectionSetGroup:FilterStart() - --- This command defines the reconnaissance network. --- It will group any detected ground enemy targets within a radius of 1km. --- It uses the DetectionSetGroup, which defines the set of reconnaissance groups to detect for enemy ground targets. -Detection = DETECTION_AREAS:New( DetectionSetGroup, 1000 ) - --- Setup the A2A dispatcher, and initialize it. -A2GDispatcher = AI_A2G_DISPATCHER:New( Detection ) - --- Add defense coordinates. -A2GDispatcher:AddDefenseCoordinate( "HQ", GROUP:FindByName( "HQ" ):GetCoordinate() ) - -A2GDispatcher:SetDefenseReactivityHigh() - -A2GDispatcher:SetDefenseRadius( 100000 ) - --- This is the test, not more than 4 defenses in total should engage! -A2GDispatcher:SetDefaultEngageLimit( 6 ) - -A2GDispatcher:SetTacticalDisplay( true ) - -local PatrolZone = ZONE:New( "PatrolZone" ) - --- Setup the squadrons. -A2GDispatcher:SetSquadron( "Maykop SEAD", AIRBASE.Caucasus.Maykop_Khanskaya, { "CCCP SU-25T SEAD" }, 10 ) -A2GDispatcher:SetSquadronSead( "Maykop SEAD", 250, 350 ) ---A2GDispatcher:SetSquadronSeadPatrol( "Maykop SEAD", PatrolZone, 1000, 2500, 400, 600, 1100, 1500 ) ---A2GDispatcher:SetSquadronSeadPatrolInterval( "Maykop SEAD", 4, 30, 60, 1 ) -A2GDispatcher:SetSquadronTakeoffInAir( "Maykop SEAD" ) -A2GDispatcher:SetSquadronOverhead( "Maykop SEAD", 0.25 ) +--- Test the default engage limit. +-- Defenses should engage enemy units, but not more defenses than the defense limit! +-- Name: AID-A2G-110 - Default DefenseLimit +-- Author: FlightControl +-- Date Created: 15 Nov 2018 + +-- Define a SET_GROUP object that builds a collection of groups that define the recce network. +-- Here we build the network with all the groups that have a name starting with CCCP Recce. +DetectionSetGroup = SET_GROUP:New() -- Defene a set of group objects, caled DetectionSetGroup. + +DetectionSetGroup:FilterPrefixes( { "CCCP Recce" } ) -- The DetectionSetGroup will search for groups that start with the name "CCCP Recce". + +-- This command will start the dynamic filtering, so when groups spawn in or are destroyed, +-- which have a group name starting with "CCCP Recce", then these will be automatically added or removed from the set. +DetectionSetGroup:FilterStart() + +-- This command defines the reconnaissance network. +-- It will group any detected ground enemy targets within a radius of 1km. +-- It uses the DetectionSetGroup, which defines the set of reconnaissance groups to detect for enemy ground targets. +Detection = DETECTION_AREAS:New( DetectionSetGroup, 1000 ) + +-- Setup the A2A dispatcher, and initialize it. +A2GDispatcher = AI_A2G_DISPATCHER:New( Detection ) + +-- Add defense coordinates. +A2GDispatcher:AddDefenseCoordinate( "HQ", GROUP:FindByName( "HQ" ):GetCoordinate() ) + +A2GDispatcher:SetDefenseReactivityHigh() + +A2GDispatcher:SetDefenseRadius( 100000 ) + +-- This is the test, not more than 4 defenses in total should engage! +A2GDispatcher:SetDefaultEngageLimit( 6 ) + +A2GDispatcher:SetTacticalDisplay( true ) + +local PatrolZone = ZONE:New( "PatrolZone" ) + +-- Setup the squadrons. +A2GDispatcher:SetSquadron( "Maykop SEAD", AIRBASE.Caucasus.Maykop_Khanskaya, { "CCCP SU-25T SEAD" }, 10 ) +A2GDispatcher:SetSquadronSead( "Maykop SEAD", 250, 350 ) +--A2GDispatcher:SetSquadronSeadPatrol( "Maykop SEAD", PatrolZone, 1000, 2500, 400, 600, 1100, 1500 ) +--A2GDispatcher:SetSquadronSeadPatrolInterval( "Maykop SEAD", 4, 30, 60, 1 ) +A2GDispatcher:SetSquadronTakeoffInAir( "Maykop SEAD" ) +A2GDispatcher:SetSquadronOverhead( "Maykop SEAD", 0.25 ) diff --git a/AID - AI Dispatching/AID-A2G - AI A2G Dispatching/AID-A2G-110 - Default Engage Limit/AID-A2G-110 - Default Engage Limit.miz b/AID - AI Dispatching/AID-A2G - AI A2G Dispatching/AID-A2G-110 - Default Engage Limit/AID-A2G-110 - Default Engage Limit.miz index c47e50d4a0..4a9d72e2f8 100644 Binary files a/AID - AI Dispatching/AID-A2G - AI A2G Dispatching/AID-A2G-110 - Default Engage Limit/AID-A2G-110 - Default Engage Limit.miz and b/AID - AI Dispatching/AID-A2G - AI A2G Dispatching/AID-A2G-110 - Default Engage Limit/AID-A2G-110 - Default Engage Limit.miz differ diff --git a/AID - AI Dispatching/AID-A2G - AI A2G Dispatching/AID-A2G-190 - Communication/AID-A2G-190 - Communication.lua b/AID - AI Dispatching/AID-A2G - AI A2G Dispatching/AID-A2G-190 - Communication/AID-A2G-190 - Communication.lua index bcf6fe2eed..46d081853b 100644 --- a/AID - AI Dispatching/AID-A2G - AI A2G Dispatching/AID-A2G-190 - Communication/AID-A2G-190 - Communication.lua +++ b/AID - AI Dispatching/AID-A2G - AI A2G Dispatching/AID-A2G-190 - Communication/AID-A2G-190 - Communication.lua @@ -1,80 +1,80 @@ ---- Test the communication system to other players. --- A command center will facilitate the A2G defenses communication to the players, who reporting to the same command center. --- The task system needs to be used to have this reporting facilitated. --- Name: AID-A2G-190 - Communication --- Author: FlightControl --- Date Created: 11 Jan 2019 - --- Define a command center that will communicate with the players. -CC_Red = COMMANDCENTER:New( GROUP:FindByName( "HQ" ), "Command" ) - --- Define a SET_GROUP object that builds a collection of groups that define the recce network. --- Here we build the network with all the groups that have a name starting with CCCP Recce. -DetectionSetGroup = SET_GROUP:New() -- Defene a set of group objects, caled DetectionSetGroup. - -DetectionSetGroup:FilterPrefixes( { "CCCP Recce" } ) -- The DetectionSetGroup will search for groups that start with the name "CCCP Recce". - --- This command will start the dynamic filtering, so when groups spawn in or are destroyed, --- which have a group name starting with "CCCP Recce", then these will be automatically added or removed from the set. -DetectionSetGroup:FilterStart() - --- This command defines the reconnaissance network. --- It will group any detected ground enemy targets within a radius of 1km. --- It uses the DetectionSetGroup, which defines the set of reconnaissance groups to detect for enemy ground targets. -Detection_Red = DETECTION_AREAS:New( DetectionSetGroup, 1000 ) - --- Setup the A2A dispatcher, and initialize it. -AI_A2G_Dispatcher_Red = AI_A2G_DISPATCHER:New( Detection_Red ) - - - - --- Add defense coordinates. -AI_A2G_Dispatcher_Red:AddDefenseCoordinate( "HQ", GROUP:FindByName( "HQ" ):GetCoordinate() ) - -AI_A2G_Dispatcher_Red:SetDefenseReactivityHigh() - -AI_A2G_Dispatcher_Red:SetDefenseRadius( 100000 ) - --- This is the test, not more than 4 defenses in total should engage! -AI_A2G_Dispatcher_Red:SetDefaultEngageLimit( 6 ) - -AI_A2G_Dispatcher_Red:SetTacticalDisplay( true ) - -local PatrolZone = ZONE:New( "PatrolZone" ) - --- Setup the squadrons. - --- SEAD -AI_A2G_Dispatcher_Red:SetSquadron( "Maykop SEAD", AIRBASE.Caucasus.Maykop_Khanskaya, { "CCCP AI SU-25T SEAD #001", "CCCP AI SU-25T SEAD #002", "CCCP AI SU-25T SEAD #003" }, 10 ) -AI_A2G_Dispatcher_Red:SetSquadronSead( "Maykop SEAD", 600, 800 ) -AI_A2G_Dispatcher_Red:SetSquadronTakeoffFromParkingHot( "Maykop SEAD" ) -AI_A2G_Dispatcher_Red:SetSquadronOverhead( "Maykop SEAD", 0.2 ) -AI_A2G_Dispatcher_Red:SetSquadronTakeoffInterval( "Maykop SEAD", 60 ) - --- CAS -AI_A2G_Dispatcher_Red:SetSquadron( "Maykop CAS", AIRBASE.Caucasus.Maykop_Khanskaya, { "CCCP AI SU-25T CAS" }, 10 ) -AI_A2G_Dispatcher_Red:SetSquadronCas( "Maykop CAS", 600, 800 ) -AI_A2G_Dispatcher_Red:SetSquadronTakeoffFromParkingHot( "Maykop CAS" ) -AI_A2G_Dispatcher_Red:SetSquadronOverhead( "Maykop CAS", 0.25 ) -AI_A2G_Dispatcher_Red:SetSquadronTakeoffInterval( "Maykop CAS", 60 ) - --- BAI -AI_A2G_Dispatcher_Red:SetSquadron( "Maykop BAI", AIRBASE.Caucasus.Maykop_Khanskaya, { "CCCP AI SU-25T BAI" }, 10 ) -AI_A2G_Dispatcher_Red:SetSquadronBai( "Maykop BAI", 600, 800 ) -AI_A2G_Dispatcher_Red:SetSquadronTakeoffFromParkingHot( "Maykop BAI" ) -AI_A2G_Dispatcher_Red:SetSquadronOverhead( "Maykop BAI", 0.25 ) -AI_A2G_Dispatcher_Red:SetSquadronTakeoffInterval( "Maykop BAI", 60 ) - - - - --- Now we setup the TASK A2G dispatcher, that will use the same detection system, as the AI A2G dispatcher! -Mission_Red = MISSION:New( CC_Red, "Comms Demo", "Example", "This mission demonstrates the communications between the AI A2G dispatcher and the TASK A2G dispatcher to the involved players.", coalition.side.RED ) -Players_Red = SET_GROUP:New():FilterPrefixes( "CCCP Player" ):FilterStart() -Task_A2G_Dispatcher_Red = TASK_A2G_DISPATCHER:New( Mission_Red, Players_Red, Detection_Red ) -Task_A2G_Dispatcher_Red:Start() - --- Here we set the command center, which will faciliate the communication to the Players_Red, using the same Detection_Red. -AI_A2G_Dispatcher_Red:SetCommandCenter( CC_Red ) - +--- Test the communication system to other players. +-- A command center will facilitate the A2G defenses communication to the players, who reporting to the same command center. +-- The task system needs to be used to have this reporting facilitated. +-- Name: AID-A2G-190 - Communication +-- Author: FlightControl +-- Date Created: 11 Jan 2019 + +-- Define a command center that will communicate with the players. +CC_Red = COMMANDCENTER:New( GROUP:FindByName( "HQ" ), "Command" ) + +-- Define a SET_GROUP object that builds a collection of groups that define the recce network. +-- Here we build the network with all the groups that have a name starting with CCCP Recce. +DetectionSetGroup = SET_GROUP:New() -- Defene a set of group objects, caled DetectionSetGroup. + +DetectionSetGroup:FilterPrefixes( { "CCCP Recce" } ) -- The DetectionSetGroup will search for groups that start with the name "CCCP Recce". + +-- This command will start the dynamic filtering, so when groups spawn in or are destroyed, +-- which have a group name starting with "CCCP Recce", then these will be automatically added or removed from the set. +DetectionSetGroup:FilterStart() + +-- This command defines the reconnaissance network. +-- It will group any detected ground enemy targets within a radius of 1km. +-- It uses the DetectionSetGroup, which defines the set of reconnaissance groups to detect for enemy ground targets. +Detection_Red = DETECTION_AREAS:New( DetectionSetGroup, 1000 ) + +-- Setup the A2A dispatcher, and initialize it. +AI_A2G_Dispatcher_Red = AI_A2G_DISPATCHER:New( Detection_Red ) + + + + +-- Add defense coordinates. +AI_A2G_Dispatcher_Red:AddDefenseCoordinate( "HQ", GROUP:FindByName( "HQ" ):GetCoordinate() ) + +AI_A2G_Dispatcher_Red:SetDefenseReactivityHigh() + +AI_A2G_Dispatcher_Red:SetDefenseRadius( 100000 ) + +-- This is the test, not more than 4 defenses in total should engage! +AI_A2G_Dispatcher_Red:SetDefaultEngageLimit( 6 ) + +AI_A2G_Dispatcher_Red:SetTacticalDisplay( true ) + +local PatrolZone = ZONE:New( "PatrolZone" ) + +-- Setup the squadrons. + +-- SEAD +AI_A2G_Dispatcher_Red:SetSquadron( "Maykop SEAD", AIRBASE.Caucasus.Maykop_Khanskaya, { "CCCP AI SU-25T SEAD #001", "CCCP AI SU-25T SEAD #002", "CCCP AI SU-25T SEAD #003" }, 10 ) +AI_A2G_Dispatcher_Red:SetSquadronSead( "Maykop SEAD", 600, 800 ) +AI_A2G_Dispatcher_Red:SetSquadronTakeoffFromParkingHot( "Maykop SEAD" ) +AI_A2G_Dispatcher_Red:SetSquadronOverhead( "Maykop SEAD", 0.2 ) +AI_A2G_Dispatcher_Red:SetSquadronTakeoffInterval( "Maykop SEAD", 60 ) + +-- CAS +AI_A2G_Dispatcher_Red:SetSquadron( "Maykop CAS", AIRBASE.Caucasus.Maykop_Khanskaya, { "CCCP AI SU-25T CAS" }, 10 ) +AI_A2G_Dispatcher_Red:SetSquadronCas( "Maykop CAS", 600, 800 ) +AI_A2G_Dispatcher_Red:SetSquadronTakeoffFromParkingHot( "Maykop CAS" ) +AI_A2G_Dispatcher_Red:SetSquadronOverhead( "Maykop CAS", 0.25 ) +AI_A2G_Dispatcher_Red:SetSquadronTakeoffInterval( "Maykop CAS", 60 ) + +-- BAI +AI_A2G_Dispatcher_Red:SetSquadron( "Maykop BAI", AIRBASE.Caucasus.Maykop_Khanskaya, { "CCCP AI SU-25T BAI" }, 10 ) +AI_A2G_Dispatcher_Red:SetSquadronBai( "Maykop BAI", 600, 800 ) +AI_A2G_Dispatcher_Red:SetSquadronTakeoffFromParkingHot( "Maykop BAI" ) +AI_A2G_Dispatcher_Red:SetSquadronOverhead( "Maykop BAI", 0.25 ) +AI_A2G_Dispatcher_Red:SetSquadronTakeoffInterval( "Maykop BAI", 60 ) + + + + +-- Now we setup the TASK A2G dispatcher, that will use the same detection system, as the AI A2G dispatcher! +Mission_Red = MISSION:New( CC_Red, "Comms Demo", "Example", "This mission demonstrates the communications between the AI A2G dispatcher and the TASK A2G dispatcher to the involved players.", coalition.side.RED ) +Players_Red = SET_GROUP:New():FilterPrefixes( "CCCP Player" ):FilterStart() +Task_A2G_Dispatcher_Red = TASK_A2G_DISPATCHER:New( Mission_Red, Players_Red, Detection_Red ) +Task_A2G_Dispatcher_Red:Start() + +-- Here we set the command center, which will faciliate the communication to the Players_Red, using the same Detection_Red. +AI_A2G_Dispatcher_Red:SetCommandCenter( CC_Red ) + diff --git a/AID - AI Dispatching/AID-A2G - AI A2G Dispatching/AID-A2G-190 - Communication/AID-A2G-190 - Communication.miz b/AID - AI Dispatching/AID-A2G - AI A2G Dispatching/AID-A2G-190 - Communication/AID-A2G-190 - Communication.miz index b70caf9bb2..37f4d6ee27 100644 Binary files a/AID - AI Dispatching/AID-A2G - AI A2G Dispatching/AID-A2G-190 - Communication/AID-A2G-190 - Communication.miz and b/AID - AI Dispatching/AID-A2G - AI A2G Dispatching/AID-A2G-190 - Communication/AID-A2G-190 - Communication.miz differ diff --git a/AID - AI Dispatching/AID-A2G - AI A2G Dispatching/AID-A2G-191 - Communication Engage One Unit/AID-A2G-191 - Communication Engage One Unit.lua b/AID - AI Dispatching/AID-A2G - AI A2G Dispatching/AID-A2G-191 - Communication Engage One Unit/AID-A2G-191 - Communication Engage One Unit.lua index 7162634a08..397048b8b7 100644 --- a/AID - AI Dispatching/AID-A2G - AI A2G Dispatching/AID-A2G-191 - Communication Engage One Unit/AID-A2G-191 - Communication Engage One Unit.lua +++ b/AID - AI Dispatching/AID-A2G - AI A2G Dispatching/AID-A2G-191 - Communication Engage One Unit/AID-A2G-191 - Communication Engage One Unit.lua @@ -1,63 +1,63 @@ ---- Test the communication system to other players. --- A command center will facilitate the A2G defenses communication to the players, who reporting to the same command center. --- The task system needs to be used to have this reporting facilitated. --- --- Author: FlightControl --- Date Created: 20 Jan 2019 - --- Define a command center that will communicate with the players. -CC_Red = COMMANDCENTER:New( GROUP:FindByName( "HQ" ), "Command" ) - --- Define a SET_GROUP object that builds a collection of groups that define the recce network. --- Here we build the network with all the groups that have a name starting with CCCP Recce. -DetectionSetGroup = SET_GROUP:New() -- Defene a set of group objects, caled DetectionSetGroup. - -DetectionSetGroup:FilterPrefixes( { "CCCP Recce" } ) -- The DetectionSetGroup will search for groups that start with the name "CCCP Recce". - --- This command will start the dynamic filtering, so when groups spawn in or are destroyed, --- which have a group name starting with "CCCP Recce", then these will be automatically added or removed from the set. -DetectionSetGroup:FilterStart() - --- This command defines the reconnaissance network. --- It will group any detected ground enemy targets within a radius of 1km. --- It uses the DetectionSetGroup, which defines the set of reconnaissance groups to detect for enemy ground targets. -Detection_Red = DETECTION_AREAS:New( DetectionSetGroup, 1000 ) - --- Setup the A2A dispatcher, and initialize it. -AI_A2G_Dispatcher_Red = AI_A2G_DISPATCHER:New( Detection_Red ) - - - - --- Add defense coordinates. -AI_A2G_Dispatcher_Red:AddDefenseCoordinate( "HQ", GROUP:FindByName( "HQ" ):GetCoordinate() ) - -AI_A2G_Dispatcher_Red:SetDefenseReactivityHigh() - -AI_A2G_Dispatcher_Red:SetDefenseRadius( 100000 ) - --- This is the test, not more than 4 defenses in total should engage! -AI_A2G_Dispatcher_Red:SetDefaultEngageLimit( 6 ) - -AI_A2G_Dispatcher_Red:SetTacticalDisplay( true ) - -local PatrolZone = ZONE:New( "PatrolZone" ) - --- Setup the squadrons. - --- SEAD -AI_A2G_Dispatcher_Red:SetSquadron( "Maykop SEAD", AIRBASE.Caucasus.Maykop_Khanskaya, { "CCCP AI SU-25T SEAD #001", "CCCP AI SU-25T SEAD #002", "CCCP AI SU-25T SEAD #003" }, 10 ) -AI_A2G_Dispatcher_Red:SetSquadronSead( "Maykop SEAD", 600, 800 ) -AI_A2G_Dispatcher_Red:SetSquadronOverhead( "Maykop SEAD", 0.2 ) -AI_A2G_Dispatcher_Red:SetSquadronTakeoffInterval( "Maykop SEAD", 60 ) - - --- Now we setup the TASK A2G dispatcher, that will use the same detection system, as the AI A2G dispatcher! -Mission_Red = MISSION:New( CC_Red, "Comms Demo", "Example", "This mission demonstrates the communications between the AI A2G dispatcher and the TASK A2G dispatcher to the involved players.", coalition.side.RED ) -Players_Red = SET_GROUP:New():FilterPrefixes( "CCCP Player" ):FilterStart() -Task_A2G_Dispatcher_Red = TASK_A2G_DISPATCHER:New( Mission_Red, Players_Red, Detection_Red ) -Task_A2G_Dispatcher_Red:Start() - --- Here we set the command center, which will faciliate the communication to the Players_Red, using the same Detection_Red. -AI_A2G_Dispatcher_Red:SetCommandCenter( CC_Red ) - +--- Test the communication system to other players. +-- A command center will facilitate the A2G defenses communication to the players, who reporting to the same command center. +-- The task system needs to be used to have this reporting facilitated. +-- +-- Author: FlightControl +-- Date Created: 20 Jan 2019 + +-- Define a command center that will communicate with the players. +CC_Red = COMMANDCENTER:New( GROUP:FindByName( "HQ" ), "Command" ) + +-- Define a SET_GROUP object that builds a collection of groups that define the recce network. +-- Here we build the network with all the groups that have a name starting with CCCP Recce. +DetectionSetGroup = SET_GROUP:New() -- Defene a set of group objects, caled DetectionSetGroup. + +DetectionSetGroup:FilterPrefixes( { "CCCP Recce" } ) -- The DetectionSetGroup will search for groups that start with the name "CCCP Recce". + +-- This command will start the dynamic filtering, so when groups spawn in or are destroyed, +-- which have a group name starting with "CCCP Recce", then these will be automatically added or removed from the set. +DetectionSetGroup:FilterStart() + +-- This command defines the reconnaissance network. +-- It will group any detected ground enemy targets within a radius of 1km. +-- It uses the DetectionSetGroup, which defines the set of reconnaissance groups to detect for enemy ground targets. +Detection_Red = DETECTION_AREAS:New( DetectionSetGroup, 1000 ) + +-- Setup the A2A dispatcher, and initialize it. +AI_A2G_Dispatcher_Red = AI_A2G_DISPATCHER:New( Detection_Red ) + + + + +-- Add defense coordinates. +AI_A2G_Dispatcher_Red:AddDefenseCoordinate( "HQ", GROUP:FindByName( "HQ" ):GetCoordinate() ) + +AI_A2G_Dispatcher_Red:SetDefenseReactivityHigh() + +AI_A2G_Dispatcher_Red:SetDefenseRadius( 100000 ) + +-- This is the test, not more than 4 defenses in total should engage! +AI_A2G_Dispatcher_Red:SetDefaultEngageLimit( 6 ) + +AI_A2G_Dispatcher_Red:SetTacticalDisplay( true ) + +local PatrolZone = ZONE:New( "PatrolZone" ) + +-- Setup the squadrons. + +-- SEAD +AI_A2G_Dispatcher_Red:SetSquadron( "Maykop SEAD", AIRBASE.Caucasus.Maykop_Khanskaya, { "CCCP AI SU-25T SEAD #001", "CCCP AI SU-25T SEAD #002", "CCCP AI SU-25T SEAD #003" }, 10 ) +AI_A2G_Dispatcher_Red:SetSquadronSead( "Maykop SEAD", 600, 800 ) +AI_A2G_Dispatcher_Red:SetSquadronOverhead( "Maykop SEAD", 0.2 ) +AI_A2G_Dispatcher_Red:SetSquadronTakeoffInterval( "Maykop SEAD", 60 ) + + +-- Now we setup the TASK A2G dispatcher, that will use the same detection system, as the AI A2G dispatcher! +Mission_Red = MISSION:New( CC_Red, "Comms Demo", "Example", "This mission demonstrates the communications between the AI A2G dispatcher and the TASK A2G dispatcher to the involved players.", coalition.side.RED ) +Players_Red = SET_GROUP:New():FilterPrefixes( "CCCP Player" ):FilterStart() +Task_A2G_Dispatcher_Red = TASK_A2G_DISPATCHER:New( Mission_Red, Players_Red, Detection_Red ) +Task_A2G_Dispatcher_Red:Start() + +-- Here we set the command center, which will faciliate the communication to the Players_Red, using the same Detection_Red. +AI_A2G_Dispatcher_Red:SetCommandCenter( CC_Red ) + diff --git a/AID - AI Dispatching/AID-A2G - AI A2G Dispatching/AID-A2G-191 - Communication Engage One Unit/AID-A2G-191 - Communication Engage One Unit.miz b/AID - AI Dispatching/AID-A2G - AI A2G Dispatching/AID-A2G-191 - Communication Engage One Unit/AID-A2G-191 - Communication Engage One Unit.miz index a1a06d963d..36647c1004 100644 Binary files a/AID - AI Dispatching/AID-A2G - AI A2G Dispatching/AID-A2G-191 - Communication Engage One Unit/AID-A2G-191 - Communication Engage One Unit.miz and b/AID - AI Dispatching/AID-A2G - AI A2G Dispatching/AID-A2G-191 - Communication Engage One Unit/AID-A2G-191 - Communication Engage One Unit.miz differ diff --git a/AID - AI Dispatching/AID-A2G - AI A2G Dispatching/AID-A2G-210 - Depart from Ramp/AID-A2G-210 - Depart from Ramp.lua b/AID - AI Dispatching/AID-A2G - AI A2G Dispatching/AID-A2G-210 - Depart from Ramp/AID-A2G-210 - Depart from Ramp.lua index dec2870538..1f0387d864 100644 --- a/AID - AI Dispatching/AID-A2G - AI A2G Dispatching/AID-A2G-210 - Depart from Ramp/AID-A2G-210 - Depart from Ramp.lua +++ b/AID - AI Dispatching/AID-A2G - AI A2G Dispatching/AID-A2G-210 - Depart from Ramp/AID-A2G-210 - Depart from Ramp.lua @@ -1,42 +1,42 @@ ---- Test the default engage limit. --- Defenses should engage enemy units, but not more defenses than the defense limit! --- Name: AID-A2G-110 - Default DefenseLimit --- Author: FlightControl --- Date Created: 15 Nov 2018 - --- Define a SET_GROUP object that builds a collection of groups that define the recce network. --- Here we build the network with all the groups that have a name starting with CCCP Recce. -DetectionSetGroup = SET_GROUP:New() -- Defene a set of group objects, caled DetectionSetGroup. - -DetectionSetGroup:FilterPrefixes( { "CCCP Recce" } ) -- The DetectionSetGroup will search for groups that start with the name "CCCP Recce". - --- This command will start the dynamic filtering, so when groups spawn in or are destroyed, --- which have a group name starting with "CCCP Recce", then these will be automatically added or removed from the set. -DetectionSetGroup:FilterStart() - --- This command defines the reconnaissance network. --- It will group any detected ground enemy targets within a radius of 1km. --- It uses the DetectionSetGroup, which defines the set of reconnaissance groups to detect for enemy ground targets. -Detection = DETECTION_AREAS:New( DetectionSetGroup, 1000 ) - --- Setup the A2A dispatcher, and initialize it. -A2GDispatcher = AI_A2G_DISPATCHER:New( Detection ) - --- Add defense coordinates. -A2GDispatcher:AddDefenseCoordinate( "HQ", GROUP:FindByName( "HQ" ):GetCoordinate() ) - -A2GDispatcher:SetDefenseReactivityHigh() - -A2GDispatcher:SetDefenseRadius( 100000 ) - -A2GDispatcher:SetTacticalDisplay( true ) - -local PatrolZone = ZONE:New( "PatrolZone" ) - --- Setup the squadrons. -A2GDispatcher:SetSquadron( "Maykop SEAD", AIRBASE.Caucasus.Maykop_Khanskaya, { "CCCP SU-25T SEAD" }, 10 ) -A2GDispatcher:SetSquadronSead( "Maykop SEAD", 250, 350 ) ---A2GDispatcher:SetSquadronSeadPatrol( "Maykop SEAD", PatrolZone, 1000, 2500, 400, 600, 1100, 1500 ) ---A2GDispatcher:SetSquadronSeadPatrolInterval( "Maykop SEAD", 4, 30, 60, 1 ) -A2GDispatcher:SetSquadronTakeoffFromParkingCold( "Maykop SEAD" ) -A2GDispatcher:SetSquadronOverhead( "Maykop SEAD", 0.25 ) +--- Test the default engage limit. +-- Defenses should engage enemy units, but not more defenses than the defense limit! +-- Name: AID-A2G-110 - Default DefenseLimit +-- Author: FlightControl +-- Date Created: 15 Nov 2018 + +-- Define a SET_GROUP object that builds a collection of groups that define the recce network. +-- Here we build the network with all the groups that have a name starting with CCCP Recce. +DetectionSetGroup = SET_GROUP:New() -- Defene a set of group objects, caled DetectionSetGroup. + +DetectionSetGroup:FilterPrefixes( { "CCCP Recce" } ) -- The DetectionSetGroup will search for groups that start with the name "CCCP Recce". + +-- This command will start the dynamic filtering, so when groups spawn in or are destroyed, +-- which have a group name starting with "CCCP Recce", then these will be automatically added or removed from the set. +DetectionSetGroup:FilterStart() + +-- This command defines the reconnaissance network. +-- It will group any detected ground enemy targets within a radius of 1km. +-- It uses the DetectionSetGroup, which defines the set of reconnaissance groups to detect for enemy ground targets. +Detection = DETECTION_AREAS:New( DetectionSetGroup, 1000 ) + +-- Setup the A2A dispatcher, and initialize it. +A2GDispatcher = AI_A2G_DISPATCHER:New( Detection ) + +-- Add defense coordinates. +A2GDispatcher:AddDefenseCoordinate( "HQ", GROUP:FindByName( "HQ" ):GetCoordinate() ) + +A2GDispatcher:SetDefenseReactivityHigh() + +A2GDispatcher:SetDefenseRadius( 100000 ) + +A2GDispatcher:SetTacticalDisplay( true ) + +local PatrolZone = ZONE:New( "PatrolZone" ) + +-- Setup the squadrons. +A2GDispatcher:SetSquadron( "Maykop SEAD", AIRBASE.Caucasus.Maykop_Khanskaya, { "CCCP SU-25T SEAD" }, 10 ) +A2GDispatcher:SetSquadronSead( "Maykop SEAD", 250, 350 ) +--A2GDispatcher:SetSquadronSeadPatrol( "Maykop SEAD", PatrolZone, 1000, 2500, 400, 600, 1100, 1500 ) +--A2GDispatcher:SetSquadronSeadPatrolInterval( "Maykop SEAD", 4, 30, 60, 1 ) +A2GDispatcher:SetSquadronTakeoffFromParkingCold( "Maykop SEAD" ) +A2GDispatcher:SetSquadronOverhead( "Maykop SEAD", 0.25 ) diff --git a/AID - AI Dispatching/AID-A2G - AI A2G Dispatching/AID-A2G-210 - Depart from Ramp/AID-A2G-210 - Depart from Ramp.miz b/AID - AI Dispatching/AID-A2G - AI A2G Dispatching/AID-A2G-210 - Depart from Ramp/AID-A2G-210 - Depart from Ramp.miz index 386ab32286..e5a3743f8c 100644 Binary files a/AID - AI Dispatching/AID-A2G - AI A2G Dispatching/AID-A2G-210 - Depart from Ramp/AID-A2G-210 - Depart from Ramp.miz and b/AID - AI Dispatching/AID-A2G - AI A2G Dispatching/AID-A2G-210 - Depart from Ramp/AID-A2G-210 - Depart from Ramp.miz differ diff --git a/AID - AI Dispatching/AID-A2G - AI A2G Dispatching/AID-A2G-211 - Depart from Hot/AID-A2G-211 - Depart from Hot.lua b/AID - AI Dispatching/AID-A2G - AI A2G Dispatching/AID-A2G-211 - Depart from Hot/AID-A2G-211 - Depart from Hot.lua index d7f26d92f0..472215f018 100644 --- a/AID - AI Dispatching/AID-A2G - AI A2G Dispatching/AID-A2G-211 - Depart from Hot/AID-A2G-211 - Depart from Hot.lua +++ b/AID - AI Dispatching/AID-A2G - AI A2G Dispatching/AID-A2G-211 - Depart from Hot/AID-A2G-211 - Depart from Hot.lua @@ -1,42 +1,42 @@ ---- Test the default engage limit. --- Defenses should engage enemy units, but not more defenses than the defense limit! --- Name: AID-A2G-110 - Default DefenseLimit --- Author: FlightControl --- Date Created: 15 Nov 2018 - --- Define a SET_GROUP object that builds a collection of groups that define the recce network. --- Here we build the network with all the groups that have a name starting with CCCP Recce. -DetectionSetGroup = SET_GROUP:New() -- Defene a set of group objects, caled DetectionSetGroup. - -DetectionSetGroup:FilterPrefixes( { "CCCP Recce" } ) -- The DetectionSetGroup will search for groups that start with the name "CCCP Recce". - --- This command will start the dynamic filtering, so when groups spawn in or are destroyed, --- which have a group name starting with "CCCP Recce", then these will be automatically added or removed from the set. -DetectionSetGroup:FilterStart() - --- This command defines the reconnaissance network. --- It will group any detected ground enemy targets within a radius of 1km. --- It uses the DetectionSetGroup, which defines the set of reconnaissance groups to detect for enemy ground targets. -Detection = DETECTION_AREAS:New( DetectionSetGroup, 1000 ) - --- Setup the A2A dispatcher, and initialize it. -A2GDispatcher = AI_A2G_DISPATCHER:New( Detection ) - --- Add defense coordinates. -A2GDispatcher:AddDefenseCoordinate( "HQ", GROUP:FindByName( "HQ" ):GetCoordinate() ) - -A2GDispatcher:SetDefenseReactivityHigh() - -A2GDispatcher:SetDefenseRadius( 100000 ) - -A2GDispatcher:SetTacticalDisplay( true ) - -local PatrolZone = ZONE:New( "PatrolZone" ) - --- Setup the squadrons. -A2GDispatcher:SetSquadron( "Maykop SEAD", AIRBASE.Caucasus.Maykop_Khanskaya, { "CCCP SU-25T SEAD" }, 10 ) -A2GDispatcher:SetSquadronSead( "Maykop SEAD", 250, 350 ) ---A2GDispatcher:SetSquadronSeadPatrol( "Maykop SEAD", PatrolZone, 1000, 2500, 400, 600, 1100, 1500 ) ---A2GDispatcher:SetSquadronSeadPatrolInterval( "Maykop SEAD", 4, 30, 60, 1 ) -A2GDispatcher:SetSquadronTakeoffFromParkingHot( "Maykop SEAD" ) -A2GDispatcher:SetSquadronOverhead( "Maykop SEAD", 0.25 ) +--- Test the default engage limit. +-- Defenses should engage enemy units, but not more defenses than the defense limit! +-- Name: AID-A2G-110 - Default DefenseLimit +-- Author: FlightControl +-- Date Created: 15 Nov 2018 + +-- Define a SET_GROUP object that builds a collection of groups that define the recce network. +-- Here we build the network with all the groups that have a name starting with CCCP Recce. +DetectionSetGroup = SET_GROUP:New() -- Defene a set of group objects, caled DetectionSetGroup. + +DetectionSetGroup:FilterPrefixes( { "CCCP Recce" } ) -- The DetectionSetGroup will search for groups that start with the name "CCCP Recce". + +-- This command will start the dynamic filtering, so when groups spawn in or are destroyed, +-- which have a group name starting with "CCCP Recce", then these will be automatically added or removed from the set. +DetectionSetGroup:FilterStart() + +-- This command defines the reconnaissance network. +-- It will group any detected ground enemy targets within a radius of 1km. +-- It uses the DetectionSetGroup, which defines the set of reconnaissance groups to detect for enemy ground targets. +Detection = DETECTION_AREAS:New( DetectionSetGroup, 1000 ) + +-- Setup the A2A dispatcher, and initialize it. +A2GDispatcher = AI_A2G_DISPATCHER:New( Detection ) + +-- Add defense coordinates. +A2GDispatcher:AddDefenseCoordinate( "HQ", GROUP:FindByName( "HQ" ):GetCoordinate() ) + +A2GDispatcher:SetDefenseReactivityHigh() + +A2GDispatcher:SetDefenseRadius( 100000 ) + +A2GDispatcher:SetTacticalDisplay( true ) + +local PatrolZone = ZONE:New( "PatrolZone" ) + +-- Setup the squadrons. +A2GDispatcher:SetSquadron( "Maykop SEAD", AIRBASE.Caucasus.Maykop_Khanskaya, { "CCCP SU-25T SEAD" }, 10 ) +A2GDispatcher:SetSquadronSead( "Maykop SEAD", 250, 350 ) +--A2GDispatcher:SetSquadronSeadPatrol( "Maykop SEAD", PatrolZone, 1000, 2500, 400, 600, 1100, 1500 ) +--A2GDispatcher:SetSquadronSeadPatrolInterval( "Maykop SEAD", 4, 30, 60, 1 ) +A2GDispatcher:SetSquadronTakeoffFromParkingHot( "Maykop SEAD" ) +A2GDispatcher:SetSquadronOverhead( "Maykop SEAD", 0.25 ) diff --git a/AID - AI Dispatching/AID-A2G - AI A2G Dispatching/AID-A2G-211 - Depart from Hot/AID-A2G-211 - Depart from Hot.miz b/AID - AI Dispatching/AID-A2G - AI A2G Dispatching/AID-A2G-211 - Depart from Hot/AID-A2G-211 - Depart from Hot.miz index 0378d264e7..29e2a10177 100644 Binary files a/AID - AI Dispatching/AID-A2G - AI A2G Dispatching/AID-A2G-211 - Depart from Hot/AID-A2G-211 - Depart from Hot.miz and b/AID - AI Dispatching/AID-A2G - AI A2G Dispatching/AID-A2G-211 - Depart from Hot/AID-A2G-211 - Depart from Hot.miz differ diff --git a/AID - AI Dispatching/AID-A2G - AI A2G Dispatching/AID-A2G-212 - Depart from Runway/AID-A2G-212 - Depart from Runway.lua b/AID - AI Dispatching/AID-A2G - AI A2G Dispatching/AID-A2G-212 - Depart from Runway/AID-A2G-212 - Depart from Runway.lua index d22dd6a5b6..91adbfd5e5 100644 --- a/AID - AI Dispatching/AID-A2G - AI A2G Dispatching/AID-A2G-212 - Depart from Runway/AID-A2G-212 - Depart from Runway.lua +++ b/AID - AI Dispatching/AID-A2G - AI A2G Dispatching/AID-A2G-212 - Depart from Runway/AID-A2G-212 - Depart from Runway.lua @@ -1,45 +1,45 @@ ---- Test the default engage limit. --- Defenses should engage enemy units, but not more defenses than the defense limit! --- Name: AID-A2G-110 - Default DefenseLimit --- Author: FlightControl --- Date Created: 15 Nov 2018 - --- Define a SET_GROUP object that builds a collection of groups that define the recce network. --- Here we build the network with all the groups that have a name starting with CCCP Recce. -DetectionSetGroup = SET_GROUP:New() -- Defene a set of group objects, caled DetectionSetGroup. - -DetectionSetGroup:FilterPrefixes( { "CCCP Recce" } ) -- The DetectionSetGroup will search for groups that start with the name "CCCP Recce". - --- This command will start the dynamic filtering, so when groups spawn in or are destroyed, --- which have a group name starting with "CCCP Recce", then these will be automatically added or removed from the set. -DetectionSetGroup:FilterStart() - --- This command defines the reconnaissance network. --- It will group any detected ground enemy targets within a radius of 1km. --- It uses the DetectionSetGroup, which defines the set of reconnaissance groups to detect for enemy ground targets. -Detection = DETECTION_AREAS:New( DetectionSetGroup, 1000 ) - --- Setup the A2A dispatcher, and initialize it. -A2GDispatcher = AI_A2G_DISPATCHER:New( Detection ) - --- Add defense coordinates. -A2GDispatcher:AddDefenseCoordinate( "HQ", GROUP:FindByName( "HQ" ):GetCoordinate() ) - -A2GDispatcher:SetDefenseReactivityHigh() - -A2GDispatcher:SetDefenseRadius( 100000 ) - --- This is the test, not more than 4 defenses in total should engage! -A2GDispatcher:SetDefaultEngageLimit( 6 ) - -A2GDispatcher:SetTacticalDisplay( true ) - -local PatrolZone = ZONE:New( "PatrolZone" ) - --- Setup the squadrons. -A2GDispatcher:SetSquadron( "Maykop SEAD", AIRBASE.Caucasus.Maykop_Khanskaya, { "CCCP SU-25T SEAD" }, 10 ) -A2GDispatcher:SetSquadronSead( "Maykop SEAD", 250, 350 ) ---A2GDispatcher:SetSquadronSeadPatrol( "Maykop SEAD", PatrolZone, 1000, 2500, 400, 600, 1100, 1500 ) ---A2GDispatcher:SetSquadronSeadPatrolInterval( "Maykop SEAD", 4, 30, 60, 1 ) -A2GDispatcher:SetSquadronTakeoffFromRunway( "Maykop SEAD" ) -A2GDispatcher:SetSquadronOverhead( "Maykop SEAD", 0.25 ) +--- Test the default engage limit. +-- Defenses should engage enemy units, but not more defenses than the defense limit! +-- Name: AID-A2G-110 - Default DefenseLimit +-- Author: FlightControl +-- Date Created: 15 Nov 2018 + +-- Define a SET_GROUP object that builds a collection of groups that define the recce network. +-- Here we build the network with all the groups that have a name starting with CCCP Recce. +DetectionSetGroup = SET_GROUP:New() -- Defene a set of group objects, caled DetectionSetGroup. + +DetectionSetGroup:FilterPrefixes( { "CCCP Recce" } ) -- The DetectionSetGroup will search for groups that start with the name "CCCP Recce". + +-- This command will start the dynamic filtering, so when groups spawn in or are destroyed, +-- which have a group name starting with "CCCP Recce", then these will be automatically added or removed from the set. +DetectionSetGroup:FilterStart() + +-- This command defines the reconnaissance network. +-- It will group any detected ground enemy targets within a radius of 1km. +-- It uses the DetectionSetGroup, which defines the set of reconnaissance groups to detect for enemy ground targets. +Detection = DETECTION_AREAS:New( DetectionSetGroup, 1000 ) + +-- Setup the A2A dispatcher, and initialize it. +A2GDispatcher = AI_A2G_DISPATCHER:New( Detection ) + +-- Add defense coordinates. +A2GDispatcher:AddDefenseCoordinate( "HQ", GROUP:FindByName( "HQ" ):GetCoordinate() ) + +A2GDispatcher:SetDefenseReactivityHigh() + +A2GDispatcher:SetDefenseRadius( 100000 ) + +-- This is the test, not more than 4 defenses in total should engage! +A2GDispatcher:SetDefaultEngageLimit( 6 ) + +A2GDispatcher:SetTacticalDisplay( true ) + +local PatrolZone = ZONE:New( "PatrolZone" ) + +-- Setup the squadrons. +A2GDispatcher:SetSquadron( "Maykop SEAD", AIRBASE.Caucasus.Maykop_Khanskaya, { "CCCP SU-25T SEAD" }, 10 ) +A2GDispatcher:SetSquadronSead( "Maykop SEAD", 250, 350 ) +--A2GDispatcher:SetSquadronSeadPatrol( "Maykop SEAD", PatrolZone, 1000, 2500, 400, 600, 1100, 1500 ) +--A2GDispatcher:SetSquadronSeadPatrolInterval( "Maykop SEAD", 4, 30, 60, 1 ) +A2GDispatcher:SetSquadronTakeoffFromRunway( "Maykop SEAD" ) +A2GDispatcher:SetSquadronOverhead( "Maykop SEAD", 0.25 ) diff --git a/AID - AI Dispatching/AID-A2G - AI A2G Dispatching/AID-A2G-212 - Depart from Runway/AID-A2G-212 - Depart from Runway.miz b/AID - AI Dispatching/AID-A2G - AI A2G Dispatching/AID-A2G-212 - Depart from Runway/AID-A2G-212 - Depart from Runway.miz index aac9e4e149..fee9bcf61c 100644 Binary files a/AID - AI Dispatching/AID-A2G - AI A2G Dispatching/AID-A2G-212 - Depart from Runway/AID-A2G-212 - Depart from Runway.miz and b/AID - AI Dispatching/AID-A2G - AI A2G Dispatching/AID-A2G-212 - Depart from Runway/AID-A2G-212 - Depart from Runway.miz differ diff --git a/AID - AI Dispatching/AID-A2G - AI A2G Dispatching/AID-A2G-213 - Depart from Air/AID-A2G-213 - Depart from Air.lua b/AID - AI Dispatching/AID-A2G - AI A2G Dispatching/AID-A2G-213 - Depart from Air/AID-A2G-213 - Depart from Air.lua index 4b77c7493b..e85099b8b9 100644 --- a/AID - AI Dispatching/AID-A2G - AI A2G Dispatching/AID-A2G-213 - Depart from Air/AID-A2G-213 - Depart from Air.lua +++ b/AID - AI Dispatching/AID-A2G - AI A2G Dispatching/AID-A2G-213 - Depart from Air/AID-A2G-213 - Depart from Air.lua @@ -1,45 +1,45 @@ ---- Test the default engage limit. --- Defenses should engage enemy units, but not more defenses than the defense limit! --- Name: AID-A2G-110 - Default DefenseLimit --- Author: FlightControl --- Date Created: 15 Nov 2018 - --- Define a SET_GROUP object that builds a collection of groups that define the recce network. --- Here we build the network with all the groups that have a name starting with CCCP Recce. -DetectionSetGroup = SET_GROUP:New() -- Defene a set of group objects, caled DetectionSetGroup. - -DetectionSetGroup:FilterPrefixes( { "CCCP Recce" } ) -- The DetectionSetGroup will search for groups that start with the name "CCCP Recce". - --- This command will start the dynamic filtering, so when groups spawn in or are destroyed, --- which have a group name starting with "CCCP Recce", then these will be automatically added or removed from the set. -DetectionSetGroup:FilterStart() - --- This command defines the reconnaissance network. --- It will group any detected ground enemy targets within a radius of 1km. --- It uses the DetectionSetGroup, which defines the set of reconnaissance groups to detect for enemy ground targets. -Detection = DETECTION_AREAS:New( DetectionSetGroup, 1000 ) - --- Setup the A2A dispatcher, and initialize it. -A2GDispatcher = AI_A2G_DISPATCHER:New( Detection ) - --- Add defense coordinates. -A2GDispatcher:AddDefenseCoordinate( "HQ", GROUP:FindByName( "HQ" ):GetCoordinate() ) - -A2GDispatcher:SetDefenseReactivityHigh() - -A2GDispatcher:SetDefenseRadius( 100000 ) - --- This is the test, not more than 4 defenses in total should engage! -A2GDispatcher:SetDefaultEngageLimit( 6 ) - -A2GDispatcher:SetTacticalDisplay( true ) - -local PatrolZone = ZONE:New( "PatrolZone" ) - --- Setup the squadrons. -A2GDispatcher:SetSquadron( "Maykop SEAD", AIRBASE.Caucasus.Maykop_Khanskaya, { "CCCP SU-25T SEAD" }, 10 ) -A2GDispatcher:SetSquadronSead( "Maykop SEAD", 250, 350 ) ---A2GDispatcher:SetSquadronSeadPatrol( "Maykop SEAD", PatrolZone, 1000, 2500, 400, 600, 1100, 1500 ) ---A2GDispatcher:SetSquadronSeadPatrolInterval( "Maykop SEAD", 4, 30, 60, 1 ) -A2GDispatcher:SetSquadronTakeoffInAir( "Maykop SEAD" ) -A2GDispatcher:SetSquadronOverhead( "Maykop SEAD", 0.25 ) +--- Test the default engage limit. +-- Defenses should engage enemy units, but not more defenses than the defense limit! +-- Name: AID-A2G-110 - Default DefenseLimit +-- Author: FlightControl +-- Date Created: 15 Nov 2018 + +-- Define a SET_GROUP object that builds a collection of groups that define the recce network. +-- Here we build the network with all the groups that have a name starting with CCCP Recce. +DetectionSetGroup = SET_GROUP:New() -- Defene a set of group objects, caled DetectionSetGroup. + +DetectionSetGroup:FilterPrefixes( { "CCCP Recce" } ) -- The DetectionSetGroup will search for groups that start with the name "CCCP Recce". + +-- This command will start the dynamic filtering, so when groups spawn in or are destroyed, +-- which have a group name starting with "CCCP Recce", then these will be automatically added or removed from the set. +DetectionSetGroup:FilterStart() + +-- This command defines the reconnaissance network. +-- It will group any detected ground enemy targets within a radius of 1km. +-- It uses the DetectionSetGroup, which defines the set of reconnaissance groups to detect for enemy ground targets. +Detection = DETECTION_AREAS:New( DetectionSetGroup, 1000 ) + +-- Setup the A2A dispatcher, and initialize it. +A2GDispatcher = AI_A2G_DISPATCHER:New( Detection ) + +-- Add defense coordinates. +A2GDispatcher:AddDefenseCoordinate( "HQ", GROUP:FindByName( "HQ" ):GetCoordinate() ) + +A2GDispatcher:SetDefenseReactivityHigh() + +A2GDispatcher:SetDefenseRadius( 100000 ) + +-- This is the test, not more than 4 defenses in total should engage! +A2GDispatcher:SetDefaultEngageLimit( 6 ) + +A2GDispatcher:SetTacticalDisplay( true ) + +local PatrolZone = ZONE:New( "PatrolZone" ) + +-- Setup the squadrons. +A2GDispatcher:SetSquadron( "Maykop SEAD", AIRBASE.Caucasus.Maykop_Khanskaya, { "CCCP SU-25T SEAD" }, 10 ) +A2GDispatcher:SetSquadronSead( "Maykop SEAD", 250, 350 ) +--A2GDispatcher:SetSquadronSeadPatrol( "Maykop SEAD", PatrolZone, 1000, 2500, 400, 600, 1100, 1500 ) +--A2GDispatcher:SetSquadronSeadPatrolInterval( "Maykop SEAD", 4, 30, 60, 1 ) +A2GDispatcher:SetSquadronTakeoffInAir( "Maykop SEAD" ) +A2GDispatcher:SetSquadronOverhead( "Maykop SEAD", 0.25 ) diff --git a/AID - AI Dispatching/AID-A2G - AI A2G Dispatching/AID-A2G-213 - Depart from Air/AID-A2G-213 - Depart from Air.miz b/AID - AI Dispatching/AID-A2G - AI A2G Dispatching/AID-A2G-213 - Depart from Air/AID-A2G-213 - Depart from Air.miz index 00741993b2..4c5cfd26b0 100644 Binary files a/AID - AI Dispatching/AID-A2G - AI A2G Dispatching/AID-A2G-213 - Depart from Air/AID-A2G-213 - Depart from Air.miz and b/AID - AI Dispatching/AID-A2G - AI A2G Dispatching/AID-A2G-213 - Depart from Air/AID-A2G-213 - Depart from Air.miz differ diff --git a/AID - AI Dispatching/AID-A2G - AI A2G Dispatching/AID-A2G-250 - Visible before start/AID-A2G-250 - Visible before start.lua b/AID - AI Dispatching/AID-A2G - AI A2G Dispatching/AID-A2G-250 - Visible before start/AID-A2G-250 - Visible before start.lua index 0adcd7b24b..b8d5ab6204 100644 --- a/AID - AI Dispatching/AID-A2G - AI A2G Dispatching/AID-A2G-250 - Visible before start/AID-A2G-250 - Visible before start.lua +++ b/AID - AI Dispatching/AID-A2G - AI A2G Dispatching/AID-A2G-250 - Visible before start/AID-A2G-250 - Visible before start.lua @@ -1,48 +1,48 @@ ---- Test the default engage limit. --- Defenses should engage enemy units, but not more defenses than the defense limit! --- Name: AID-A2G-110 - Default DefenseLimit --- Author: FlightControl --- Date Created: 15 Nov 2018 - --- Define a SET_GROUP object that builds a collection of groups that define the recce network. --- Here we build the network with all the groups that have a name starting with CCCP Recce. -DetectionSetGroup = SET_GROUP:New() -- Defene a set of group objects, caled DetectionSetGroup. - -DetectionSetGroup:FilterPrefixes( { "CCCP Recce" } ) -- The DetectionSetGroup will search for groups that start with the name "CCCP Recce". - --- This command will start the dynamic filtering, so when groups spawn in or are destroyed, --- which have a group name starting with "CCCP Recce", then these will be automatically added or removed from the set. -DetectionSetGroup:FilterStart() - --- This command defines the reconnaissance network. --- It will group any detected ground enemy targets within a radius of 1km. --- It uses the DetectionSetGroup, which defines the set of reconnaissance groups to detect for enemy ground targets. -Detection = DETECTION_AREAS:New( DetectionSetGroup, 1000 ) - --- Setup the A2A dispatcher, and initialize it. -A2GDispatcher = AI_A2G_DISPATCHER:New( Detection ) - --- Add defense coordinates. -A2GDispatcher:AddDefenseCoordinate( "HQ", GROUP:FindByName( "HQ" ):GetCoordinate() ) - -A2GDispatcher:SetDefenseReactivityHigh() - -A2GDispatcher:SetDefenseRadius( 200000 ) - --- This is the test, not more than 4 defenses in total should engage! -A2GDispatcher:SetDefaultEngageLimit( 6 ) - -A2GDispatcher:SetTacticalDisplay( true ) - -local PatrolZone = ZONE:New( "PatrolZone" ) - --- Setup the squadrons. -A2GDispatcher:SetSquadron( "Krymsk SEAD", AIRBASE.Caucasus.Krymsk, { "CCCP SEAD Su-30", "CCCP SEAD Su-25T", "CCCP SEAD Su-25TM", "CCCP SEAD Su-34" }, 20 ) -A2GDispatcher:SetSquadronSead( "Krymsk SEAD", 600, 800 ) ---A2GDispatcher:SetSquadronSeadPatrol( "Krymsk SEAD", PatrolZone, 1000, 2500, 400, 600, 1100, 1500 ) ---A2GDispatcher:SetSquadronSeadPatrolInterval( "Krymsk SEAD", 4, 30, 60, 1 ) -A2GDispatcher:SetSquadronOverhead( "Krymsk SEAD", 0.2 ) -A2GDispatcher:SetSquadronTakeoffFromParkingHot( "Krymsk SEAD" ) -A2GDispatcher:SetSquadronLandingAtEngineShutdown( "Krymsk SEAD" ) - +--- Test the default engage limit. +-- Defenses should engage enemy units, but not more defenses than the defense limit! +-- Name: AID-A2G-110 - Default DefenseLimit +-- Author: FlightControl +-- Date Created: 15 Nov 2018 + +-- Define a SET_GROUP object that builds a collection of groups that define the recce network. +-- Here we build the network with all the groups that have a name starting with CCCP Recce. +DetectionSetGroup = SET_GROUP:New() -- Defene a set of group objects, caled DetectionSetGroup. + +DetectionSetGroup:FilterPrefixes( { "CCCP Recce" } ) -- The DetectionSetGroup will search for groups that start with the name "CCCP Recce". + +-- This command will start the dynamic filtering, so when groups spawn in or are destroyed, +-- which have a group name starting with "CCCP Recce", then these will be automatically added or removed from the set. +DetectionSetGroup:FilterStart() + +-- This command defines the reconnaissance network. +-- It will group any detected ground enemy targets within a radius of 1km. +-- It uses the DetectionSetGroup, which defines the set of reconnaissance groups to detect for enemy ground targets. +Detection = DETECTION_AREAS:New( DetectionSetGroup, 1000 ) + +-- Setup the A2A dispatcher, and initialize it. +A2GDispatcher = AI_A2G_DISPATCHER:New( Detection ) + +-- Add defense coordinates. +A2GDispatcher:AddDefenseCoordinate( "HQ", GROUP:FindByName( "HQ" ):GetCoordinate() ) + +A2GDispatcher:SetDefenseReactivityHigh() + +A2GDispatcher:SetDefenseRadius( 200000 ) + +-- This is the test, not more than 4 defenses in total should engage! +A2GDispatcher:SetDefaultEngageLimit( 6 ) + +A2GDispatcher:SetTacticalDisplay( true ) + +local PatrolZone = ZONE:New( "PatrolZone" ) + +-- Setup the squadrons. +A2GDispatcher:SetSquadron( "Krymsk SEAD", AIRBASE.Caucasus.Krymsk, { "CCCP SEAD Su-30", "CCCP SEAD Su-25T", "CCCP SEAD Su-25TM", "CCCP SEAD Su-34" }, 20 ) +A2GDispatcher:SetSquadronSead( "Krymsk SEAD", 600, 800 ) +--A2GDispatcher:SetSquadronSeadPatrol( "Krymsk SEAD", PatrolZone, 1000, 2500, 400, 600, 1100, 1500 ) +--A2GDispatcher:SetSquadronSeadPatrolInterval( "Krymsk SEAD", 4, 30, 60, 1 ) +A2GDispatcher:SetSquadronOverhead( "Krymsk SEAD", 0.2 ) +A2GDispatcher:SetSquadronTakeoffFromParkingHot( "Krymsk SEAD" ) +A2GDispatcher:SetSquadronLandingAtEngineShutdown( "Krymsk SEAD" ) + --A2GDispatcher:SetSquadronVisible( "Krymsk SEAD" ) \ No newline at end of file diff --git a/AID - AI Dispatching/AID-A2G - AI A2G Dispatching/AID-A2G-250 - Visible before start/AID-A2G-250 - Visible before start.miz b/AID - AI Dispatching/AID-A2G - AI A2G Dispatching/AID-A2G-250 - Visible before start/AID-A2G-250 - Visible before start.miz index 99b04fcb02..e02df0106b 100644 Binary files a/AID - AI Dispatching/AID-A2G - AI A2G Dispatching/AID-A2G-250 - Visible before start/AID-A2G-250 - Visible before start.miz and b/AID - AI Dispatching/AID-A2G - AI A2G Dispatching/AID-A2G-250 - Visible before start/AID-A2G-250 - Visible before start.miz differ diff --git a/AID - AI Dispatching/AID-A2G - AI A2G Dispatching/AID-A2G-300 - CAS Helicopters/AID-A2G-300 - CAS Helicopters.lua b/AID - AI Dispatching/AID-A2G - AI A2G Dispatching/AID-A2G-300 - CAS Helicopters/AID-A2G-300 - CAS Helicopters.lua index 91bf32f732..11240a6dd9 100644 --- a/AID - AI Dispatching/AID-A2G - AI A2G Dispatching/AID-A2G-300 - CAS Helicopters/AID-A2G-300 - CAS Helicopters.lua +++ b/AID - AI Dispatching/AID-A2G - AI A2G Dispatching/AID-A2G-300 - CAS Helicopters/AID-A2G-300 - CAS Helicopters.lua @@ -1,31 +1,31 @@ ---- Detect and attack a set of enemy units using helicopters. --- Name: AID-A2G-001 - Detection and Attack Helicopters --- Author: FlightControl --- Date Created: 02 Nov 2018 - --- Define a SET_GROUP object that builds a collection of groups that define the recce network. --- Here we build the network with all the groups that have a name starting with CCCP Recce. -DetectionSetGroup = SET_GROUP:New() -DetectionSetGroup:FilterPrefixes( { "Recce" } ) -DetectionSetGroup:FilterStart() - -Detection = DETECTION_AREAS:New( DetectionSetGroup, 1000 ) - --- Setup the A2A dispatcher, and initialize it. -A2GDispatcher = AI_A2G_DISPATCHER:New( Detection ) - --- Add defense coordinates. -A2GDispatcher:AddDefenseCoordinate( "HQ", GROUP:FindByName( "HQ" ):GetCoordinate() ) - -A2GDispatcher:SetDefenseReactivityMedium() - -A2GDispatcher:SetDefenseRadius( 100000 ) - -A2GDispatcher:SetTacticalDisplay( true ) - --- Setup the squadrons. - -A2GDispatcher:SetSquadron( "Sq34", "FARP CAS", { "Defender" }, 10 ) -A2GDispatcher:SetSquadronCas( "Sq34", 120, 250 ) -A2GDispatcher:SetSquadronTakeoffFromParkingHot( "Sq34" ) -A2GDispatcher:SetSquadronOverhead( "Sq34", 0.75 ) +--- Detect and attack a set of enemy units using helicopters. +-- Name: AID-A2G-001 - Detection and Attack Helicopters +-- Author: FlightControl +-- Date Created: 02 Nov 2018 + +-- Define a SET_GROUP object that builds a collection of groups that define the recce network. +-- Here we build the network with all the groups that have a name starting with CCCP Recce. +DetectionSetGroup = SET_GROUP:New() +DetectionSetGroup:FilterPrefixes( { "Recce" } ) +DetectionSetGroup:FilterStart() + +Detection = DETECTION_AREAS:New( DetectionSetGroup, 1000 ) + +-- Setup the A2A dispatcher, and initialize it. +A2GDispatcher = AI_A2G_DISPATCHER:New( Detection ) + +-- Add defense coordinates. +A2GDispatcher:AddDefenseCoordinate( "HQ", GROUP:FindByName( "HQ" ):GetCoordinate() ) + +A2GDispatcher:SetDefenseReactivityMedium() + +A2GDispatcher:SetDefenseRadius( 100000 ) + +A2GDispatcher:SetTacticalDisplay( true ) + +-- Setup the squadrons. + +A2GDispatcher:SetSquadron( "Sq34", "FARP CAS", { "Defender" }, 10 ) +A2GDispatcher:SetSquadronCas( "Sq34", 120, 250 ) +A2GDispatcher:SetSquadronTakeoffFromParkingHot( "Sq34" ) +A2GDispatcher:SetSquadronOverhead( "Sq34", 0.25 ) diff --git a/AID - AI Dispatching/AID-A2G - AI A2G Dispatching/AID-A2G-300 - CAS Helicopters/AID-A2G-300 - CAS Helicopters.miz b/AID - AI Dispatching/AID-A2G - AI A2G Dispatching/AID-A2G-300 - CAS Helicopters/AID-A2G-300 - CAS Helicopters.miz index 602b0b7708..49ba038614 100644 Binary files a/AID - AI Dispatching/AID-A2G - AI A2G Dispatching/AID-A2G-300 - CAS Helicopters/AID-A2G-300 - CAS Helicopters.miz and b/AID - AI Dispatching/AID-A2G - AI A2G Dispatching/AID-A2G-300 - CAS Helicopters/AID-A2G-300 - CAS Helicopters.miz differ diff --git a/AID - AI Dispatching/AID-A2G - AI A2G Dispatching/AID-A2G-310 - CAS Helicopters Patrol/AID-A2G-310 - CAS Helicopters Patrol.lua b/AID - AI Dispatching/AID-A2G - AI A2G Dispatching/AID-A2G-310 - CAS Helicopters Patrol/AID-A2G-310 - CAS Helicopters Patrol.lua index 9a4a75fd46..91dbe42976 100644 --- a/AID - AI Dispatching/AID-A2G - AI A2G Dispatching/AID-A2G-310 - CAS Helicopters Patrol/AID-A2G-310 - CAS Helicopters Patrol.lua +++ b/AID - AI Dispatching/AID-A2G - AI A2G Dispatching/AID-A2G-310 - CAS Helicopters Patrol/AID-A2G-310 - CAS Helicopters Patrol.lua @@ -1,33 +1,33 @@ ---- Detect and attack a set of enemy units using helicopters. --- Name: AID-A2G-001 - Detection and Attack Helicopters --- Author: FlightControl --- Date Created: 02 Nov 2018 - --- Define a SET_GROUP object that builds a collection of groups that define the recce network. --- Here we build the network with all the groups that have a name starting with CCCP Recce. -DetectionSetGroup = SET_GROUP:New() -DetectionSetGroup:FilterPrefixes( { "Recce" } ) -DetectionSetGroup:FilterStart() - -Detection = DETECTION_AREAS:New( DetectionSetGroup, 1000 ) - --- Setup the A2A dispatcher, and initialize it. -A2GDispatcher = AI_A2G_DISPATCHER:New( Detection ) - --- Add defense coordinates. -A2GDispatcher:AddDefenseCoordinate( "HQ", GROUP:FindByName( "HQ" ):GetCoordinate() ) - -A2GDispatcher:SetDefenseReactivityMedium() - -A2GDispatcher:SetDefenseRadius( 100000 ) - -A2GDispatcher:SetTacticalDisplay( true ) - --- Setup the squadrons. - -local CASPatrolZone = ZONE:New( "CASPatrolZone" ) -A2GDispatcher:SetSquadron( "Sq34", "FARP CAS", { "Defender" }, 10 ) -A2GDispatcher:SetSquadronCasPatrol( "Sq34", CASPatrolZone, 200, 500, 70, 100, 250, 300 ) -A2GDispatcher:SetSquadronCasPatrolInterval( "Sq34", 2, 30, 60 ) -A2GDispatcher:SetSquadronTakeoffFromParkingHot( "Sq34" ) -A2GDispatcher:SetSquadronOverhead( "Sq34", 0.25 ) +--- Detect and attack a set of enemy units using helicopters. +-- Name: AID-A2G-001 - Detection and Attack Helicopters +-- Author: FlightControl +-- Date Created: 02 Nov 2018 + +-- Define a SET_GROUP object that builds a collection of groups that define the recce network. +-- Here we build the network with all the groups that have a name starting with CCCP Recce. +DetectionSetGroup = SET_GROUP:New() +DetectionSetGroup:FilterPrefixes( { "Recce" } ) +DetectionSetGroup:FilterStart() + +Detection = DETECTION_AREAS:New( DetectionSetGroup, 1000 ) + +-- Setup the A2A dispatcher, and initialize it. +A2GDispatcher = AI_A2G_DISPATCHER:New( Detection ) + +-- Add defense coordinates. +A2GDispatcher:AddDefenseCoordinate( "HQ", GROUP:FindByName( "HQ" ):GetCoordinate() ) + +A2GDispatcher:SetDefenseReactivityMedium() + +A2GDispatcher:SetDefenseRadius( 100000 ) + +A2GDispatcher:SetTacticalDisplay( true ) + +-- Setup the squadrons. + +local CASPatrolZone = ZONE:New( "CASPatrolZone" ) +A2GDispatcher:SetSquadron( "Sq34", "FARP CAS", { "Defender" }, 10 ) +A2GDispatcher:SetSquadronCasPatrol( "Sq34", CASPatrolZone, 200, 500, 70, 100, 250, 300 ) +A2GDispatcher:SetSquadronCasPatrolInterval( "Sq34", 2, 30, 60 ) +A2GDispatcher:SetSquadronTakeoffFromParkingHot( "Sq34" ) +A2GDispatcher:SetSquadronOverhead( "Sq34", 0.25 ) diff --git a/AID - AI Dispatching/AID-A2G - AI A2G Dispatching/AID-A2G-310 - CAS Helicopters Patrol/AID-A2G-310 - CAS Helicopters Patrol.miz b/AID - AI Dispatching/AID-A2G - AI A2G Dispatching/AID-A2G-310 - CAS Helicopters Patrol/AID-A2G-310 - CAS Helicopters Patrol.miz index 84f72d9054..172e3fcfe5 100644 Binary files a/AID - AI Dispatching/AID-A2G - AI A2G Dispatching/AID-A2G-310 - CAS Helicopters Patrol/AID-A2G-310 - CAS Helicopters Patrol.miz and b/AID - AI Dispatching/AID-A2G - AI A2G Dispatching/AID-A2G-310 - CAS Helicopters Patrol/AID-A2G-310 - CAS Helicopters Patrol.miz differ diff --git a/AID - AI Dispatching/AID-A2G - AI A2G Dispatching/AID-A2G-350 - CAS Airplanes/AID-A2G-350 - CAS Airplanes.lua b/AID - AI Dispatching/AID-A2G - AI A2G Dispatching/AID-A2G-350 - CAS Airplanes/AID-A2G-350 - CAS Airplanes.lua index 3e5beef7ff..52c5f832ce 100644 --- a/AID - AI Dispatching/AID-A2G - AI A2G Dispatching/AID-A2G-350 - CAS Airplanes/AID-A2G-350 - CAS Airplanes.lua +++ b/AID - AI Dispatching/AID-A2G - AI A2G Dispatching/AID-A2G-350 - CAS Airplanes/AID-A2G-350 - CAS Airplanes.lua @@ -1,61 +1,61 @@ ---- Detect and attack a set of enemy units using helicopters. --- Name: AID-A2G-001 - Detection and Attack Helicopters --- Author: FlightControl --- Date Created: 02 Nov 2018 - --- Define a SET_GROUP object that builds a collection of groups that define the recce network. --- Here we build the network with all the groups that have a name starting with CCCP Recce. -DetectionSetGroup = SET_GROUP:New() -DetectionSetGroup:FilterPrefixes( { "Recce" } ) -DetectionSetGroup:FilterStart() - -Detection = DETECTION_AREAS:New( DetectionSetGroup, 1000 ) - -Detection:SetFriendliesRange( 20000 ) - --- Setup the A2A dispatcher, and initialize it. -A2GDispatcher = AI_A2G_DISPATCHER:New( Detection ) - --- Add defense coordinates. -A2GDispatcher:AddDefenseCoordinate( "HQ", GROUP:FindByName( "HQ" ):GetCoordinate() ) - -A2GDispatcher:SetDefenseReactivityMedium() - -A2GDispatcher:SetDefenseRadius( 100000 ) - - -A2GDispatcher:SetTacticalDisplay( true ) - --- Setup the squadrons. - --- Setup the squadron Sq34. -A2GDispatcher:SetSquadron( "Sq34", AIRBASE.Caucasus.Vaziani, { "Defender Sq34" }, 10 ) - --- This will setup the squadron Sq34 for CAS from Vaziani. --- Attack speed between 1000 and 1500 km/h. --- Attack altitude between 4000 and 6000 meters. -A2GDispatcher:SetSquadronCas( "Sq34", 1000, 1500, 4000, 6000 ) - - --- Start from airbase hot. -A2GDispatcher:SetSquadronTakeoffFromParkingHot( "Sq34" ) - --- For every 2 targets, there will be one plane spawned, so we give a 0.5 value. -A2GDispatcher:SetSquadronOverhead( "Sq34", 0.5 ) - - --- Setup the squadron Sq25. -A2GDispatcher:SetSquadron( "Sq25", AIRBASE.Caucasus.Soganlug, { "Defender Sq25" }, 10 ) - --- This will setup the squadron Sq34 for CAS from Vaziani. --- No additional altitude and speed parameters are given, so the defaults are assigned. --- Default speed between 50% and 75% of the maximum speed of the units in the group. --- Default altitude is between 1000 and 1500 meters. -A2GDispatcher:SetSquadronCas( "Sq25" ) - - --- Start from airbase hot. -A2GDispatcher:SetSquadronTakeoffFromParkingHot( "Sq25" ) - --- For every 2 targets, there will be one plane spawned, so we give a 0.5 value. -A2GDispatcher:SetSquadronOverhead( "Sq25", 0.25 ) +--- Detect and attack a set of enemy units using helicopters. +-- Name: AID-A2G-001 - Detection and Attack Helicopters +-- Author: FlightControl +-- Date Created: 02 Nov 2018 + +-- Define a SET_GROUP object that builds a collection of groups that define the recce network. +-- Here we build the network with all the groups that have a name starting with CCCP Recce. +DetectionSetGroup = SET_GROUP:New() +DetectionSetGroup:FilterPrefixes( { "Recce" } ) +DetectionSetGroup:FilterStart() + +Detection = DETECTION_AREAS:New( DetectionSetGroup, 1000 ) + +Detection:SetFriendliesRange( 20000 ) + +-- Setup the A2A dispatcher, and initialize it. +A2GDispatcher = AI_A2G_DISPATCHER:New( Detection ) + +-- Add defense coordinates. +A2GDispatcher:AddDefenseCoordinate( "HQ", GROUP:FindByName( "HQ" ):GetCoordinate() ) + +A2GDispatcher:SetDefenseReactivityMedium() + +A2GDispatcher:SetDefenseRadius( 100000 ) + + +A2GDispatcher:SetTacticalDisplay( true ) + +-- Setup the squadrons. + +-- Setup the squadron Sq34. +A2GDispatcher:SetSquadron( "Sq34", AIRBASE.Caucasus.Vaziani, { "Defender Sq34" }, 10 ) + +-- This will setup the squadron Sq34 for CAS from Vaziani. +-- Attack speed between 1000 and 1500 km/h. +-- Attack altitude between 4000 and 6000 meters. +A2GDispatcher:SetSquadronCas( "Sq34", 1000, 1500, 4000, 6000 ) + + +-- Start from airbase hot. +A2GDispatcher:SetSquadronTakeoffFromParkingHot( "Sq34" ) + +-- For every 2 targets, there will be one plane spawned, so we give a 0.5 value. +A2GDispatcher:SetSquadronOverhead( "Sq34", 0.5 ) + + +-- Setup the squadron Sq25. +A2GDispatcher:SetSquadron( "Sq25", AIRBASE.Caucasus.Soganlug, { "Defender Sq25" }, 10 ) + +-- This will setup the squadron Sq34 for CAS from Vaziani. +-- No additional altitude and speed parameters are given, so the defaults are assigned. +-- Default speed between 50% and 75% of the maximum speed of the units in the group. +-- Default altitude is between 1000 and 1500 meters. +A2GDispatcher:SetSquadronCas( "Sq25" ) + + +-- Start from airbase hot. +A2GDispatcher:SetSquadronTakeoffFromParkingHot( "Sq25" ) + +-- For every 2 targets, there will be one plane spawned, so we give a 0.5 value. +A2GDispatcher:SetSquadronOverhead( "Sq25", 0.25 ) diff --git a/AID - AI Dispatching/AID-A2G - AI A2G Dispatching/AID-A2G-350 - CAS Airplanes/AID-A2G-350 - CAS Airplanes.miz b/AID - AI Dispatching/AID-A2G - AI A2G Dispatching/AID-A2G-350 - CAS Airplanes/AID-A2G-350 - CAS Airplanes.miz index 25a2c025fd..010fcbc0cf 100644 Binary files a/AID - AI Dispatching/AID-A2G - AI A2G Dispatching/AID-A2G-350 - CAS Airplanes/AID-A2G-350 - CAS Airplanes.miz and b/AID - AI Dispatching/AID-A2G - AI A2G Dispatching/AID-A2G-350 - CAS Airplanes/AID-A2G-350 - CAS Airplanes.miz differ diff --git a/AID - AI Dispatching/AID-A2G - AI A2G Dispatching/AID-A2G-351 - CAS Airplanes/AID-A2G-351 - CAS Airplanes.lua b/AID - AI Dispatching/AID-A2G - AI A2G Dispatching/AID-A2G-351 - CAS Airplanes/AID-A2G-351 - CAS Airplanes.lua index 5fc04b75ba..2396a8ade9 100644 --- a/AID - AI Dispatching/AID-A2G - AI A2G Dispatching/AID-A2G-351 - CAS Airplanes/AID-A2G-351 - CAS Airplanes.lua +++ b/AID - AI Dispatching/AID-A2G - AI A2G Dispatching/AID-A2G-351 - CAS Airplanes/AID-A2G-351 - CAS Airplanes.lua @@ -1,45 +1,45 @@ ---- Detect and attack a set of enemy units using helicopters. --- Name: AID-A2G-001 - Detection and Attack Helicopters --- Author: FlightControl --- Date Created: 02 Nov 2018 - --- Define a SET_GROUP object that builds a collection of groups that define the recce network. --- Here we build the network with all the groups that have a name starting with CCCP Recce. -DetectionSetGroup = SET_GROUP:New() -DetectionSetGroup:FilterPrefixes( { "Recce" } ) -DetectionSetGroup:FilterStart() - -Detection = DETECTION_AREAS:New( DetectionSetGroup, 1000 ) - -Detection:SetFriendliesRange( 20000 ) --- Setup the A2A dispatcher, and initialize it. -A2GDispatcher = AI_A2G_DISPATCHER:New( Detection ) - --- Add defense coordinates. -A2GDispatcher:AddDefenseCoordinate( "HQ", GROUP:FindByName( "HQ" ):GetCoordinate() ) - -A2GDispatcher:SetDefenseReactivityMedium() - -A2GDispatcher:SetDefenseRadius( 250000 ) - - -A2GDispatcher:SetTacticalDisplay( true ) - --- Setup the squadrons. - -local CASPatrolZone = ZONE:New( "CASPatrolZone" ) - --- Setup the squadron Sq25. -A2GDispatcher:SetSquadron( "Sq25", AIRBASE.Caucasus.Beslan, { "Defender" }, 10 ) - --- This will setup the squadron Sq34 for CAS from Beslan. --- No additional altitude and speed parameters are given, so the defaults are assigned. --- Default speed between 50% and 75% of the maximum speed of the units in the group. --- Default altitude is between 1000 and 1500 meters. -A2GDispatcher:SetSquadronCas( "Sq25" ) - --- Start from airbase hot. -A2GDispatcher:SetSquadronTakeoffFromParkingHot( "Sq25" ) - --- For every 2 targets, there will be one plane spawned. -A2GDispatcher:SetSquadronOverhead( "Sq25", 0.5 ) +--- Detect and attack a set of enemy units using helicopters. +-- Name: AID-A2G-001 - Detection and Attack Helicopters +-- Author: FlightControl +-- Date Created: 02 Nov 2018 + +-- Define a SET_GROUP object that builds a collection of groups that define the recce network. +-- Here we build the network with all the groups that have a name starting with CCCP Recce. +DetectionSetGroup = SET_GROUP:New() +DetectionSetGroup:FilterPrefixes( { "Recce" } ) +DetectionSetGroup:FilterStart() + +Detection = DETECTION_AREAS:New( DetectionSetGroup, 1000 ) + +Detection:SetFriendliesRange( 20000 ) +-- Setup the A2A dispatcher, and initialize it. +A2GDispatcher = AI_A2G_DISPATCHER:New( Detection ) + +-- Add defense coordinates. +A2GDispatcher:AddDefenseCoordinate( "HQ", GROUP:FindByName( "HQ" ):GetCoordinate() ) + +A2GDispatcher:SetDefenseReactivityMedium() + +A2GDispatcher:SetDefenseRadius( 250000 ) + + +A2GDispatcher:SetTacticalDisplay( true ) + +-- Setup the squadrons. + +local CASPatrolZone = ZONE:New( "CASPatrolZone" ) + +-- Setup the squadron Sq25. +A2GDispatcher:SetSquadron( "Sq25", AIRBASE.Caucasus.Beslan, { "Defender" }, 10 ) + +-- This will setup the squadron Sq34 for CAS from Beslan. +-- No additional altitude and speed parameters are given, so the defaults are assigned. +-- Default speed between 50% and 75% of the maximum speed of the units in the group. +-- Default altitude is between 1000 and 1500 meters. +A2GDispatcher:SetSquadronCas( "Sq25" ) + +-- Start from airbase hot. +A2GDispatcher:SetSquadronTakeoffFromParkingHot( "Sq25" ) + +-- For every 2 targets, there will be one plane spawned. +A2GDispatcher:SetSquadronOverhead( "Sq25", 0.5 ) diff --git a/AID - AI Dispatching/AID-A2G - AI A2G Dispatching/AID-A2G-351 - CAS Airplanes/AID-A2G-351 - CAS Airplanes.miz b/AID - AI Dispatching/AID-A2G - AI A2G Dispatching/AID-A2G-351 - CAS Airplanes/AID-A2G-351 - CAS Airplanes.miz index 2448572289..0bdb1d011f 100644 Binary files a/AID - AI Dispatching/AID-A2G - AI A2G Dispatching/AID-A2G-351 - CAS Airplanes/AID-A2G-351 - CAS Airplanes.miz and b/AID - AI Dispatching/AID-A2G - AI A2G Dispatching/AID-A2G-351 - CAS Airplanes/AID-A2G-351 - CAS Airplanes.miz differ diff --git a/AID - AI Dispatching/AID-A2G - AI A2G Dispatching/AID-A2G-352 - CAS Airplanes/AID-A2G-352 - CAS Airplanes.lua b/AID - AI Dispatching/AID-A2G - AI A2G Dispatching/AID-A2G-352 - CAS Airplanes/AID-A2G-352 - CAS Airplanes.lua index bbaa5be2f6..5077742a82 100644 --- a/AID - AI Dispatching/AID-A2G - AI A2G Dispatching/AID-A2G-352 - CAS Airplanes/AID-A2G-352 - CAS Airplanes.lua +++ b/AID - AI Dispatching/AID-A2G - AI A2G Dispatching/AID-A2G-352 - CAS Airplanes/AID-A2G-352 - CAS Airplanes.lua @@ -1,45 +1,45 @@ ---- Detect and attack a set of enemy units using helicopters. --- --- Author: FlightControl --- Date Created: 23 Jan 2018 - --- Define a SET_GROUP object that builds a collection of groups that define the recce network. --- Here we build the network with all the groups that have a name starting with CCCP Recce. -DetectionSetGroup = SET_GROUP:New() -DetectionSetGroup:FilterPrefixes( { "Recce" } ) -DetectionSetGroup:FilterStart() - -Detection = DETECTION_AREAS:New( DetectionSetGroup, 1000 ) - -Detection:SetFriendliesRange( 20000 ) --- Setup the A2A dispatcher, and initialize it. -A2GDispatcher = AI_A2G_DISPATCHER:New( Detection ) - --- Add defense coordinates. -A2GDispatcher:AddDefenseCoordinate( "HQ", GROUP:FindByName( "HQ" ):GetCoordinate() ) - -A2GDispatcher:SetDefenseReactivityMedium() - -A2GDispatcher:SetDefenseRadius( 250000 ) - - -A2GDispatcher:SetTacticalDisplay( true ) - --- Setup the squadrons. - -local CASPatrolZone = ZONE:New( "CASPatrolZone" ) - --- Setup the squadron Sq25. -A2GDispatcher:SetSquadron( "Sq26", AIRBASE.Caucasus.Nalchik, { "Defender" }, 10 ) - --- This will setup the squadron Sq34 for CAS from Beslan. --- No additional altitude and speed parameters are given, so the defaults are assigned. --- Default speed between 50% and 75% of the maximum speed of the units in the group. --- Default altitude is between 1000 and 1500 meters. -A2GDispatcher:SetSquadronCas( "Sq26" ) - --- Start from airbase hot. -A2GDispatcher:SetSquadronTakeoffFromParkingHot( "Sq26" ) - --- For every 2 targets, there will be one plane spawned. -A2GDispatcher:SetSquadronOverhead( "Sq26", 0.20 ) +--- Detect and attack a set of enemy units using helicopters. +-- +-- Author: FlightControl +-- Date Created: 23 Jan 2018 + +-- Define a SET_GROUP object that builds a collection of groups that define the recce network. +-- Here we build the network with all the groups that have a name starting with CCCP Recce. +DetectionSetGroup = SET_GROUP:New() +DetectionSetGroup:FilterPrefixes( { "Recce" } ) +DetectionSetGroup:FilterStart() + +Detection = DETECTION_AREAS:New( DetectionSetGroup, 1000 ) + +Detection:SetFriendliesRange( 20000 ) +-- Setup the A2A dispatcher, and initialize it. +A2GDispatcher = AI_A2G_DISPATCHER:New( Detection ) + +-- Add defense coordinates. +A2GDispatcher:AddDefenseCoordinate( "HQ", GROUP:FindByName( "HQ" ):GetCoordinate() ) + +A2GDispatcher:SetDefenseReactivityMedium() + +A2GDispatcher:SetDefenseRadius( 250000 ) + + +A2GDispatcher:SetTacticalDisplay( true ) + +-- Setup the squadrons. + +local CASPatrolZone = ZONE:New( "CASPatrolZone" ) + +-- Setup the squadron Sq25. +A2GDispatcher:SetSquadron( "Sq26", AIRBASE.Caucasus.Nalchik, { "Defender" }, 10 ) + +-- This will setup the squadron Sq34 for CAS from Beslan. +-- No additional altitude and speed parameters are given, so the defaults are assigned. +-- Default speed between 50% and 75% of the maximum speed of the units in the group. +-- Default altitude is between 1000 and 1500 meters. +A2GDispatcher:SetSquadronCas( "Sq26" ) + +-- Start from airbase hot. +A2GDispatcher:SetSquadronTakeoffFromParkingHot( "Sq26" ) + +-- For every 2 targets, there will be one plane spawned. +A2GDispatcher:SetSquadronOverhead( "Sq26", 0.20 ) diff --git a/AID - AI Dispatching/AID-A2G - AI A2G Dispatching/AID-A2G-352 - CAS Airplanes/AID-A2G-352 - CAS Airplanes.miz b/AID - AI Dispatching/AID-A2G - AI A2G Dispatching/AID-A2G-352 - CAS Airplanes/AID-A2G-352 - CAS Airplanes.miz index 93a7c69e31..35c50ecde5 100644 Binary files a/AID - AI Dispatching/AID-A2G - AI A2G Dispatching/AID-A2G-352 - CAS Airplanes/AID-A2G-352 - CAS Airplanes.miz and b/AID - AI Dispatching/AID-A2G - AI A2G Dispatching/AID-A2G-352 - CAS Airplanes/AID-A2G-352 - CAS Airplanes.miz differ diff --git a/AID - AI Dispatching/AID-A2G - AI A2G Dispatching/AID-A2G-360 - CAS Airplanes Patrol/AID-A2G-360 - CAS Airplanes Patrol.lua b/AID - AI Dispatching/AID-A2G - AI A2G Dispatching/AID-A2G-360 - CAS Airplanes Patrol/AID-A2G-360 - CAS Airplanes Patrol.lua index 5ebff04e69..a348a0f806 100644 --- a/AID - AI Dispatching/AID-A2G - AI A2G Dispatching/AID-A2G-360 - CAS Airplanes Patrol/AID-A2G-360 - CAS Airplanes Patrol.lua +++ b/AID - AI Dispatching/AID-A2G - AI A2G Dispatching/AID-A2G-360 - CAS Airplanes Patrol/AID-A2G-360 - CAS Airplanes Patrol.lua @@ -1,43 +1,43 @@ ---- Detect and attack a set of enemy units using helicopters. --- Name: AID-A2G-001 - Detection and Attack Helicopters --- Author: FlightControl --- Date Created: 02 Nov 2018 - --- Define a SET_GROUP object that builds a collection of groups that define the recce network. --- Here we build the network with all the groups that have a name starting with CCCP Recce. -DetectionSetGroup = SET_GROUP:New() -DetectionSetGroup:FilterPrefixes( { "Recce" } ) -DetectionSetGroup:FilterStart() - -Detection = DETECTION_AREAS:New( DetectionSetGroup, 1000 ) - --- Setup the A2A dispatcher, and initialize it. -A2GDispatcher = AI_A2G_DISPATCHER:New( Detection ) - --- Add defense coordinates. -A2GDispatcher:AddDefenseCoordinate( "HQ", GROUP:FindByName( "HQ" ):GetCoordinate() ) - -A2GDispatcher:SetDefenseReactivityMedium() - -A2GDispatcher:SetDefenseRadius( 100000 ) - -A2GDispatcher:SetTacticalDisplay( true ) - --- Setup the squadrons. - -local CASPatrolZone = ZONE:New( "CASPatrolZone" ) - --- Setup the squadron Sq34. -A2GDispatcher:SetSquadron( "Sq34", AIRBASE.Caucasus.Vaziani, { "Defender" }, 10 ) - --- This will setup the squadron Sq34 for patrol and CAS from Vaziani. -A2GDispatcher:SetSquadronCasPatrol( "Sq34", CASPatrolZone, 1500, 2500, 600, 800, 800, 1200 ) - --- Maximum 6 units for patrol, with a spawn interval between 30 and 60 seconds. -A2GDispatcher:SetSquadronCasPatrolInterval( "Sq34", 2, 30, 60 ) - --- Start from airbase hot. -A2GDispatcher:SetSquadronTakeoffFromParkingHot( "Sq34" ) - --- For every 4 targets, there will be one plane spawned. -A2GDispatcher:SetSquadronOverhead( "Sq34", 0.25 ) +--- Detect and attack a set of enemy units using helicopters. +-- Name: AID-A2G-001 - Detection and Attack Helicopters +-- Author: FlightControl +-- Date Created: 02 Nov 2018 + +-- Define a SET_GROUP object that builds a collection of groups that define the recce network. +-- Here we build the network with all the groups that have a name starting with CCCP Recce. +DetectionSetGroup = SET_GROUP:New() +DetectionSetGroup:FilterPrefixes( { "Recce" } ) +DetectionSetGroup:FilterStart() + +Detection = DETECTION_AREAS:New( DetectionSetGroup, 1000 ) + +-- Setup the A2A dispatcher, and initialize it. +A2GDispatcher = AI_A2G_DISPATCHER:New( Detection ) + +-- Add defense coordinates. +A2GDispatcher:AddDefenseCoordinate( "HQ", GROUP:FindByName( "HQ" ):GetCoordinate() ) + +A2GDispatcher:SetDefenseReactivityMedium() + +A2GDispatcher:SetDefenseRadius( 100000 ) + +A2GDispatcher:SetTacticalDisplay( true ) + +-- Setup the squadrons. + +local CASPatrolZone = ZONE:New( "CASPatrolZone" ) + +-- Setup the squadron Sq34. +A2GDispatcher:SetSquadron( "Sq34", AIRBASE.Caucasus.Vaziani, { "Defender" }, 10 ) + +-- This will setup the squadron Sq34 for patrol and CAS from Vaziani. +A2GDispatcher:SetSquadronCasPatrol( "Sq34", CASPatrolZone, 1500, 2500, 600, 800, 800, 1200 ) + +-- Maximum 6 units for patrol, with a spawn interval between 30 and 60 seconds. +A2GDispatcher:SetSquadronCasPatrolInterval( "Sq34", 2, 30, 60 ) + +-- Start from airbase hot. +A2GDispatcher:SetSquadronTakeoffFromParkingHot( "Sq34" ) + +-- For every 4 targets, there will be one plane spawned. +A2GDispatcher:SetSquadronOverhead( "Sq34", 0.25 ) diff --git a/AID - AI Dispatching/AID-A2G - AI A2G Dispatching/AID-A2G-360 - CAS Airplanes Patrol/AID-A2G-360 - CAS Airplanes Patrol.miz b/AID - AI Dispatching/AID-A2G - AI A2G Dispatching/AID-A2G-360 - CAS Airplanes Patrol/AID-A2G-360 - CAS Airplanes Patrol.miz index 32e3dc8e1d..18a1f58c6c 100644 Binary files a/AID - AI Dispatching/AID-A2G - AI A2G Dispatching/AID-A2G-360 - CAS Airplanes Patrol/AID-A2G-360 - CAS Airplanes Patrol.miz and b/AID - AI Dispatching/AID-A2G - AI A2G Dispatching/AID-A2G-360 - CAS Airplanes Patrol/AID-A2G-360 - CAS Airplanes Patrol.miz differ diff --git a/AID - AI Dispatching/AID-A2G - AI A2G Dispatching/AID-A2G-361 - CAS Airplanes Patrol/AID-A2G-361 - CAS Airplanes Patrol.lua b/AID - AI Dispatching/AID-A2G - AI A2G Dispatching/AID-A2G-361 - CAS Airplanes Patrol/AID-A2G-361 - CAS Airplanes Patrol.lua index 97a124f687..685e8ffac2 100644 --- a/AID - AI Dispatching/AID-A2G - AI A2G Dispatching/AID-A2G-361 - CAS Airplanes Patrol/AID-A2G-361 - CAS Airplanes Patrol.lua +++ b/AID - AI Dispatching/AID-A2G - AI A2G Dispatching/AID-A2G-361 - CAS Airplanes Patrol/AID-A2G-361 - CAS Airplanes Patrol.lua @@ -1,40 +1,40 @@ --- Date Created: 09 Mar 2019 - --- Define a SET_GROUP object that builds a collection of groups that define the recce network. --- Here we build the network with all the groups that have a name starting with CCCP Recce. -DetectionSetGroup = SET_GROUP:New() -DetectionSetGroup:FilterPrefixes( { "Recce" } ) -DetectionSetGroup:FilterStart() - -Detection = DETECTION_AREAS:New( DetectionSetGroup, 1000 ) - --- Setup the A2A dispatcher, and initialize it. -A2GDispatcher = AI_A2G_DISPATCHER:New( Detection ) - --- Add defense coordinates. -A2GDispatcher:AddDefenseCoordinate( "HQ", GROUP:FindByName( "HQ" ):GetCoordinate() ) - -A2GDispatcher:SetDefenseReactivityMedium() - -A2GDispatcher:SetDefenseRadius( 100000 ) - -A2GDispatcher:SetTacticalDisplay( true ) - --- Setup the squadrons. - -local CASPatrolZone = ZONE:New( "CASPatrolZone" ) - --- Setup the squadron Sq34. -A2GDispatcher:SetSquadron( "Sq34", AIRBASE.Caucasus.Vaziani, { "Defender" }, 10 ) - --- This will setup the squadron Sq34 for patrol and CAS from Vaziani. -A2GDispatcher:SetSquadronCasPatrol( "Sq34", CASPatrolZone, 1500, 2500, 600, 800, 800, 1200 ) - --- Maximum 6 units for patrol, with a spawn interval between 30 and 60 seconds. ---A2GDispatcher:SetSquadronCasPatrolInterval( "Sq34", 2, 30, 60 ) - --- Start from airbase hot. -A2GDispatcher:SetSquadronTakeoffFromParkingHot( "Sq34" ) - --- For every 4 targets, there will be one plane spawned. -A2GDispatcher:SetSquadronOverhead( "Sq34", 0.25 ) +-- Date Created: 09 Mar 2019 + +-- Define a SET_GROUP object that builds a collection of groups that define the recce network. +-- Here we build the network with all the groups that have a name starting with CCCP Recce. +DetectionSetGroup = SET_GROUP:New() +DetectionSetGroup:FilterPrefixes( { "Recce" } ) +DetectionSetGroup:FilterStart() + +Detection = DETECTION_AREAS:New( DetectionSetGroup, 1000 ) + +-- Setup the A2A dispatcher, and initialize it. +A2GDispatcher = AI_A2G_DISPATCHER:New( Detection ) + +-- Add defense coordinates. +A2GDispatcher:AddDefenseCoordinate( "HQ", GROUP:FindByName( "HQ" ):GetCoordinate() ) + +A2GDispatcher:SetDefenseReactivityMedium() + +A2GDispatcher:SetDefenseRadius( 100000 ) + +A2GDispatcher:SetTacticalDisplay( true ) + +-- Setup the squadrons. + +local CASPatrolZone = ZONE:New( "CASPatrolZone" ) + +-- Setup the squadron Sq34. +A2GDispatcher:SetSquadron( "Sq34", AIRBASE.Caucasus.Vaziani, { "Defender" }, 10 ) + +-- This will setup the squadron Sq34 for patrol and CAS from Vaziani. +A2GDispatcher:SetSquadronCasPatrol( "Sq34", CASPatrolZone, 1500, 2500, 600, 800, 800, 1200 ) + +-- Maximum 6 units for patrol, with a spawn interval between 30 and 60 seconds. +--A2GDispatcher:SetSquadronCasPatrolInterval( "Sq34", 2, 30, 60 ) + +-- Start from airbase hot. +A2GDispatcher:SetSquadronTakeoffFromParkingHot( "Sq34" ) + +-- For every 4 targets, there will be one plane spawned. +A2GDispatcher:SetSquadronOverhead( "Sq34", 0.25 ) diff --git a/AID - AI Dispatching/AID-A2G - AI A2G Dispatching/AID-A2G-361 - CAS Airplanes Patrol/AID-A2G-361 - CAS Airplanes Patrol.miz b/AID - AI Dispatching/AID-A2G - AI A2G Dispatching/AID-A2G-361 - CAS Airplanes Patrol/AID-A2G-361 - CAS Airplanes Patrol.miz index 96bca074e7..5cc4bc6560 100644 Binary files a/AID - AI Dispatching/AID-A2G - AI A2G Dispatching/AID-A2G-361 - CAS Airplanes Patrol/AID-A2G-361 - CAS Airplanes Patrol.miz and b/AID - AI Dispatching/AID-A2G - AI A2G Dispatching/AID-A2G-361 - CAS Airplanes Patrol/AID-A2G-361 - CAS Airplanes Patrol.miz differ diff --git a/AID - AI Dispatching/AID-A2G - AI A2G Dispatching/AID-A2G-362 - CAS Airplanes Patrol Visible/AID-A2G-362 - CAS Airplanes Patrol Visible.lua b/AID - AI Dispatching/AID-A2G - AI A2G Dispatching/AID-A2G-362 - CAS Airplanes Patrol Visible/AID-A2G-362 - CAS Airplanes Patrol Visible.lua index 08614f8435..8d2eeb22e6 100644 --- a/AID - AI Dispatching/AID-A2G - AI A2G Dispatching/AID-A2G-362 - CAS Airplanes Patrol Visible/AID-A2G-362 - CAS Airplanes Patrol Visible.lua +++ b/AID - AI Dispatching/AID-A2G - AI A2G Dispatching/AID-A2G-362 - CAS Airplanes Patrol Visible/AID-A2G-362 - CAS Airplanes Patrol Visible.lua @@ -1,47 +1,47 @@ ---- Detect and attack a set of enemy units using helicopters. --- Name: AID-A2G-001 - Detection and Attack Helicopters --- Author: FlightControl --- Date Created: 02 Nov 2018 - --- Define a SET_GROUP object that builds a collection of groups that define the recce network. --- Here we build the network with all the groups that have a name starting with CCCP Recce. -DetectionSetGroup = SET_GROUP:New() -DetectionSetGroup:FilterPrefixes( { "Recce" } ) -DetectionSetGroup:FilterStart() - -Detection = DETECTION_AREAS:New( DetectionSetGroup, 1000 ) - --- Setup the A2A dispatcher, and initialize it. -A2GDispatcher = AI_A2G_DISPATCHER:New( Detection ) - --- Add defense coordinates. -A2GDispatcher:AddDefenseCoordinate( "HQ", GROUP:FindByName( "HQ" ):GetCoordinate() ) - -A2GDispatcher:SetDefenseReactivityMedium() - -A2GDispatcher:SetDefenseRadius( 100000 ) - -A2GDispatcher:SetTacticalDisplay( true ) - --- Setup the squadrons. - -local CASPatrolZone = ZONE:New( "CASPatrolZone" ) - --- Setup the squadron Sq34 at Kutaisi, using template Defender for 10 units. -A2GDispatcher:SetSquadron( "Sq34", AIRBASE.Caucasus.Kutaisi, { "Defender" }, 10 ) - --- This will setup the squadron Sq34 for patrol and CAS. -A2GDispatcher:SetSquadronCasPatrol( "Sq34", CASPatrolZone, 1500, 2500, 600, 800, 800, 1200 ) - --- Maximum 2 units for patrol, with a spawn interval between 30 and 60 seconds. -A2GDispatcher:SetSquadronCasPatrolInterval( "Sq34", 2, 30, 60 ) - --- Start from airbase hot. -A2GDispatcher:SetSquadronTakeoffFromParkingHot( "Sq34" ) - --- For every 4 targets, there will be one plane spawned. -A2GDispatcher:SetSquadronOverhead( "Sq34", 0.25 ) - --- Make planes visible before start ... -A2GDispatcher:SetSquadronVisible( "Sq34" ) - +--- Detect and attack a set of enemy units using helicopters. +-- Name: AID-A2G-001 - Detection and Attack Helicopters +-- Author: FlightControl +-- Date Created: 02 Nov 2018 + +-- Define a SET_GROUP object that builds a collection of groups that define the recce network. +-- Here we build the network with all the groups that have a name starting with CCCP Recce. +DetectionSetGroup = SET_GROUP:New() +DetectionSetGroup:FilterPrefixes( { "Recce" } ) +DetectionSetGroup:FilterStart() + +Detection = DETECTION_AREAS:New( DetectionSetGroup, 1000 ) + +-- Setup the A2A dispatcher, and initialize it. +A2GDispatcher = AI_A2G_DISPATCHER:New( Detection ) + +-- Add defense coordinates. +A2GDispatcher:AddDefenseCoordinate( "HQ", GROUP:FindByName( "HQ" ):GetCoordinate() ) + +A2GDispatcher:SetDefenseReactivityMedium() + +A2GDispatcher:SetDefenseRadius( 100000 ) + +A2GDispatcher:SetTacticalDisplay( true ) + +-- Setup the squadrons. + +local CASPatrolZone = ZONE:New( "CASPatrolZone" ) + +-- Setup the squadron Sq34 at Kutaisi, using template Defender for 10 units. +A2GDispatcher:SetSquadron( "Sq34", AIRBASE.Caucasus.Kutaisi, { "Defender" }, 10 ) + +-- This will setup the squadron Sq34 for patrol and CAS. +A2GDispatcher:SetSquadronCasPatrol( "Sq34", CASPatrolZone, 1500, 2500, 600, 800, 800, 1200 ) + +-- Maximum 2 units for patrol, with a spawn interval between 30 and 60 seconds. +A2GDispatcher:SetSquadronCasPatrolInterval( "Sq34", 2, 30, 60 ) + +-- Start from airbase hot. +A2GDispatcher:SetSquadronTakeoffFromParkingHot( "Sq34" ) + +-- For every 4 targets, there will be one plane spawned. +A2GDispatcher:SetSquadronOverhead( "Sq34", 0.25 ) + +-- Make planes visible before start ... +A2GDispatcher:SetSquadronVisible( "Sq34" ) + diff --git a/AID - AI Dispatching/AID-A2G - AI A2G Dispatching/AID-A2G-362 - CAS Airplanes Patrol Visible/AID-A2G-362 - CAS Airplanes Patrol Visible.miz b/AID - AI Dispatching/AID-A2G - AI A2G Dispatching/AID-A2G-362 - CAS Airplanes Patrol Visible/AID-A2G-362 - CAS Airplanes Patrol Visible.miz index 82da2d6fc5..9e0c405626 100644 Binary files a/AID - AI Dispatching/AID-A2G - AI A2G Dispatching/AID-A2G-362 - CAS Airplanes Patrol Visible/AID-A2G-362 - CAS Airplanes Patrol Visible.miz and b/AID - AI Dispatching/AID-A2G - AI A2G Dispatching/AID-A2G-362 - CAS Airplanes Patrol Visible/AID-A2G-362 - CAS Airplanes Patrol Visible.miz differ diff --git a/AID - AI Dispatching/AID-A2G - AI A2G Dispatching/AID-A2G-363 - CAS Airplanes Patrol Refuel/AID-A2G-363 - CAS Airplanes Patrol Refuel.lua b/AID - AI Dispatching/AID-A2G - AI A2G Dispatching/AID-A2G-363 - CAS Airplanes Patrol Refuel/AID-A2G-363 - CAS Airplanes Patrol Refuel.lua index 7ec4ae9149..19a13b20a9 100644 --- a/AID - AI Dispatching/AID-A2G - AI A2G Dispatching/AID-A2G-363 - CAS Airplanes Patrol Refuel/AID-A2G-363 - CAS Airplanes Patrol Refuel.lua +++ b/AID - AI Dispatching/AID-A2G - AI A2G Dispatching/AID-A2G-363 - CAS Airplanes Patrol Refuel/AID-A2G-363 - CAS Airplanes Patrol Refuel.lua @@ -1,44 +1,44 @@ --- Date Created: 09 Mar 2019 - --- Define a SET_GROUP object that builds a collection of groups that define the recce network. --- Here we build the network with all the groups that have a name starting with CCCP Recce. -DetectionSetGroup = SET_GROUP:New() -DetectionSetGroup:FilterPrefixes( { "Recce" } ) -DetectionSetGroup:FilterStart() - -Detection = DETECTION_AREAS:New( DetectionSetGroup, 1000 ) - --- Setup the A2A dispatcher, and initialize it. -A2GDispatcher = AI_A2G_DISPATCHER:New( Detection ) - --- Add defense coordinates. -A2GDispatcher:AddDefenseCoordinate( "HQ", GROUP:FindByName( "HQ" ):GetCoordinate() ) - -A2GDispatcher:SetDefenseReactivityMedium() - -A2GDispatcher:SetDefenseRadius( 100000 ) - -A2GDispatcher:SetTacticalDisplay( true ) - --- Setup the squadrons. - -local CASPatrolZone = ZONE:New( "CASPatrolZone" ) - --- Setup the squadron Sq34. -A2GDispatcher:SetSquadron( "Sq34", AIRBASE.Caucasus.Vaziani, { "Defender" }, 10 ) - --- This will setup the squadron Sq34 for patrol and CAS from Vaziani. -A2GDispatcher:SetSquadronCasPatrol( "Sq34", CASPatrolZone, 1500, 2500, 600, 800, 800, 1200 ) - --- Maximum 6 units for patrol, with a spawn interval between 30 and 60 seconds. ---A2GDispatcher:SetSquadronCasPatrolInterval( "Sq34", 2, 30, 60 ) - --- Start from airbase hot. -A2GDispatcher:SetSquadronTakeoffFromParkingHot( "Sq34" ) - --- For every 4 targets, there will be one plane spawned. -A2GDispatcher:SetSquadronOverhead( "Sq34", 0.25 ) - -A2GDispatcher:SetDefaultTanker( "Tanker" ) -A2GDispatcher:SetDefaultFuelThreshold( 0.9 ) - +-- Date Created: 09 Mar 2019 + +-- Define a SET_GROUP object that builds a collection of groups that define the recce network. +-- Here we build the network with all the groups that have a name starting with CCCP Recce. +DetectionSetGroup = SET_GROUP:New() +DetectionSetGroup:FilterPrefixes( { "Recce" } ) +DetectionSetGroup:FilterStart() + +Detection = DETECTION_AREAS:New( DetectionSetGroup, 1000 ) + +-- Setup the A2A dispatcher, and initialize it. +A2GDispatcher = AI_A2G_DISPATCHER:New( Detection ) + +-- Add defense coordinates. +A2GDispatcher:AddDefenseCoordinate( "HQ", GROUP:FindByName( "HQ" ):GetCoordinate() ) + +A2GDispatcher:SetDefenseReactivityMedium() + +A2GDispatcher:SetDefenseRadius( 100000 ) + +A2GDispatcher:SetTacticalDisplay( true ) + +-- Setup the squadrons. + +local CASPatrolZone = ZONE:New( "CASPatrolZone" ) + +-- Setup the squadron Sq34. +A2GDispatcher:SetSquadron( "Sq34", AIRBASE.Caucasus.Vaziani, { "Defender" }, 10 ) + +-- This will setup the squadron Sq34 for patrol and CAS from Vaziani. +A2GDispatcher:SetSquadronCasPatrol( "Sq34", CASPatrolZone, 1500, 2500, 600, 800, 800, 1200 ) + +-- Maximum 6 units for patrol, with a spawn interval between 30 and 60 seconds. +--A2GDispatcher:SetSquadronCasPatrolInterval( "Sq34", 2, 30, 60 ) + +-- Start from airbase hot. +A2GDispatcher:SetSquadronTakeoffFromParkingHot( "Sq34" ) + +-- For every 4 targets, there will be one plane spawned. +A2GDispatcher:SetSquadronOverhead( "Sq34", 0.25 ) + +A2GDispatcher:SetDefaultTanker( "Tanker" ) +A2GDispatcher:SetDefaultFuelThreshold( 0.9 ) + diff --git a/AID - AI Dispatching/AID-A2G - AI A2G Dispatching/AID-A2G-363 - CAS Airplanes Patrol Refuel/AID-A2G-363 - CAS Airplanes Patrol Refuel.miz b/AID - AI Dispatching/AID-A2G - AI A2G Dispatching/AID-A2G-363 - CAS Airplanes Patrol Refuel/AID-A2G-363 - CAS Airplanes Patrol Refuel.miz index 6090c7989a..359966699d 100644 Binary files a/AID - AI Dispatching/AID-A2G - AI A2G Dispatching/AID-A2G-363 - CAS Airplanes Patrol Refuel/AID-A2G-363 - CAS Airplanes Patrol Refuel.miz and b/AID - AI Dispatching/AID-A2G - AI A2G Dispatching/AID-A2G-363 - CAS Airplanes Patrol Refuel/AID-A2G-363 - CAS Airplanes Patrol Refuel.miz differ diff --git a/AID - AI Dispatching/AID-A2G - AI A2G Dispatching/AID-A2G-400 - BAI Helicopters/AID-A2G-400 - BAI Helicopters.lua b/AID - AI Dispatching/AID-A2G - AI A2G Dispatching/AID-A2G-400 - BAI Helicopters/AID-A2G-400 - BAI Helicopters.lua index e90889b195..cf3e066503 100644 --- a/AID - AI Dispatching/AID-A2G - AI A2G Dispatching/AID-A2G-400 - BAI Helicopters/AID-A2G-400 - BAI Helicopters.lua +++ b/AID - AI Dispatching/AID-A2G - AI A2G Dispatching/AID-A2G-400 - BAI Helicopters/AID-A2G-400 - BAI Helicopters.lua @@ -1,36 +1,36 @@ ---- Detect and attack a set of enemy units using helicopters. --- Author: FlightControl --- Date Created: 27 Jan 2019 - --- Define a SET_GROUP object that builds a collection of groups that define the recce network. --- Here we build the network with all the groups that have a name starting with CCCP Recce. -DetectionSetGroup = SET_GROUP:New() -DetectionSetGroup:FilterPrefixes( { "CCCP Recce" } ) -DetectionSetGroup:FilterStart() - -Detection = DETECTION_AREAS:New( DetectionSetGroup, 1000 ) - --- Setup the A2A dispatcher, and initialize it. -A2GDispatcher = AI_A2G_DISPATCHER:New( Detection ) - --- Add defense coordinates. -A2GDispatcher:AddDefenseCoordinate( "HQ", GROUP:FindByName( "HQ" ):GetCoordinate() ) - -A2GDispatcher:SetDefenseReactivityMedium() - -A2GDispatcher:SetDefenseRadius( 100000 ) - -A2GDispatcher:SetTacticalDisplay( true ) - --- Setup the squadrons. - -A2GDispatcher:SetSquadron( "Maykop BAI", "BAI", { "CCCP KA-50 BAI" }, 10 ) -A2GDispatcher:SetSquadronBai( "Maykop BAI", 120, 250, 1000, 1500 ) -A2GDispatcher:SetSquadronTakeoffFromParkingCold( "Maykop BAI" ) -A2GDispatcher:SetSquadronOverhead( "Maykop BAI", 0.25 ) - --- Wait for each helicopter to spawn about 4 minutes from cold start. --- So the FARP has 4 spots, that means every 60 seconds one helo. --- Otherwise the FARP will clutter. --- This will result in helicopters not guided properly by the dispatcher. -A2GDispatcher:SetSquadronTakeoffInterval( "Maykop BAI", 60 ) +--- Detect and attack a set of enemy units using helicopters. +-- Author: FlightControl +-- Date Created: 27 Jan 2019 + +-- Define a SET_GROUP object that builds a collection of groups that define the recce network. +-- Here we build the network with all the groups that have a name starting with CCCP Recce. +DetectionSetGroup = SET_GROUP:New() +DetectionSetGroup:FilterPrefixes( { "CCCP Recce" } ) +DetectionSetGroup:FilterStart() + +Detection = DETECTION_AREAS:New( DetectionSetGroup, 1000 ) + +-- Setup the A2A dispatcher, and initialize it. +A2GDispatcher = AI_A2G_DISPATCHER:New( Detection ) + +-- Add defense coordinates. +A2GDispatcher:AddDefenseCoordinate( "HQ", GROUP:FindByName( "HQ" ):GetCoordinate() ) + +A2GDispatcher:SetDefenseReactivityMedium() + +A2GDispatcher:SetDefenseRadius( 100000 ) + +A2GDispatcher:SetTacticalDisplay( true ) + +-- Setup the squadrons. + +A2GDispatcher:SetSquadron( "Maykop BAI", "BAI", { "CCCP KA-50 BAI" }, 10 ) +A2GDispatcher:SetSquadronBai( "Maykop BAI", 120, 250, 1000, 1500 ) +A2GDispatcher:SetSquadronTakeoffFromParkingCold( "Maykop BAI" ) +A2GDispatcher:SetSquadronOverhead( "Maykop BAI", 0.25 ) + +-- Wait for each helicopter to spawn about 4 minutes from cold start. +-- So the FARP has 4 spots, that means every 60 seconds one helo. +-- Otherwise the FARP will clutter. +-- This will result in helicopters not guided properly by the dispatcher. +A2GDispatcher:SetSquadronTakeoffInterval( "Maykop BAI", 60 ) diff --git a/AID - AI Dispatching/AID-A2G - AI A2G Dispatching/AID-A2G-400 - BAI Helicopters/AID-A2G-400 - BAI Helicopters.miz b/AID - AI Dispatching/AID-A2G - AI A2G Dispatching/AID-A2G-400 - BAI Helicopters/AID-A2G-400 - BAI Helicopters.miz index eed855fe81..0d6a3dd739 100644 Binary files a/AID - AI Dispatching/AID-A2G - AI A2G Dispatching/AID-A2G-400 - BAI Helicopters/AID-A2G-400 - BAI Helicopters.miz and b/AID - AI Dispatching/AID-A2G - AI A2G Dispatching/AID-A2G-400 - BAI Helicopters/AID-A2G-400 - BAI Helicopters.miz differ diff --git a/AID - AI Dispatching/AID-A2G - AI A2G Dispatching/AID-A2G-550 - SEAD Airplanes/AID-A2G-550 - SEAD Airplanes.lua b/AID - AI Dispatching/AID-A2G - AI A2G Dispatching/AID-A2G-550 - SEAD Airplanes/AID-A2G-550 - SEAD Airplanes.lua index 02826948ca..9a75c991c6 100644 --- a/AID - AI Dispatching/AID-A2G - AI A2G Dispatching/AID-A2G-550 - SEAD Airplanes/AID-A2G-550 - SEAD Airplanes.lua +++ b/AID - AI Dispatching/AID-A2G - AI A2G Dispatching/AID-A2G-550 - SEAD Airplanes/AID-A2G-550 - SEAD Airplanes.lua @@ -1,61 +1,61 @@ ---- Detect and attack a set of enemy units using helicopters. --- --- Author: FlightControl --- Date Created: 23 Jan 2018 - --- Define a SET_GROUP object that builds a collection of groups that define the recce network. --- Here we build the network with all the groups that have a name starting with CCCP Recce. -DetectionSetGroup = SET_GROUP:New() -DetectionSetGroup:FilterPrefixes( { "Recce" } ) -DetectionSetGroup:FilterStart() - -Detection = DETECTION_AREAS:New( DetectionSetGroup, 20000 ) - -Detection:SetFriendliesRange( 20000 ) - --- Setup the A2A dispatcher, and initialize it. -A2GDispatcher = AI_A2G_DISPATCHER:New( Detection ) - --- Add defense coordinates. -A2GDispatcher:AddDefenseCoordinate( "HQ", GROUP:FindByName( "HQ" ):GetCoordinate() ) - -A2GDispatcher:SetDefenseReactivityHigh() - -A2GDispatcher:SetDefenseRadius( 200000 ) - - -A2GDispatcher:SetTacticalDisplay( true ) - --- Setup the squadrons. - --- Setup the squadron Sq34. -A2GDispatcher:SetSquadron( "Sq34", AIRBASE.Caucasus.Vaziani, { "Defender Sq34" }, 10 ) - --- This will setup the squadron Sq34 for SEAD from Vaziani. --- Attack speed between 1000 and 1500 km/h. --- Attack altitude between 4000 and 6000 meters. -A2GDispatcher:SetSquadronSead( "Sq34", 600, 800, 4500, 6000 ) - - --- Start from airbase hot. -A2GDispatcher:SetSquadronTakeoffFromParkingHot( "Sq34" ) - --- For every 2 targets, there will be one plane spawned, so we give a 0.5 value. -A2GDispatcher:SetSquadronOverhead( "Sq34", 0.5 ) - - --- Setup the squadron Sq25. -A2GDispatcher:SetSquadron( "Sq25", AIRBASE.Caucasus.Soganlug, { "Defender Sq25" }, 10 ) - --- This will setup the squadron Sq34 for CAS from Vaziani. --- No additional altitude and speed parameters are given, so the defaults are assigned. --- Default speed between 50% and 75% of the maximum speed of the units in the group. --- Default altitude is between 1000 and 1500 meters. -A2GDispatcher:SetSquadronCas( "Sq25" ) - - --- Start from airbase hot. -A2GDispatcher:SetSquadronTakeoffFromParkingHot( "Sq25" ) - --- For every 2 targets, there will be one plane spawned, so we give a 0.5 value. -A2GDispatcher:SetSquadronOverhead( "Sq25", 0.25 ) +--- Detect and attack a set of enemy units using helicopters. +-- +-- Author: FlightControl +-- Date Created: 23 Jan 2018 + +-- Define a SET_GROUP object that builds a collection of groups that define the recce network. +-- Here we build the network with all the groups that have a name starting with CCCP Recce. +DetectionSetGroup = SET_GROUP:New() +DetectionSetGroup:FilterPrefixes( { "Recce" } ) +DetectionSetGroup:FilterStart() + +Detection = DETECTION_AREAS:New( DetectionSetGroup, 20000 ) + +Detection:SetFriendliesRange( 20000 ) + +-- Setup the A2A dispatcher, and initialize it. +A2GDispatcher = AI_A2G_DISPATCHER:New( Detection ) + +-- Add defense coordinates. +A2GDispatcher:AddDefenseCoordinate( "HQ", GROUP:FindByName( "HQ" ):GetCoordinate() ) + +A2GDispatcher:SetDefenseReactivityHigh() + +A2GDispatcher:SetDefenseRadius( 200000 ) + + +A2GDispatcher:SetTacticalDisplay( true ) + +-- Setup the squadrons. + +-- Setup the squadron Sq34. +A2GDispatcher:SetSquadron( "Sq34", AIRBASE.Caucasus.Vaziani, { "Defender Sq34" }, 10 ) + +-- This will setup the squadron Sq34 for SEAD from Vaziani. +-- Attack speed between 1000 and 1500 km/h. +-- Attack altitude between 4000 and 6000 meters. +A2GDispatcher:SetSquadronSead( "Sq34", 600, 800, 4500, 6000 ) + + +-- Start from airbase hot. +A2GDispatcher:SetSquadronTakeoffFromParkingHot( "Sq34" ) + +-- For every 2 targets, there will be one plane spawned, so we give a 0.5 value. +A2GDispatcher:SetSquadronOverhead( "Sq34", 0.5 ) + + +-- Setup the squadron Sq25. +A2GDispatcher:SetSquadron( "Sq25", AIRBASE.Caucasus.Soganlug, { "Defender Sq25" }, 10 ) + +-- This will setup the squadron Sq34 for CAS from Vaziani. +-- No additional altitude and speed parameters are given, so the defaults are assigned. +-- Default speed between 50% and 75% of the maximum speed of the units in the group. +-- Default altitude is between 1000 and 1500 meters. +A2GDispatcher:SetSquadronCas( "Sq25" ) + + +-- Start from airbase hot. +A2GDispatcher:SetSquadronTakeoffFromParkingHot( "Sq25" ) + +-- For every 2 targets, there will be one plane spawned, so we give a 0.5 value. +A2GDispatcher:SetSquadronOverhead( "Sq25", 0.25 ) diff --git a/AID - AI Dispatching/AID-A2G - AI A2G Dispatching/AID-A2G-550 - SEAD Airplanes/AID-A2G-550 - SEAD Airplanes.miz b/AID - AI Dispatching/AID-A2G - AI A2G Dispatching/AID-A2G-550 - SEAD Airplanes/AID-A2G-550 - SEAD Airplanes.miz index fe732de18c..3e0cc93cc3 100644 Binary files a/AID - AI Dispatching/AID-A2G - AI A2G Dispatching/AID-A2G-550 - SEAD Airplanes/AID-A2G-550 - SEAD Airplanes.miz and b/AID - AI Dispatching/AID-A2G - AI A2G Dispatching/AID-A2G-550 - SEAD Airplanes/AID-A2G-550 - SEAD Airplanes.miz differ diff --git a/AID - AI Dispatching/AID-A2G - AI A2G Dispatching/AID-A2G-600 - Detection Zones and Attack Helicopters/AID-A2G-600 - Detection Zones and Attack Helicopters.lua b/AID - AI Dispatching/AID-A2G - AI A2G Dispatching/AID-A2G-600 - Detection Zones and Attack Helicopters/AID-A2G-600 - Detection Zones and Attack Helicopters.lua index 2394330530..f900c02223 100644 --- a/AID - AI Dispatching/AID-A2G - AI A2G Dispatching/AID-A2G-600 - Detection Zones and Attack Helicopters/AID-A2G-600 - Detection Zones and Attack Helicopters.lua +++ b/AID - AI Dispatching/AID-A2G - AI A2G Dispatching/AID-A2G-600 - Detection Zones and Attack Helicopters/AID-A2G-600 - Detection Zones and Attack Helicopters.lua @@ -1,46 +1,46 @@ ---- Detect and attack a set of enemy units using helicopters. --- Name: AID-A2G-001 - Detection and Attack Helicopters --- Author: FlightControl --- Date Created: 02 Nov 2018 - - - -local DetectionZones = SET_ZONE:New():FilterPrefixes( { "Detection Zone " } ):FilterOnce() - -Detection = DETECTION_ZONES:New( DetectionZones, coalition.side.BLUE ) - --- Setup the A2A dispatcher, and initialize it. -A2GDispatcher = AI_A2G_DISPATCHER:New( Detection ) - --- Add defense coordinates. -A2GDispatcher:AddDefenseCoordinate( "HQ", GROUP:FindByName( "HQ" ):GetCoordinate() ) - -A2GDispatcher:SetDefenseReactivityHigh() - -A2GDispatcher:SetDefenseRadius( 200000 ) - -A2GDispatcher:SetTacticalDisplay( true ) - --- Setup the squadrons. - -A2GDispatcher:SetSquadron( "Maykop SEAD", AIRBASE.Caucasus.Maykop_Khanskaya, { "CCCP SU-25T" }, 10 ) -A2GDispatcher:SetSquadronSead( "Maykop SEAD", 120, 250 ) -A2GDispatcher:SetSquadronTakeoffFromParkingHot( "Maykop SEAD" ) -A2GDispatcher:SetSquadronOverhead( "Maykop SEAD", 0.2 ) - -A2GDispatcher:SetSquadron( "Maykop CAS", "CAS", { "CCCP KA-50" }, 10 ) -A2GDispatcher:SetSquadronCas( "Maykop CAS", 120, 250 ) -A2GDispatcher:SetSquadronTakeoffFromParkingHot( "Maykop CAS" ) -A2GDispatcher:SetSquadronOverhead( "Maykop CAS", 0.25 ) - -A2GDispatcher:SetSquadron( "Maykop BAI", "BAI", { "CCCP KA-50" }, 10 ) -A2GDispatcher:SetSquadronBai( "Maykop BAI", 120, 250 ) -A2GDispatcher:SetSquadronTakeoffFromParkingHot( "Maykop BAI" ) -A2GDispatcher:SetSquadronOverhead( "Maykop BAI", 0.25 ) - --- We set for each squadron a takeoff interval, as each helicopter will launch from a FARP. --- This to prevent helicopters to clutter. --- Each helicopter group is taking off the FARP in hot start. -A2GDispatcher:SetSquadronTakeoffInterval( "Maykop SEAD", 60 ) -A2GDispatcher:SetSquadronTakeoffInterval( "Maykop CAS", 60 ) -A2GDispatcher:SetSquadronTakeoffInterval( "Maykop BAI", 60 ) +--- Detect and attack a set of enemy units using helicopters. +-- Name: AID-A2G-001 - Detection and Attack Helicopters +-- Author: FlightControl +-- Date Created: 02 Nov 2018 + + + +local DetectionZones = SET_ZONE:New():FilterPrefixes( { "Detection Zone " } ):FilterOnce() + +Detection = DETECTION_ZONES:New( DetectionZones, coalition.side.BLUE ) + +-- Setup the A2A dispatcher, and initialize it. +A2GDispatcher = AI_A2G_DISPATCHER:New( Detection ) + +-- Add defense coordinates. +A2GDispatcher:AddDefenseCoordinate( "HQ", GROUP:FindByName( "HQ" ):GetCoordinate() ) + +A2GDispatcher:SetDefenseReactivityHigh() + +A2GDispatcher:SetDefenseRadius( 200000 ) + +A2GDispatcher:SetTacticalDisplay( true ) + +-- Setup the squadrons. + +A2GDispatcher:SetSquadron( "Maykop SEAD", AIRBASE.Caucasus.Maykop_Khanskaya, { "CCCP SU-25T" }, 10 ) +A2GDispatcher:SetSquadronSead( "Maykop SEAD", 120, 250 ) +A2GDispatcher:SetSquadronTakeoffFromParkingHot( "Maykop SEAD" ) +A2GDispatcher:SetSquadronOverhead( "Maykop SEAD", 0.2 ) + +A2GDispatcher:SetSquadron( "Maykop CAS", "CAS", { "CCCP KA-50" }, 10 ) +A2GDispatcher:SetSquadronCas( "Maykop CAS", 120, 250 ) +A2GDispatcher:SetSquadronTakeoffFromParkingHot( "Maykop CAS" ) +A2GDispatcher:SetSquadronOverhead( "Maykop CAS", 0.25 ) + +A2GDispatcher:SetSquadron( "Maykop BAI", "BAI", { "CCCP KA-50" }, 10 ) +A2GDispatcher:SetSquadronBai( "Maykop BAI", 120, 250 ) +A2GDispatcher:SetSquadronTakeoffFromParkingHot( "Maykop BAI" ) +A2GDispatcher:SetSquadronOverhead( "Maykop BAI", 0.25 ) + +-- We set for each squadron a takeoff interval, as each helicopter will launch from a FARP. +-- This to prevent helicopters to clutter. +-- Each helicopter group is taking off the FARP in hot start. +A2GDispatcher:SetSquadronTakeoffInterval( "Maykop SEAD", 60 ) +A2GDispatcher:SetSquadronTakeoffInterval( "Maykop CAS", 60 ) +A2GDispatcher:SetSquadronTakeoffInterval( "Maykop BAI", 60 ) diff --git a/AID - AI Dispatching/AID-A2G - AI A2G Dispatching/AID-A2G-600 - Detection Zones and Attack Helicopters/AID-A2G-600 - Detection Zones and Attack Helicopters.miz b/AID - AI Dispatching/AID-A2G - AI A2G Dispatching/AID-A2G-600 - Detection Zones and Attack Helicopters/AID-A2G-600 - Detection Zones and Attack Helicopters.miz index 41d129320b..68867f8881 100644 Binary files a/AID - AI Dispatching/AID-A2G - AI A2G Dispatching/AID-A2G-600 - Detection Zones and Attack Helicopters/AID-A2G-600 - Detection Zones and Attack Helicopters.miz and b/AID - AI Dispatching/AID-A2G - AI A2G Dispatching/AID-A2G-600 - Detection Zones and Attack Helicopters/AID-A2G-600 - Detection Zones and Attack Helicopters.miz differ diff --git a/AID - AI Dispatching/AID-A2G - AI A2G Dispatching/AID-A2G-601 - Detection Zones and Defense Limit/AID-A2G-601 - Detection Zones and Defense Limit.lua b/AID - AI Dispatching/AID-A2G - AI A2G Dispatching/AID-A2G-601 - Detection Zones and Defense Limit/AID-A2G-601 - Detection Zones and Defense Limit.lua index 0350aa57cb..65919ba250 100644 --- a/AID - AI Dispatching/AID-A2G - AI A2G Dispatching/AID-A2G-601 - Detection Zones and Defense Limit/AID-A2G-601 - Detection Zones and Defense Limit.lua +++ b/AID - AI Dispatching/AID-A2G - AI A2G Dispatching/AID-A2G-601 - Detection Zones and Defense Limit/AID-A2G-601 - Detection Zones and Defense Limit.lua @@ -1,48 +1,48 @@ ---- Detect and attack a set of enemy units using helicopters. --- Name: AID-A2G-001 - Detection and Attack Helicopters --- Author: FlightControl --- Date Created: 02 Nov 2018 - - - -local DetectionZones = SET_ZONE:New():FilterPrefixes( { "Detection Zone " } ):FilterOnce() - -Detection = DETECTION_ZONES:New( DetectionZones, coalition.side.BLUE ) - --- Setup the A2A dispatcher, and initialize it. -A2GDispatcher = AI_A2G_DISPATCHER:New( Detection ) - --- Add defense coordinates. -A2GDispatcher:AddDefenseCoordinate( "HQ", GROUP:FindByName( "HQ" ):GetCoordinate() ) - -A2GDispatcher:SetDefenseReactivityHigh() - -A2GDispatcher:SetDefenseRadius( 200000 ) - -A2GDispatcher:SetDefenseLimit( 1 ) - -A2GDispatcher:SetTacticalDisplay( true ) - --- Setup the squadrons. - -A2GDispatcher:SetSquadron( "Maykop SEAD", AIRBASE.Caucasus.Maykop_Khanskaya, { "CCCP SU-25T" }, 10 ) -A2GDispatcher:SetSquadronSead( "Maykop SEAD", 120, 250 ) -A2GDispatcher:SetSquadronTakeoffFromParkingHot( "Maykop SEAD" ) -A2GDispatcher:SetSquadronOverhead( "Maykop SEAD", 0.2 ) - -A2GDispatcher:SetSquadron( "Maykop CAS", "CAS", { "CCCP KA-50" }, 10 ) -A2GDispatcher:SetSquadronCas( "Maykop CAS", 120, 250 ) -A2GDispatcher:SetSquadronTakeoffFromParkingHot( "Maykop CAS" ) -A2GDispatcher:SetSquadronOverhead( "Maykop CAS", 0.25 ) - -A2GDispatcher:SetSquadron( "Maykop BAI", "BAI", { "CCCP KA-50" }, 10 ) -A2GDispatcher:SetSquadronBai( "Maykop BAI", 120, 250 ) -A2GDispatcher:SetSquadronTakeoffFromParkingHot( "Maykop BAI" ) -A2GDispatcher:SetSquadronOverhead( "Maykop BAI", 0.25 ) - --- We set for each squadron a takeoff interval, as each helicopter will launch from a FARP. --- This to prevent helicopters to clutter. --- Each helicopter group is taking off the FARP in hot start. -A2GDispatcher:SetSquadronTakeoffInterval( "Maykop SEAD", 60 ) -A2GDispatcher:SetSquadronTakeoffInterval( "Maykop CAS", 60 ) -A2GDispatcher:SetSquadronTakeoffInterval( "Maykop BAI", 60 ) +--- Detect and attack a set of enemy units using helicopters. +-- Name: AID-A2G-001 - Detection and Attack Helicopters +-- Author: FlightControl +-- Date Created: 02 Nov 2018 + + + +local DetectionZones = SET_ZONE:New():FilterPrefixes( { "Detection Zone " } ):FilterOnce() + +Detection = DETECTION_ZONES:New( DetectionZones, coalition.side.BLUE ) + +-- Setup the A2A dispatcher, and initialize it. +A2GDispatcher = AI_A2G_DISPATCHER:New( Detection ) + +-- Add defense coordinates. +A2GDispatcher:AddDefenseCoordinate( "HQ", GROUP:FindByName( "HQ" ):GetCoordinate() ) + +A2GDispatcher:SetDefenseReactivityHigh() + +A2GDispatcher:SetDefenseRadius( 200000 ) + +A2GDispatcher:SetDefenseLimit( 1 ) + +A2GDispatcher:SetTacticalDisplay( true ) + +-- Setup the squadrons. + +A2GDispatcher:SetSquadron( "Maykop SEAD", AIRBASE.Caucasus.Maykop_Khanskaya, { "CCCP SU-25T" }, 10 ) +A2GDispatcher:SetSquadronSead( "Maykop SEAD", 120, 250 ) +A2GDispatcher:SetSquadronTakeoffFromParkingHot( "Maykop SEAD" ) +A2GDispatcher:SetSquadronOverhead( "Maykop SEAD", 0.2 ) + +A2GDispatcher:SetSquadron( "Maykop CAS", "CAS", { "CCCP KA-50" }, 10 ) +A2GDispatcher:SetSquadronCas( "Maykop CAS", 120, 250 ) +A2GDispatcher:SetSquadronTakeoffFromParkingHot( "Maykop CAS" ) +A2GDispatcher:SetSquadronOverhead( "Maykop CAS", 0.25 ) + +A2GDispatcher:SetSquadron( "Maykop BAI", "BAI", { "CCCP KA-50" }, 10 ) +A2GDispatcher:SetSquadronBai( "Maykop BAI", 120, 250 ) +A2GDispatcher:SetSquadronTakeoffFromParkingHot( "Maykop BAI" ) +A2GDispatcher:SetSquadronOverhead( "Maykop BAI", 0.25 ) + +-- We set for each squadron a takeoff interval, as each helicopter will launch from a FARP. +-- This to prevent helicopters to clutter. +-- Each helicopter group is taking off the FARP in hot start. +A2GDispatcher:SetSquadronTakeoffInterval( "Maykop SEAD", 60 ) +A2GDispatcher:SetSquadronTakeoffInterval( "Maykop CAS", 60 ) +A2GDispatcher:SetSquadronTakeoffInterval( "Maykop BAI", 60 ) diff --git a/AID - AI Dispatching/AID-A2G - AI A2G Dispatching/AID-A2G-601 - Detection Zones and Defense Limit/AID-A2G-601 - Detection Zones and Defense Limit.miz b/AID - AI Dispatching/AID-A2G - AI A2G Dispatching/AID-A2G-601 - Detection Zones and Defense Limit/AID-A2G-601 - Detection Zones and Defense Limit.miz index e3678fb351..c4a5328918 100644 Binary files a/AID - AI Dispatching/AID-A2G - AI A2G Dispatching/AID-A2G-601 - Detection Zones and Defense Limit/AID-A2G-601 - Detection Zones and Defense Limit.miz and b/AID - AI Dispatching/AID-A2G - AI A2G Dispatching/AID-A2G-601 - Detection Zones and Defense Limit/AID-A2G-601 - Detection Zones and Defense Limit.miz differ diff --git a/AID - AI Dispatching/AID-A2G - AI A2G Dispatching/AID-A2G-702 - Patrol and Engage Sound Check/AID-A2G-702 - Patrol and Engage Sound Check.lua b/AID - AI Dispatching/AID-A2G - AI A2G Dispatching/AID-A2G-702 - Patrol and Engage Sound Check/AID-A2G-702 - Patrol and Engage Sound Check.lua index f710b92f23..98e74e1393 100644 --- a/AID - AI Dispatching/AID-A2G - AI A2G Dispatching/AID-A2G-702 - Patrol and Engage Sound Check/AID-A2G-702 - Patrol and Engage Sound Check.lua +++ b/AID - AI Dispatching/AID-A2G - AI A2G Dispatching/AID-A2G-702 - Patrol and Engage Sound Check/AID-A2G-702 - Patrol and Engage Sound Check.lua @@ -1,60 +1,60 @@ ---- Sound check using patrol and engage for helicopters. --- Author: FlightControl --- Date Created: 14 Sep 2019 - --- Define a SET_GROUP object that builds a collection of groups that define the recce network. --- Here we build the network with all the groups that have a name starting with CCCP Recce. -DetectionSetGroup = SET_GROUP:New() -DetectionSetGroup:FilterPrefixes( { "US Recce" } ) -DetectionSetGroup:FilterStart() - -CCGroup = GROUP:FindByName( "HQ" ) -CC = COMMANDCENTER:New( CCGroup, "HQ" ) - -Detection = DETECTION_AREAS:New( DetectionSetGroup, 1000 ) - --- Setup the A2A dispatcher, and initialize it. -A2GDispatcher = AI_A2G_DISPATCHER:New( Detection ) - -A2GDispatcher:SetCommandCenter( CC ) -A2GDispatcher:SetTacticalMenu( "Dispatchers", "A2G Tactical Situation" ) - --- Add defense coordinates. -A2GDispatcher:AddDefenseCoordinate( "HQ", GROUP:FindByName( "HQ" ):GetCoordinate() ) - -A2GDispatcher:SetDefenseReactivityHigh() - -A2GDispatcher:SetDefenseRadius( 100000 ) - -A2GDispatcher:SetTacticalDisplay( false ) - -local PatrolZone = ZONE:New( "PatrolZone" ) - --- Setup the squadrons. -A2GDispatcher:SetSquadron( "Maykop SEAD", "SEAD", { "US KA-50" }, 10 ) -A2GDispatcher:SetSquadronSeadPatrol( "Maykop SEAD", PatrolZone, 300, 500, 50, 80, 250, 300 ) -A2GDispatcher:SetSquadronPatrolInterval( "Maykop SEAD", 2, 30, 60, 1, "SEAD" ) -A2GDispatcher:SetSquadronTakeoffFromParkingHot( "Maykop SEAD" ) -A2GDispatcher:SetSquadronOverhead( "Maykop SEAD", 0.25 ) -A2GDispatcher:SetSquadronRadioFrequency( "Maykop SEAD", 124 ) - -A2GDispatcher:SetSquadron( "Maykop CAS", "CAS", { "US KA-50" }, 10 ) -A2GDispatcher:SetSquadronCasPatrol( "Maykop CAS", PatrolZone, 600, 700, 50, 80, 250, 300 ) -A2GDispatcher:SetSquadronPatrolInterval( "Maykop CAS", 2, 30, 60, 1, "CAS" ) -A2GDispatcher:SetSquadronTakeoffFromParkingHot( "Maykop CAS" ) -A2GDispatcher:SetSquadronOverhead( "Maykop CAS", 0.25 ) -A2GDispatcher:SetSquadronRadioFrequency( "Maykop CAS", 126 ) - -A2GDispatcher:SetSquadron( "Maykop BAI", "BAI", { "US KA-50" }, 10 ) -A2GDispatcher:SetSquadronBaiPatrol( "Maykop BAI", PatrolZone, 800, 900, 50, 80, 250, 300 ) -A2GDispatcher:SetSquadronPatrolInterval( "Maykop BAI", 2, 30, 60, 1, "BAI" ) -A2GDispatcher:SetSquadronTakeoffFromParkingHot( "Maykop BAI" ) -A2GDispatcher:SetSquadronOverhead( "Maykop BAI", 0.25 ) -A2GDispatcher:SetSquadronRadioFrequency( "Maykop BAI", 128 ) - --- We set for each squadron a takeoff interval, as each helicopter will launch from a FARP. --- This to prevent helicopters to clutter. --- Each helicopter group is taking off the FARP in hot start. -A2GDispatcher:SetSquadronTakeoffInterval( "Maykop SEAD", 60 ) -A2GDispatcher:SetSquadronTakeoffInterval( "Maykop CAS", 60 ) +--- Sound check using patrol and engage for helicopters. +-- Author: FlightControl +-- Date Created: 14 Sep 2019 + +-- Define a SET_GROUP object that builds a collection of groups that define the recce network. +-- Here we build the network with all the groups that have a name starting with CCCP Recce. +DetectionSetGroup = SET_GROUP:New() +DetectionSetGroup:FilterPrefixes( { "US Recce" } ) +DetectionSetGroup:FilterStart() + +CCGroup = GROUP:FindByName( "HQ" ) +CC = COMMANDCENTER:New( CCGroup, "HQ" ) + +Detection = DETECTION_AREAS:New( DetectionSetGroup, 1000 ) + +-- Setup the A2A dispatcher, and initialize it. +A2GDispatcher = AI_A2G_DISPATCHER:New( Detection ) + +A2GDispatcher:SetCommandCenter( CC ) +A2GDispatcher:SetTacticalMenu( "Dispatchers", "A2G Tactical Situation" ) + +-- Add defense coordinates. +A2GDispatcher:AddDefenseCoordinate( "HQ", GROUP:FindByName( "HQ" ):GetCoordinate() ) + +A2GDispatcher:SetDefenseReactivityHigh() + +A2GDispatcher:SetDefenseRadius( 100000 ) + +A2GDispatcher:SetTacticalDisplay( false ) + +local PatrolZone = ZONE:New( "PatrolZone" ) + +-- Setup the squadrons. +A2GDispatcher:SetSquadron( "Maykop SEAD", "SEAD", { "US KA-50" }, 10 ) +A2GDispatcher:SetSquadronSeadPatrol( "Maykop SEAD", PatrolZone, 300, 500, 50, 80, 250, 300 ) +A2GDispatcher:SetSquadronPatrolInterval( "Maykop SEAD", 2, 30, 60, 1, "SEAD" ) +A2GDispatcher:SetSquadronTakeoffFromParkingHot( "Maykop SEAD" ) +A2GDispatcher:SetSquadronOverhead( "Maykop SEAD", 0.25 ) +A2GDispatcher:SetSquadronRadioFrequency( "Maykop SEAD", 124 ) + +A2GDispatcher:SetSquadron( "Maykop CAS", "CAS", { "US KA-50" }, 10 ) +A2GDispatcher:SetSquadronCasPatrol( "Maykop CAS", PatrolZone, 600, 700, 50, 80, 250, 300 ) +A2GDispatcher:SetSquadronPatrolInterval( "Maykop CAS", 2, 30, 60, 1, "CAS" ) +A2GDispatcher:SetSquadronTakeoffFromParkingHot( "Maykop CAS" ) +A2GDispatcher:SetSquadronOverhead( "Maykop CAS", 0.25 ) +A2GDispatcher:SetSquadronRadioFrequency( "Maykop CAS", 126 ) + +A2GDispatcher:SetSquadron( "Maykop BAI", "BAI", { "US KA-50" }, 10 ) +A2GDispatcher:SetSquadronBaiPatrol( "Maykop BAI", PatrolZone, 800, 900, 50, 80, 250, 300 ) +A2GDispatcher:SetSquadronPatrolInterval( "Maykop BAI", 2, 30, 60, 1, "BAI" ) +A2GDispatcher:SetSquadronTakeoffFromParkingHot( "Maykop BAI" ) +A2GDispatcher:SetSquadronOverhead( "Maykop BAI", 0.25 ) +A2GDispatcher:SetSquadronRadioFrequency( "Maykop BAI", 128 ) + +-- We set for each squadron a takeoff interval, as each helicopter will launch from a FARP. +-- This to prevent helicopters to clutter. +-- Each helicopter group is taking off the FARP in hot start. +A2GDispatcher:SetSquadronTakeoffInterval( "Maykop SEAD", 60 ) +A2GDispatcher:SetSquadronTakeoffInterval( "Maykop CAS", 60 ) A2GDispatcher:SetSquadronTakeoffInterval( "Maykop BAI", 60 ) \ No newline at end of file diff --git a/AID - AI Dispatching/AID-A2G - AI A2G Dispatching/AID-A2G-702 - Patrol and Engage Sound Check/AID-A2G-702 - Patrol and Engage Sound Check.miz b/AID - AI Dispatching/AID-A2G - AI A2G Dispatching/AID-A2G-702 - Patrol and Engage Sound Check/AID-A2G-702 - Patrol and Engage Sound Check.miz index e08fe65bf9..c41d47ef47 100644 Binary files a/AID - AI Dispatching/AID-A2G - AI A2G Dispatching/AID-A2G-702 - Patrol and Engage Sound Check/AID-A2G-702 - Patrol and Engage Sound Check.miz and b/AID - AI Dispatching/AID-A2G - AI A2G Dispatching/AID-A2G-702 - Patrol and Engage Sound Check/AID-A2G-702 - Patrol and Engage Sound Check.miz differ diff --git a/AID - AI Dispatching/AID-A2G - AI A2G Dispatching/AID-A2G-900 - A fun A2G Mission/AID-A2G-900 - A fun A2G Mission.lua b/AID - AI Dispatching/AID-A2G - AI A2G Dispatching/AID-A2G-900 - A fun A2G Mission/AID-A2G-900 - A fun A2G Mission.lua index b3f5f71659..616858b05c 100644 --- a/AID - AI Dispatching/AID-A2G - AI A2G Dispatching/AID-A2G-900 - A fun A2G Mission/AID-A2G-900 - A fun A2G Mission.lua +++ b/AID - AI Dispatching/AID-A2G - AI A2G Dispatching/AID-A2G-900 - A fun A2G Mission/AID-A2G-900 - A fun A2G Mission.lua @@ -1,28 +1,28 @@ - -Recce_Blue = SET_GROUP:New():FilterPrefixes( "RECCE" ):FilterStart() - -Detection_Blue = DETECTION_AREAS:New( Recce_Blue, 3000 ) - -A2G_Blue = AI_A2G_DISPATCHER:New(Detection_Blue) - -A2G_Blue:SetTacticalDisplay( true ) -- set on using true as a parameter - -DefenseCoordinate = GROUP:FindByName( "COMMAND" ):GetCoordinate() - -A2G_Blue:AddDefenseCoordinate( "Defense Point", DefenseCoordinate ) -A2G_Blue:SetDefenseRadius( 200000 ) -- in meters -A2G_Blue:SetDefenseReactivityHigh() -- we engage almost immediately - -A2G_Blue:SetSquadron( "SQ-1", AIRBASE.Caucasus.Gudauta, { "A2G-DEFENSE-AH-64D-ROCKETS", "A2G-DEFENSE-AH-64D-HELLFIRES" }, 20 ) -A2G_Blue:SetSquadronBai( "SQ-1", 200, 280, 160, 500 ) -A2G_Blue:SetSquadronTakeoffInAir( "SQ-1", 1000 ) -- altitude in meters when spawning in the air. -A2G_Blue:SetSquadronLandingNearAirbase( "SQ-1" ) -A2G_Blue:SetSquadronOverhead( "SQ-1", 0.25 ) - -A2G_Blue:SetSquadron( "SQ-2", AIRBASE.Caucasus.Gudauta, { "A2G-DEFENSE-AH-SU-25T-SEAD" }, 6 ) -A2G_Blue:SetSquadronSead( "SQ-2", 600, 900, 1000, 2000 ) -A2G_Blue:SetSquadronTakeoffInAir( "SQ-2", 2000 ) -- altitude in meters when spawning in the air. -A2G_Blue:SetSquadronLandingNearAirbase( "SQ-2" ) -A2G_Blue:SetSquadronOverhead( "SQ-2", 0.5 ) - - + +Recce_Blue = SET_GROUP:New():FilterPrefixes( "RECCE" ):FilterStart() + +Detection_Blue = DETECTION_AREAS:New( Recce_Blue, 3000 ) + +A2G_Blue = AI_A2G_DISPATCHER:New(Detection_Blue) + +A2G_Blue:SetTacticalDisplay( true ) -- set on using true as a parameter + +DefenseCoordinate = GROUP:FindByName( "COMMAND" ):GetCoordinate() + +A2G_Blue:AddDefenseCoordinate( "Defense Point", DefenseCoordinate ) +A2G_Blue:SetDefenseRadius( 200000 ) -- in meters +A2G_Blue:SetDefenseReactivityHigh() -- we engage almost immediately + +A2G_Blue:SetSquadron( "SQ-1", AIRBASE.Caucasus.Gudauta, { "A2G-DEFENSE-AH-64D-ROCKETS", "A2G-DEFENSE-AH-64D-HELLFIRES" }, 20 ) +A2G_Blue:SetSquadronBai( "SQ-1", 200, 280, 160, 500 ) +A2G_Blue:SetSquadronTakeoffInAir( "SQ-1", 1000 ) -- altitude in meters when spawning in the air. +A2G_Blue:SetSquadronLandingNearAirbase( "SQ-1" ) +A2G_Blue:SetSquadronOverhead( "SQ-1", 0.25 ) + +A2G_Blue:SetSquadron( "SQ-2", AIRBASE.Caucasus.Gudauta, { "A2G-DEFENSE-AH-SU-25T-SEAD" }, 6 ) +A2G_Blue:SetSquadronSead( "SQ-2", 600, 900, 1000, 2000 ) +A2G_Blue:SetSquadronTakeoffInAir( "SQ-2", 2000 ) -- altitude in meters when spawning in the air. +A2G_Blue:SetSquadronLandingNearAirbase( "SQ-2" ) +A2G_Blue:SetSquadronOverhead( "SQ-2", 0.5 ) + + diff --git a/AID - AI Dispatching/AID-A2G - AI A2G Dispatching/AID-A2G-900 - A fun A2G Mission/AID-A2G-900 - A fun A2G Mission.miz b/AID - AI Dispatching/AID-A2G - AI A2G Dispatching/AID-A2G-900 - A fun A2G Mission/AID-A2G-900 - A fun A2G Mission.miz index c18eb13aac..a551374261 100644 Binary files a/AID - AI Dispatching/AID-A2G - AI A2G Dispatching/AID-A2G-900 - A fun A2G Mission/AID-A2G-900 - A fun A2G Mission.miz and b/AID - AI Dispatching/AID-A2G - AI A2G Dispatching/AID-A2G-900 - A fun A2G Mission/AID-A2G-900 - A fun A2G Mission.miz differ diff --git a/AID - AI Dispatching/AID-A2G - AI A2G Dispatching/AID-A2G-901 - A fun A2G Mission/AID-A2G-901 - A fun A2G Mission.lua b/AID - AI Dispatching/AID-A2G - AI A2G Dispatching/AID-A2G-901 - A fun A2G Mission/AID-A2G-901 - A fun A2G Mission.lua index 090e4a6b2c..564c7f2d5a 100644 --- a/AID - AI Dispatching/AID-A2G - AI A2G Dispatching/AID-A2G-901 - A fun A2G Mission/AID-A2G-901 - A fun A2G Mission.lua +++ b/AID - AI Dispatching/AID-A2G - AI A2G Dispatching/AID-A2G-901 - A fun A2G Mission/AID-A2G-901 - A fun A2G Mission.lua @@ -1,35 +1,35 @@ - -Recce_Blue = SET_GROUP:New():FilterPrefixes( "RECCE" ):FilterStart() - -Detection_Blue = DETECTION_AREAS:New( Recce_Blue, 3000 ) - -A2G_Blue = AI_A2G_DISPATCHER:New(Detection_Blue) - -A2G_Blue:SetTacticalDisplay( true ) -- set on using true as a parameter - -A2G_Blue:AddDefenseCoordinate( "Command", GROUP:FindByName( "COMMAND" ):GetCoordinate() ) -A2G_Blue:AddDefenseCoordinate( "Home", GROUP:FindByName( "HOME" ):GetCoordinate() ) - - -A2G_Blue:SetDefenseRadius( 200000 ) -- in meters -A2G_Blue:SetDefenseReactivityHigh() -- we engage almost immediately - -A2G_Blue:SetSquadron( "SQ-1", AIRBASE.Caucasus.Senaki_Kolkhi, { "A2G-DEFENSE-HELO-001", "A2G-DEFENSE-HELO-002", "A2G-DEFENSE-HELO-003" }, 20 ) -A2G_Blue:SetSquadronBai( "SQ-1", 200, 280, 160, 500 ) -A2G_Blue:SetSquadronTakeoffInAir( "SQ-1", 1000 ) -- altitude in meters when spawning in the air. -A2G_Blue:SetSquadronLandingNearAirbase( "SQ-1" ) -A2G_Blue:SetSquadronOverhead( "SQ-1", 0.25 ) - -A2G_Blue:SetSquadron( "SQ-2", AIRBASE.Caucasus.Gudauta, { "A2G-DEFENSE-SU-25T-SEAD" }, 10 ) -A2G_Blue:SetSquadronSead( "SQ-2", 600, 900, 1000, 2000 ) -A2G_Blue:SetSquadronTakeoffFromParkingHot( "SQ-2" ) -- altitude in meters when spawning in the air. -A2G_Blue:SetSquadronLandingAtRunway( "SQ-2" ) -A2G_Blue:SetSquadronOverhead( "SQ-2", 0.5 ) - -A2G_Blue:SetSquadron( "SQ-3", AIRBASE.Caucasus.Kobuleti, { "A2G-DEFENSE-AJS37-CAS" }, 6 ) -A2G_Blue:SetSquadronBai( "SQ-3", 600, 900, 1000, 2000 ) -A2G_Blue:SetSquadronTakeoffFromParkingHot( "SQ-3" ) -- altitude in meters when spawning in the air. -A2G_Blue:SetSquadronLandingAtRunway( "SQ-3" ) -A2G_Blue:SetSquadronOverhead( "SQ-3", 0.5 ) -A2G_Blue:SetSquadronBaiPatrol( "SQ-3", ZONE:New( "PatrolZone" ), 2000, 3000, 600, 800, 1000, 1400 ) -A2G_Blue:SetSquadronPatrolInterval( "SQ-3", 4, 30, 60, 1, "BAI" ) + +Recce_Blue = SET_GROUP:New():FilterPrefixes( "RECCE" ):FilterStart() + +Detection_Blue = DETECTION_AREAS:New( Recce_Blue, 3000 ) + +A2G_Blue = AI_A2G_DISPATCHER:New(Detection_Blue) + +A2G_Blue:SetTacticalDisplay( true ) -- set on using true as a parameter + +A2G_Blue:AddDefenseCoordinate( "Command", GROUP:FindByName( "COMMAND" ):GetCoordinate() ) +A2G_Blue:AddDefenseCoordinate( "Home", GROUP:FindByName( "HOME" ):GetCoordinate() ) + + +A2G_Blue:SetDefenseRadius( 200000 ) -- in meters +A2G_Blue:SetDefenseReactivityHigh() -- we engage almost immediately + +A2G_Blue:SetSquadron( "SQ-1", AIRBASE.Caucasus.Senaki_Kolkhi, { "A2G-DEFENSE-HELO-001", "A2G-DEFENSE-HELO-002", "A2G-DEFENSE-HELO-003" }, 20 ) +A2G_Blue:SetSquadronBai( "SQ-1", 200, 280, 160, 500 ) +A2G_Blue:SetSquadronTakeoffInAir( "SQ-1", 1000 ) -- altitude in meters when spawning in the air. +A2G_Blue:SetSquadronLandingNearAirbase( "SQ-1" ) +A2G_Blue:SetSquadronOverhead( "SQ-1", 0.25 ) + +A2G_Blue:SetSquadron( "SQ-2", AIRBASE.Caucasus.Gudauta, { "A2G-DEFENSE-SU-25T-SEAD" }, 10 ) +A2G_Blue:SetSquadronSead( "SQ-2", 600, 900, 1000, 2000 ) +A2G_Blue:SetSquadronTakeoffFromParkingHot( "SQ-2" ) -- altitude in meters when spawning in the air. +A2G_Blue:SetSquadronLandingAtRunway( "SQ-2" ) +A2G_Blue:SetSquadronOverhead( "SQ-2", 0.5 ) + +A2G_Blue:SetSquadron( "SQ-3", AIRBASE.Caucasus.Kobuleti, { "A2G-DEFENSE-AJS37-CAS" }, 6 ) +A2G_Blue:SetSquadronBai( "SQ-3", 600, 900, 1000, 2000 ) +A2G_Blue:SetSquadronTakeoffFromParkingHot( "SQ-3" ) -- altitude in meters when spawning in the air. +A2G_Blue:SetSquadronLandingAtRunway( "SQ-3" ) +A2G_Blue:SetSquadronOverhead( "SQ-3", 0.5 ) +A2G_Blue:SetSquadronBaiPatrol( "SQ-3", ZONE:New( "PatrolZone" ), 2000, 3000, 600, 800, 1000, 1400 ) +A2G_Blue:SetSquadronPatrolInterval( "SQ-3", 4, 30, 60, 1, "BAI" ) diff --git a/AID - AI Dispatching/AID-A2G - AI A2G Dispatching/AID-A2G-901 - A fun A2G Mission/AID-A2G-901 - A fun A2G Mission.miz b/AID - AI Dispatching/AID-A2G - AI A2G Dispatching/AID-A2G-901 - A fun A2G Mission/AID-A2G-901 - A fun A2G Mission.miz index eda01c910f..4c373fb557 100644 Binary files a/AID - AI Dispatching/AID-A2G - AI A2G Dispatching/AID-A2G-901 - A fun A2G Mission/AID-A2G-901 - A fun A2G Mission.miz and b/AID - AI Dispatching/AID-A2G - AI A2G Dispatching/AID-A2G-901 - A fun A2G Mission/AID-A2G-901 - A fun A2G Mission.miz differ diff --git a/AID - AI Dispatching/AID-A2G - AI A2G Dispatching/AID-A2G-902 - A fun A2G Mission/AID-A2G-902 - A fun A2G Mission.lua b/AID - AI Dispatching/AID-A2G - AI A2G Dispatching/AID-A2G-902 - A fun A2G Mission/AID-A2G-902 - A fun A2G Mission.lua index cda06f4b72..d498f27523 100644 --- a/AID - AI Dispatching/AID-A2G - AI A2G Dispatching/AID-A2G-902 - A fun A2G Mission/AID-A2G-902 - A fun A2G Mission.lua +++ b/AID - AI Dispatching/AID-A2G - AI A2G Dispatching/AID-A2G-902 - A fun A2G Mission/AID-A2G-902 - A fun A2G Mission.lua @@ -1,44 +1,44 @@ - -Recce_Blue = SET_GROUP:New():FilterPrefixes( "RECCE" ):FilterStart() - -Detection_Blue = DETECTION_AREAS:New( Recce_Blue, 3000 ) - -A2G_Blue = AI_A2G_DISPATCHER:New(Detection_Blue) - -A2G_Blue:SetTacticalDisplay( true ) -- set on using true as a parameter - -A2G_Blue:AddDefenseCoordinate( "Command", GROUP:FindByName( "COMMAND" ):GetCoordinate() ) -A2G_Blue:AddDefenseCoordinate( "Home", GROUP:FindByName( "HOME" ):GetCoordinate() ) - - -A2G_Blue:SetDefenseRadius( 350000 ) -- in meters -A2G_Blue:SetDefenseReactivityMedium() -- we engage almost immediately - -A2G_Blue:SetSquadron( "SQ-1", AIRBASE.Caucasus.Senaki_Kolkhi, { "A2G-DEFENSE-HELO-001", "A2G-DEFENSE-HELO-002", "A2G-DEFENSE-HELO-003" }, 20 ) -A2G_Blue:SetSquadronBai( "SQ-1", 200, 280, 160, 500 ) -A2G_Blue:SetSquadronTakeoffInAir( "SQ-1", 1000 ) -- altitude in meters when spawning in the air. -A2G_Blue:SetSquadronLandingNearAirbase( "SQ-1" ) -A2G_Blue:SetSquadronOverhead( "SQ-1", 0.5 ) -A2G_Blue:SetSquadronGrouping( "SQ-1", 4 ) - -A2G_Blue:SetSquadron( "SQ-HELO", AIRBASE.Caucasus.Sukhumi_Babushara, { "A2G-DEFENSE-HELO-004", "A2G-DEFENSE-HELO-005", "A2G-DEFENSE-HELO-006" }, 20 ) -A2G_Blue:SetSquadronBai( "SQ-HELO", 200, 280, 1500, 2000 ) -A2G_Blue:SetSquadronTakeoffInAir( "SQ-HELO", 1000 ) -- altitude in meters when spawning in the air. -A2G_Blue:SetSquadronLandingNearAirbase( "SQ-HELO" ) -A2G_Blue:SetSquadronOverhead( "SQ-HELO", 0.75 ) -A2G_Blue:SetSquadronGrouping( "SQ-HELO", 4 ) - -A2G_Blue:SetSquadron( "SQ-2", AIRBASE.Caucasus.Gudauta, { "A2G-DEFENSE-SU-25T-SEAD" }, 10 ) -A2G_Blue:SetSquadronSead( "SQ-2", 700, 1100, 2500, 4000 ) -A2G_Blue:SetSquadronTakeoffFromParkingHot( "SQ-2" ) -- altitude in meters when spawning in the air. -A2G_Blue:SetSquadronLandingAtRunway( "SQ-2" ) -A2G_Blue:SetSquadronOverhead( "SQ-2", 0.5 ) - -A2G_Blue:SetSquadron( "SQ-AIR", AIRBASE.Caucasus.Kobuleti, { "A2G-DEFENSE-A-10C-CAS" }, 6 ) -A2G_Blue:SetSquadronBai( "SQ-AIR", 600, 900, 1000, 2000 ) -A2G_Blue:SetSquadronTakeoffFromParkingHot( "SQ-AIR" ) -- altitude in meters when spawning in the air. -A2G_Blue:SetSquadronLandingAtRunway( "SQ-AIR" ) -A2G_Blue:SetSquadronOverhead( "SQ-AIR", 0.75 ) -A2G_Blue:SetSquadronBaiPatrol( "SQ-AIR", ZONE:New( "PatrolZone" ), 2000, 3000, 600, 800, 1000, 1400 ) -A2G_Blue:SetSquadronPatrolInterval( "SQ-AIR", 4, 30, 60, 1, "BAI" ) -A2G_Blue:SetSquadronGrouping( "SQ-AIR", 4 ) + +Recce_Blue = SET_GROUP:New():FilterPrefixes( "RECCE" ):FilterStart() + +Detection_Blue = DETECTION_AREAS:New( Recce_Blue, 3000 ) + +A2G_Blue = AI_A2G_DISPATCHER:New(Detection_Blue) + +A2G_Blue:SetTacticalDisplay( true ) -- set on using true as a parameter + +A2G_Blue:AddDefenseCoordinate( "Command", GROUP:FindByName( "COMMAND" ):GetCoordinate() ) +A2G_Blue:AddDefenseCoordinate( "Home", GROUP:FindByName( "HOME" ):GetCoordinate() ) + + +A2G_Blue:SetDefenseRadius( 350000 ) -- in meters +A2G_Blue:SetDefenseReactivityMedium() -- we engage almost immediately + +A2G_Blue:SetSquadron( "SQ-1", AIRBASE.Caucasus.Senaki_Kolkhi, { "A2G-DEFENSE-HELO-001", "A2G-DEFENSE-HELO-002", "A2G-DEFENSE-HELO-003" }, 20 ) +A2G_Blue:SetSquadronBai( "SQ-1", 200, 280, 160, 500 ) +A2G_Blue:SetSquadronTakeoffInAir( "SQ-1", 1000 ) -- altitude in meters when spawning in the air. +A2G_Blue:SetSquadronLandingNearAirbase( "SQ-1" ) +A2G_Blue:SetSquadronOverhead( "SQ-1", 0.5 ) +A2G_Blue:SetSquadronGrouping( "SQ-1", 4 ) + +A2G_Blue:SetSquadron( "SQ-HELO", AIRBASE.Caucasus.Sukhumi_Babushara, { "A2G-DEFENSE-HELO-004", "A2G-DEFENSE-HELO-005", "A2G-DEFENSE-HELO-006" }, 20 ) +A2G_Blue:SetSquadronBai( "SQ-HELO", 200, 280, 1500, 2000 ) +A2G_Blue:SetSquadronTakeoffInAir( "SQ-HELO", 1000 ) -- altitude in meters when spawning in the air. +A2G_Blue:SetSquadronLandingNearAirbase( "SQ-HELO" ) +A2G_Blue:SetSquadronOverhead( "SQ-HELO", 0.75 ) +A2G_Blue:SetSquadronGrouping( "SQ-HELO", 4 ) + +A2G_Blue:SetSquadron( "SQ-2", AIRBASE.Caucasus.Gudauta, { "A2G-DEFENSE-SU-25T-SEAD" }, 10 ) +A2G_Blue:SetSquadronSead( "SQ-2", 700, 1100, 2500, 4000 ) +A2G_Blue:SetSquadronTakeoffFromParkingHot( "SQ-2" ) -- altitude in meters when spawning in the air. +A2G_Blue:SetSquadronLandingAtRunway( "SQ-2" ) +A2G_Blue:SetSquadronOverhead( "SQ-2", 0.5 ) + +A2G_Blue:SetSquadron( "SQ-AIR", AIRBASE.Caucasus.Kobuleti, { "A2G-DEFENSE-A-10C-CAS" }, 6 ) +A2G_Blue:SetSquadronBai( "SQ-AIR", 600, 900, 1000, 2000 ) +A2G_Blue:SetSquadronTakeoffFromParkingHot( "SQ-AIR" ) -- altitude in meters when spawning in the air. +A2G_Blue:SetSquadronLandingAtRunway( "SQ-AIR" ) +A2G_Blue:SetSquadronOverhead( "SQ-AIR", 0.75 ) +A2G_Blue:SetSquadronBaiPatrol( "SQ-AIR", ZONE:New( "PatrolZone" ), 2000, 3000, 600, 800, 1000, 1400 ) +A2G_Blue:SetSquadronPatrolInterval( "SQ-AIR", 4, 30, 60, 1, "BAI" ) +A2G_Blue:SetSquadronGrouping( "SQ-AIR", 4 ) diff --git a/AID - AI Dispatching/AID-A2G - AI A2G Dispatching/AID-A2G-902 - A fun A2G Mission/AID-A2G-902 - A fun A2G Mission.miz b/AID - AI Dispatching/AID-A2G - AI A2G Dispatching/AID-A2G-902 - A fun A2G Mission/AID-A2G-902 - A fun A2G Mission.miz index 294d5da609..cdb222a0b9 100644 Binary files a/AID - AI Dispatching/AID-A2G - AI A2G Dispatching/AID-A2G-902 - A fun A2G Mission/AID-A2G-902 - A fun A2G Mission.miz and b/AID - AI Dispatching/AID-A2G - AI A2G Dispatching/AID-A2G-902 - A fun A2G Mission/AID-A2G-902 - A fun A2G Mission.miz differ diff --git a/AID - AI Dispatching/AID-A2G - AI A2G Dispatching/AID-A2G-903 - A fun A2G Mission/AID-A2G-903 - A fun A2G Mission.lua b/AID - AI Dispatching/AID-A2G - AI A2G Dispatching/AID-A2G-903 - A fun A2G Mission/AID-A2G-903 - A fun A2G Mission.lua index 31108d19d3..28ea81517d 100644 --- a/AID - AI Dispatching/AID-A2G - AI A2G Dispatching/AID-A2G-903 - A fun A2G Mission/AID-A2G-903 - A fun A2G Mission.lua +++ b/AID - AI Dispatching/AID-A2G - AI A2G Dispatching/AID-A2G-903 - A fun A2G Mission/AID-A2G-903 - A fun A2G Mission.lua @@ -1,56 +1,56 @@ - -Recce_Blue = SET_GROUP:New():FilterPrefixes( "RECCE" ):FilterStart() - -Detection_Blue = DETECTION_AREAS:New( Recce_Blue, 3000 ) - -A2G_Blue = AI_A2G_DISPATCHER:New(Detection_Blue) - -A2G_Blue:SetTacticalDisplay( true ) -- set on using true as a parameter - -A2G_Blue:AddDefenseCoordinate( "Command", GROUP:FindByName( "COMMAND" ):GetCoordinate() ) -A2G_Blue:AddDefenseCoordinate( "Home", GROUP:FindByName( "HOME" ):GetCoordinate() ) - - -A2G_Blue:SetDefenseRadius( 350000 ) -- in meters -A2G_Blue:SetDefenseReactivityMedium() -- we engage almost immediately - -A2G_Blue:SetSquadron( "SQ-HELO-BAI-1", AIRBASE.Caucasus.Senaki_Kolkhi, { "A2G-DEFENSE-HELO-001", "A2G-DEFENSE-HELO-002", "A2G-DEFENSE-HELO-003" }, 20 ) -A2G_Blue:SetSquadronBai( "SQ-HELO-BAI-1", 200, 280, 160, 500 ) -A2G_Blue:SetSquadronTakeoffInAir( "SQ-HELO-BAI-1", 1000 ) -- altitude in meters when spawning in the air. -A2G_Blue:SetSquadronLandingNearAirbase( "SQ-HELO-BAI-1" ) -A2G_Blue:SetSquadronOverhead( "SQ-HELO-BAI-1", 0.5 ) -A2G_Blue:SetSquadronGrouping( "SQ-HELO-BAI-1", 4 ) - -A2G_Blue:SetSquadron( "SQ-HELO-BAI-2", AIRBASE.Caucasus.Sukhumi_Babushara, { "A2G-DEFENSE-HELO-004", "A2G-DEFENSE-HELO-005", "A2G-DEFENSE-HELO-006" }, 20 ) -A2G_Blue:SetSquadronBai( "SQ-HELO-BAI-2", 200, 280, 1500, 2000 ) -A2G_Blue:SetSquadronTakeoffInAir( "SQ-HELO-BAI-2", 1000 ) -- altitude in meters when spawning in the air. -A2G_Blue:SetSquadronLandingNearAirbase( "SQ-HELO-BAI-2" ) -A2G_Blue:SetSquadronOverhead( "SQ-HELO-BAI-2", 0.75 ) -A2G_Blue:SetSquadronGrouping( "SQ-HELO-BAI-2", 4 ) - -A2G_Blue:SetSquadron( "SQ-SEAD", AIRBASE.Caucasus.Gudauta, { "A2G-DEFENSE-SU-25T-SEAD" }, 10 ) -A2G_Blue:SetSquadronSead( "SQ-SEAD", 700, 1100, 2500, 4000 ) -A2G_Blue:SetSquadronTakeoffFromParkingHot( "SQ-SEAD" ) -- altitude in meters when spawning in the air. -A2G_Blue:SetSquadronLandingAtRunway( "SQ-SEAD" ) -A2G_Blue:SetSquadronOverhead( "SQ-SEAD", 1 ) -A2G_Blue:SetSquadronGrouping( "SQ-SEAD", 2 ) - -A2G_Blue:SetSquadron( "SQ-AIR-BAI", AIRBASE.Caucasus.Kobuleti, { "A2G-DEFENSE-A-10C" }, 6 ) -A2G_Blue:SetSquadronBai( "SQ-AIR-BAI", 600, 900, 1000, 2000 ) -A2G_Blue:SetSquadronTakeoffFromParkingHot( "SQ-AIR-BAI" ) -- altitude in meters when spawning in the air. -A2G_Blue:SetSquadronLandingAtRunway( "SQ-AIR-BAI" ) -A2G_Blue:SetSquadronOverhead( "SQ-AIR-BAI", 0.75 ) -A2G_Blue:SetSquadronBaiPatrol( "SQ-AIR-BAI", ZONE:New( "PatrolZone" ), 2000, 3000, 600, 800, 1000, 1400 ) -A2G_Blue:SetSquadronPatrolInterval( "SQ-AIR-BAI", 4, 30, 60, 1, "BAI" ) -A2G_Blue:SetSquadronGrouping( "SQ-AIR-BAI", 4 ) - - --- A2G task dispatcher - -Command_Blue = COMMANDCENTER:New( GROUP:FindByName( "NATO HQ" ), "NATO HQ" ) - -Mission_Blue = MISSION:New( Command_Blue, "Invasion", "High", "Eliminate 5 targets", coalition.side.BLUE ) - -Players_Blue = SET_GROUP:New():FilterPrefixes( { "NATO Player" } ):FilterStart() - + +Recce_Blue = SET_GROUP:New():FilterPrefixes( "RECCE" ):FilterStart() + +Detection_Blue = DETECTION_AREAS:New( Recce_Blue, 3000 ) + +A2G_Blue = AI_A2G_DISPATCHER:New(Detection_Blue) + +A2G_Blue:SetTacticalDisplay( true ) -- set on using true as a parameter + +A2G_Blue:AddDefenseCoordinate( "Command", GROUP:FindByName( "COMMAND" ):GetCoordinate() ) +A2G_Blue:AddDefenseCoordinate( "Home", GROUP:FindByName( "HOME" ):GetCoordinate() ) + + +A2G_Blue:SetDefenseRadius( 350000 ) -- in meters +A2G_Blue:SetDefenseReactivityMedium() -- we engage almost immediately + +A2G_Blue:SetSquadron( "SQ-HELO-BAI-1", AIRBASE.Caucasus.Senaki_Kolkhi, { "A2G-DEFENSE-HELO-001", "A2G-DEFENSE-HELO-002", "A2G-DEFENSE-HELO-003" }, 20 ) +A2G_Blue:SetSquadronBai( "SQ-HELO-BAI-1", 200, 280, 160, 500 ) +A2G_Blue:SetSquadronTakeoffInAir( "SQ-HELO-BAI-1", 1000 ) -- altitude in meters when spawning in the air. +A2G_Blue:SetSquadronLandingNearAirbase( "SQ-HELO-BAI-1" ) +A2G_Blue:SetSquadronOverhead( "SQ-HELO-BAI-1", 0.5 ) +A2G_Blue:SetSquadronGrouping( "SQ-HELO-BAI-1", 4 ) + +A2G_Blue:SetSquadron( "SQ-HELO-BAI-2", AIRBASE.Caucasus.Sukhumi_Babushara, { "A2G-DEFENSE-HELO-004", "A2G-DEFENSE-HELO-005", "A2G-DEFENSE-HELO-006" }, 20 ) +A2G_Blue:SetSquadronBai( "SQ-HELO-BAI-2", 200, 280, 1500, 2000 ) +A2G_Blue:SetSquadronTakeoffInAir( "SQ-HELO-BAI-2", 1000 ) -- altitude in meters when spawning in the air. +A2G_Blue:SetSquadronLandingNearAirbase( "SQ-HELO-BAI-2" ) +A2G_Blue:SetSquadronOverhead( "SQ-HELO-BAI-2", 0.75 ) +A2G_Blue:SetSquadronGrouping( "SQ-HELO-BAI-2", 4 ) + +A2G_Blue:SetSquadron( "SQ-SEAD", AIRBASE.Caucasus.Gudauta, { "A2G-DEFENSE-SU-25T-SEAD" }, 10 ) +A2G_Blue:SetSquadronSead( "SQ-SEAD", 700, 1100, 2500, 4000 ) +A2G_Blue:SetSquadronTakeoffFromParkingHot( "SQ-SEAD" ) -- altitude in meters when spawning in the air. +A2G_Blue:SetSquadronLandingAtRunway( "SQ-SEAD" ) +A2G_Blue:SetSquadronOverhead( "SQ-SEAD", 1 ) +A2G_Blue:SetSquadronGrouping( "SQ-SEAD", 2 ) + +A2G_Blue:SetSquadron( "SQ-AIR-BAI", AIRBASE.Caucasus.Kobuleti, { "A2G-DEFENSE-A-10C" }, 6 ) +A2G_Blue:SetSquadronBai( "SQ-AIR-BAI", 600, 900, 1000, 2000 ) +A2G_Blue:SetSquadronTakeoffFromParkingHot( "SQ-AIR-BAI" ) -- altitude in meters when spawning in the air. +A2G_Blue:SetSquadronLandingAtRunway( "SQ-AIR-BAI" ) +A2G_Blue:SetSquadronOverhead( "SQ-AIR-BAI", 0.75 ) +A2G_Blue:SetSquadronBaiPatrol( "SQ-AIR-BAI", ZONE:New( "PatrolZone" ), 2000, 3000, 600, 800, 1000, 1400 ) +A2G_Blue:SetSquadronPatrolInterval( "SQ-AIR-BAI", 4, 30, 60, 1, "BAI" ) +A2G_Blue:SetSquadronGrouping( "SQ-AIR-BAI", 4 ) + + +-- A2G task dispatcher + +Command_Blue = COMMANDCENTER:New( GROUP:FindByName( "NATO HQ" ), "NATO HQ" ) + +Mission_Blue = MISSION:New( Command_Blue, "Invasion", "High", "Eliminate 5 targets", coalition.side.BLUE ) + +Players_Blue = SET_GROUP:New():FilterPrefixes( { "NATO Player" } ):FilterStart() + A2G_Task_Blue = TASK_A2G_DISPATCHER:New( Mission_Blue, Players_Blue, Detection_Blue ) \ No newline at end of file diff --git a/AID - AI Dispatching/AID-A2G - AI A2G Dispatching/AID-A2G-903 - A fun A2G Mission/AID-A2G-903 - A fun A2G Mission.miz b/AID - AI Dispatching/AID-A2G - AI A2G Dispatching/AID-A2G-903 - A fun A2G Mission/AID-A2G-903 - A fun A2G Mission.miz index cb3ae5fc04..3069a59a7e 100644 Binary files a/AID - AI Dispatching/AID-A2G - AI A2G Dispatching/AID-A2G-903 - A fun A2G Mission/AID-A2G-903 - A fun A2G Mission.miz and b/AID - AI Dispatching/AID-A2G - AI A2G Dispatching/AID-A2G-903 - A fun A2G Mission/AID-A2G-903 - A fun A2G Mission.miz differ diff --git a/AID - AI Dispatching/AID-CGO - AI Cargo Dispatching/AID-CGO-100 - APC - Pickup and Deploy/AID-CGO-100 - APC - Pickup and Deploy.lua b/AID - AI Dispatching/AID-CGO - AI Cargo Dispatching/AID-CGO-100 - APC - Pickup and Deploy/AID-CGO-100 - APC - Pickup and Deploy.lua index d639b671f5..8bcf07915d 100644 --- a/AID - AI Dispatching/AID-CGO - AI Cargo Dispatching/AID-CGO-100 - APC - Pickup and Deploy/AID-CGO-100 - APC - Pickup and Deploy.lua +++ b/AID - AI Dispatching/AID-CGO - AI Cargo Dispatching/AID-CGO-100 - APC - Pickup and Deploy/AID-CGO-100 - APC - Pickup and Deploy.lua @@ -1,13 +1,13 @@ ---- --- Name: AID-CGO-100 - APC - Pickup and Deploy --- Author: FlightControl --- Date Created: 10 May 2018 --- - -local SetCargoInfantry = SET_CARGO:New():FilterTypes( "Infantry" ):FilterStart() -local SetAPC = SET_GROUP:New():FilterPrefixes( "APC" ):FilterStart() -local SetDeployZones = SET_ZONE:New():FilterPrefixes( "Deploy" ):FilterStart() - -AICargoDispatcherAPC = AI_CARGO_DISPATCHER_APC:New( SetAPC, SetCargoInfantry, nil, SetDeployZones ) -AICargoDispatcherAPC:Start() - +--- +-- Name: AID-CGO-100 - APC - Pickup and Deploy +-- Author: FlightControl +-- Date Created: 10 May 2018 +-- + +local SetCargoInfantry = SET_CARGO:New():FilterTypes( "Infantry" ):FilterStart() +local SetAPC = SET_GROUP:New():FilterPrefixes( "APC" ):FilterStart() +local SetDeployZones = SET_ZONE:New():FilterPrefixes( "Deploy" ):FilterStart() + +AICargoDispatcherAPC = AI_CARGO_DISPATCHER_APC:New( SetAPC, SetCargoInfantry, nil, SetDeployZones ) +AICargoDispatcherAPC:Start() + diff --git a/AID - AI Dispatching/AID-CGO - AI Cargo Dispatching/AID-CGO-100 - APC - Pickup and Deploy/AID-CGO-100 - APC - Pickup and Deploy.miz b/AID - AI Dispatching/AID-CGO - AI Cargo Dispatching/AID-CGO-100 - APC - Pickup and Deploy/AID-CGO-100 - APC - Pickup and Deploy.miz index aa70f5dccf..a62709ce04 100644 Binary files a/AID - AI Dispatching/AID-CGO - AI Cargo Dispatching/AID-CGO-100 - APC - Pickup and Deploy/AID-CGO-100 - APC - Pickup and Deploy.miz and b/AID - AI Dispatching/AID-CGO - AI Cargo Dispatching/AID-CGO-100 - APC - Pickup and Deploy/AID-CGO-100 - APC - Pickup and Deploy.miz differ diff --git a/AID - AI Dispatching/AID-CGO - AI Cargo Dispatching/AID-CGO-110 - APC - Deploy at Group Zones/AID-CGO-110 - APC - Deploy at Group Zones.lua b/AID - AI Dispatching/AID-CGO - AI Cargo Dispatching/AID-CGO-110 - APC - Deploy at Group Zones/AID-CGO-110 - APC - Deploy at Group Zones.lua index b3f4315e93..362bc43fbc 100644 --- a/AID - AI Dispatching/AID-CGO - AI Cargo Dispatching/AID-CGO-110 - APC - Deploy at Group Zones/AID-CGO-110 - APC - Deploy at Group Zones.lua +++ b/AID - AI Dispatching/AID-CGO - AI Cargo Dispatching/AID-CGO-110 - APC - Deploy at Group Zones/AID-CGO-110 - APC - Deploy at Group Zones.lua @@ -1,17 +1,17 @@ ---- --- Name: AID-CGO-110 - APC - Deploy at Group Zones --- Author: FlightControl --- Date Created: 10 May 2018 --- - -local SetCargoInfantry = SET_CARGO:New():FilterTypes( "Infantry" ):FilterStart() -local SetAPC = SET_GROUP:New():FilterPrefixes( "APC" ):FilterStart() -local SetDeployZones = SET_ZONE:New():FilterPrefixes( "Deploy" ):FilterStart() - -local ZoneGroup = GROUP:FindByName( "Deploy Group") -local DeployZone = ZONE_GROUP:New( "Deploy Group", ZoneGroup, 200 ) - - -AICargoDispatcherAPC = AI_CARGO_DISPATCHER_APC:New( SetAPC, SetCargoInfantry, nil, SetDeployZones ) -AICargoDispatcherAPC:Start() - +--- +-- Name: AID-CGO-110 - APC - Deploy at Group Zones +-- Author: FlightControl +-- Date Created: 10 May 2018 +-- + +local SetCargoInfantry = SET_CARGO:New():FilterTypes( "Infantry" ):FilterStart() +local SetAPC = SET_GROUP:New():FilterPrefixes( "APC" ):FilterStart() +local SetDeployZones = SET_ZONE:New():FilterPrefixes( "Deploy" ):FilterStart() + +local ZoneGroup = GROUP:FindByName( "Deploy Group") +local DeployZone = ZONE_GROUP:New( "Deploy Group", ZoneGroup, 200 ) + + +AICargoDispatcherAPC = AI_CARGO_DISPATCHER_APC:New( SetAPC, SetCargoInfantry, nil, SetDeployZones ) +AICargoDispatcherAPC:Start() + diff --git a/AID - AI Dispatching/AID-CGO - AI Cargo Dispatching/AID-CGO-110 - APC - Deploy at Group Zones/AID-CGO-110 - APC - Deploy at Group Zones.miz b/AID - AI Dispatching/AID-CGO - AI Cargo Dispatching/AID-CGO-110 - APC - Deploy at Group Zones/AID-CGO-110 - APC - Deploy at Group Zones.miz index 505189a1b2..5457ea55eb 100644 Binary files a/AID - AI Dispatching/AID-CGO - AI Cargo Dispatching/AID-CGO-110 - APC - Deploy at Group Zones/AID-CGO-110 - APC - Deploy at Group Zones.miz and b/AID - AI Dispatching/AID-CGO - AI Cargo Dispatching/AID-CGO-110 - APC - Deploy at Group Zones/AID-CGO-110 - APC - Deploy at Group Zones.miz differ diff --git a/AID - AI Dispatching/AID-CGO - AI Cargo Dispatching/AID-CGO-120 - APC - Pickup and Deploy Large/AID-CGO-120 - APC - Pickup and Deploy Large.lua b/AID - AI Dispatching/AID-CGO - AI Cargo Dispatching/AID-CGO-120 - APC - Pickup and Deploy Large/AID-CGO-120 - APC - Pickup and Deploy Large.lua index d639b671f5..8bcf07915d 100644 --- a/AID - AI Dispatching/AID-CGO - AI Cargo Dispatching/AID-CGO-120 - APC - Pickup and Deploy Large/AID-CGO-120 - APC - Pickup and Deploy Large.lua +++ b/AID - AI Dispatching/AID-CGO - AI Cargo Dispatching/AID-CGO-120 - APC - Pickup and Deploy Large/AID-CGO-120 - APC - Pickup and Deploy Large.lua @@ -1,13 +1,13 @@ ---- --- Name: AID-CGO-100 - APC - Pickup and Deploy --- Author: FlightControl --- Date Created: 10 May 2018 --- - -local SetCargoInfantry = SET_CARGO:New():FilterTypes( "Infantry" ):FilterStart() -local SetAPC = SET_GROUP:New():FilterPrefixes( "APC" ):FilterStart() -local SetDeployZones = SET_ZONE:New():FilterPrefixes( "Deploy" ):FilterStart() - -AICargoDispatcherAPC = AI_CARGO_DISPATCHER_APC:New( SetAPC, SetCargoInfantry, nil, SetDeployZones ) -AICargoDispatcherAPC:Start() - +--- +-- Name: AID-CGO-100 - APC - Pickup and Deploy +-- Author: FlightControl +-- Date Created: 10 May 2018 +-- + +local SetCargoInfantry = SET_CARGO:New():FilterTypes( "Infantry" ):FilterStart() +local SetAPC = SET_GROUP:New():FilterPrefixes( "APC" ):FilterStart() +local SetDeployZones = SET_ZONE:New():FilterPrefixes( "Deploy" ):FilterStart() + +AICargoDispatcherAPC = AI_CARGO_DISPATCHER_APC:New( SetAPC, SetCargoInfantry, nil, SetDeployZones ) +AICargoDispatcherAPC:Start() + diff --git a/AID - AI Dispatching/AID-CGO - AI Cargo Dispatching/AID-CGO-120 - APC - Pickup and Deploy Large/AID-CGO-120 - APC - Pickup and Deploy Large.miz b/AID - AI Dispatching/AID-CGO - AI Cargo Dispatching/AID-CGO-120 - APC - Pickup and Deploy Large/AID-CGO-120 - APC - Pickup and Deploy Large.miz index 79996c5abf..7bba6e27c0 100644 Binary files a/AID - AI Dispatching/AID-CGO - AI Cargo Dispatching/AID-CGO-120 - APC - Pickup and Deploy Large/AID-CGO-120 - APC - Pickup and Deploy Large.miz and b/AID - AI Dispatching/AID-CGO - AI Cargo Dispatching/AID-CGO-120 - APC - Pickup and Deploy Large/AID-CGO-120 - APC - Pickup and Deploy Large.miz differ diff --git a/AID - AI Dispatching/AID-CGO - AI Cargo Dispatching/AID-CGO-140 - APC - Event Handling/AID-CGO-140 - APC - Event Handling.lua b/AID - AI Dispatching/AID-CGO - AI Cargo Dispatching/AID-CGO-140 - APC - Event Handling/AID-CGO-140 - APC - Event Handling.lua index c630d3322f..a696f2de38 100644 --- a/AID - AI Dispatching/AID-CGO - AI Cargo Dispatching/AID-CGO-140 - APC - Event Handling/AID-CGO-140 - APC - Event Handling.lua +++ b/AID - AI Dispatching/AID-CGO - AI Cargo Dispatching/AID-CGO-140 - APC - Event Handling/AID-CGO-140 - APC - Event Handling.lua @@ -1,172 +1,172 @@ ---- --- Name: AID-CGO-100 - APC - Pickup and Deploy --- Author: FlightControl --- Date Created: 10 May 2018 --- - -local SetCargoInfantry = SET_CARGO:New():FilterTypes( "Infantry" ):FilterStart() -local SetAPC = SET_GROUP:New():FilterPrefixes( "APC" ):FilterStart() -local SetPickupZones = SET_ZONE:New():FilterPrefixes( "Pickup" ):FilterStart() -local SetDeployZones = SET_ZONE:New():FilterPrefixes( "Deploy" ):FilterStart() - -AICargoDispatcherAPC = AI_CARGO_DISPATCHER_APC:New( SetAPC, SetCargoInfantry, SetPickupZones, SetDeployZones ) -AICargoDispatcherAPC:SetHomeZone( ZONE:New("Home") ) - ---- Pickup Handler OnAfter for AICargoDispatcherAPC. --- Use this event handler to tailor the event when a CarrierGroup is routed towards a new pickup Coordinate and a specified Speed. --- You can use this event handler to post messages to players, or provide status updates etc. --- @param #AICargoDispatcherAPC self --- @param #string From A string that contains the "*from state name*" when the event was fired. --- @param #string Event A string that contains the "*event name*" when the event was fired. --- @param #string To A string that contains the "*to state name*" when the event was fired. --- @param Wrapper.Group#GROUP CarrierGroup The group object that contains the CarrierUnits. --- @param Core.Point#COORDINATE Coordinate The coordinate of the pickup location. --- @param #number Speed The velocity in meters per second on which the CarrierGroup is routed towards the pickup Coordinate. --- @param #number Height Height in meters to move to the pickup coordinate. --- @param Core.Zone#ZONE PickupZone (optional) The zone from where the cargo is picked up. Note that the zone is optional and may not be provided, but for AI_CARGO_DISPATCHER_AIRBASE there will always be a PickupZone, as the pickup location is an airbase zone. -function AICargoDispatcherAPC:OnAfterPickup( From, Event, To, CarrierGroup, Coordinate, Speed, Height, PickupZone ) - - -- Write here your own code. - MESSAGE:NewType( "Group " .. CarrierGroup:GetName().. " is picking up cargo at airbase " .. PickupZone:GetName(), MESSAGE.Type.Information ):ToAll() - - -end - - ---- Load Handler OnAfter for AICargoDispatcherAPC. --- Use this event handler to tailor the event when a CarrierGroup has initiated the loading or boarding of cargo within reporting or near range. --- You can use this event handler to post messages to players, or provide status updates etc. --- @param #AICargoDispatcherAPC self --- @param #string From A string that contains the "*from state name*" when the event was fired. --- @param #string Event A string that contains the "*event name*" when the event was fired. --- @param #string To A string that contains the "*to state name*" when the event was fired. --- @param Wrapper.Group#GROUP CarrierGroup The group object that contains the CarrierUnits. --- @param Core.Zone#ZONE_AIRBASE PickupZone (optional) The zone from where the cargo is picked up. Note that the zone is optional and may not be provided, but for AI_CARGO_DISPATCHER_AIRBASE there will always be a PickupZone, as the pickup location is an airbase zone. -function AICargoDispatcherAPC:OnAfterLoad( From, Event, To, CarrierGroup, PickupZone ) - - -- Write here your own code. - MESSAGE:NewType( "Group " .. CarrierGroup:GetName().. " is loading cargo at airbase " .. PickupZone:GetName(), MESSAGE.Type.Information ):ToAll() - -end - ---- PickedUp Handler OnAfter for AICargoDispatcherAPC. --- Use this event handler to tailor the event when a carrier has picked up all cargo objects into the CarrierGroup. --- You can use this event handler to post messages to players, or provide status updates etc. --- @param #AICargoDispatcherAPC self --- @param #string From A string that contains the "*from state name*" when the event was fired. --- @param #string Event A string that contains the "*event name*" when the event was fired. --- @param #string To A string that contains the "*to state name*" when the event was fired. --- @param Wrapper.Group#GROUP CarrierGroup The group object that contains the CarrierUnits. --- @param Core.Zone#ZONE_AIRBASE PickupZone (optional) The zone from where the cargo is picked up. Note that the zone is optional and may not be provided, but for AI_CARGO_DISPATCHER_AIRBASE there will always be a PickupZone, as the pickup location is an airbase zone. -function AICargoDispatcherAPC:OnAfterPickedUp( From, Event, To, CarrierGroup, PickupZone ) - - -- Write here your own code. - -- Write here your own code. - MESSAGE:NewType( "Group " .. CarrierGroup:GetName().. " has loaded all cargo at airbase " .. PickupZone:GetName(), MESSAGE.Type.Information ):ToAll() - -end - - ---- Deploy Handler OnAfter for AICargoDispatcherAPC. --- Use this event handler to tailor the event when a CarrierGroup is routed to a deploy coordinate, to Unload all cargo objects in each CarrierUnit. --- You can use this event handler to post messages to players, or provide status updates etc. --- @function OnAfterDeploy --- @param #AICargoDispatcherAPC self --- @param #string From A string that contains the "*from state name*" when the event was fired. --- @param #string Event A string that contains the "*event name*" when the event was fired. --- @param #string To A string that contains the "*to state name*" when the event was fired. --- @param Wrapper.Group#GROUP CarrierGroup The group object that contains the CarrierUnits. --- @param Core.Point#COORDINATE Coordinate The deploy coordinate. --- @param #number Speed The velocity in meters per second on which the CarrierGroup is routed towards the deploy Coordinate. --- @param #number Height Height in meters to move to the deploy coordinate. --- @param Core.Zone#ZONE DeployZone The zone wherein the cargo is deployed. This can be any zone type, like a ZONE, ZONE_GROUP, ZONE_AIRBASE. -function AICargoDispatcherAPC:OnAfterDeploy( From, Event, To, CarrierGroup, Coordinate, Speed, Height, DeployZone ) - - MESSAGE:NewType( "Group " .. CarrierGroup:GetName().. " is starting deployment of all cargo in zone " .. DeployZone:GetName(), MESSAGE.Type.Information ):ToAll() - -end - - - - - - - ---- Unloaded Handler OnAfter for AICargoDispatcherAPC. --- Use this event handler to tailor the event when a CarrierUnit of a CarrierGroup has unloaded a cargo object. --- You can use this event handler to post messages to players, or provide status updates etc. --- Note that if more cargo objects were unloading or unboarding from the CarrierUnit, then this event can be fired multiple times for each different Cargo/CarrierUnit. --- A CarrierUnit can be part of the larger CarrierGroup. --- @function OnAfterUnloaded --- @param #AICargoDispatcherAPC self --- @param #string From A string that contains the "*from state name*" when the event was fired. --- @param #string Event A string that contains the "*event name*" when the event was fired. --- @param #string To A string that contains the "*to state name*" when the event was fired. --- @param Wrapper.Group#GROUP CarrierGroup The group object that contains the CarrierUnits. --- @param Cargo.Cargo#CARGO Cargo The cargo object. --- @param Wrapper.Unit#UNIT CarrierUnit The carrier unit that is executing the cargo unloading operation. --- @param Core.Zone#ZONE DeployZone The zone wherein the cargo is deployed. This can be any zone type, like a ZONE, ZONE_GROUP, ZONE_AIRBASE. -function AICargoDispatcherAPC:OnAfterUnloaded( From, Event, To, CarrierGroup, Cargo, CarrierUnit, DeployZone ) - - local CargoGroup = Cargo:GetObject() -- Wrapper.Group#GROUP - - -- Get the name of the DeployZone - local DeployZoneName = DeployZone:GetName() - - local DeployBuildingNames = { - ["Deploy A"] = "Building A", - } - - - -- Now board the infantry into the respective warehouse building. - if DeployZoneName then - local Building = STATIC:FindByName( DeployBuildingNames[DeployZoneName] ) - Cargo:__Board( 5, Building, 25 ) - end - - MESSAGE:NewType( "Group " .. CarrierGroup:GetName() .. ", Unit " .. CarrierUnit:GetName() .. " has unloaded cargo " .. Cargo:GetName() .. " in zone " .. DeployZone:GetName() .. " and cargo is moving to building " .. DeployBuildingNames[DeployZoneName], MESSAGE.Type.Information ):ToAll() - - -end - - ---- Deployed Handler OnAfter for AICargoDispatcherAPC. --- Use this event handler to tailor the event when a carrier has deployed all cargo objects from the CarrierGroup. --- You can use this event handler to post messages to players, or provide status updates etc. --- @function OnAfterDeployed --- @param #AICargoDispatcherAPC self --- @param #string From A string that contains the "*from state name*" when the event was fired. --- @param #string Event A string that contains the "*event name*" when the event was fired. --- @param #string To A string that contains the "*to state name*" when the event was fired. --- @param Wrapper.Group#GROUP CarrierGroup The group object that contains the CarrierUnits. --- @param Core.Zone#ZONE DeployZone The zone wherein the cargo is deployed. This can be any zone type, like a ZONE, ZONE_GROUP, ZONE_AIRBASE. -function AICargoDispatcherAPC:OnAfterDeployed( From, Event, To, CarrierGroup, DeployZone ) - - MESSAGE:NewType( "Group " .. CarrierGroup:GetName() .. " deployed all cargo in zone " .. DeployZone:GetName(), MESSAGE.Type.Information ):ToAll() - -end - - ---- Home event handler OnAfter for AICargoDispatcherAPC. --- Use this event handler to tailor the event when a CarrierGroup is returning to the HomeZone, after it has deployed all cargo objects from the CarrierGroup. --- You can use this event handler to post messages to players, or provide status updates etc. --- If there is no HomeZone is specified, the CarrierGroup will stay at the current location after having deployed all cargo. --- @param #AICargoDispatcherAPC self --- @param #string From A string that contains the "*from state name*" when the event was triggered. --- @param #string Event A string that contains the "*event name*" when the event was triggered. --- @param #string To A string that contains the "*to state name*" when the event was triggered. --- @param Wrapper.Group#GROUP CarrierGroup The group object that contains the CarrierUnits. --- @param Core.Point#COORDINATE Coordinate The home coordinate the Carrier will arrive and stop it's activities. --- @param #number Speed The velocity in meters per second on which the CarrierGroup is routed towards the home Coordinate. --- @param #number Height Height in meters to move to the home coordinate. --- @param Core.Zone#ZONE HomeZone The zone wherein the carrier will return when all cargo has been transported. This can be any zone type, like a ZONE, ZONE_GROUP, ZONE_AIRBASE. -function AICargoDispatcherAPC:OnAfterHome( From, Event, To, CarrierGroup, Coordinate, Speed, Height, HomeZone ) - - MESSAGE:NewType( "Group " .. CarrierGroup:GetName() .. " deployed all cargo and going home to zone " .. HomeZone:GetName(), MESSAGE.Type.Detailed ):ToAll() - -end - - - -AICargoDispatcherAPC:Start() - +--- +-- Name: AID-CGO-100 - APC - Pickup and Deploy +-- Author: FlightControl +-- Date Created: 10 May 2018 +-- + +local SetCargoInfantry = SET_CARGO:New():FilterTypes( "Infantry" ):FilterStart() +local SetAPC = SET_GROUP:New():FilterPrefixes( "APC" ):FilterStart() +local SetPickupZones = SET_ZONE:New():FilterPrefixes( "Pickup" ):FilterStart() +local SetDeployZones = SET_ZONE:New():FilterPrefixes( "Deploy" ):FilterStart() + +AICargoDispatcherAPC = AI_CARGO_DISPATCHER_APC:New( SetAPC, SetCargoInfantry, SetPickupZones, SetDeployZones ) +AICargoDispatcherAPC:SetHomeZone( ZONE:New("Home") ) + +--- Pickup Handler OnAfter for AICargoDispatcherAPC. +-- Use this event handler to tailor the event when a CarrierGroup is routed towards a new pickup Coordinate and a specified Speed. +-- You can use this event handler to post messages to players, or provide status updates etc. +-- @param #AICargoDispatcherAPC self +-- @param #string From A string that contains the "*from state name*" when the event was fired. +-- @param #string Event A string that contains the "*event name*" when the event was fired. +-- @param #string To A string that contains the "*to state name*" when the event was fired. +-- @param Wrapper.Group#GROUP CarrierGroup The group object that contains the CarrierUnits. +-- @param Core.Point#COORDINATE Coordinate The coordinate of the pickup location. +-- @param #number Speed The velocity in meters per second on which the CarrierGroup is routed towards the pickup Coordinate. +-- @param #number Height Height in meters to move to the pickup coordinate. +-- @param Core.Zone#ZONE PickupZone (optional) The zone from where the cargo is picked up. Note that the zone is optional and may not be provided, but for AI_CARGO_DISPATCHER_AIRBASE there will always be a PickupZone, as the pickup location is an airbase zone. +function AICargoDispatcherAPC:OnAfterPickup( From, Event, To, CarrierGroup, Coordinate, Speed, Height, PickupZone ) + + -- Write here your own code. + MESSAGE:NewType( "Group " .. CarrierGroup:GetName().. " is picking up cargo at airbase " .. PickupZone:GetName(), MESSAGE.Type.Information ):ToAll() + + +end + + +--- Load Handler OnAfter for AICargoDispatcherAPC. +-- Use this event handler to tailor the event when a CarrierGroup has initiated the loading or boarding of cargo within reporting or near range. +-- You can use this event handler to post messages to players, or provide status updates etc. +-- @param #AICargoDispatcherAPC self +-- @param #string From A string that contains the "*from state name*" when the event was fired. +-- @param #string Event A string that contains the "*event name*" when the event was fired. +-- @param #string To A string that contains the "*to state name*" when the event was fired. +-- @param Wrapper.Group#GROUP CarrierGroup The group object that contains the CarrierUnits. +-- @param Core.Zone#ZONE_AIRBASE PickupZone (optional) The zone from where the cargo is picked up. Note that the zone is optional and may not be provided, but for AI_CARGO_DISPATCHER_AIRBASE there will always be a PickupZone, as the pickup location is an airbase zone. +function AICargoDispatcherAPC:OnAfterLoad( From, Event, To, CarrierGroup, PickupZone ) + + -- Write here your own code. + MESSAGE:NewType( "Group " .. CarrierGroup:GetName().. " is loading cargo at airbase " .. PickupZone:GetName(), MESSAGE.Type.Information ):ToAll() + +end + +--- PickedUp Handler OnAfter for AICargoDispatcherAPC. +-- Use this event handler to tailor the event when a carrier has picked up all cargo objects into the CarrierGroup. +-- You can use this event handler to post messages to players, or provide status updates etc. +-- @param #AICargoDispatcherAPC self +-- @param #string From A string that contains the "*from state name*" when the event was fired. +-- @param #string Event A string that contains the "*event name*" when the event was fired. +-- @param #string To A string that contains the "*to state name*" when the event was fired. +-- @param Wrapper.Group#GROUP CarrierGroup The group object that contains the CarrierUnits. +-- @param Core.Zone#ZONE_AIRBASE PickupZone (optional) The zone from where the cargo is picked up. Note that the zone is optional and may not be provided, but for AI_CARGO_DISPATCHER_AIRBASE there will always be a PickupZone, as the pickup location is an airbase zone. +function AICargoDispatcherAPC:OnAfterPickedUp( From, Event, To, CarrierGroup, PickupZone ) + + -- Write here your own code. + -- Write here your own code. + MESSAGE:NewType( "Group " .. CarrierGroup:GetName().. " has loaded all cargo at airbase " .. PickupZone:GetName(), MESSAGE.Type.Information ):ToAll() + +end + + +--- Deploy Handler OnAfter for AICargoDispatcherAPC. +-- Use this event handler to tailor the event when a CarrierGroup is routed to a deploy coordinate, to Unload all cargo objects in each CarrierUnit. +-- You can use this event handler to post messages to players, or provide status updates etc. +-- @function OnAfterDeploy +-- @param #AICargoDispatcherAPC self +-- @param #string From A string that contains the "*from state name*" when the event was fired. +-- @param #string Event A string that contains the "*event name*" when the event was fired. +-- @param #string To A string that contains the "*to state name*" when the event was fired. +-- @param Wrapper.Group#GROUP CarrierGroup The group object that contains the CarrierUnits. +-- @param Core.Point#COORDINATE Coordinate The deploy coordinate. +-- @param #number Speed The velocity in meters per second on which the CarrierGroup is routed towards the deploy Coordinate. +-- @param #number Height Height in meters to move to the deploy coordinate. +-- @param Core.Zone#ZONE DeployZone The zone wherein the cargo is deployed. This can be any zone type, like a ZONE, ZONE_GROUP, ZONE_AIRBASE. +function AICargoDispatcherAPC:OnAfterDeploy( From, Event, To, CarrierGroup, Coordinate, Speed, Height, DeployZone ) + + MESSAGE:NewType( "Group " .. CarrierGroup:GetName().. " is starting deployment of all cargo in zone " .. DeployZone:GetName(), MESSAGE.Type.Information ):ToAll() + +end + + + + + + + +--- Unloaded Handler OnAfter for AICargoDispatcherAPC. +-- Use this event handler to tailor the event when a CarrierUnit of a CarrierGroup has unloaded a cargo object. +-- You can use this event handler to post messages to players, or provide status updates etc. +-- Note that if more cargo objects were unloading or unboarding from the CarrierUnit, then this event can be fired multiple times for each different Cargo/CarrierUnit. +-- A CarrierUnit can be part of the larger CarrierGroup. +-- @function OnAfterUnloaded +-- @param #AICargoDispatcherAPC self +-- @param #string From A string that contains the "*from state name*" when the event was fired. +-- @param #string Event A string that contains the "*event name*" when the event was fired. +-- @param #string To A string that contains the "*to state name*" when the event was fired. +-- @param Wrapper.Group#GROUP CarrierGroup The group object that contains the CarrierUnits. +-- @param Cargo.Cargo#CARGO Cargo The cargo object. +-- @param Wrapper.Unit#UNIT CarrierUnit The carrier unit that is executing the cargo unloading operation. +-- @param Core.Zone#ZONE DeployZone The zone wherein the cargo is deployed. This can be any zone type, like a ZONE, ZONE_GROUP, ZONE_AIRBASE. +function AICargoDispatcherAPC:OnAfterUnloaded( From, Event, To, CarrierGroup, Cargo, CarrierUnit, DeployZone ) + + local CargoGroup = Cargo:GetObject() -- Wrapper.Group#GROUP + + -- Get the name of the DeployZone + local DeployZoneName = DeployZone:GetName() + + local DeployBuildingNames = { + ["Deploy A"] = "Building A", + } + + + -- Now board the infantry into the respective warehouse building. + if DeployZoneName then + local Building = STATIC:FindByName( DeployBuildingNames[DeployZoneName] ) + Cargo:__Board( 5, Building, 25 ) + end + + MESSAGE:NewType( "Group " .. CarrierGroup:GetName() .. ", Unit " .. CarrierUnit:GetName() .. " has unloaded cargo " .. Cargo:GetName() .. " in zone " .. DeployZone:GetName() .. " and cargo is moving to building " .. DeployBuildingNames[DeployZoneName], MESSAGE.Type.Information ):ToAll() + + +end + + +--- Deployed Handler OnAfter for AICargoDispatcherAPC. +-- Use this event handler to tailor the event when a carrier has deployed all cargo objects from the CarrierGroup. +-- You can use this event handler to post messages to players, or provide status updates etc. +-- @function OnAfterDeployed +-- @param #AICargoDispatcherAPC self +-- @param #string From A string that contains the "*from state name*" when the event was fired. +-- @param #string Event A string that contains the "*event name*" when the event was fired. +-- @param #string To A string that contains the "*to state name*" when the event was fired. +-- @param Wrapper.Group#GROUP CarrierGroup The group object that contains the CarrierUnits. +-- @param Core.Zone#ZONE DeployZone The zone wherein the cargo is deployed. This can be any zone type, like a ZONE, ZONE_GROUP, ZONE_AIRBASE. +function AICargoDispatcherAPC:OnAfterDeployed( From, Event, To, CarrierGroup, DeployZone ) + + MESSAGE:NewType( "Group " .. CarrierGroup:GetName() .. " deployed all cargo in zone " .. DeployZone:GetName(), MESSAGE.Type.Information ):ToAll() + +end + + +--- Home event handler OnAfter for AICargoDispatcherAPC. +-- Use this event handler to tailor the event when a CarrierGroup is returning to the HomeZone, after it has deployed all cargo objects from the CarrierGroup. +-- You can use this event handler to post messages to players, or provide status updates etc. +-- If there is no HomeZone is specified, the CarrierGroup will stay at the current location after having deployed all cargo. +-- @param #AICargoDispatcherAPC self +-- @param #string From A string that contains the "*from state name*" when the event was triggered. +-- @param #string Event A string that contains the "*event name*" when the event was triggered. +-- @param #string To A string that contains the "*to state name*" when the event was triggered. +-- @param Wrapper.Group#GROUP CarrierGroup The group object that contains the CarrierUnits. +-- @param Core.Point#COORDINATE Coordinate The home coordinate the Carrier will arrive and stop it's activities. +-- @param #number Speed The velocity in meters per second on which the CarrierGroup is routed towards the home Coordinate. +-- @param #number Height Height in meters to move to the home coordinate. +-- @param Core.Zone#ZONE HomeZone The zone wherein the carrier will return when all cargo has been transported. This can be any zone type, like a ZONE, ZONE_GROUP, ZONE_AIRBASE. +function AICargoDispatcherAPC:OnAfterHome( From, Event, To, CarrierGroup, Coordinate, Speed, Height, HomeZone ) + + MESSAGE:NewType( "Group " .. CarrierGroup:GetName() .. " deployed all cargo and going home to zone " .. HomeZone:GetName(), MESSAGE.Type.Detailed ):ToAll() + +end + + + +AICargoDispatcherAPC:Start() + diff --git a/AID - AI Dispatching/AID-CGO - AI Cargo Dispatching/AID-CGO-140 - APC - Event Handling/AID-CGO-140 - APC - Event Handling.miz b/AID - AI Dispatching/AID-CGO - AI Cargo Dispatching/AID-CGO-140 - APC - Event Handling/AID-CGO-140 - APC - Event Handling.miz index d90488d9c8..bc8ddcde24 100644 Binary files a/AID - AI Dispatching/AID-CGO - AI Cargo Dispatching/AID-CGO-140 - APC - Event Handling/AID-CGO-140 - APC - Event Handling.miz and b/AID - AI Dispatching/AID-CGO - AI Cargo Dispatching/AID-CGO-140 - APC - Event Handling/AID-CGO-140 - APC - Event Handling.miz differ diff --git a/AID - AI Dispatching/AID-CGO - AI Cargo Dispatching/AID-CGO-150 - APC - Manpads against enemy helicopters/AID-CGO-150 - APC - Manpads against enemy helicopters.lua b/AID - AI Dispatching/AID-CGO - AI Cargo Dispatching/AID-CGO-150 - APC - Manpads against enemy helicopters/AID-CGO-150 - APC - Manpads against enemy helicopters.lua index f988621bc2..0e27131bc1 100644 --- a/AID - AI Dispatching/AID-CGO - AI Cargo Dispatching/AID-CGO-150 - APC - Manpads against enemy helicopters/AID-CGO-150 - APC - Manpads against enemy helicopters.lua +++ b/AID - AI Dispatching/AID-CGO - AI Cargo Dispatching/AID-CGO-150 - APC - Manpads against enemy helicopters/AID-CGO-150 - APC - Manpads against enemy helicopters.lua @@ -1,21 +1,21 @@ ---- --- Name: AID-CGO-150 - APC - Manpads against enemy helicopters --- Author: FlightControl --- Date Created: 17 May 2018 --- --- This simulates manpads to fight against enemy helicpters. --- So when the enemy helicopters are within combat range, the manpads will unload and will attack the helos. - - -local SetCargoInfantry = SET_CARGO:New():FilterTypes( "Infantry" ):FilterStart() -local SetAPC = SET_GROUP:New():FilterPrefixes( "APC" ):FilterStart() -local SetDeployZones = SET_ZONE:New():FilterPrefixes( "Deploy" ):FilterStart() - -local ZoneGroup = GROUP:FindByName( "Deploy Group") -local DeployZone = ZONE_GROUP:New( "Deploy Group", ZoneGroup, 200 ) - - --- For the manpads to unload on time, a range of 8000 meters is appropriate. -AICargoDispatcherAPC = AI_CARGO_DISPATCHER_APC:New( SetAPC, SetCargoInfantry, nil, SetDeployZones, 8000 ) -AICargoDispatcherAPC:Start() - +--- +-- Name: AID-CGO-150 - APC - Manpads against enemy helicopters +-- Author: FlightControl +-- Date Created: 17 May 2018 +-- +-- This simulates manpads to fight against enemy helicpters. +-- So when the enemy helicopters are within combat range, the manpads will unload and will attack the helos. + + +local SetCargoInfantry = SET_CARGO:New():FilterTypes( "Infantry" ):FilterStart() +local SetAPC = SET_GROUP:New():FilterPrefixes( "APC" ):FilterStart() +local SetDeployZones = SET_ZONE:New():FilterPrefixes( "Deploy" ):FilterStart() + +local ZoneGroup = GROUP:FindByName( "Deploy Group") +local DeployZone = ZONE_GROUP:New( "Deploy Group", ZoneGroup, 200 ) + + +-- For the manpads to unload on time, a range of 8000 meters is appropriate. +AICargoDispatcherAPC = AI_CARGO_DISPATCHER_APC:New( SetAPC, SetCargoInfantry, nil, SetDeployZones, 8000 ) +AICargoDispatcherAPC:Start() + diff --git a/AID - AI Dispatching/AID-CGO - AI Cargo Dispatching/AID-CGO-150 - APC - Manpads against enemy helicopters/AID-CGO-150 - APC - Manpads against enemy helicopters.miz b/AID - AI Dispatching/AID-CGO - AI Cargo Dispatching/AID-CGO-150 - APC - Manpads against enemy helicopters/AID-CGO-150 - APC - Manpads against enemy helicopters.miz index 87cc37d660..2ff90b94e4 100644 Binary files a/AID - AI Dispatching/AID-CGO - AI Cargo Dispatching/AID-CGO-150 - APC - Manpads against enemy helicopters/AID-CGO-150 - APC - Manpads against enemy helicopters.miz and b/AID - AI Dispatching/AID-CGO - AI Cargo Dispatching/AID-CGO-150 - APC - Manpads against enemy helicopters/AID-CGO-150 - APC - Manpads against enemy helicopters.miz differ diff --git a/AID - AI Dispatching/AID-CGO - AI Cargo Dispatching/AID-CGO-151 - APC - Manpads and not defending the carrier/AID-CGO-151 - APC - Manpads and not defending the carrier.lua b/AID - AI Dispatching/AID-CGO - AI Cargo Dispatching/AID-CGO-151 - APC - Manpads and not defending the carrier/AID-CGO-151 - APC - Manpads and not defending the carrier.lua index 74f93810bf..016cc99551 100644 --- a/AID - AI Dispatching/AID-CGO - AI Cargo Dispatching/AID-CGO-151 - APC - Manpads and not defending the carrier/AID-CGO-151 - APC - Manpads and not defending the carrier.lua +++ b/AID - AI Dispatching/AID-CGO - AI Cargo Dispatching/AID-CGO-151 - APC - Manpads and not defending the carrier/AID-CGO-151 - APC - Manpads and not defending the carrier.lua @@ -1,26 +1,26 @@ ---- --- Name: AID-CGO-151 - APC - Manpads and not defending the carrier --- Author: FlightControl --- Date Created: 08 Sep 2018 --- --- This simulates manpads to board APCs and won't disembark to defend the enemy carrier when enemies are nearby.. --- So when the enemy helicopters are within combat range, the manpads will NOT unload and will NOT attack the helos. --- This is because the combat range was not provided, and thus is 0. - - -local SetCargoInfantry = SET_CARGO:New():FilterTypes( "Infantry" ):FilterStart() -local SetAPC = SET_GROUP:New():FilterPrefixes( "APC" ):FilterStart() -local SetDeployZones = SET_ZONE:New():FilterPrefixes( "Deploy" ):FilterStart() - -local ZoneGroup = GROUP:FindByName( "Deploy Group") -local DeployZone = ZONE_GROUP:New( "Deploy Group", ZoneGroup, 200 ) - - --- For the manpads to unload on time, a range of 8000 meters is appropriate. -AICargoDispatcherAPC = AI_CARGO_DISPATCHER_APC:New( SetAPC, SetCargoInfantry, nil, SetDeployZones ) - --- This will work too, so the combat range can be provided, but must be 0. ---AICargoDispatcherAPC = AI_CARGO_DISPATCHER_APC:New( SetAPC, SetCargoInfantry, nil, SetDeployZones, 0 ) - -AICargoDispatcherAPC:Start() - +--- +-- Name: AID-CGO-151 - APC - Manpads and not defending the carrier +-- Author: FlightControl +-- Date Created: 08 Sep 2018 +-- +-- This simulates manpads to board APCs and won't disembark to defend the enemy carrier when enemies are nearby.. +-- So when the enemy helicopters are within combat range, the manpads will NOT unload and will NOT attack the helos. +-- This is because the combat range was not provided, and thus is 0. + + +local SetCargoInfantry = SET_CARGO:New():FilterTypes( "Infantry" ):FilterStart() +local SetAPC = SET_GROUP:New():FilterPrefixes( "APC" ):FilterStart() +local SetDeployZones = SET_ZONE:New():FilterPrefixes( "Deploy" ):FilterStart() + +local ZoneGroup = GROUP:FindByName( "Deploy Group") +local DeployZone = ZONE_GROUP:New( "Deploy Group", ZoneGroup, 200 ) + + +-- For the manpads to unload on time, a range of 8000 meters is appropriate. +AICargoDispatcherAPC = AI_CARGO_DISPATCHER_APC:New( SetAPC, SetCargoInfantry, nil, SetDeployZones ) + +-- This will work too, so the combat range can be provided, but must be 0. +--AICargoDispatcherAPC = AI_CARGO_DISPATCHER_APC:New( SetAPC, SetCargoInfantry, nil, SetDeployZones, 0 ) + +AICargoDispatcherAPC:Start() + diff --git a/AID - AI Dispatching/AID-CGO - AI Cargo Dispatching/AID-CGO-151 - APC - Manpads and not defending the carrier/AID-CGO-151 - APC - Manpads and not defending the carrier.miz b/AID - AI Dispatching/AID-CGO - AI Cargo Dispatching/AID-CGO-151 - APC - Manpads and not defending the carrier/AID-CGO-151 - APC - Manpads and not defending the carrier.miz index 31d07b2634..9c20bfda6c 100644 Binary files a/AID - AI Dispatching/AID-CGO - AI Cargo Dispatching/AID-CGO-151 - APC - Manpads and not defending the carrier/AID-CGO-151 - APC - Manpads and not defending the carrier.miz and b/AID - AI Dispatching/AID-CGO - AI Cargo Dispatching/AID-CGO-151 - APC - Manpads and not defending the carrier/AID-CGO-151 - APC - Manpads and not defending the carrier.miz differ diff --git a/AID - AI Dispatching/AID-CGO - AI Cargo Dispatching/AID-CGO-152 - APC - Defending the carrier/AID-CGO-152 - APC - Defending the carrier.lua b/AID - AI Dispatching/AID-CGO - AI Cargo Dispatching/AID-CGO-152 - APC - Defending the carrier/AID-CGO-152 - APC - Defending the carrier.lua index 9ec1df3c99..b90014035d 100644 --- a/AID - AI Dispatching/AID-CGO - AI Cargo Dispatching/AID-CGO-152 - APC - Defending the carrier/AID-CGO-152 - APC - Defending the carrier.lua +++ b/AID - AI Dispatching/AID-CGO - AI Cargo Dispatching/AID-CGO-152 - APC - Defending the carrier/AID-CGO-152 - APC - Defending the carrier.lua @@ -1,28 +1,28 @@ ---- --- Name: AID-CGO-152 - APC - Defending the carrier --- Author: FlightControl --- Date Created: 18 Oct 2018 --- --- This simulates infantry to board APCs and will disembark to defend the enemy carrier when enemies are nearby.. - - -local SetCargoInfantry = SET_CARGO:New():FilterTypes( "Infantry" ):FilterStart() -local SetAPC = SET_GROUP:New():FilterPrefixes( "APC" ):FilterStart() -local SetDeployZones = SET_ZONE:New():FilterPrefixes( "Deploy" ):FilterStart() - -local ZoneGroup = GROUP:FindByName( "Deploy Group") -local DeployZone = ZONE_GROUP:New( "Deploy Group", ZoneGroup, 200 ) - - --- For the manpads to unload on time, a range of 8000 meters is appropriate. -AICargoDispatcherAPC = AI_CARGO_DISPATCHER_APC:New( SetAPC, SetCargoInfantry, nil, SetDeployZones, 800 ) - --- This will work too, so the combat range can be provided, but must be 0. ---AICargoDispatcherAPC = AI_CARGO_DISPATCHER_APC:New( SetAPC, SetCargoInfantry, nil, SetDeployZones, 0 ) - -AICargoDispatcherAPC:Start() - -Sound = USERSOUND:New( "Sounds/BOS05ej9982.ogg" ) - -Sound:ToAll() - +--- +-- Name: AID-CGO-152 - APC - Defending the carrier +-- Author: FlightControl +-- Date Created: 18 Oct 2018 +-- +-- This simulates infantry to board APCs and will disembark to defend the enemy carrier when enemies are nearby.. + + +local SetCargoInfantry = SET_CARGO:New():FilterTypes( "Infantry" ):FilterStart() +local SetAPC = SET_GROUP:New():FilterPrefixes( "APC" ):FilterStart() +local SetDeployZones = SET_ZONE:New():FilterPrefixes( "Deploy" ):FilterStart() + +local ZoneGroup = GROUP:FindByName( "Deploy Group") +local DeployZone = ZONE_GROUP:New( "Deploy Group", ZoneGroup, 200 ) + + +-- For the manpads to unload on time, a range of 8000 meters is appropriate. +AICargoDispatcherAPC = AI_CARGO_DISPATCHER_APC:New( SetAPC, SetCargoInfantry, nil, SetDeployZones, 800 ) + +-- This will work too, so the combat range can be provided, but must be 0. +--AICargoDispatcherAPC = AI_CARGO_DISPATCHER_APC:New( SetAPC, SetCargoInfantry, nil, SetDeployZones, 0 ) + +AICargoDispatcherAPC:Start() + +Sound = USERSOUND:New( "Sounds/BOS05ej9982.ogg" ) + +Sound:ToAll() + diff --git a/AID - AI Dispatching/AID-CGO - AI Cargo Dispatching/AID-CGO-152 - APC - Defending the carrier/AID-CGO-152 - APC - Defending the carrier.miz b/AID - AI Dispatching/AID-CGO - AI Cargo Dispatching/AID-CGO-152 - APC - Defending the carrier/AID-CGO-152 - APC - Defending the carrier.miz index 43675bccf5..248c95f3fd 100644 Binary files a/AID - AI Dispatching/AID-CGO - AI Cargo Dispatching/AID-CGO-152 - APC - Defending the carrier/AID-CGO-152 - APC - Defending the carrier.miz and b/AID - AI Dispatching/AID-CGO - AI Cargo Dispatching/AID-CGO-152 - APC - Defending the carrier/AID-CGO-152 - APC - Defending the carrier.miz differ diff --git a/AID - AI Dispatching/AID-CGO - AI Cargo Dispatching/AID-CGO-160 - APC - Spawning of cargo objects/AID-CGO-160 - APC - Spawning of cargo objects.lua b/AID - AI Dispatching/AID-CGO - AI Cargo Dispatching/AID-CGO-160 - APC - Spawning of cargo objects/AID-CGO-160 - APC - Spawning of cargo objects.lua index 6663908342..229aae2845 100644 --- a/AID - AI Dispatching/AID-CGO - AI Cargo Dispatching/AID-CGO-160 - APC - Spawning of cargo objects/AID-CGO-160 - APC - Spawning of cargo objects.lua +++ b/AID - AI Dispatching/AID-CGO - AI Cargo Dispatching/AID-CGO-160 - APC - Spawning of cargo objects/AID-CGO-160 - APC - Spawning of cargo objects.lua @@ -1,43 +1,43 @@ ---- --- Name: AID-CGO-160 - APC - Spawning of cargo objects --- Author: FlightControl --- Date Created: 11 Sep 2018 --- --- In this demo cargo objects are spawned at random locations within the battle field. --- --- This simulates manpads to board APCs and won't disembark to defend the enemy carrier when enemies are nearby.. --- So when the enemy helicopters are within combat range, the manpads will NOT unload and will NOT attack the helos. --- This is because the combat range was not provided, and thus is 0. - - --- Spawn some random cargo in a zone. - -SpawnInfantry = SPAWN:New( "Infantry" ) -:InitLimit( 30, 100 ) -:InitRandomizePosition(true,500,100) -:InitRandomizeZones( { ZONE:New( "SpawnZone" ) } ) -:OnSpawnGroup( - function( SpawnGroup ) - CARGO_GROUP:New(SpawnGroup,"InfantryType",SpawnGroup:GetName(),150,10) - end -) -:SpawnScheduled( 30, 0 ) - - -local CargoInfantrySet = SET_CARGO:New():FilterTypes( "InfantryType" ):FilterStart() -local SetAPC = SET_GROUP:New():FilterPrefixes( "APC" ):FilterStart() -local PickupZonesSet = SET_ZONE:New():FilterPrefixes( "Spawn" ):FilterOnce() -local DeployZonesSet = SET_ZONE:New():FilterPrefixes( "Deploy" ):FilterOnce() - --- For the manpads to unload on time, a range of 8000 meters is appropriate. -AICargoDispatcherAPC = AI_CARGO_DISPATCHER_APC:New( SetAPC, CargoInfantrySet, PickupZonesSet, DeployZonesSet ) - --- This will work too, so the combat range can be provided, but must be 0. ---AICargoDispatcherAPC = AI_CARGO_DISPATCHER_APC:New( SetAPC, SetCargoInfantry, nil, SetDeployZones, 0 ) - --- Now also make the carriers spawn in. -CarrierSpawn = SPAWN:New( "APC" ):InitLimit( 10, 10 ):InitRandomizePosition( true, 200, 50 ):SpawnScheduled( 10, 0 ) - - -AICargoDispatcherAPC:Start() - +--- +-- Name: AID-CGO-160 - APC - Spawning of cargo objects +-- Author: FlightControl +-- Date Created: 11 Sep 2018 +-- +-- In this demo cargo objects are spawned at random locations within the battle field. +-- +-- This simulates manpads to board APCs and won't disembark to defend the enemy carrier when enemies are nearby.. +-- So when the enemy helicopters are within combat range, the manpads will NOT unload and will NOT attack the helos. +-- This is because the combat range was not provided, and thus is 0. + + +-- Spawn some random cargo in a zone. + +SpawnInfantry = SPAWN:New( "Infantry" ) +:InitLimit( 30, 100 ) +:InitRandomizePosition(true,500,100) +:InitRandomizeZones( { ZONE:New( "SpawnZone" ) } ) +:OnSpawnGroup( + function( SpawnGroup ) + CARGO_GROUP:New(SpawnGroup,"InfantryType",SpawnGroup:GetName(),150,10) + end +) +:SpawnScheduled( 30, 0 ) + + +local CargoInfantrySet = SET_CARGO:New():FilterTypes( "InfantryType" ):FilterStart() +local SetAPC = SET_GROUP:New():FilterPrefixes( "APC" ):FilterStart() +local PickupZonesSet = SET_ZONE:New():FilterPrefixes( "Spawn" ):FilterOnce() +local DeployZonesSet = SET_ZONE:New():FilterPrefixes( "Deploy" ):FilterOnce() + +-- For the manpads to unload on time, a range of 8000 meters is appropriate. +AICargoDispatcherAPC = AI_CARGO_DISPATCHER_APC:New( SetAPC, CargoInfantrySet, PickupZonesSet, DeployZonesSet ) + +-- This will work too, so the combat range can be provided, but must be 0. +--AICargoDispatcherAPC = AI_CARGO_DISPATCHER_APC:New( SetAPC, SetCargoInfantry, nil, SetDeployZones, 0 ) + +-- Now also make the carriers spawn in. +CarrierSpawn = SPAWN:New( "APC" ):InitLimit( 10, 10 ):InitRandomizePosition( true, 200, 50 ):SpawnScheduled( 10, 0 ) + + +AICargoDispatcherAPC:Start() + diff --git a/AID - AI Dispatching/AID-CGO - AI Cargo Dispatching/AID-CGO-160 - APC - Spawning of cargo objects/AID-CGO-160 - APC - Spawning of cargo objects.miz b/AID - AI Dispatching/AID-CGO - AI Cargo Dispatching/AID-CGO-160 - APC - Spawning of cargo objects/AID-CGO-160 - APC - Spawning of cargo objects.miz index 5f68e1abe0..c8fb51b2e0 100644 Binary files a/AID - AI Dispatching/AID-CGO - AI Cargo Dispatching/AID-CGO-160 - APC - Spawning of cargo objects/AID-CGO-160 - APC - Spawning of cargo objects.miz and b/AID - AI Dispatching/AID-CGO - AI Cargo Dispatching/AID-CGO-160 - APC - Spawning of cargo objects/AID-CGO-160 - APC - Spawning of cargo objects.miz differ diff --git a/AID - AI Dispatching/AID-CGO - AI Cargo Dispatching/AID-CGO-200 - Helicopter - Pickup and Deploy/AID-CGO-200 - Helicopter - Pickup and Deploy.lua b/AID - AI Dispatching/AID-CGO - AI Cargo Dispatching/AID-CGO-200 - Helicopter - Pickup and Deploy/AID-CGO-200 - Helicopter - Pickup and Deploy.lua index 43bc6f1c57..34c9b1c205 100644 --- a/AID - AI Dispatching/AID-CGO - AI Cargo Dispatching/AID-CGO-200 - Helicopter - Pickup and Deploy/AID-CGO-200 - Helicopter - Pickup and Deploy.lua +++ b/AID - AI Dispatching/AID-CGO - AI Cargo Dispatching/AID-CGO-200 - Helicopter - Pickup and Deploy/AID-CGO-200 - Helicopter - Pickup and Deploy.lua @@ -1,13 +1,13 @@ ---- --- Name: AID-CGO-200 - Helicopter - Pickup and Deploy --- Author: FlightControl --- Date Created: 10 May 2018 --- - -local SetCargoInfantry = SET_CARGO:New():FilterTypes( "Infantry" ):FilterStart() -local SetHelicopter = SET_GROUP:New():FilterPrefixes( "Helicopter" ):FilterStart() -local SetDeployZones = SET_ZONE:New():FilterPrefixes( "Deploy" ):FilterStart() - -AICargoDispatcherHelicopter = AI_CARGO_DISPATCHER_HELICOPTER:New( SetHelicopter, SetCargoInfantry, nil, SetDeployZones ) -AICargoDispatcherHelicopter:Start() - +--- +-- Name: AID-CGO-200 - Helicopter - Pickup and Deploy +-- Author: FlightControl +-- Date Created: 10 May 2018 +-- + +local SetCargoInfantry = SET_CARGO:New():FilterTypes( "Infantry" ):FilterStart() +local SetHelicopter = SET_GROUP:New():FilterPrefixes( "Helicopter" ):FilterStart() +local SetDeployZones = SET_ZONE:New():FilterPrefixes( "Deploy" ):FilterStart() + +AICargoDispatcherHelicopter = AI_CARGO_DISPATCHER_HELICOPTER:New( SetHelicopter, SetCargoInfantry, nil, SetDeployZones ) +AICargoDispatcherHelicopter:Start() + diff --git a/AID - AI Dispatching/AID-CGO - AI Cargo Dispatching/AID-CGO-200 - Helicopter - Pickup and Deploy/AID-CGO-200 - Helicopter - Pickup and Deploy.miz b/AID - AI Dispatching/AID-CGO - AI Cargo Dispatching/AID-CGO-200 - Helicopter - Pickup and Deploy/AID-CGO-200 - Helicopter - Pickup and Deploy.miz index 4cfa65f1b9..09fe580db4 100644 Binary files a/AID - AI Dispatching/AID-CGO - AI Cargo Dispatching/AID-CGO-200 - Helicopter - Pickup and Deploy/AID-CGO-200 - Helicopter - Pickup and Deploy.miz and b/AID - AI Dispatching/AID-CGO - AI Cargo Dispatching/AID-CGO-200 - Helicopter - Pickup and Deploy/AID-CGO-200 - Helicopter - Pickup and Deploy.miz differ diff --git a/AID - AI Dispatching/AID-CGO - AI Cargo Dispatching/AID-CGO-201 - Helicopter - DeployZone Orbit/AID-CGO-201 - Helicopter - DeployZone Orbit.lua b/AID - AI Dispatching/AID-CGO - AI Cargo Dispatching/AID-CGO-201 - Helicopter - DeployZone Orbit/AID-CGO-201 - Helicopter - DeployZone Orbit.lua index 993ef0b5b6..51a401bb6d 100644 --- a/AID - AI Dispatching/AID-CGO - AI Cargo Dispatching/AID-CGO-201 - Helicopter - DeployZone Orbit/AID-CGO-201 - Helicopter - DeployZone Orbit.lua +++ b/AID - AI Dispatching/AID-CGO - AI Cargo Dispatching/AID-CGO-201 - Helicopter - DeployZone Orbit/AID-CGO-201 - Helicopter - DeployZone Orbit.lua @@ -1,14 +1,14 @@ ---- --- Name: AID-CGO-201 - Helicopter - DeployZone Orbit --- Author: FlightControl --- Date Created: 10 May 2018 --- - -local SetCargoInfantry = SET_CARGO:New():FilterTypes( "Infantry" ):FilterStart() -local SetHelicopter = SET_GROUP:New():FilterPrefixes( "Helicopter" ):FilterStart() -local SetDeployZones = SET_ZONE:New():FilterPrefixes( "Deploy" ):FilterStart() - -AICargoDispatcherHelicopter = AI_CARGO_DISPATCHER_HELICOPTER:New( SetHelicopter, SetCargoInfantry, nil, SetDeployZones ) -AICargoDispatcherHelicopter:SetHomeZone( ZONE:FindByName( "Home" ) ) -AICargoDispatcherHelicopter:Start() - +--- +-- Name: AID-CGO-201 - Helicopter - DeployZone Orbit +-- Author: FlightControl +-- Date Created: 10 May 2018 +-- + +local SetCargoInfantry = SET_CARGO:New():FilterTypes( "Infantry" ):FilterStart() +local SetHelicopter = SET_GROUP:New():FilterPrefixes( "Helicopter" ):FilterStart() +local SetDeployZones = SET_ZONE:New():FilterPrefixes( "Deploy" ):FilterStart() + +AICargoDispatcherHelicopter = AI_CARGO_DISPATCHER_HELICOPTER:New( SetHelicopter, SetCargoInfantry, nil, SetDeployZones ) +AICargoDispatcherHelicopter:SetHomeZone( ZONE:FindByName( "Home" ) ) +AICargoDispatcherHelicopter:Start() + diff --git a/AID - AI Dispatching/AID-CGO - AI Cargo Dispatching/AID-CGO-201 - Helicopter - DeployZone Orbit/AID-CGO-201 - Helicopter - DeployZone Orbit.miz b/AID - AI Dispatching/AID-CGO - AI Cargo Dispatching/AID-CGO-201 - Helicopter - DeployZone Orbit/AID-CGO-201 - Helicopter - DeployZone Orbit.miz index 8b9a3de0a5..322e70efc1 100644 Binary files a/AID - AI Dispatching/AID-CGO - AI Cargo Dispatching/AID-CGO-201 - Helicopter - DeployZone Orbit/AID-CGO-201 - Helicopter - DeployZone Orbit.miz and b/AID - AI Dispatching/AID-CGO - AI Cargo Dispatching/AID-CGO-201 - Helicopter - DeployZone Orbit/AID-CGO-201 - Helicopter - DeployZone Orbit.miz differ diff --git a/AID - AI Dispatching/AID-CGO - AI Cargo Dispatching/AID-CGO-202 - Helicopter - Spawning of Helicopters/AID-CGO-202 - Helicopter - Spawning of Helicopters.lua b/AID - AI Dispatching/AID-CGO - AI Cargo Dispatching/AID-CGO-202 - Helicopter - Spawning of Helicopters/AID-CGO-202 - Helicopter - Spawning of Helicopters.lua index 24f908c019..923b37ad37 100644 --- a/AID - AI Dispatching/AID-CGO - AI Cargo Dispatching/AID-CGO-202 - Helicopter - Spawning of Helicopters/AID-CGO-202 - Helicopter - Spawning of Helicopters.lua +++ b/AID - AI Dispatching/AID-CGO - AI Cargo Dispatching/AID-CGO-202 - Helicopter - Spawning of Helicopters/AID-CGO-202 - Helicopter - Spawning of Helicopters.lua @@ -1,18 +1,18 @@ ---- --- Name: AID-CGO-202 - Helicopter - Spawning of Helicopters --- Author: FlightControl --- Date Created: 19 May 2018 --- - -local SetCargoInfantry = SET_CARGO:New():FilterTypes( "Infantry" ):FilterStart() -local SetHelicopter = SET_GROUP:New():FilterPrefixes( "Helicopter" ):FilterStart() -local SetDeployZones = SET_ZONE:New():FilterPrefixes( "Deploy" ):FilterStart() - -AICargoDispatcherHelicopter = AI_CARGO_DISPATCHER_HELICOPTER:New( SetHelicopter, SetCargoInfantry, nil, SetDeployZones ) -AICargoDispatcherHelicopter:Start() - -HelicopterSpawn = SPAWN - :New( "Helicopter" ) - :InitLimit( 4, 20 ) - :InitLateActivated( true ) - :SpawnScheduled( 180, 0.5 ) +--- +-- Name: AID-CGO-202 - Helicopter - Spawning of Helicopters +-- Author: FlightControl +-- Date Created: 19 May 2018 +-- + +local SetCargoInfantry = SET_CARGO:New():FilterTypes( "Infantry" ):FilterStart() +local SetHelicopter = SET_GROUP:New():FilterPrefixes( "Helicopter" ):FilterStart() +local SetDeployZones = SET_ZONE:New():FilterPrefixes( "Deploy" ):FilterStart() + +AICargoDispatcherHelicopter = AI_CARGO_DISPATCHER_HELICOPTER:New( SetHelicopter, SetCargoInfantry, nil, SetDeployZones ) +AICargoDispatcherHelicopter:Start() + +HelicopterSpawn = SPAWN + :New( "Helicopter" ) + :InitLimit( 4, 20 ) + :InitLateActivated( true ) + :SpawnScheduled( 20, 0.5 ) diff --git a/AID - AI Dispatching/AID-CGO - AI Cargo Dispatching/AID-CGO-202 - Helicopter - Spawning of Helicopters/AID-CGO-202 - Helicopter - Spawning of Helicopters.miz b/AID - AI Dispatching/AID-CGO - AI Cargo Dispatching/AID-CGO-202 - Helicopter - Spawning of Helicopters/AID-CGO-202 - Helicopter - Spawning of Helicopters.miz index a782209809..7aaf9a8510 100644 Binary files a/AID - AI Dispatching/AID-CGO - AI Cargo Dispatching/AID-CGO-202 - Helicopter - Spawning of Helicopters/AID-CGO-202 - Helicopter - Spawning of Helicopters.miz and b/AID - AI Dispatching/AID-CGO - AI Cargo Dispatching/AID-CGO-202 - Helicopter - Spawning of Helicopters/AID-CGO-202 - Helicopter - Spawning of Helicopters.miz differ diff --git a/AID - AI Dispatching/AID-CGO - AI Cargo Dispatching/AID-CGO-203 - Helicopter - Spawning of Infantry/AID-CGO-203 - Helicopter - Spawning of Infantry.lua b/AID - AI Dispatching/AID-CGO - AI Cargo Dispatching/AID-CGO-203 - Helicopter - Spawning of Infantry/AID-CGO-203 - Helicopter - Spawning of Infantry.lua index d177ea531e..a734a35f8d 100644 --- a/AID - AI Dispatching/AID-CGO - AI Cargo Dispatching/AID-CGO-203 - Helicopter - Spawning of Infantry/AID-CGO-203 - Helicopter - Spawning of Infantry.lua +++ b/AID - AI Dispatching/AID-CGO - AI Cargo Dispatching/AID-CGO-203 - Helicopter - Spawning of Infantry/AID-CGO-203 - Helicopter - Spawning of Infantry.lua @@ -1,30 +1,30 @@ ---- --- Name: AID-CGO-203 - Helicopter - Spawning of Infantry --- Author: FlightControl --- Date Created: 19 May 2018 --- - -local SetCargoInfantry = SET_CARGO:New():FilterTypes( "Infantry" ):FilterStart() -local SetHelicopter = SET_GROUP:New():FilterPrefixes( "Helicopter" ):FilterStart() -local SetDeployZones = SET_ZONE:New():FilterPrefixes( "Deploy" ):FilterStart() - -AICargoDispatcherHelicopter = AI_CARGO_DISPATCHER_HELICOPTER:New( SetHelicopter, SetCargoInfantry, nil, SetDeployZones ) -AICargoDispatcherHelicopter:Start() - -HelicopterSpawn = SPAWN - :New( "Helicopter" ) - :InitLimit( 4, 20 ) - :InitLateActivated( true ) - :SpawnScheduled( 20, 0.5 ) - -InfantrySpawn = SPAWN - :New( "Infantry" ) - :InitLimit( 20, 60 ) - :OnSpawnGroup( - function( SpawnGroup ) - CARGO_GROUP:New( SpawnGroup, "Infantry", SpawnGroup:GetName(), 500, 25 ) - end - ) - :InitRandomizePosition( true, 1000, 250 ) - :SpawnScheduled( 10, 0.5 ) - +--- +-- Name: AID-CGO-203 - Helicopter - Spawning of Infantry +-- Author: FlightControl +-- Date Created: 19 May 2018 +-- + +local SetCargoInfantry = SET_CARGO:New():FilterTypes( "Infantry" ):FilterStart() +local SetHelicopter = SET_GROUP:New():FilterPrefixes( "Helicopter" ):FilterStart() +local SetDeployZones = SET_ZONE:New():FilterPrefixes( "Deploy" ):FilterStart() + +AICargoDispatcherHelicopter = AI_CARGO_DISPATCHER_HELICOPTER:New( SetHelicopter, SetCargoInfantry, nil, SetDeployZones ) +AICargoDispatcherHelicopter:Start() + +HelicopterSpawn = SPAWN + :New( "Helicopter" ) + :InitLimit( 4, 20 ) + :InitLateActivated( true ) + :SpawnScheduled( 20, 0.5 ) + +InfantrySpawn = SPAWN + :New( "Infantry" ) + :InitLimit( 20, 60 ) + :OnSpawnGroup( + function( SpawnGroup ) + CARGO_GROUP:New( SpawnGroup, "Infantry", SpawnGroup:GetName(), 500, 25 ) + end + ) + :InitRandomizePosition( true, 1000, 250 ) + :SpawnScheduled( 10, 0.5 ) + diff --git a/AID - AI Dispatching/AID-CGO - AI Cargo Dispatching/AID-CGO-203 - Helicopter - Spawning of Infantry/AID-CGO-203 - Helicopter - Spawning of Infantry.miz b/AID - AI Dispatching/AID-CGO - AI Cargo Dispatching/AID-CGO-203 - Helicopter - Spawning of Infantry/AID-CGO-203 - Helicopter - Spawning of Infantry.miz index d1bc60dd6b..81cdd6e06c 100644 Binary files a/AID - AI Dispatching/AID-CGO - AI Cargo Dispatching/AID-CGO-203 - Helicopter - Spawning of Infantry/AID-CGO-203 - Helicopter - Spawning of Infantry.miz and b/AID - AI Dispatching/AID-CGO - AI Cargo Dispatching/AID-CGO-203 - Helicopter - Spawning of Infantry/AID-CGO-203 - Helicopter - Spawning of Infantry.miz differ diff --git a/AID - AI Dispatching/AID-CGO - AI Cargo Dispatching/AID-CGO-210 - Helicopter - Home/AID-CGO-210 - Helicopter - Home.lua b/AID - AI Dispatching/AID-CGO - AI Cargo Dispatching/AID-CGO-210 - Helicopter - Home/AID-CGO-210 - Helicopter - Home.lua index c2af7a85d8..2a7cd271f9 100644 --- a/AID - AI Dispatching/AID-CGO - AI Cargo Dispatching/AID-CGO-210 - Helicopter - Home/AID-CGO-210 - Helicopter - Home.lua +++ b/AID - AI Dispatching/AID-CGO - AI Cargo Dispatching/AID-CGO-210 - Helicopter - Home/AID-CGO-210 - Helicopter - Home.lua @@ -1,13 +1,13 @@ ---- --- Name: AID-CGO-210 - Helicopter - Home --- Author: FlightControl --- Date Created: 10 May 2018 --- - -local SetCargoInfantry = SET_CARGO:New():FilterTypes( "Infantry" ):FilterStart() -local SetHelicopter = SET_GROUP:New():FilterPrefixes( "Helicopter" ):FilterStart() -local SetDeployZones = SET_ZONE:New():FilterPrefixes( "Deploy" ):FilterStart() - -AICargoDispatcherHelicopter = AI_CARGO_DISPATCHER_HELICOPTER:New( SetHelicopter, SetCargoInfantry, nil, SetDeployZones ) -AICargoDispatcherHelicopter:SetHomeZone( ZONE:FindByName( "Home" ) ) -AICargoDispatcherHelicopter:Start() +--- +-- Name: AID-CGO-210 - Helicopter - Home +-- Author: FlightControl +-- Date Created: 10 May 2018 +-- + +local SetCargoInfantry = SET_CARGO:New():FilterTypes( "Infantry" ):FilterStart() +local SetHelicopter = SET_GROUP:New():FilterPrefixes( "Helicopter" ):FilterStart() +local SetDeployZones = SET_ZONE:New():FilterPrefixes( "Deploy" ):FilterStart() + +AICargoDispatcherHelicopter = AI_CARGO_DISPATCHER_HELICOPTER:New( SetHelicopter, SetCargoInfantry, nil, SetDeployZones ) +AICargoDispatcherHelicopter:SetHomeZone( ZONE:FindByName( "Home" ) ) +AICargoDispatcherHelicopter:Start() diff --git a/AID - AI Dispatching/AID-CGO - AI Cargo Dispatching/AID-CGO-210 - Helicopter - Home/AID-CGO-210 - Helicopter - Home.miz b/AID - AI Dispatching/AID-CGO - AI Cargo Dispatching/AID-CGO-210 - Helicopter - Home/AID-CGO-210 - Helicopter - Home.miz index 5b9824bf7e..17ee83d569 100644 Binary files a/AID - AI Dispatching/AID-CGO - AI Cargo Dispatching/AID-CGO-210 - Helicopter - Home/AID-CGO-210 - Helicopter - Home.miz and b/AID - AI Dispatching/AID-CGO - AI Cargo Dispatching/AID-CGO-210 - Helicopter - Home/AID-CGO-210 - Helicopter - Home.miz differ diff --git a/AID - AI Dispatching/AID-CGO - AI Cargo Dispatching/AID-CGO-220 - Helicopter - Randomize Coordinates/AID-CGO-220 - Helicopter - Randomize Coordinates.lua b/AID - AI Dispatching/AID-CGO - AI Cargo Dispatching/AID-CGO-220 - Helicopter - Randomize Coordinates/AID-CGO-220 - Helicopter - Randomize Coordinates.lua index e9eca93557..a8c4bfdf80 100644 --- a/AID - AI Dispatching/AID-CGO - AI Cargo Dispatching/AID-CGO-220 - Helicopter - Randomize Coordinates/AID-CGO-220 - Helicopter - Randomize Coordinates.lua +++ b/AID - AI Dispatching/AID-CGO - AI Cargo Dispatching/AID-CGO-220 - Helicopter - Randomize Coordinates/AID-CGO-220 - Helicopter - Randomize Coordinates.lua @@ -1,16 +1,16 @@ ---- --- Name: AID-CGO-220 - Helicopter - Randomize Coordinates --- Author: FlightControl --- Date Created: 10 May 2018 --- --- Demonstrates the way how the pickup and deploy locations can be randomized. - -local SetCargoInfantry = SET_CARGO:New():FilterTypes( "Infantry" ):FilterStart() -local SetHelicopter = SET_GROUP:New():FilterPrefixes( "Helicopter" ):FilterStart() -local SetDeployZones = SET_ZONE:New():FilterPrefixes( "Deploy" ):FilterStart() - -AICargoDispatcherHelicopter = AI_CARGO_DISPATCHER_HELICOPTER:New( SetHelicopter, SetCargoInfantry, nil, SetDeployZones ) -AICargoDispatcherHelicopter:Start() - -AICargoDispatcherHelicopter:SetPickupRadius( 100, 50 ) -AICargoDispatcherHelicopter:SetDeployRadius( 100, 50 ) +--- +-- Name: AID-CGO-220 - Helicopter - Randomize Coordinates +-- Author: FlightControl +-- Date Created: 10 May 2018 +-- +-- Demonstrates the way how the pickup and deploy locations can be randomized. + +local SetCargoInfantry = SET_CARGO:New():FilterTypes( "Infantry" ):FilterStart() +local SetHelicopter = SET_GROUP:New():FilterPrefixes( "Helicopter" ):FilterStart() +local SetDeployZones = SET_ZONE:New():FilterPrefixes( "Deploy" ):FilterStart() + +AICargoDispatcherHelicopter = AI_CARGO_DISPATCHER_HELICOPTER:New( SetHelicopter, SetCargoInfantry, nil, SetDeployZones ) +AICargoDispatcherHelicopter:Start() + +AICargoDispatcherHelicopter:SetPickupRadius( 100, 50 ) +AICargoDispatcherHelicopter:SetDeployRadius( 100, 50 ) diff --git a/AID - AI Dispatching/AID-CGO - AI Cargo Dispatching/AID-CGO-220 - Helicopter - Randomize Coordinates/AID-CGO-220 - Helicopter - Randomize Coordinates.miz b/AID - AI Dispatching/AID-CGO - AI Cargo Dispatching/AID-CGO-220 - Helicopter - Randomize Coordinates/AID-CGO-220 - Helicopter - Randomize Coordinates.miz index 1be2aa1a9d..c8386c9079 100644 Binary files a/AID - AI Dispatching/AID-CGO - AI Cargo Dispatching/AID-CGO-220 - Helicopter - Randomize Coordinates/AID-CGO-220 - Helicopter - Randomize Coordinates.miz and b/AID - AI Dispatching/AID-CGO - AI Cargo Dispatching/AID-CGO-220 - Helicopter - Randomize Coordinates/AID-CGO-220 - Helicopter - Randomize Coordinates.miz differ diff --git a/AID - AI Dispatching/AID-CGO - AI Cargo Dispatching/AID-CGO-230 - Helicopter - DeployZone Probability/AID-CGO-230 - Helicopter - DeployZone Probability.lua b/AID - AI Dispatching/AID-CGO - AI Cargo Dispatching/AID-CGO-230 - Helicopter - DeployZone Probability/AID-CGO-230 - Helicopter - DeployZone Probability.lua index 4a96b975b7..59dee05197 100644 --- a/AID - AI Dispatching/AID-CGO - AI Cargo Dispatching/AID-CGO-230 - Helicopter - DeployZone Probability/AID-CGO-230 - Helicopter - DeployZone Probability.lua +++ b/AID - AI Dispatching/AID-CGO - AI Cargo Dispatching/AID-CGO-230 - Helicopter - DeployZone Probability/AID-CGO-230 - Helicopter - DeployZone Probability.lua @@ -1,18 +1,18 @@ ---- --- Name: AID-CGO-230 - Helicopter - DeployZone Probability --- Author: FlightControl --- Date Created: 15 May 2018 --- --- Demonstrates the way how the deploy locations can be set to a specific probability distribution. - -local SetCargoInfantry = SET_CARGO:New():FilterTypes( "Infantry" ):FilterStart() -local SetHelicopter = SET_GROUP:New():FilterPrefixes( "Helicopter" ):FilterStart() -local SetDeployZones = SET_ZONE:New():FilterPrefixes( "Deploy" ):FilterStart() - -AICargoDispatcherHelicopter = AI_CARGO_DISPATCHER_HELICOPTER:New( SetHelicopter, SetCargoInfantry, nil, SetDeployZones ) -AICargoDispatcherHelicopter:SetHomeZone( ZONE:FindByName( "Home" ) ) -AICargoDispatcherHelicopter:Start() - -SetDeployZones:SetZoneProbability( "Deploy A", 0.1 ) -SetDeployZones:SetZoneProbability( "Deploy B", 0.1 ) +--- +-- Name: AID-CGO-230 - Helicopter - DeployZone Probability +-- Author: FlightControl +-- Date Created: 15 May 2018 +-- +-- Demonstrates the way how the deploy locations can be set to a specific probability distribution. + +local SetCargoInfantry = SET_CARGO:New():FilterTypes( "Infantry" ):FilterStart() +local SetHelicopter = SET_GROUP:New():FilterPrefixes( "Helicopter" ):FilterStart() +local SetDeployZones = SET_ZONE:New():FilterPrefixes( "Deploy" ):FilterStart() + +AICargoDispatcherHelicopter = AI_CARGO_DISPATCHER_HELICOPTER:New( SetHelicopter, SetCargoInfantry, nil, SetDeployZones ) +AICargoDispatcherHelicopter:SetHomeZone( ZONE:FindByName( "Home" ) ) +AICargoDispatcherHelicopter:Start() + +SetDeployZones:SetZoneProbability( "Deploy A", 0.1 ) +SetDeployZones:SetZoneProbability( "Deploy B", 0.1 ) SetDeployZones:SetZoneProbability( "Deploy C", 0.8 ) \ No newline at end of file diff --git a/AID - AI Dispatching/AID-CGO - AI Cargo Dispatching/AID-CGO-230 - Helicopter - DeployZone Probability/AID-CGO-230 - Helicopter - DeployZone Probability.miz b/AID - AI Dispatching/AID-CGO - AI Cargo Dispatching/AID-CGO-230 - Helicopter - DeployZone Probability/AID-CGO-230 - Helicopter - DeployZone Probability.miz index 9dc77fff97..5bc2135216 100644 Binary files a/AID - AI Dispatching/AID-CGO - AI Cargo Dispatching/AID-CGO-230 - Helicopter - DeployZone Probability/AID-CGO-230 - Helicopter - DeployZone Probability.miz and b/AID - AI Dispatching/AID-CGO - AI Cargo Dispatching/AID-CGO-230 - Helicopter - DeployZone Probability/AID-CGO-230 - Helicopter - DeployZone Probability.miz differ diff --git a/AID - AI Dispatching/AID-CGO - AI Cargo Dispatching/AID-CGO-240 - Helicopter - Unloaded Event Handling/AID-CGO-240 - Helicopter - Unloaded Event Handling.lua b/AID - AI Dispatching/AID-CGO - AI Cargo Dispatching/AID-CGO-240 - Helicopter - Unloaded Event Handling/AID-CGO-240 - Helicopter - Unloaded Event Handling.lua index 808f62cc93..46d62ea505 100644 --- a/AID - AI Dispatching/AID-CGO - AI Cargo Dispatching/AID-CGO-240 - Helicopter - Unloaded Event Handling/AID-CGO-240 - Helicopter - Unloaded Event Handling.lua +++ b/AID - AI Dispatching/AID-CGO - AI Cargo Dispatching/AID-CGO-240 - Helicopter - Unloaded Event Handling/AID-CGO-240 - Helicopter - Unloaded Event Handling.lua @@ -1,176 +1,176 @@ ---- --- Name: AID-CGO-240 - Helicopter - Unloaded Event Handling --- Author: FlightControl --- Date Created: 15 May 2018 --- --- Demonstrates the way how the deploy locations can be set to a specific probability distribution. - -local SetCargoInfantry = SET_CARGO:New():FilterTypes( "Infantry" ):FilterStart() -local SetHelicopter = SET_GROUP:New():FilterPrefixes( "Helicopter" ):FilterStart() -local SetPickupZones = SET_ZONE:New():FilterPrefixes( "Pickup" ):FilterStart() -local SetDeployZones = SET_ZONE:New():FilterPrefixes( "Deploy" ):FilterStart() - -AICargoDispatcherHelicopter = AI_CARGO_DISPATCHER_HELICOPTER:New( SetHelicopter, SetCargoInfantry, SetPickupZones, SetDeployZones ) -AICargoDispatcherHelicopter:SetHomeZone( ZONE:FindByName( "Home" ) ) - - - ---- Pickup Handler OnAfter for AICargoDispatcherHelicopter. --- Use this event handler to tailor the event when a CarrierGroup is routed towards a new pickup Coordinate and a specified Speed. --- You can use this event handler to post messages to players, or provide status updates etc. --- @param #AICargoDispatcherAirplanes self --- @param #string From A string that contains the "*from state name*" when the event was fired. --- @param #string Event A string that contains the "*event name*" when the event was fired. --- @param #string To A string that contains the "*to state name*" when the event was fired. --- @param Wrapper.Group#GROUP CarrierGroup The group object that contains the CarrierUnits. --- @param Core.Point#COORDINATE Coordinate The coordinate of the pickup location. --- @param #number Speed The velocity in meters per second on which the CarrierGroup is routed towards the pickup Coordinate. --- @param #number Height Height in meters to move to the pickup coordinate. -function AICargoDispatcherHelicopter:OnAfterPickup( From, Event, To, CarrierGroup, Coordinate, Speed, Height ) - - -- Write here your own code. - MESSAGE:NewType( "Group " .. CarrierGroup:GetName().. " is picking up cargo.", MESSAGE.Type.Information ):ToAll() - - -end - - ---- Load Handler OnAfter for AICargoDispatcherHelicopter. --- Use this event handler to tailor the event when a CarrierGroup has initiated the loading or boarding of cargo within reporting or near range. --- You can use this event handler to post messages to players, or provide status updates etc. --- @param #AICargoDispatcherHelicopter self --- @param #string From A string that contains the "*from state name*" when the event was fired. --- @param #string Event A string that contains the "*event name*" when the event was fired. --- @param #string To A string that contains the "*to state name*" when the event was fired. --- @param Wrapper.Group#GROUP CarrierGroup The group object that contains the CarrierUnits. -function AICargoDispatcherHelicopter:OnAfterLoad( From, Event, To, CarrierGroup ) - - -- Write here your own code. - MESSAGE:NewType( "Group " .. CarrierGroup:GetName().. " is loading cargo.", MESSAGE.Type.Information ):ToAll() - -end - - ---- Loaded event handler OnAfter for AICargoDispatcherHelicopter. --- Use this event handler to tailor the event when a CarrierUnit of a CarrierGroup has loaded a cargo object. --- You can use this event handler to post messages to players, or provide status updates etc. --- Note that if more cargo objects were loading or boarding into the CarrierUnit, then this event can be triggered multiple times for each different Cargo/CarrierUnit. --- A CarrierUnit can be part of the larger CarrierGroup. --- @param #AICargoDispatcherHelicopter self --- @param #string From A string that contains the "*from state name*" when the event was triggered. --- @param #string Event A string that contains the "*event name*" when the event was triggered. --- @param #string To A string that contains the "*to state name*" when the event was triggered. --- @param Wrapper.Group#GROUP CarrierGroup The group object that contains the CarrierUnits. --- @param Cargo.Cargo#CARGO Cargo The cargo object. --- @param Wrapper.Unit#UNIT CarrierUnit The carrier unit that is executing the cargo loading operation. --- @param Core.Zone#ZONE_AIRBASE PickupZone (optional) The zone from where the cargo is picked up. Note that the zone is optional and may not be provided, but for AI_CARGO_DISPATCHER_AIRBASE there will always be a PickupZone, as the pickup location is an airbase zone. -function AICargoDispatcherHelicopter:OnAfterLoaded( From, Event, To, CarrierGroup, Cargo, CarrierUnit, PickupZone ) - - -- Write here your own code. - MESSAGE:NewType( "Group " .. CarrierGroup:GetName().. " has loaded cargo " .. Cargo:GetName(), MESSAGE.Type.Information ):ToAll() - -end - ---- Deploy Handler OnAfter for AI_CARGO_DISPATCHER. --- Use this event handler to tailor the event when a CarrierGroup is routed to a deploy coordinate, to Unload all cargo objects in each CarrierUnit. --- You can use this event handler to post messages to players, or provide status updates etc. --- @function OnAfterPickedUp --- @param self --- @param #string From A string that contains the "*from state name*" when the event was fired. --- @param #string Event A string that contains the "*event name*" when the event was fired. --- @param #string To A string that contains the "*to state name*" when the event was fired. --- @param Wrapper.Group#GROUP CarrierGroup The group object that contains the CarrierUnits. --- @param Core.Point#COORDINATE Coordinate The deploy coordinate. --- @param #number Speed The velocity in meters per second on which the CarrierGroup is routed towards the deploy Coordinate. --- @param #number Height Height in meters to move to the deploy coordinate. --- @param Core.Zone#ZONE DeployZone The zone wherein the cargo is deployed. This can be any zone type, like a ZONE, ZONE_GROUP, ZONE_AIRBASE. -function AICargoDispatcherHelicopter:OnAfterDeploy( From, Event, To, CarrierGroup, Coordinate, Speed, Height, DeployZone ) - - MESSAGE:NewType( "Group " .. CarrierGroup:GetName().. " is starting deployment of all cargo in zone " .. DeployZone:GetName(), MESSAGE.Type.Information ):ToAll() - -end - - - - - - - ---- Unloaded Handler OnAfter for AI_CARGO_DISPATCHER. --- Use this event handler to tailor the event when a CarrierUnit of a CarrierGroup has unloaded a cargo object. --- You can use this event handler to post messages to players, or provide status updates etc. --- Note that if more cargo objects were unloading or unboarding from the CarrierUnit, then this event can be fired multiple times for each different Cargo/CarrierUnit. --- A CarrierUnit can be part of the larger CarrierGroup. --- @function OnAfterUnloaded --- @param #AICargoDispatcherHelicopter self --- @param #string From A string that contains the "*from state name*" when the event was fired. --- @param #string Event A string that contains the "*event name*" when the event was fired. --- @param #string To A string that contains the "*to state name*" when the event was fired. --- @param Wrapper.Group#GROUP CarrierGroup The group object that contains the CarrierUnits. --- @param Cargo.Cargo#CARGO Cargo The cargo object. --- @param Wrapper.Unit#UNIT CarrierUnit The carrier unit that is executing the cargo unloading operation. --- @param Core.Zone#ZONE DeployZone The zone wherein the cargo is deployed. This can be any zone type, like a ZONE, ZONE_GROUP, ZONE_AIRBASE. -function AICargoDispatcherHelicopter:OnAfterUnloaded( From, Event, To, CarrierGroup, Cargo, CarrierUnit, DeployZone ) - - local CargoGroup = Cargo:GetObject() -- Wrapper.Group#GROUP - - -- Get the name of the DeployZone - local DeployZoneName = DeployZone:GetName() - - local DeployBuildingNames = { - ["Deploy A"] = "Building A", - ["Deploy B"] = "Building B", - ["Deploy C"] = "Building C", - } - - - -- Now board the infantry into the respective warehouse building. - if DeployZoneName then - local Building = STATIC:FindByName( DeployBuildingNames[DeployZoneName] ) - Cargo:__Board( 5, Building, 25 ) - end - - MESSAGE:NewType( "Group " .. CarrierGroup:GetName() .. ", Unit " .. CarrierUnit:GetName() .. " has unloaded cargo " .. Cargo:GetName() .. " in zone " .. DeployZone:GetName() .. " and cargo is moving to building " .. DeployBuildingNames[DeployZoneName], MESSAGE.Type.Information ):ToAll() - - -end - - ---- Deployed Handler OnAfter for AI_CARGO_DISPATCHER. --- Use this event handler to tailor the event when a carrier has deployed all cargo objects from the CarrierGroup. --- You can use this event handler to post messages to players, or provide status updates etc. --- @function OnAfterDeployed --- @param #AICargoDispatcherHelicopter self --- @param #string From A string that contains the "*from state name*" when the event was fired. --- @param #string Event A string that contains the "*event name*" when the event was fired. --- @param #string To A string that contains the "*to state name*" when the event was fired. --- @param Wrapper.Group#GROUP CarrierGroup The group object that contains the CarrierUnits. --- @param Core.Zone#ZONE DeployZone The zone wherein the cargo is deployed. This can be any zone type, like a ZONE, ZONE_GROUP, ZONE_AIRBASE. -function AICargoDispatcherHelicopter:OnAfterDeployed( From, Event, To, CarrierGroup, DeployZone ) - - MESSAGE:NewType( "Group " .. CarrierGroup:GetName() .. " deployed all cargo in zone " .. DeployZone:GetName(), MESSAGE.Type.Information ):ToAll() - -end - - ---- Home event handler OnAfter for AICargoDispatcherHelicopter. --- Use this event handler to tailor the event when a CarrierGroup is returning to the HomeZone, after it has deployed all cargo objects from the CarrierGroup. --- You can use this event handler to post messages to players, or provide status updates etc. --- If there is no HomeZone is specified, the CarrierGroup will stay at the current location after having deployed all cargo. --- @param #AICargoDispatcherHelicopter self --- @param #string From A string that contains the "*from state name*" when the event was triggered. --- @param #string Event A string that contains the "*event name*" when the event was triggered. --- @param #string To A string that contains the "*to state name*" when the event was triggered. --- @param Wrapper.Group#GROUP CarrierGroup The group object that contains the CarrierUnits. --- @param Core.Point#COORDINATE Coordinate The home coordinate the Carrier will arrive and stop it's activities. --- @param #number Speed The velocity in meters per second on which the CarrierGroup is routed towards the home Coordinate. --- @param #number Height Height in meters to move to the home coordinate. --- @param Core.Zone#ZONE HomeZone The zone wherein the carrier will return when all cargo has been transported. This can be any zone type, like a ZONE, ZONE_GROUP, ZONE_AIRBASE. -function AICargoDispatcherHelicopter:OnAfterHome( From, Event, To, CarrierGroup, Coordinate, Speed, Height, HomeZone ) - - MESSAGE:NewType( "Group " .. CarrierGroup:GetName() .. " deployed all cargo and going home to zone " .. HomeZone:GetName(), MESSAGE.Type.Detailed ):ToAll() - -end - - -AICargoDispatcherHelicopter:Start() +--- +-- Name: AID-CGO-240 - Helicopter - Unloaded Event Handling +-- Author: FlightControl +-- Date Created: 15 May 2018 +-- +-- Demonstrates the way how the deploy locations can be set to a specific probability distribution. + +local SetCargoInfantry = SET_CARGO:New():FilterTypes( "Infantry" ):FilterStart() +local SetHelicopter = SET_GROUP:New():FilterPrefixes( "Helicopter" ):FilterStart() +local SetPickupZones = SET_ZONE:New():FilterPrefixes( "Pickup" ):FilterStart() +local SetDeployZones = SET_ZONE:New():FilterPrefixes( "Deploy" ):FilterStart() + +AICargoDispatcherHelicopter = AI_CARGO_DISPATCHER_HELICOPTER:New( SetHelicopter, SetCargoInfantry, SetPickupZones, SetDeployZones ) +AICargoDispatcherHelicopter:SetHomeZone( ZONE:FindByName( "Home" ) ) + + + +--- Pickup Handler OnAfter for AICargoDispatcherHelicopter. +-- Use this event handler to tailor the event when a CarrierGroup is routed towards a new pickup Coordinate and a specified Speed. +-- You can use this event handler to post messages to players, or provide status updates etc. +-- @param #AICargoDispatcherAirplanes self +-- @param #string From A string that contains the "*from state name*" when the event was fired. +-- @param #string Event A string that contains the "*event name*" when the event was fired. +-- @param #string To A string that contains the "*to state name*" when the event was fired. +-- @param Wrapper.Group#GROUP CarrierGroup The group object that contains the CarrierUnits. +-- @param Core.Point#COORDINATE Coordinate The coordinate of the pickup location. +-- @param #number Speed The velocity in meters per second on which the CarrierGroup is routed towards the pickup Coordinate. +-- @param #number Height Height in meters to move to the pickup coordinate. +function AICargoDispatcherHelicopter:OnAfterPickup( From, Event, To, CarrierGroup, Coordinate, Speed, Height ) + + -- Write here your own code. + MESSAGE:NewType( "Group " .. CarrierGroup:GetName().. " is picking up cargo.", MESSAGE.Type.Information ):ToAll() + + +end + + +--- Load Handler OnAfter for AICargoDispatcherHelicopter. +-- Use this event handler to tailor the event when a CarrierGroup has initiated the loading or boarding of cargo within reporting or near range. +-- You can use this event handler to post messages to players, or provide status updates etc. +-- @param #AICargoDispatcherHelicopter self +-- @param #string From A string that contains the "*from state name*" when the event was fired. +-- @param #string Event A string that contains the "*event name*" when the event was fired. +-- @param #string To A string that contains the "*to state name*" when the event was fired. +-- @param Wrapper.Group#GROUP CarrierGroup The group object that contains the CarrierUnits. +function AICargoDispatcherHelicopter:OnAfterLoad( From, Event, To, CarrierGroup ) + + -- Write here your own code. + MESSAGE:NewType( "Group " .. CarrierGroup:GetName().. " is loading cargo.", MESSAGE.Type.Information ):ToAll() + +end + + +--- Loaded event handler OnAfter for AICargoDispatcherHelicopter. +-- Use this event handler to tailor the event when a CarrierUnit of a CarrierGroup has loaded a cargo object. +-- You can use this event handler to post messages to players, or provide status updates etc. +-- Note that if more cargo objects were loading or boarding into the CarrierUnit, then this event can be triggered multiple times for each different Cargo/CarrierUnit. +-- A CarrierUnit can be part of the larger CarrierGroup. +-- @param #AICargoDispatcherHelicopter self +-- @param #string From A string that contains the "*from state name*" when the event was triggered. +-- @param #string Event A string that contains the "*event name*" when the event was triggered. +-- @param #string To A string that contains the "*to state name*" when the event was triggered. +-- @param Wrapper.Group#GROUP CarrierGroup The group object that contains the CarrierUnits. +-- @param Cargo.Cargo#CARGO Cargo The cargo object. +-- @param Wrapper.Unit#UNIT CarrierUnit The carrier unit that is executing the cargo loading operation. +-- @param Core.Zone#ZONE_AIRBASE PickupZone (optional) The zone from where the cargo is picked up. Note that the zone is optional and may not be provided, but for AI_CARGO_DISPATCHER_AIRBASE there will always be a PickupZone, as the pickup location is an airbase zone. +function AICargoDispatcherHelicopter:OnAfterLoaded( From, Event, To, CarrierGroup, Cargo, CarrierUnit, PickupZone ) + + -- Write here your own code. + MESSAGE:NewType( "Group " .. CarrierGroup:GetName().. " has loaded cargo " .. Cargo:GetName(), MESSAGE.Type.Information ):ToAll() + +end + +--- Deploy Handler OnAfter for AI_CARGO_DISPATCHER. +-- Use this event handler to tailor the event when a CarrierGroup is routed to a deploy coordinate, to Unload all cargo objects in each CarrierUnit. +-- You can use this event handler to post messages to players, or provide status updates etc. +-- @function OnAfterPickedUp +-- @param self +-- @param #string From A string that contains the "*from state name*" when the event was fired. +-- @param #string Event A string that contains the "*event name*" when the event was fired. +-- @param #string To A string that contains the "*to state name*" when the event was fired. +-- @param Wrapper.Group#GROUP CarrierGroup The group object that contains the CarrierUnits. +-- @param Core.Point#COORDINATE Coordinate The deploy coordinate. +-- @param #number Speed The velocity in meters per second on which the CarrierGroup is routed towards the deploy Coordinate. +-- @param #number Height Height in meters to move to the deploy coordinate. +-- @param Core.Zone#ZONE DeployZone The zone wherein the cargo is deployed. This can be any zone type, like a ZONE, ZONE_GROUP, ZONE_AIRBASE. +function AICargoDispatcherHelicopter:OnAfterDeploy( From, Event, To, CarrierGroup, Coordinate, Speed, Height, DeployZone ) + + MESSAGE:NewType( "Group " .. CarrierGroup:GetName().. " is starting deployment of all cargo in zone " .. DeployZone:GetName(), MESSAGE.Type.Information ):ToAll() + +end + + + + + + + +--- Unloaded Handler OnAfter for AI_CARGO_DISPATCHER. +-- Use this event handler to tailor the event when a CarrierUnit of a CarrierGroup has unloaded a cargo object. +-- You can use this event handler to post messages to players, or provide status updates etc. +-- Note that if more cargo objects were unloading or unboarding from the CarrierUnit, then this event can be fired multiple times for each different Cargo/CarrierUnit. +-- A CarrierUnit can be part of the larger CarrierGroup. +-- @function OnAfterUnloaded +-- @param #AICargoDispatcherHelicopter self +-- @param #string From A string that contains the "*from state name*" when the event was fired. +-- @param #string Event A string that contains the "*event name*" when the event was fired. +-- @param #string To A string that contains the "*to state name*" when the event was fired. +-- @param Wrapper.Group#GROUP CarrierGroup The group object that contains the CarrierUnits. +-- @param Cargo.Cargo#CARGO Cargo The cargo object. +-- @param Wrapper.Unit#UNIT CarrierUnit The carrier unit that is executing the cargo unloading operation. +-- @param Core.Zone#ZONE DeployZone The zone wherein the cargo is deployed. This can be any zone type, like a ZONE, ZONE_GROUP, ZONE_AIRBASE. +function AICargoDispatcherHelicopter:OnAfterUnloaded( From, Event, To, CarrierGroup, Cargo, CarrierUnit, DeployZone ) + + local CargoGroup = Cargo:GetObject() -- Wrapper.Group#GROUP + + -- Get the name of the DeployZone + local DeployZoneName = DeployZone:GetName() + + local DeployBuildingNames = { + ["Deploy A"] = "Building A", + ["Deploy B"] = "Building B", + ["Deploy C"] = "Building C", + } + + + -- Now board the infantry into the respective warehouse building. + if DeployZoneName then + local Building = STATIC:FindByName( DeployBuildingNames[DeployZoneName] ) + Cargo:__Board( 5, Building, 25 ) + end + + MESSAGE:NewType( "Group " .. CarrierGroup:GetName() .. ", Unit " .. CarrierUnit:GetName() .. " has unloaded cargo " .. Cargo:GetName() .. " in zone " .. DeployZone:GetName() .. " and cargo is moving to building " .. DeployBuildingNames[DeployZoneName], MESSAGE.Type.Information ):ToAll() + + +end + + +--- Deployed Handler OnAfter for AI_CARGO_DISPATCHER. +-- Use this event handler to tailor the event when a carrier has deployed all cargo objects from the CarrierGroup. +-- You can use this event handler to post messages to players, or provide status updates etc. +-- @function OnAfterDeployed +-- @param #AICargoDispatcherHelicopter self +-- @param #string From A string that contains the "*from state name*" when the event was fired. +-- @param #string Event A string that contains the "*event name*" when the event was fired. +-- @param #string To A string that contains the "*to state name*" when the event was fired. +-- @param Wrapper.Group#GROUP CarrierGroup The group object that contains the CarrierUnits. +-- @param Core.Zone#ZONE DeployZone The zone wherein the cargo is deployed. This can be any zone type, like a ZONE, ZONE_GROUP, ZONE_AIRBASE. +function AICargoDispatcherHelicopter:OnAfterDeployed( From, Event, To, CarrierGroup, DeployZone ) + + MESSAGE:NewType( "Group " .. CarrierGroup:GetName() .. " deployed all cargo in zone " .. DeployZone:GetName(), MESSAGE.Type.Information ):ToAll() + +end + + +--- Home event handler OnAfter for AICargoDispatcherHelicopter. +-- Use this event handler to tailor the event when a CarrierGroup is returning to the HomeZone, after it has deployed all cargo objects from the CarrierGroup. +-- You can use this event handler to post messages to players, or provide status updates etc. +-- If there is no HomeZone is specified, the CarrierGroup will stay at the current location after having deployed all cargo. +-- @param #AICargoDispatcherHelicopter self +-- @param #string From A string that contains the "*from state name*" when the event was triggered. +-- @param #string Event A string that contains the "*event name*" when the event was triggered. +-- @param #string To A string that contains the "*to state name*" when the event was triggered. +-- @param Wrapper.Group#GROUP CarrierGroup The group object that contains the CarrierUnits. +-- @param Core.Point#COORDINATE Coordinate The home coordinate the Carrier will arrive and stop it's activities. +-- @param #number Speed The velocity in meters per second on which the CarrierGroup is routed towards the home Coordinate. +-- @param #number Height Height in meters to move to the home coordinate. +-- @param Core.Zone#ZONE HomeZone The zone wherein the carrier will return when all cargo has been transported. This can be any zone type, like a ZONE, ZONE_GROUP, ZONE_AIRBASE. +function AICargoDispatcherHelicopter:OnAfterHome( From, Event, To, CarrierGroup, Coordinate, Speed, Height, HomeZone ) + + MESSAGE:NewType( "Group " .. CarrierGroup:GetName() .. " deployed all cargo and going home to zone " .. HomeZone:GetName(), MESSAGE.Type.Detailed ):ToAll() + +end + + +AICargoDispatcherHelicopter:Start() diff --git a/AID - AI Dispatching/AID-CGO - AI Cargo Dispatching/AID-CGO-240 - Helicopter - Unloaded Event Handling/AID-CGO-240 - Helicopter - Unloaded Event Handling.miz b/AID - AI Dispatching/AID-CGO - AI Cargo Dispatching/AID-CGO-240 - Helicopter - Unloaded Event Handling/AID-CGO-240 - Helicopter - Unloaded Event Handling.miz index 40c49e283c..72835951f2 100644 Binary files a/AID - AI Dispatching/AID-CGO - AI Cargo Dispatching/AID-CGO-240 - Helicopter - Unloaded Event Handling/AID-CGO-240 - Helicopter - Unloaded Event Handling.miz and b/AID - AI Dispatching/AID-CGO - AI Cargo Dispatching/AID-CGO-240 - Helicopter - Unloaded Event Handling/AID-CGO-240 - Helicopter - Unloaded Event Handling.miz differ diff --git a/AID - AI Dispatching/AID-CGO - AI Cargo Dispatching/AID-CGO-250 - Helicopter - Front-Line Enforcements/AID-CGO-250 - Helicopter - Front-Line Enforcements.lua b/AID - AI Dispatching/AID-CGO - AI Cargo Dispatching/AID-CGO-250 - Helicopter - Front-Line Enforcements/AID-CGO-250 - Helicopter - Front-Line Enforcements.lua index 4e1350cec3..5381a35135 100644 --- a/AID - AI Dispatching/AID-CGO - AI Cargo Dispatching/AID-CGO-250 - Helicopter - Front-Line Enforcements/AID-CGO-250 - Helicopter - Front-Line Enforcements.lua +++ b/AID - AI Dispatching/AID-CGO - AI Cargo Dispatching/AID-CGO-250 - Helicopter - Front-Line Enforcements/AID-CGO-250 - Helicopter - Front-Line Enforcements.lua @@ -1,206 +1,206 @@ ---- --- Name: AID-CGO-250 - Helicopter - Front-Line Enforcements --- Author: FlightControl --- Date Created: 20 Sep 2018 --- --- Demonstrates the way how front-line enforcements can be setup using helicopter transportations. - -local SetCargoInfantry = SET_CARGO:New():FilterTypes( "Infantry" ):FilterStart() -local SetHelicopter = SET_GROUP:New():FilterPrefixes( "Helicopter" ):FilterStart() -local SetPickupZones = SET_ZONE:New():FilterPrefixes( "Pickup" ):FilterStart() -local SetDeployZones = SET_ZONE:New():FilterPrefixes( "Defense" ):FilterStart() - -AICargoDispatcherHelicopter = AI_CARGO_DISPATCHER_HELICOPTER:New( SetHelicopter, SetCargoInfantry, SetPickupZones, SetDeployZones ) -AICargoDispatcherHelicopter:SetHomeZone( ZONE:FindByName( "Home" ) ) - - --- Here we setup the spawning of Infantry. -SpawnCargoInfantry = SPAWN - :New( "Infantry" ) - :InitLimit( 40, 60 ) - :InitRandomizeZones( { ZONE_POLYGON:NewFromGroupName( "Pickup Location" ) } ) - :OnSpawnGroup( - function( SpawnGroup ) - -- This will automatically add also the CargoInfantry object to the SetCargoInfantry (in the background through the event system). - local CargoInfantry = CARGO_GROUP:New( SpawnGroup, "Infantry", SpawnGroup:GetName(), 150 ) - end - ) - :SpawnScheduled( 60, 0.5 ) - --- Now we create 4 zones based on GROUP objects within the battlefield, which form the front line defense points. -local ZoneDefense1 = ZONE_GROUP:New( "Defense 1", GROUP:FindByName("Defense #001"), 1500 ) -local ZoneDefense2 = ZONE_GROUP:New( "Defense 2", GROUP:FindByName("Defense #002"), 1500 ) -local ZoneDefense3 = ZONE_GROUP:New( "Defense 3", GROUP:FindByName("Defense #003"), 1500 ) -local ZoneDefense4 = ZONE_GROUP:New( "Defense 4", GROUP:FindByName("Defense #004"), 1500 ) - - --- Here we setup the spawning of Helicopters. - - - ---- Pickup Handler OnAfter for AICargoDispatcherHelicopter. --- Use this event handler to tailor the event when a CarrierGroup is routed towards a new pickup Coordinate and a specified Speed. --- You can use this event handler to post messages to players, or provide status updates etc. --- @param #AICargoDispatcherAirplanes self --- @param #string From A string that contains the "*from state name*" when the event was fired. --- @param #string Event A string that contains the "*event name*" when the event was fired. --- @param #string To A string that contains the "*to state name*" when the event was fired. --- @param Wrapper.Group#GROUP CarrierGroup The group object that contains the CarrierUnits. --- @param Core.Point#COORDINATE Coordinate The coordinate of the pickup location. --- @param #number Speed The velocity in meters per second on which the CarrierGroup is routed towards the pickup Coordinate. --- @param #number Height Height in meters to move to the pickup coordinate. -function AICargoDispatcherHelicopter:OnAfterPickup( From, Event, To, CarrierGroup, Coordinate, Speed, Height, PickupZone ) - - -- Write here your own code. - MESSAGE:NewType( "Group " .. CarrierGroup:GetName().. " is picking up cargo.", MESSAGE.Type.Information ):ToAll() - - -end - - ---- Load Handler OnAfter for AICargoDispatcherHelicopter. --- Use this event handler to tailor the event when a CarrierGroup has initiated the loading or boarding of cargo within reporting or near range. --- You can use this event handler to post messages to players, or provide status updates etc. --- @param #AICargoDispatcherHelicopter self --- @param #string From A string that contains the "*from state name*" when the event was fired. --- @param #string Event A string that contains the "*event name*" when the event was fired. --- @param #string To A string that contains the "*to state name*" when the event was fired. --- @param Wrapper.Group#GROUP CarrierGroup The group object that contains the CarrierUnits. -function AICargoDispatcherHelicopter:OnAfterLoad( From, Event, To, CarrierGroup ) - - -- Write here your own code. - MESSAGE:NewType( "Group " .. CarrierGroup:GetName().. " is loading cargo.", MESSAGE.Type.Information ):ToAll() - -end - - ---- Loaded event handler OnAfter for AICargoDispatcherHelicopter. --- Use this event handler to tailor the event when a CarrierUnit of a CarrierGroup has loaded a cargo object. --- You can use this event handler to post messages to players, or provide status updates etc. --- Note that if more cargo objects were loading or boarding into the CarrierUnit, then this event can be triggered multiple times for each different Cargo/CarrierUnit. --- A CarrierUnit can be part of the larger CarrierGroup. --- @param #AICargoDispatcherHelicopter self --- @param #string From A string that contains the "*from state name*" when the event was triggered. --- @param #string Event A string that contains the "*event name*" when the event was triggered. --- @param #string To A string that contains the "*to state name*" when the event was triggered. --- @param Wrapper.Group#GROUP CarrierGroup The group object that contains the CarrierUnits. --- @param Cargo.Cargo#CARGO Cargo The cargo object. --- @param Wrapper.Unit#UNIT CarrierUnit The carrier unit that is executing the cargo loading operation. --- @param Core.Zone#ZONE_AIRBASE PickupZone (optional) The zone from where the cargo is picked up. Note that the zone is optional and may not be provided, but for AI_CARGO_DISPATCHER_AIRBASE there will always be a PickupZone, as the pickup location is an airbase zone. -function AICargoDispatcherHelicopter:OnAfterLoaded( From, Event, To, CarrierGroup, Cargo, CarrierUnit, PickupZone ) - - -- Write here your own code. - MESSAGE:NewType( "Group " .. CarrierGroup:GetName().. " has loaded cargo " .. Cargo:GetName(), MESSAGE.Type.Information ):ToAll() - -end - ---- Deploy Handler OnAfter for AI_CARGO_DISPATCHER. --- Use this event handler to tailor the event when a CarrierGroup is routed to a deploy coordinate, to Unload all cargo objects in each CarrierUnit. --- You can use this event handler to post messages to players, or provide status updates etc. --- @function OnAfterPickedUp --- @param self --- @param #string From A string that contains the "*from state name*" when the event was fired. --- @param #string Event A string that contains the "*event name*" when the event was fired. --- @param #string To A string that contains the "*to state name*" when the event was fired. --- @param Wrapper.Group#GROUP CarrierGroup The group object that contains the CarrierUnits. --- @param Core.Point#COORDINATE Coordinate The deploy coordinate. --- @param #number Speed The velocity in meters per second on which the CarrierGroup is routed towards the deploy Coordinate. --- @param #number Height Height in meters to move to the deploy coordinate. --- @param Core.Zone#ZONE DeployZone The zone wherein the cargo is deployed. This can be any zone type, like a ZONE, ZONE_GROUP, ZONE_AIRBASE. -function AICargoDispatcherHelicopter:OnAfterDeploy( From, Event, To, CarrierGroup, Coordinate, Speed, Height, DeployZone ) - - MESSAGE:NewType( "Group " .. CarrierGroup:GetName().. " is starting deployment of all cargo in zone " .. DeployZone:GetName(), MESSAGE.Type.Information ):ToAll() - -end - - - - - - - ---- Unloaded Handler OnAfter for AI_CARGO_DISPATCHER. --- Use this event handler to tailor the event when a CarrierUnit of a CarrierGroup has unloaded a cargo object. --- You can use this event handler to post messages to players, or provide status updates etc. --- Note that if more cargo objects were unloading or unboarding from the CarrierUnit, then this event can be fired multiple times for each different Cargo/CarrierUnit. --- A CarrierUnit can be part of the larger CarrierGroup. --- @function OnAfterUnloaded --- @param #AICargoDispatcherHelicopter self --- @param #string From A string that contains the "*from state name*" when the event was fired. --- @param #string Event A string that contains the "*event name*" when the event was fired. --- @param #string To A string that contains the "*to state name*" when the event was fired. --- @param Wrapper.Group#GROUP CarrierGroup The group object that contains the CarrierUnits. --- @param Cargo.Cargo#CARGO Cargo The cargo object. --- @param Wrapper.Unit#UNIT CarrierUnit The carrier unit that is executing the cargo unloading operation. --- @param Core.Zone#ZONE DeployZone The zone wherein the cargo is deployed. This can be any zone type, like a ZONE, ZONE_GROUP, ZONE_AIRBASE. -function AICargoDispatcherHelicopter:OnAfterUnloaded( From, Event, To, CarrierGroup, Cargo, CarrierUnit, DeployZone ) - - local CargoGroup = Cargo:GetObject() -- Wrapper.Group#GROUP - - -- Get the name of the DeployZone - local DeployZoneName = DeployZone:GetName() - - local DeployBuildingNames = { - ["Deploy A"] = "Building A", - ["Deploy B"] = "Building B", - ["Deploy C"] = "Building C", - } - - - -- Now board the infantry into the respective warehouse building. - if DeployZoneName then - local Building = STATIC:FindByName( DeployBuildingNames[DeployZoneName] ) - Cargo:__Board( 5, Building, 25 ) - end - - MESSAGE:NewType( "Group " .. CarrierGroup:GetName() .. ", Unit " .. CarrierUnit:GetName() .. " has unloaded cargo " .. Cargo:GetName() .. " in zone " .. DeployZone:GetName() .. " and cargo is moving to building " .. DeployBuildingNames[DeployZoneName], MESSAGE.Type.Information ):ToAll() - - -end - - ---- Deployed Handler OnAfter for AI_CARGO_DISPATCHER. --- Use this event handler to tailor the event when a carrier has deployed all cargo objects from the CarrierGroup. --- You can use this event handler to post messages to players, or provide status updates etc. --- @function OnAfterDeployed --- @param #AICargoDispatcherHelicopter self --- @param #string From A string that contains the "*from state name*" when the event was fired. --- @param #string Event A string that contains the "*event name*" when the event was fired. --- @param #string To A string that contains the "*to state name*" when the event was fired. --- @param Wrapper.Group#GROUP CarrierGroup The group object that contains the CarrierUnits. --- @param Core.Zone#ZONE DeployZone The zone wherein the cargo is deployed. This can be any zone type, like a ZONE, ZONE_GROUP, ZONE_AIRBASE. -function AICargoDispatcherHelicopter:OnAfterDeployed( From, Event, To, CarrierGroup, DeployZone ) - - MESSAGE:NewType( "Group " .. CarrierGroup:GetName() .. " deployed all cargo in zone " .. DeployZone:GetName(), MESSAGE.Type.Information ):ToAll() - -end - - ---- Home event handler OnAfter for AICargoDispatcherHelicopter. --- Use this event handler to tailor the event when a CarrierGroup is returning to the HomeZone, after it has deployed all cargo objects from the CarrierGroup. --- You can use this event handler to post messages to players, or provide status updates etc. --- If there is no HomeZone is specified, the CarrierGroup will stay at the current location after having deployed all cargo. --- @param #AICargoDispatcherHelicopter self --- @param #string From A string that contains the "*from state name*" when the event was triggered. --- @param #string Event A string that contains the "*event name*" when the event was triggered. --- @param #string To A string that contains the "*to state name*" when the event was triggered. --- @param Wrapper.Group#GROUP CarrierGroup The group object that contains the CarrierUnits. --- @param Core.Point#COORDINATE Coordinate The home coordinate the Carrier will arrive and stop it's activities. --- @param #number Speed The velocity in meters per second on which the CarrierGroup is routed towards the home Coordinate. --- @param #number Height Height in meters to move to the home coordinate. --- @param Core.Zone#ZONE HomeZone The zone wherein the carrier will return when all cargo has been transported. This can be any zone type, like a ZONE, ZONE_GROUP, ZONE_AIRBASE. -function AICargoDispatcherHelicopter:OnAfterHome( From, Event, To, CarrierGroup, Coordinate, Speed, Height, HomeZone ) - - MESSAGE:NewType( "Group " .. CarrierGroup:GetName() .. " deployed all cargo and going home to zone " .. HomeZone:GetName(), MESSAGE.Type.Detailed ):ToAll() - -end - - -AICargoDispatcherHelicopter:SetPickupRadius( 30, 10 ) -AICargoDispatcherHelicopter:SetDeployRadius( 200, 100 ) -AICargoDispatcherHelicopter:SetPickupSpeed( 300, 200 ) -AICargoDispatcherHelicopter:SetDeploySpeed( 300, 200 ) -AICargoDispatcherHelicopter:SetPickupHeight( 100, 30 ) -AICargoDispatcherHelicopter:SetDeployHeight( 100, 30 ) - -AICargoDispatcherHelicopter:__Start( 10 ) +--- +-- Name: AID-CGO-250 - Helicopter - Front-Line Enforcements +-- Author: FlightControl +-- Date Created: 20 Sep 2018 +-- +-- Demonstrates the way how front-line enforcements can be setup using helicopter transportations. + +local SetCargoInfantry = SET_CARGO:New():FilterTypes( "Infantry" ):FilterStart() +local SetHelicopter = SET_GROUP:New():FilterPrefixes( "Helicopter" ):FilterStart() +local SetPickupZones = SET_ZONE:New():FilterPrefixes( "Pickup" ):FilterStart() +local SetDeployZones = SET_ZONE:New():FilterPrefixes( "Defense" ):FilterStart() + +AICargoDispatcherHelicopter = AI_CARGO_DISPATCHER_HELICOPTER:New( SetHelicopter, SetCargoInfantry, SetPickupZones, SetDeployZones ) +AICargoDispatcherHelicopter:SetHomeZone( ZONE:FindByName( "Home" ) ) + + +-- Here we setup the spawning of Infantry. +SpawnCargoInfantry = SPAWN + :New( "Infantry" ) + :InitLimit( 40, 60 ) + :InitRandomizeZones( { ZONE_POLYGON:NewFromGroupName( "Pickup Location" ) } ) + :OnSpawnGroup( + function( SpawnGroup ) + -- This will automatically add also the CargoInfantry object to the SetCargoInfantry (in the background through the event system). + local CargoInfantry = CARGO_GROUP:New( SpawnGroup, "Infantry", SpawnGroup:GetName(), 150 ) + end + ) + :SpawnScheduled( 60, 0.5 ) + +-- Now we create 4 zones based on GROUP objects within the battlefield, which form the front line defense points. +local ZoneDefense1 = ZONE_GROUP:New( "Defense 1", GROUP:FindByName("Defense #001"), 1500 ) +local ZoneDefense2 = ZONE_GROUP:New( "Defense 2", GROUP:FindByName("Defense #002"), 1500 ) +local ZoneDefense3 = ZONE_GROUP:New( "Defense 3", GROUP:FindByName("Defense #003"), 1500 ) +local ZoneDefense4 = ZONE_GROUP:New( "Defense 4", GROUP:FindByName("Defense #004"), 1500 ) + + +-- Here we setup the spawning of Helicopters. + + + +--- Pickup Handler OnAfter for AICargoDispatcherHelicopter. +-- Use this event handler to tailor the event when a CarrierGroup is routed towards a new pickup Coordinate and a specified Speed. +-- You can use this event handler to post messages to players, or provide status updates etc. +-- @param #AICargoDispatcherAirplanes self +-- @param #string From A string that contains the "*from state name*" when the event was fired. +-- @param #string Event A string that contains the "*event name*" when the event was fired. +-- @param #string To A string that contains the "*to state name*" when the event was fired. +-- @param Wrapper.Group#GROUP CarrierGroup The group object that contains the CarrierUnits. +-- @param Core.Point#COORDINATE Coordinate The coordinate of the pickup location. +-- @param #number Speed The velocity in meters per second on which the CarrierGroup is routed towards the pickup Coordinate. +-- @param #number Height Height in meters to move to the pickup coordinate. +function AICargoDispatcherHelicopter:OnAfterPickup( From, Event, To, CarrierGroup, Coordinate, Speed, Height ) + + -- Write here your own code. + MESSAGE:NewType( "Group " .. CarrierGroup:GetName().. " is picking up cargo.", MESSAGE.Type.Information ):ToAll() + + +end + + +--- Load Handler OnAfter for AICargoDispatcherHelicopter. +-- Use this event handler to tailor the event when a CarrierGroup has initiated the loading or boarding of cargo within reporting or near range. +-- You can use this event handler to post messages to players, or provide status updates etc. +-- @param #AICargoDispatcherHelicopter self +-- @param #string From A string that contains the "*from state name*" when the event was fired. +-- @param #string Event A string that contains the "*event name*" when the event was fired. +-- @param #string To A string that contains the "*to state name*" when the event was fired. +-- @param Wrapper.Group#GROUP CarrierGroup The group object that contains the CarrierUnits. +function AICargoDispatcherHelicopter:OnAfterLoad( From, Event, To, CarrierGroup ) + + -- Write here your own code. + MESSAGE:NewType( "Group " .. CarrierGroup:GetName().. " is loading cargo.", MESSAGE.Type.Information ):ToAll() + +end + + +--- Loaded event handler OnAfter for AICargoDispatcherHelicopter. +-- Use this event handler to tailor the event when a CarrierUnit of a CarrierGroup has loaded a cargo object. +-- You can use this event handler to post messages to players, or provide status updates etc. +-- Note that if more cargo objects were loading or boarding into the CarrierUnit, then this event can be triggered multiple times for each different Cargo/CarrierUnit. +-- A CarrierUnit can be part of the larger CarrierGroup. +-- @param #AICargoDispatcherHelicopter self +-- @param #string From A string that contains the "*from state name*" when the event was triggered. +-- @param #string Event A string that contains the "*event name*" when the event was triggered. +-- @param #string To A string that contains the "*to state name*" when the event was triggered. +-- @param Wrapper.Group#GROUP CarrierGroup The group object that contains the CarrierUnits. +-- @param Cargo.Cargo#CARGO Cargo The cargo object. +-- @param Wrapper.Unit#UNIT CarrierUnit The carrier unit that is executing the cargo loading operation. +-- @param Core.Zone#ZONE_AIRBASE PickupZone (optional) The zone from where the cargo is picked up. Note that the zone is optional and may not be provided, but for AI_CARGO_DISPATCHER_AIRBASE there will always be a PickupZone, as the pickup location is an airbase zone. +function AICargoDispatcherHelicopter:OnAfterLoaded( From, Event, To, CarrierGroup, Cargo, CarrierUnit, PickupZone ) + + -- Write here your own code. + MESSAGE:NewType( "Group " .. CarrierGroup:GetName().. " has loaded cargo " .. Cargo:GetName(), MESSAGE.Type.Information ):ToAll() + +end + +--- Deploy Handler OnAfter for AI_CARGO_DISPATCHER. +-- Use this event handler to tailor the event when a CarrierGroup is routed to a deploy coordinate, to Unload all cargo objects in each CarrierUnit. +-- You can use this event handler to post messages to players, or provide status updates etc. +-- @function OnAfterPickedUp +-- @param self +-- @param #string From A string that contains the "*from state name*" when the event was fired. +-- @param #string Event A string that contains the "*event name*" when the event was fired. +-- @param #string To A string that contains the "*to state name*" when the event was fired. +-- @param Wrapper.Group#GROUP CarrierGroup The group object that contains the CarrierUnits. +-- @param Core.Point#COORDINATE Coordinate The deploy coordinate. +-- @param #number Speed The velocity in meters per second on which the CarrierGroup is routed towards the deploy Coordinate. +-- @param #number Height Height in meters to move to the deploy coordinate. +-- @param Core.Zone#ZONE DeployZone The zone wherein the cargo is deployed. This can be any zone type, like a ZONE, ZONE_GROUP, ZONE_AIRBASE. +function AICargoDispatcherHelicopter:OnAfterDeploy( From, Event, To, CarrierGroup, Coordinate, Speed, Height, DeployZone ) + + MESSAGE:NewType( "Group " .. CarrierGroup:GetName().. " is starting deployment of all cargo in zone " .. DeployZone:GetName(), MESSAGE.Type.Information ):ToAll() + +end + + + + + + + +--- Unloaded Handler OnAfter for AI_CARGO_DISPATCHER. +-- Use this event handler to tailor the event when a CarrierUnit of a CarrierGroup has unloaded a cargo object. +-- You can use this event handler to post messages to players, or provide status updates etc. +-- Note that if more cargo objects were unloading or unboarding from the CarrierUnit, then this event can be fired multiple times for each different Cargo/CarrierUnit. +-- A CarrierUnit can be part of the larger CarrierGroup. +-- @function OnAfterUnloaded +-- @param #AICargoDispatcherHelicopter self +-- @param #string From A string that contains the "*from state name*" when the event was fired. +-- @param #string Event A string that contains the "*event name*" when the event was fired. +-- @param #string To A string that contains the "*to state name*" when the event was fired. +-- @param Wrapper.Group#GROUP CarrierGroup The group object that contains the CarrierUnits. +-- @param Cargo.Cargo#CARGO Cargo The cargo object. +-- @param Wrapper.Unit#UNIT CarrierUnit The carrier unit that is executing the cargo unloading operation. +-- @param Core.Zone#ZONE DeployZone The zone wherein the cargo is deployed. This can be any zone type, like a ZONE, ZONE_GROUP, ZONE_AIRBASE. +function AICargoDispatcherHelicopter:OnAfterUnloaded( From, Event, To, CarrierGroup, Cargo, CarrierUnit, DeployZone ) + + local CargoGroup = Cargo:GetObject() -- Wrapper.Group#GROUP + + -- Get the name of the DeployZone + local DeployZoneName = DeployZone:GetName() + + local DeployBuildingNames = { + ["Deploy A"] = "Building A", + ["Deploy B"] = "Building B", + ["Deploy C"] = "Building C", + } + + + -- Now board the infantry into the respective warehouse building. + if DeployZoneName then + local Building = STATIC:FindByName( DeployBuildingNames[DeployZoneName] ) + Cargo:__Board( 5, Building, 25 ) + end + + MESSAGE:NewType( "Group " .. CarrierGroup:GetName() .. ", Unit " .. CarrierUnit:GetName() .. " has unloaded cargo " .. Cargo:GetName() .. " in zone " .. DeployZone:GetName() .. " and cargo is moving to building " .. DeployBuildingNames[DeployZoneName], MESSAGE.Type.Information ):ToAll() + + +end + + +--- Deployed Handler OnAfter for AI_CARGO_DISPATCHER. +-- Use this event handler to tailor the event when a carrier has deployed all cargo objects from the CarrierGroup. +-- You can use this event handler to post messages to players, or provide status updates etc. +-- @function OnAfterDeployed +-- @param #AICargoDispatcherHelicopter self +-- @param #string From A string that contains the "*from state name*" when the event was fired. +-- @param #string Event A string that contains the "*event name*" when the event was fired. +-- @param #string To A string that contains the "*to state name*" when the event was fired. +-- @param Wrapper.Group#GROUP CarrierGroup The group object that contains the CarrierUnits. +-- @param Core.Zone#ZONE DeployZone The zone wherein the cargo is deployed. This can be any zone type, like a ZONE, ZONE_GROUP, ZONE_AIRBASE. +function AICargoDispatcherHelicopter:OnAfterDeployed( From, Event, To, CarrierGroup, DeployZone ) + + MESSAGE:NewType( "Group " .. CarrierGroup:GetName() .. " deployed all cargo in zone " .. DeployZone:GetName(), MESSAGE.Type.Information ):ToAll() + +end + + +--- Home event handler OnAfter for AICargoDispatcherHelicopter. +-- Use this event handler to tailor the event when a CarrierGroup is returning to the HomeZone, after it has deployed all cargo objects from the CarrierGroup. +-- You can use this event handler to post messages to players, or provide status updates etc. +-- If there is no HomeZone is specified, the CarrierGroup will stay at the current location after having deployed all cargo. +-- @param #AICargoDispatcherHelicopter self +-- @param #string From A string that contains the "*from state name*" when the event was triggered. +-- @param #string Event A string that contains the "*event name*" when the event was triggered. +-- @param #string To A string that contains the "*to state name*" when the event was triggered. +-- @param Wrapper.Group#GROUP CarrierGroup The group object that contains the CarrierUnits. +-- @param Core.Point#COORDINATE Coordinate The home coordinate the Carrier will arrive and stop it's activities. +-- @param #number Speed The velocity in meters per second on which the CarrierGroup is routed towards the home Coordinate. +-- @param #number Height Height in meters to move to the home coordinate. +-- @param Core.Zone#ZONE HomeZone The zone wherein the carrier will return when all cargo has been transported. This can be any zone type, like a ZONE, ZONE_GROUP, ZONE_AIRBASE. +function AICargoDispatcherHelicopter:OnAfterHome( From, Event, To, CarrierGroup, Coordinate, Speed, Height, HomeZone ) + + MESSAGE:NewType( "Group " .. CarrierGroup:GetName() .. " deployed all cargo and going home to zone " .. HomeZone:GetName(), MESSAGE.Type.Detailed ):ToAll() + +end + + +AICargoDispatcherHelicopter:SetPickupRadius( 30, 10 ) +AICargoDispatcherHelicopter:SetDeployRadius( 200, 100 ) +AICargoDispatcherHelicopter:SetPickupSpeed( 300, 200 ) +AICargoDispatcherHelicopter:SetDeploySpeed( 300, 200 ) +AICargoDispatcherHelicopter:SetPickupHeight( 100, 30 ) +AICargoDispatcherHelicopter:SetDeployHeight( 100, 30 ) + +AICargoDispatcherHelicopter:ScheduleOnce( 10, AICargoDispatcherHelicopter.Start, AICargoDispatcherHelicopter ) diff --git a/AID - AI Dispatching/AID-CGO - AI Cargo Dispatching/AID-CGO-250 - Helicopter - Front-Line Enforcements/AID-CGO-250 - Helicopter - Front-Line Enforcements.miz b/AID - AI Dispatching/AID-CGO - AI Cargo Dispatching/AID-CGO-250 - Helicopter - Front-Line Enforcements/AID-CGO-250 - Helicopter - Front-Line Enforcements.miz index f957bd3ab9..4bb2c68318 100644 Binary files a/AID - AI Dispatching/AID-CGO - AI Cargo Dispatching/AID-CGO-250 - Helicopter - Front-Line Enforcements/AID-CGO-250 - Helicopter - Front-Line Enforcements.miz and b/AID - AI Dispatching/AID-CGO - AI Cargo Dispatching/AID-CGO-250 - Helicopter - Front-Line Enforcements/AID-CGO-250 - Helicopter - Front-Line Enforcements.miz differ diff --git a/AID - AI Dispatching/AID-CGO - AI Cargo Dispatching/AID-CGO-300 - Airplane - Pickup and Deploy/AID-CGO-300 - Airplane - Pickup and Deploy.lua b/AID - AI Dispatching/AID-CGO - AI Cargo Dispatching/AID-CGO-300 - Airplane - Pickup and Deploy/AID-CGO-300 - Airplane - Pickup and Deploy.lua index b4c9bbfc90..ab2569dda2 100644 --- a/AID - AI Dispatching/AID-CGO - AI Cargo Dispatching/AID-CGO-300 - Airplane - Pickup and Deploy/AID-CGO-300 - Airplane - Pickup and Deploy.lua +++ b/AID - AI Dispatching/AID-CGO - AI Cargo Dispatching/AID-CGO-300 - Airplane - Pickup and Deploy/AID-CGO-300 - Airplane - Pickup and Deploy.lua @@ -1,17 +1,17 @@ ---- --- Name: AID-CGO-300 - Airplane - Pickup and Deploy --- Author: FlightControl --- Date Created: 02 Aug 2018 --- - -local CargoInfantrySet = SET_CARGO:New():FilterTypes( "Infantry" ):FilterStart() -local AirplanesSet = SET_GROUP:New():FilterPrefixes( "Airplane" ):FilterStart() -local PickupZoneSet = SET_ZONE:New() -local DeployZoneSet = SET_ZONE:New() - -PickupZoneSet:AddZone( ZONE_AIRBASE:New( AIRBASE.Caucasus.Gudauta ) ) -DeployZoneSet:AddZone( ZONE_AIRBASE:New( AIRBASE.Caucasus.Sochi_Adler ) ) - -AICargoDispatcherAirplanes = AI_CARGO_DISPATCHER_AIRPLANE:New( AirplanesSet, CargoInfantrySet, PickupZoneSet, DeployZoneSet ) -AICargoDispatcherAirplanes:Start() - +--- +-- Name: AID-CGO-300 - Airplane - Pickup and Deploy +-- Author: FlightControl +-- Date Created: 02 Aug 2018 +-- + +local CargoInfantrySet = SET_CARGO:New():FilterTypes( "Infantry" ):FilterStart() +local AirplanesSet = SET_GROUP:New():FilterPrefixes( "Airplane" ):FilterStart() +local PickupZoneSet = SET_ZONE:New() +local DeployZoneSet = SET_ZONE:New() + +PickupZoneSet:AddZone( ZONE_AIRBASE:New( AIRBASE.Caucasus.Gudauta ) ) +DeployZoneSet:AddZone( ZONE_AIRBASE:New( AIRBASE.Caucasus.Sochi_Adler ) ) + +AICargoDispatcherAirplanes = AI_CARGO_DISPATCHER_AIRPLANE:New( AirplanesSet, CargoInfantrySet, PickupZoneSet, DeployZoneSet ) +AICargoDispatcherAirplanes:Start() + diff --git a/AID - AI Dispatching/AID-CGO - AI Cargo Dispatching/AID-CGO-300 - Airplane - Pickup and Deploy/AID-CGO-300 - Airplane - Pickup and Deploy.miz b/AID - AI Dispatching/AID-CGO - AI Cargo Dispatching/AID-CGO-300 - Airplane - Pickup and Deploy/AID-CGO-300 - Airplane - Pickup and Deploy.miz index 6abe24e9c0..2b212d9462 100644 Binary files a/AID - AI Dispatching/AID-CGO - AI Cargo Dispatching/AID-CGO-300 - Airplane - Pickup and Deploy/AID-CGO-300 - Airplane - Pickup and Deploy.miz and b/AID - AI Dispatching/AID-CGO - AI Cargo Dispatching/AID-CGO-300 - Airplane - Pickup and Deploy/AID-CGO-300 - Airplane - Pickup and Deploy.miz differ diff --git a/AID - AI Dispatching/AID-CGO - AI Cargo Dispatching/AID-CGO-310 - Airplane - Pickup and Deploy Multiple/AID-CGO-310 - Airplane - Pickup and Deploy Multiple.lua b/AID - AI Dispatching/AID-CGO - AI Cargo Dispatching/AID-CGO-310 - Airplane - Pickup and Deploy Multiple/AID-CGO-310 - Airplane - Pickup and Deploy Multiple.lua index af6f24ff04..7cb8115c85 100644 --- a/AID - AI Dispatching/AID-CGO - AI Cargo Dispatching/AID-CGO-310 - Airplane - Pickup and Deploy Multiple/AID-CGO-310 - Airplane - Pickup and Deploy Multiple.lua +++ b/AID - AI Dispatching/AID-CGO - AI Cargo Dispatching/AID-CGO-310 - Airplane - Pickup and Deploy Multiple/AID-CGO-310 - Airplane - Pickup and Deploy Multiple.lua @@ -1,21 +1,21 @@ ---- --- Name: AID-CGO-310 - Airplane - Pickup and Deploy Multiple --- Author: FlightControl --- Date Created: 03 Aug 2018 --- - -local CargoInfantrySet = SET_CARGO:New():FilterTypes( "Infantry" ):FilterStart() -local AirplanesSet = SET_GROUP:New():FilterPrefixes( "Airplane" ):FilterStart() -local PickupZoneSet = SET_ZONE:New() -local DeployZoneSet = SET_ZONE:New() - -PickupZoneSet:AddZone( ZONE_AIRBASE:New( AIRBASE.Caucasus.Gudauta ) ) -DeployZoneSet:AddZone( ZONE_AIRBASE:New( AIRBASE.Caucasus.Sochi_Adler ) ) - -AICargoDispatcherAirplanes = AI_CARGO_DISPATCHER_AIRPLANE:New( AirplanesSet, CargoInfantrySet, PickupZoneSet, DeployZoneSet ) -AICargoDispatcherAirplanes:Start() - -for CargoName, Cargo in pairs( CargoInfantrySet:GetSet() ) do - AICargoDispatcherAirplanes:I( { Cargo = Cargo:GetName() } ) -end - +--- +-- Name: AID-CGO-310 - Airplane - Pickup and Deploy Multiple +-- Author: FlightControl +-- Date Created: 03 Aug 2018 +-- + +local CargoInfantrySet = SET_CARGO:New():FilterTypes( "Infantry" ):FilterStart() +local AirplanesSet = SET_GROUP:New():FilterPrefixes( "Airplane" ):FilterStart() +local PickupZoneSet = SET_ZONE:New() +local DeployZoneSet = SET_ZONE:New() + +PickupZoneSet:AddZone( ZONE_AIRBASE:New( AIRBASE.Caucasus.Gudauta ) ) +DeployZoneSet:AddZone( ZONE_AIRBASE:New( AIRBASE.Caucasus.Sochi_Adler ) ) + +AICargoDispatcherAirplanes = AI_CARGO_DISPATCHER_AIRPLANE:New( AirplanesSet, CargoInfantrySet, PickupZoneSet, DeployZoneSet ) +AICargoDispatcherAirplanes:Start() + +for CargoName, Cargo in pairs( CargoInfantrySet:GetSet() ) do + AICargoDispatcherAirplanes:I( { Cargo = Cargo:GetName() } ) +end + diff --git a/AID - AI Dispatching/AID-CGO - AI Cargo Dispatching/AID-CGO-310 - Airplane - Pickup and Deploy Multiple/AID-CGO-310 - Airplane - Pickup and Deploy Multiple.miz b/AID - AI Dispatching/AID-CGO - AI Cargo Dispatching/AID-CGO-310 - Airplane - Pickup and Deploy Multiple/AID-CGO-310 - Airplane - Pickup and Deploy Multiple.miz index a5cec7797d..dd6877a65d 100644 Binary files a/AID - AI Dispatching/AID-CGO - AI Cargo Dispatching/AID-CGO-310 - Airplane - Pickup and Deploy Multiple/AID-CGO-310 - Airplane - Pickup and Deploy Multiple.miz and b/AID - AI Dispatching/AID-CGO - AI Cargo Dispatching/AID-CGO-310 - Airplane - Pickup and Deploy Multiple/AID-CGO-310 - Airplane - Pickup and Deploy Multiple.miz differ diff --git a/AID - AI Dispatching/AID-CGO - AI Cargo Dispatching/AID-CGO-340 - Airplane - Event Handling/AID-CGO-340 - Airplane - Event Handling.lua b/AID - AI Dispatching/AID-CGO - AI Cargo Dispatching/AID-CGO-340 - Airplane - Event Handling/AID-CGO-340 - Airplane - Event Handling.lua index 8424c0d461..2cd5cc7804 100644 --- a/AID - AI Dispatching/AID-CGO - AI Cargo Dispatching/AID-CGO-340 - Airplane - Event Handling/AID-CGO-340 - Airplane - Event Handling.lua +++ b/AID - AI Dispatching/AID-CGO - AI Cargo Dispatching/AID-CGO-340 - Airplane - Event Handling/AID-CGO-340 - Airplane - Event Handling.lua @@ -1,153 +1,153 @@ ---- --- Name: AID-CGO-340 - Airplane - Event Handling --- Author: FlightControl --- Date Created: 02 Aug 2018 --- - -local CargoInfantrySet = SET_CARGO:New():FilterTypes( "Infantry" ):FilterStart() -local AirplanesSet = SET_GROUP:New():FilterPrefixes( "Airplane" ):FilterStart() -local PickupZoneSet = SET_ZONE:New() -local DeployZoneSet = SET_ZONE:New() - -PickupZoneSet:AddZone( ZONE_AIRBASE:New( AIRBASE.Caucasus.Gudauta ) ) -DeployZoneSet:AddZone( ZONE_AIRBASE:New( AIRBASE.Caucasus.Sochi_Adler ) ) -DeployZoneSet:AddZone( ZONE_AIRBASE:New( AIRBASE.Caucasus.Maykop_Khanskaya ) ) -DeployZoneSet:AddZone( ZONE_AIRBASE:New( AIRBASE.Caucasus.Mineralnye_Vody ) ) -DeployZoneSet:AddZone( ZONE_AIRBASE:New( AIRBASE.Caucasus.Vaziani ) ) - -AICargoDispatcherAirplanes = AI_CARGO_DISPATCHER_AIRPLANE:New( AirplanesSet, CargoInfantrySet, PickupZoneSet, DeployZoneSet ) -AICargoDispatcherAirplanes:SetHomeZone( ZONE_AIRBASE:New( AIRBASE.Caucasus.Kobuleti ) ) - ---- Pickup Handler OnAfter for AICargoDispatcherAirplanes. --- Use this event handler to tailor the event when a CarrierGroup is routed towards a new pickup Coordinate and a specified Speed. --- You can use this event handler to post messages to players, or provide status updates etc. --- @param #AICargoDispatcherAirplanes self --- @param #string From A string that contains the "*from state name*" when the event was fired. --- @param #string Event A string that contains the "*event name*" when the event was fired. --- @param #string To A string that contains the "*to state name*" when the event was fired. --- @param Wrapper.Group#GROUP CarrierGroup The group object that contains the CarrierUnits. --- @param Core.Point#COORDINATE Coordinate The coordinate of the pickup location. --- @param #number Speed The velocity in meters per second on which the CarrierGroup is routed towards the pickup Coordinate. --- @param #number Height Height in meters to move to the pickup coordinate. --- @param Core.Zone#ZONE_AIRBASE PickupZone (optional) The zone from where the cargo is picked up. Note that the zone is optional and may not be provided, but for AI_CARGO_DISPATCHER_AIRBASE there will always be a PickupZone, as the pickup location is an airbase zone. -function AICargoDispatcherAirplanes:OnAfterPickup( From, Event, To, CarrierGroup, Coordinate, Speed, Height, PickupZone ) - - -- Write here your own code. - MESSAGE:NewType( "Group " .. CarrierGroup:GetName().. " is picking up cargo at airbase " .. PickupZone:GetName(), MESSAGE.Type.Information ):ToAll() - - -end - - ---- Load Handler OnAfter for AICargoDispatcherAirplanes. --- Use this event handler to tailor the event when a CarrierGroup has initiated the loading or boarding of cargo within reporting or near range. --- You can use this event handler to post messages to players, or provide status updates etc. --- @param #AICargoDispatcherAirplanes self --- @param #string From A string that contains the "*from state name*" when the event was fired. --- @param #string Event A string that contains the "*event name*" when the event was fired. --- @param #string To A string that contains the "*to state name*" when the event was fired. --- @param Wrapper.Group#GROUP CarrierGroup The group object that contains the CarrierUnits. --- @param Core.Zone#ZONE_AIRBASE PickupZone (optional) The zone from where the cargo is picked up. Note that the zone is optional and may not be provided, but for AI_CARGO_DISPATCHER_AIRBASE there will always be a PickupZone, as the pickup location is an airbase zone. -function AICargoDispatcherAirplanes:OnAfterLoad( From, Event, To, CarrierGroup, PickupZone ) - - -- Write here your own code. - MESSAGE:NewType( "Group " .. CarrierGroup:GetName().. " is loading cargo at airbase " .. PickupZone:GetName(), MESSAGE.Type.Information ):ToAll() - -end - ---- PickedUp Handler OnAfter for AICargoDispatcherAirplanes. --- Use this event handler to tailor the event when a carrier has picked up all cargo objects into the CarrierGroup. --- You can use this event handler to post messages to players, or provide status updates etc. --- @param #AICargoDispatcherAirplanes self --- @param #string From A string that contains the "*from state name*" when the event was fired. --- @param #string Event A string that contains the "*event name*" when the event was fired. --- @param #string To A string that contains the "*to state name*" when the event was fired. --- @param Wrapper.Group#GROUP CarrierGroup The group object that contains the CarrierUnits. --- @param Core.Zone#ZONE_AIRBASE PickupZone (optional) The zone from where the cargo is picked up. Note that the zone is optional and may not be provided, but for AI_CARGO_DISPATCHER_AIRBASE there will always be a PickupZone, as the pickup location is an airbase zone. -function AICargoDispatcherAirplanes:OnAfterPickedUp( From, Event, To, CarrierGroup, PickupZone ) - - -- Write here your own code. - -- Write here your own code. - MESSAGE:NewType( "Group " .. CarrierGroup:GetName().. " has loaded all cargo at airbase " .. PickupZone:GetName(), MESSAGE.Type.Information ):ToAll() - -end - - ---- Deploy Handler OnAfter for AICargoDispatcherAirplanes. --- Use this event handler to tailor the event when a CarrierGroup is routed to a deploy coordinate, to Unload all cargo objects in each CarrierUnit. --- You can use this event handler to post messages to players, or provide status updates etc. --- @function OnAfterDeploy --- @param #AICargoDispatcherAirplanes self --- @param #string From A string that contains the "*from state name*" when the event was fired. --- @param #string Event A string that contains the "*event name*" when the event was fired. --- @param #string To A string that contains the "*to state name*" when the event was fired. --- @param Wrapper.Group#GROUP CarrierGroup The group object that contains the CarrierUnits. --- @param Core.Point#COORDINATE Coordinate The deploy coordinate. --- @param #number Speed The velocity in meters per second on which the CarrierGroup is routed towards the deploy Coordinate. --- @param #number Height Height in meters to move to the deploy coordinate. --- @param Core.Zone#ZONE DeployZone The zone wherein the cargo is deployed. This can be any zone type, like a ZONE, ZONE_GROUP, ZONE_AIRBASE. -function AICargoDispatcherAirplanes:OnAfterDeploy( From, Event, To, CarrierGroup, Coordinate, Speed, Height, DeployZone ) - - -- Write here your own code. - MESSAGE:NewType( "Group " .. CarrierGroup:GetName().. " is starting deployment of all cargo in zone " .. DeployZone:GetName(), MESSAGE.Type.Information ):ToAll() - -end - - ---- Unloaded Handler OnAfter for AICargoDispatcherAirplanes. --- Use this event handler to tailor the event when a CarrierUnit of a CarrierGroup has unloaded a cargo object. --- You can use this event handler to post messages to players, or provide status updates etc. --- Note that if more cargo objects were unloading or unboarding from the CarrierUnit, then this event can be fired multiple times for each different Cargo/CarrierUnit. --- A CarrierUnit can be part of the larger CarrierGroup. --- @function OnAfterUnloaded --- @param #AICargoDispatcherAirplanes self --- @param #string From A string that contains the "*from state name*" when the event was fired. --- @param #string Event A string that contains the "*event name*" when the event was fired. --- @param #string To A string that contains the "*to state name*" when the event was fired. --- @param Wrapper.Group#GROUP CarrierGroup The group object that contains the CarrierUnits. --- @param Cargo.Cargo#CARGO Cargo The cargo object. --- @param Wrapper.Unit#UNIT CarrierUnit The carrier unit that is executing the cargo unloading operation. --- @param Core.Zone#ZONE DeployZone The zone wherein the cargo is deployed. This can be any zone type, like a ZONE, ZONE_GROUP, ZONE_AIRBASE. -function AICargoDispatcherAirplanes:OnAfterUnloaded( From, Event, To, CarrierGroup, Cargo, CarrierUnit, DeployZone ) - - -- Write here your own code. - local CargoGroup = Cargo:GetObject() -- Wrapper.Group#GROUP - - -- Get the name of the DeployZone - local DeployZoneName = DeployZone:GetName() - - local DeployBuildingNames = { - ["Deploy A"] = "Building A", - } - - - -- Now board the infantry into the respective warehouse building. - if DeployZoneName then - local Building = STATIC:FindByName( DeployBuildingNames[DeployZoneName] ) - Cargo:__Board( 5, Building, 25 ) - end - - MESSAGE:NewType( "Group " .. CarrierGroup:GetName() .. ", Unit " .. CarrierUnit:GetName() .. " has unloaded cargo " .. Cargo:GetName() .. " in zone " .. DeployZone:GetName() .. " and cargo is moving to building " .. DeployBuildingNames[DeployZoneName], MESSAGE.Type.Information ):ToAll() - - -end - - ---- Deployed Handler OnAfter for AICargoDispatcherAirplanes. --- @function OnAfterDeployed --- @param #AICargoDispatcherAirplanes self --- @param #string From A string that contains the "*from state name*" when the event was fired. --- @param #string Event A string that contains the "*event name*" when the event was fired. --- @param #string To A string that contains the "*to state name*" when the event was fired. --- @param Wrapper.Group#GROUP CarrierGroup The group object that contains the CarrierUnits. --- @param Core.Zone#ZONE DeployZone The zone wherein the cargo is deployed. This can be any zone type, like a ZONE, ZONE_GROUP, ZONE_AIRBASE. -function AICargoDispatcherAirplanes:OnAfterDeployed( From, Event, To, CarrierGroup, DeployZone ) - - -- Write here your own code. - MESSAGE:NewType( "Group " .. CarrierGroup:GetName() .. " deployed all cargo in zone " .. DeployZone:GetName(), MESSAGE.Type.Information ):ToAll() - -end - - -AICargoDispatcherAirplanes:Start() - +--- +-- Name: AID-CGO-340 - Airplane - Event Handling +-- Author: FlightControl +-- Date Created: 02 Aug 2018 +-- + +local CargoInfantrySet = SET_CARGO:New():FilterTypes( "Infantry" ):FilterStart() +local AirplanesSet = SET_GROUP:New():FilterPrefixes( "Airplane" ):FilterStart() +local PickupZoneSet = SET_ZONE:New() +local DeployZoneSet = SET_ZONE:New() + +PickupZoneSet:AddZone( ZONE_AIRBASE:New( AIRBASE.Caucasus.Gudauta ) ) +DeployZoneSet:AddZone( ZONE_AIRBASE:New( AIRBASE.Caucasus.Sochi_Adler ) ) +DeployZoneSet:AddZone( ZONE_AIRBASE:New( AIRBASE.Caucasus.Maykop_Khanskaya ) ) +DeployZoneSet:AddZone( ZONE_AIRBASE:New( AIRBASE.Caucasus.Mineralnye_Vody ) ) +DeployZoneSet:AddZone( ZONE_AIRBASE:New( AIRBASE.Caucasus.Vaziani ) ) + +AICargoDispatcherAirplanes = AI_CARGO_DISPATCHER_AIRPLANE:New( AirplanesSet, CargoInfantrySet, PickupZoneSet, DeployZoneSet ) +AICargoDispatcherAirplanes:SetHomeZone( ZONE_AIRBASE:New( AIRBASE.Caucasus.Kobuleti ) ) + +--- Pickup Handler OnAfter for AICargoDispatcherAirplanes. +-- Use this event handler to tailor the event when a CarrierGroup is routed towards a new pickup Coordinate and a specified Speed. +-- You can use this event handler to post messages to players, or provide status updates etc. +-- @param #AICargoDispatcherAirplanes self +-- @param #string From A string that contains the "*from state name*" when the event was fired. +-- @param #string Event A string that contains the "*event name*" when the event was fired. +-- @param #string To A string that contains the "*to state name*" when the event was fired. +-- @param Wrapper.Group#GROUP CarrierGroup The group object that contains the CarrierUnits. +-- @param Core.Point#COORDINATE Coordinate The coordinate of the pickup location. +-- @param #number Speed The velocity in meters per second on which the CarrierGroup is routed towards the pickup Coordinate. +-- @param #number Height Height in meters to move to the pickup coordinate. +-- @param Core.Zone#ZONE_AIRBASE PickupZone (optional) The zone from where the cargo is picked up. Note that the zone is optional and may not be provided, but for AI_CARGO_DISPATCHER_AIRBASE there will always be a PickupZone, as the pickup location is an airbase zone. +function AICargoDispatcherAirplanes:OnAfterPickup( From, Event, To, CarrierGroup, Coordinate, Speed, Height, PickupZone ) + + -- Write here your own code. + MESSAGE:NewType( "Group " .. CarrierGroup:GetName().. " is picking up cargo at airbase " .. PickupZone:GetName(), MESSAGE.Type.Information ):ToAll() + + +end + + +--- Load Handler OnAfter for AICargoDispatcherAirplanes. +-- Use this event handler to tailor the event when a CarrierGroup has initiated the loading or boarding of cargo within reporting or near range. +-- You can use this event handler to post messages to players, or provide status updates etc. +-- @param #AICargoDispatcherAirplanes self +-- @param #string From A string that contains the "*from state name*" when the event was fired. +-- @param #string Event A string that contains the "*event name*" when the event was fired. +-- @param #string To A string that contains the "*to state name*" when the event was fired. +-- @param Wrapper.Group#GROUP CarrierGroup The group object that contains the CarrierUnits. +-- @param Core.Zone#ZONE_AIRBASE PickupZone (optional) The zone from where the cargo is picked up. Note that the zone is optional and may not be provided, but for AI_CARGO_DISPATCHER_AIRBASE there will always be a PickupZone, as the pickup location is an airbase zone. +function AICargoDispatcherAirplanes:OnAfterLoad( From, Event, To, CarrierGroup, PickupZone ) + + -- Write here your own code. + MESSAGE:NewType( "Group " .. CarrierGroup:GetName().. " is loading cargo at airbase " .. PickupZone:GetName(), MESSAGE.Type.Information ):ToAll() + +end + +--- PickedUp Handler OnAfter for AICargoDispatcherAirplanes. +-- Use this event handler to tailor the event when a carrier has picked up all cargo objects into the CarrierGroup. +-- You can use this event handler to post messages to players, or provide status updates etc. +-- @param #AICargoDispatcherAirplanes self +-- @param #string From A string that contains the "*from state name*" when the event was fired. +-- @param #string Event A string that contains the "*event name*" when the event was fired. +-- @param #string To A string that contains the "*to state name*" when the event was fired. +-- @param Wrapper.Group#GROUP CarrierGroup The group object that contains the CarrierUnits. +-- @param Core.Zone#ZONE_AIRBASE PickupZone (optional) The zone from where the cargo is picked up. Note that the zone is optional and may not be provided, but for AI_CARGO_DISPATCHER_AIRBASE there will always be a PickupZone, as the pickup location is an airbase zone. +function AICargoDispatcherAirplanes:OnAfterPickedUp( From, Event, To, CarrierGroup, PickupZone ) + + -- Write here your own code. + -- Write here your own code. + MESSAGE:NewType( "Group " .. CarrierGroup:GetName().. " has loaded all cargo at airbase " .. PickupZone:GetName(), MESSAGE.Type.Information ):ToAll() + +end + + +--- Deploy Handler OnAfter for AICargoDispatcherAirplanes. +-- Use this event handler to tailor the event when a CarrierGroup is routed to a deploy coordinate, to Unload all cargo objects in each CarrierUnit. +-- You can use this event handler to post messages to players, or provide status updates etc. +-- @function OnAfterDeploy +-- @param #AICargoDispatcherAirplanes self +-- @param #string From A string that contains the "*from state name*" when the event was fired. +-- @param #string Event A string that contains the "*event name*" when the event was fired. +-- @param #string To A string that contains the "*to state name*" when the event was fired. +-- @param Wrapper.Group#GROUP CarrierGroup The group object that contains the CarrierUnits. +-- @param Core.Point#COORDINATE Coordinate The deploy coordinate. +-- @param #number Speed The velocity in meters per second on which the CarrierGroup is routed towards the deploy Coordinate. +-- @param #number Height Height in meters to move to the deploy coordinate. +-- @param Core.Zone#ZONE DeployZone The zone wherein the cargo is deployed. This can be any zone type, like a ZONE, ZONE_GROUP, ZONE_AIRBASE. +function AICargoDispatcherAirplanes:OnAfterDeploy( From, Event, To, CarrierGroup, Coordinate, Speed, Height, DeployZone ) + + -- Write here your own code. + MESSAGE:NewType( "Group " .. CarrierGroup:GetName().. " is starting deployment of all cargo in zone " .. DeployZone:GetName(), MESSAGE.Type.Information ):ToAll() + +end + + +--- Unloaded Handler OnAfter for AICargoDispatcherAirplanes. +-- Use this event handler to tailor the event when a CarrierUnit of a CarrierGroup has unloaded a cargo object. +-- You can use this event handler to post messages to players, or provide status updates etc. +-- Note that if more cargo objects were unloading or unboarding from the CarrierUnit, then this event can be fired multiple times for each different Cargo/CarrierUnit. +-- A CarrierUnit can be part of the larger CarrierGroup. +-- @function OnAfterUnloaded +-- @param #AICargoDispatcherAirplanes self +-- @param #string From A string that contains the "*from state name*" when the event was fired. +-- @param #string Event A string that contains the "*event name*" when the event was fired. +-- @param #string To A string that contains the "*to state name*" when the event was fired. +-- @param Wrapper.Group#GROUP CarrierGroup The group object that contains the CarrierUnits. +-- @param Cargo.Cargo#CARGO Cargo The cargo object. +-- @param Wrapper.Unit#UNIT CarrierUnit The carrier unit that is executing the cargo unloading operation. +-- @param Core.Zone#ZONE DeployZone The zone wherein the cargo is deployed. This can be any zone type, like a ZONE, ZONE_GROUP, ZONE_AIRBASE. +function AICargoDispatcherAirplanes:OnAfterUnloaded( From, Event, To, CarrierGroup, Cargo, CarrierUnit, DeployZone ) + + -- Write here your own code. + local CargoGroup = Cargo:GetObject() -- Wrapper.Group#GROUP + + -- Get the name of the DeployZone + local DeployZoneName = DeployZone:GetName() + + local DeployBuildingNames = { + ["Deploy A"] = "Building A", + } + + + -- Now board the infantry into the respective warehouse building. + if DeployZoneName then + local Building = STATIC:FindByName( DeployBuildingNames[DeployZoneName] ) + Cargo:__Board( 5, Building, 25 ) + end + + MESSAGE:NewType( "Group " .. CarrierGroup:GetName() .. ", Unit " .. CarrierUnit:GetName() .. " has unloaded cargo " .. Cargo:GetName() .. " in zone " .. DeployZone:GetName() .. " and cargo is moving to building " .. DeployBuildingNames[DeployZoneName], MESSAGE.Type.Information ):ToAll() + + +end + + +--- Deployed Handler OnAfter for AICargoDispatcherAirplanes. +-- @function OnAfterDeployed +-- @param #AICargoDispatcherAirplanes self +-- @param #string From A string that contains the "*from state name*" when the event was fired. +-- @param #string Event A string that contains the "*event name*" when the event was fired. +-- @param #string To A string that contains the "*to state name*" when the event was fired. +-- @param Wrapper.Group#GROUP CarrierGroup The group object that contains the CarrierUnits. +-- @param Core.Zone#ZONE DeployZone The zone wherein the cargo is deployed. This can be any zone type, like a ZONE, ZONE_GROUP, ZONE_AIRBASE. +function AICargoDispatcherAirplanes:OnAfterDeployed( From, Event, To, CarrierGroup, DeployZone ) + + -- Write here your own code. + MESSAGE:NewType( "Group " .. CarrierGroup:GetName() .. " deployed all cargo in zone " .. DeployZone:GetName(), MESSAGE.Type.Information ):ToAll() + +end + + +AICargoDispatcherAirplanes:Start() + diff --git a/AID - AI Dispatching/AID-CGO - AI Cargo Dispatching/AID-CGO-340 - Airplane - Event Handling/AID-CGO-340 - Airplane - Event Handling.miz b/AID - AI Dispatching/AID-CGO - AI Cargo Dispatching/AID-CGO-340 - Airplane - Event Handling/AID-CGO-340 - Airplane - Event Handling.miz index 8016512a13..ed6406e1f0 100644 Binary files a/AID - AI Dispatching/AID-CGO - AI Cargo Dispatching/AID-CGO-340 - Airplane - Event Handling/AID-CGO-340 - Airplane - Event Handling.miz and b/AID - AI Dispatching/AID-CGO - AI Cargo Dispatching/AID-CGO-340 - Airplane - Event Handling/AID-CGO-340 - Airplane - Event Handling.miz differ diff --git a/BAI - Battlefield Air Interdiction/BAI-001 - BAI in a Zone by Airplane Group/BAI-001 - BAI in a Zone by Airplane Group.lua b/BAI - Battlefield Air Interdiction/BAI-001 - BAI in a Zone by Airplane Group/BAI-001 - BAI in a Zone by Airplane Group.lua index 5bb060dd35..bd9499bc4a 100644 --- a/BAI - Battlefield Air Interdiction/BAI-001 - BAI in a Zone by Airplane Group/BAI-001 - BAI in a Zone by Airplane Group.lua +++ b/BAI - Battlefield Air Interdiction/BAI-001 - BAI in a Zone by Airplane Group/BAI-001 - BAI in a Zone by Airplane Group.lua @@ -1,74 +1,74 @@ ---- --- Name: BAI-001 - BAI in a Zone by Airplane Group --- Author: FlightControl --- Date Created: 09 May 2017 --- --- # Situation: --- --- A group of 4 bombers at patrolling north of an engage zone for 10 minutes. --- After 10 minutes, the command center orders the bombers to engage the zone and execute a BAI strike. --- --- # Test cases: --- --- 1. Observe that the bombers is patrolling in the patrol zone, until the engage command is given. --- 2. The bombers are not detecting any target during the patrol. --- 3. When the bombers is commanded to engage, the group will fly to the engage zone. --- 4. Detection is activated and detected targets within the engage zone are assigned for BAI. --- 5. Observe the bombers eliminating the targets. --- 6. Observe the bombers defenses. --- 7. When all targets within the engage zone are destroyed, the bombers BAI task is set to Accomplished. --- 8. The bombers will return to base. - - - --- Create a local variable (in this case called BAIEngagementZone) and --- using the ZONE function find the pre-defined zone called "Engagement Zone" --- currently on the map and assign it to this variable -BAIEngagementZone = ZONE:New( "Engagement Zone" ) - --- Create a local variable (in this case called BAIPlane) and --- using the GROUP function find the aircraft group called "Plane" and assign to this variable -BAIPlane = GROUP:FindByName( "Plane" ) - --- Create a local Variable (in this cased called PatrolZone and --- using the ZONE function find the pre-defined zone called "Patrol Zone" and assign it to this variable -PatrolZone = ZONE:New( "Patrol Zone" ) - --- Create and object (in this case called AIBAIZone) and --- using the functions AI_BAI_ZONE assign the parameters that define this object --- (in this case PatrolZone, 500, 1000, 500, 600, BAIEngagementZone) -AIBAIZone = AI_BAI_ZONE:New( PatrolZone, 500, 1000, 500, 600, BAIEngagementZone ) - --- Create an object (in this case called Targets) and --- using the GROUP function find the group labeled "Targets" and assign it to this object -Targets = GROUP:FindByName("Targets") - - --- Tell the program to use the object (in this case called BAIPlane) as the group to use in the BAI function -AIBAIZone:SetControllable( BAIPlane ) - --- Tell the group BAIPlane to start the mission in 1 second. -AIBAIZone:__Start( 1 ) -- They should statup, and start patrolling in the PatrolZone. - --- After 10 minutes, tell the group BAIPlane to engage the targets located in the engagement zone called BAIEngagement Zone. (600 is 600 seconds) -AIBAIZone:__Engage( 600 ) - --- Check every 60 seconds whether the Targets have been eliminated. --- When the trigger completed has been fired, the Plane will go back to the Patrol Zone. -Check, CheckScheduleID = SCHEDULER:New(nil, - function() - if Targets:IsAlive() and Targets:GetSize() > 5 then - BASE:E( "Test Mission: " .. Targets:GetSize() .. " targets left to be destroyed.") - else - BASE:E( "Test Mission: The required targets are destroyed." ) - AIBAIZone:__Accomplish( 1 ) -- Now they should fly back to the patrolzone and patrol. - end - end, {}, 20, 60, 0.2 ) - - --- When the targets in the zone are destroyed, (see scheduled function), the planes will return home ... -function AIBAIZone:OnAfterAccomplish( Controllable, From, Event, To ) - BASE:E( "Test Mission: Sending the bombers back to base." ) - Check:Stop( CheckScheduleID ) - AIBAIZone:__RTB( 1 ) -end +--- +-- Name: BAI-001 - BAI in a Zone by Airplane Group +-- Author: FlightControl +-- Date Created: 09 May 2017 +-- +-- # Situation: +-- +-- A group of 4 bombers at patrolling north of an engage zone for 10 minutes. +-- After 10 minutes, the command center orders the bombers to engage the zone and execute a BAI strike. +-- +-- # Test cases: +-- +-- 1. Observe that the bombers is patrolling in the patrol zone, until the engage command is given. +-- 2. The bombers are not detecting any target during the patrol. +-- 3. When the bombers is commanded to engage, the group will fly to the engage zone. +-- 4. Detection is activated and detected targets within the engage zone are assigned for BAI. +-- 5. Observe the bombers eliminating the targets. +-- 6. Observe the bombers defenses. +-- 7. When all targets within the engage zone are destroyed, the bombers BAI task is set to Accomplished. +-- 8. The bombers will return to base. + + + +-- Create a local variable (in this case called BAIEngagementZone) and +-- using the ZONE function find the pre-defined zone called "Engagement Zone" +-- currently on the map and assign it to this variable +BAIEngagementZone = ZONE:New( "Engagement Zone" ) + +-- Create a local variable (in this case called BAIPlane) and +-- using the GROUP function find the aircraft group called "Plane" and assign to this variable +BAIPlane = GROUP:FindByName( "Plane" ) + +-- Create a local Variable (in this cased called PatrolZone and +-- using the ZONE function find the pre-defined zone called "Patrol Zone" and assign it to this variable +PatrolZone = ZONE:New( "Patrol Zone" ) + +-- Create and object (in this case called AIBAIZone) and +-- using the functions AI_BAI_ZONE assign the parameters that define this object +-- (in this case PatrolZone, 500, 1000, 500, 600, BAIEngagementZone) +AIBAIZone = AI_BAI_ZONE:New( PatrolZone, 500, 1000, 500, 600, BAIEngagementZone ) + +-- Create an object (in this case called Targets) and +-- using the GROUP function find the group labeled "Targets" and assign it to this object +Targets = GROUP:FindByName("Targets") + + +-- Tell the program to use the object (in this case called BAIPlane) as the group to use in the BAI function +AIBAIZone:SetControllable( BAIPlane ) + +-- Tell the group BAIPlane to start the mission in 1 second. +AIBAIZone:__Start( 1 ) -- They should statup, and start patrolling in the PatrolZone. + +-- After 10 minutes, tell the group BAIPlane to engage the targets located in the engagement zone called BAIEngagement Zone. (600 is 600 seconds) +AIBAIZone:__Engage( 600 ) + +-- Check every 60 seconds whether the Targets have been eliminated. +-- When the trigger completed has been fired, the Plane will go back to the Patrol Zone. +Check, CheckScheduleID = SCHEDULER:New(nil, + function() + if Targets:IsAlive() and Targets:GetSize() > 5 then + BASE:E( "Test Mission: " .. Targets:GetSize() .. " targets left to be destroyed.") + else + BASE:E( "Test Mission: The required targets are destroyed." ) + AIBAIZone:__Accomplish( 1 ) -- Now they should fly back to the patrolzone and patrol. + end + end, {}, 20, 60, 0.2 ) + + +-- When the targets in the zone are destroyed, (see scheduled function), the planes will return home ... +function AIBAIZone:OnAfterAccomplish( Controllable, From, Event, To ) + BASE:E( "Test Mission: Sending the bombers back to base." ) + Check:Stop( CheckScheduleID ) + AIBAIZone:__RTB( 1 ) +end diff --git a/BAI - Battlefield Air Interdiction/BAI-001 - BAI in a Zone by Airplane Group/BAI-001 - BAI in a Zone by Airplane Group.miz b/BAI - Battlefield Air Interdiction/BAI-001 - BAI in a Zone by Airplane Group/BAI-001 - BAI in a Zone by Airplane Group.miz index bcbe6b7f2a..b32039e182 100644 Binary files a/BAI - Battlefield Air Interdiction/BAI-001 - BAI in a Zone by Airplane Group/BAI-001 - BAI in a Zone by Airplane Group.miz and b/BAI - Battlefield Air Interdiction/BAI-001 - BAI in a Zone by Airplane Group/BAI-001 - BAI in a Zone by Airplane Group.miz differ diff --git a/BAI - Battlefield Air Interdiction/BAI-002 - BAI in a Zone by Airplane Group - Engage with Speed/BAI-002 - BAI in a Zone by Airplane Group - Engage with Speed.lua b/BAI - Battlefield Air Interdiction/BAI-002 - BAI in a Zone by Airplane Group - Engage with Speed/BAI-002 - BAI in a Zone by Airplane Group - Engage with Speed.lua index f8fdfdb665..5e5deef03d 100644 --- a/BAI - Battlefield Air Interdiction/BAI-002 - BAI in a Zone by Airplane Group - Engage with Speed/BAI-002 - BAI in a Zone by Airplane Group - Engage with Speed.lua +++ b/BAI - Battlefield Air Interdiction/BAI-002 - BAI in a Zone by Airplane Group - Engage with Speed/BAI-002 - BAI in a Zone by Airplane Group - Engage with Speed.lua @@ -1,75 +1,75 @@ ---- --- Name: BAI-002 - BAI in a Zone by Airplane Group - Engage with Speed --- Author: FlightControl --- Date Created: 09 May 2017 --- --- # Situation: --- --- A group of 4 bombers at patrolling north of an engage zone for 1 minute. --- After 1 minute, the command center orders the bombers to engage the zone and execute a BAI. --- --- # Test cases: --- --- 1. Observe that the bombers is patrolling in the patrol zone, until the engage command is given. --- 2. The bombers are not detecting any target during the patrol. --- 3. When the bombers is commanded to engage, the group will fly to the engage zone. --- 3.1. The approach speed to the engage zone is set to 400 km/h. --- 4. Detection is activated and detected targets within the engage zone are assigned for BAI. --- 5. Observe the bombers eliminating the targets. --- 6. Observe the bombers defenses. --- 7. When all targets within the engage zone are destroyed, the bombers BAI task is set to Accomplished. --- 8. The bombers will return to base. - - - --- Create a local variable (in this case called BAIEngagementZone) and --- using the ZONE function find the pre-defined zone called "Engagement Zone" --- currently on the map and assign it to this variable -BAIEngagementZone = ZONE:New( "Engagement Zone" ) - --- Create a local variable (in this case called BAIPlane) and --- using the GROUP function find the aircraft group called "Plane" and assign to this variable -BAIPlane = GROUP:FindByName( "Plane" ) - --- Create a local Variable (in this cased called PatrolZone and --- using the ZONE function find the pre-defined zone called "Patrol Zone" and assign it to this variable -PatrolZone = ZONE:New( "Patrol Zone" ) - --- Create and object (in this case called AIBAIZone) and --- using the functions AI_BAI_ZONE assign the parameters that define this object --- (in this case PatrolZone, 500, 1000, 500, 600, BAIEngagementZone) -AIBAIZone = AI_BAI_ZONE:New( PatrolZone, 500, 1000, 500, 600, BAIEngagementZone ) - --- Create an object (in this case called Targets) and --- using the GROUP function find the group labeled "Targets" and assign it to this object -Targets = GROUP:FindByName("Targets") - - --- Tell the program to use the object (in this case called BAIPlane) as the group to use in the BAI function -AIBAIZone:SetControllable( BAIPlane ) - --- Tell the group BAIPlane to start the mission in 1 second. -AIBAIZone:__Start( 1 ) -- They should statup, and start patrolling in the PatrolZone. - --- After 10 minutes, tell the group BAIPlane to engage the targets located in the engagement zone called BAIEngagement Zone. (600 is 600 seconds) -AIBAIZone:__Engage( 60, 400 ) -- Engage after one minute with a speed of 400 km/h. - --- Check every 60 seconds whether the Targets have been eliminated. --- When the trigger completed has been fired, the Plane will go back to the Patrol Zone. -Check, CheckScheduleID = SCHEDULER:New(nil, - function() - if Targets:IsAlive() and Targets:GetSize() > 5 then - BASE:E( "Test Mission: " .. Targets:GetSize() .. " targets left to be destroyed.") - else - BASE:E( "Test Mission: The required targets are destroyed." ) - AIBAIZone:__Accomplish( 1 ) -- Now they should fly back to teh patrolzone and patrol. - end - end, {}, 20, 60, 0.2 ) - - --- When the targets in the zone are destroyed, (see scheduled function), the planes will return home ... -function AIBAIZone:OnAfterAccomplish( Controllable, From, Event, To ) - BASE:E( "Test Mission: Sending the bombers back to base." ) - Check:Stop( CheckScheduleID ) - AIBAIZone:__RTB( 1 ) -end +--- +-- Name: BAI-002 - BAI in a Zone by Airplane Group - Engage with Speed +-- Author: FlightControl +-- Date Created: 09 May 2017 +-- +-- # Situation: +-- +-- A group of 4 bombers at patrolling north of an engage zone for 1 minute. +-- After 1 minute, the command center orders the bombers to engage the zone and execute a BAI. +-- +-- # Test cases: +-- +-- 1. Observe that the bombers is patrolling in the patrol zone, until the engage command is given. +-- 2. The bombers are not detecting any target during the patrol. +-- 3. When the bombers is commanded to engage, the group will fly to the engage zone. +-- 3.1. The approach speed to the engage zone is set to 400 km/h. +-- 4. Detection is activated and detected targets within the engage zone are assigned for BAI. +-- 5. Observe the bombers eliminating the targets. +-- 6. Observe the bombers defenses. +-- 7. When all targets within the engage zone are destroyed, the bombers BAI task is set to Accomplished. +-- 8. The bombers will return to base. + + + +-- Create a local variable (in this case called BAIEngagementZone) and +-- using the ZONE function find the pre-defined zone called "Engagement Zone" +-- currently on the map and assign it to this variable +BAIEngagementZone = ZONE:New( "Engagement Zone" ) + +-- Create a local variable (in this case called BAIPlane) and +-- using the GROUP function find the aircraft group called "Plane" and assign to this variable +BAIPlane = GROUP:FindByName( "Plane" ) + +-- Create a local Variable (in this cased called PatrolZone and +-- using the ZONE function find the pre-defined zone called "Patrol Zone" and assign it to this variable +PatrolZone = ZONE:New( "Patrol Zone" ) + +-- Create and object (in this case called AIBAIZone) and +-- using the functions AI_BAI_ZONE assign the parameters that define this object +-- (in this case PatrolZone, 500, 1000, 500, 600, BAIEngagementZone) +AIBAIZone = AI_BAI_ZONE:New( PatrolZone, 500, 1000, 500, 600, BAIEngagementZone ) + +-- Create an object (in this case called Targets) and +-- using the GROUP function find the group labeled "Targets" and assign it to this object +Targets = GROUP:FindByName("Targets") + + +-- Tell the program to use the object (in this case called BAIPlane) as the group to use in the BAI function +AIBAIZone:SetControllable( BAIPlane ) + +-- Tell the group BAIPlane to start the mission in 1 second. +AIBAIZone:__Start( 1 ) -- They should statup, and start patrolling in the PatrolZone. + +-- After 10 minutes, tell the group BAIPlane to engage the targets located in the engagement zone called BAIEngagement Zone. (600 is 600 seconds) +AIBAIZone:__Engage( 60, 400 ) -- Engage after one minute with a speed of 400 km/h. + +-- Check every 60 seconds whether the Targets have been eliminated. +-- When the trigger completed has been fired, the Plane will go back to the Patrol Zone. +Check, CheckScheduleID = SCHEDULER:New(nil, + function() + if Targets:IsAlive() and Targets:GetSize() > 5 then + BASE:E( "Test Mission: " .. Targets:GetSize() .. " targets left to be destroyed.") + else + BASE:E( "Test Mission: The required targets are destroyed." ) + AIBAIZone:__Accomplish( 1 ) -- Now they should fly back to teh patrolzone and patrol. + end + end, {}, 20, 60, 0.2 ) + + +-- When the targets in the zone are destroyed, (see scheduled function), the planes will return home ... +function AIBAIZone:OnAfterAccomplish( Controllable, From, Event, To ) + BASE:E( "Test Mission: Sending the bombers back to base." ) + Check:Stop( CheckScheduleID ) + AIBAIZone:__RTB( 1 ) +end diff --git a/BAI - Battlefield Air Interdiction/BAI-002 - BAI in a Zone by Airplane Group - Engage with Speed/BAI-002 - BAI in a Zone by Airplane Group - Engage with Speed.miz b/BAI - Battlefield Air Interdiction/BAI-002 - BAI in a Zone by Airplane Group - Engage with Speed/BAI-002 - BAI in a Zone by Airplane Group - Engage with Speed.miz index 6f86e54b1e..2052e3da88 100644 Binary files a/BAI - Battlefield Air Interdiction/BAI-002 - BAI in a Zone by Airplane Group - Engage with Speed/BAI-002 - BAI in a Zone by Airplane Group - Engage with Speed.miz and b/BAI - Battlefield Air Interdiction/BAI-002 - BAI in a Zone by Airplane Group - Engage with Speed/BAI-002 - BAI in a Zone by Airplane Group - Engage with Speed.miz differ diff --git a/BAI - Battlefield Air Interdiction/BAI-004 - BAI in a Zone by Airplane Group - Test Abort/BAI-004 - BAI in a Zone by Airplane Group - Test Abort.lua b/BAI - Battlefield Air Interdiction/BAI-004 - BAI in a Zone by Airplane Group - Test Abort/BAI-004 - BAI in a Zone by Airplane Group - Test Abort.lua index 43ff85443e..e9401f29b5 100644 --- a/BAI - Battlefield Air Interdiction/BAI-004 - BAI in a Zone by Airplane Group - Test Abort/BAI-004 - BAI in a Zone by Airplane Group - Test Abort.lua +++ b/BAI - Battlefield Air Interdiction/BAI-004 - BAI in a Zone by Airplane Group - Test Abort/BAI-004 - BAI in a Zone by Airplane Group - Test Abort.lua @@ -1,81 +1,81 @@ ---- --- Name: BAI-004 - BAI in a Zone by Airplane Group - Test Abort --- Author: FlightControl --- Date Created: 09 May 2017 --- --- # Situation: --- --- A group of 4 bombers at patrolling north of an engage zone for 1 minute. --- After 10 minutes, the command center orders the bombers to engage the zone and execute a BAI. --- After 12 minutes, the mission is aborted. --- --- # Test cases: --- --- 1. Observe that the bombers is patrolling in the patrol zone, until the engage command is given. --- 2. The bombers are not detecting any target during the patrol. --- 3. When the bombers is commanded to engage, the group will fly to the engage zone --- 3.1. The approach speed to the engage zone is set to 350 km/h. --- 3.2. The altitude to the engage zone and BAI execution is set to 4000 meters. --- 4. Observe the mission being aborted. A message will be sent. --- 5. The bombers will go back patrolling. - - - --- Create a local variable (in this case called BAIEngagementZone) and --- using the ZONE function find the pre-defined zone called "Engagement Zone" --- currently on the map and assign it to this variable -BAIEngagementZone = ZONE:New( "Engagement Zone" ) - --- Create a local variable (in this case called BAIPlane) and --- using the GROUP function find the aircraft group called "Plane" and assign to this variable -BAIPlane = GROUP:FindByName( "Plane" ) - --- Create a local Variable (in this cased called PatrolZone and --- using the ZONE function find the pre-defined zone called "Patrol Zone" and assign it to this variable -PatrolZone = ZONE:New( "Patrol Zone" ) - --- Create and object (in this case called AIBAIZone) and --- using the functions AI_BAI_ZONE assign the parameters that define this object --- (in this case PatrolZone, 500, 1000, 500, 600, BAIEngagementZone) -AIBAIZone = AI_BAI_ZONE:New( PatrolZone, 500, 1000, 500, 600, BAIEngagementZone ) - --- Create an object (in this case called Targets) and --- using the GROUP function find the group labeled "Targets" and assign it to this object -Targets = GROUP:FindByName("Targets") - - --- Tell the program to use the object (in this case called BAIPlane) as the group to use in the BAI function -AIBAIZone:SetControllable( BAIPlane ) - --- Tell the group BAIPlane to start the mission in 1 second. -AIBAIZone:__Start( 1 ) -- They should statup, and start patrolling in the PatrolZone. - --- After 10 minutes, tell the group BAIPlane to engage the targets located in the engagement zone called BAIEngagement Zone. (600 is 600 seconds) -AIBAIZone:__Engage( 600, 350, 4000 ) -- Engage after 10 minutes with a speed of 350 km/h and an altitude of 4000 meters. - --- After 12 minutes, tell the group BAIPlane to abort the engagement. -AIBAIZone:__Abort( 720 ) -- Abort the engagement. - --- Check every 60 seconds whether the Targets have been eliminated. --- When the trigger completed has been fired, the Plane will go back to the Patrol Zone. -Check, CheckScheduleID = SCHEDULER:New(nil, - function() - if Targets:IsAlive() and Targets:GetSize() > 5 then - BASE:E( "Test Mission: " .. Targets:GetSize() .. " targets left to be destroyed.") - else - BASE:E( "Test Mission: The required targets are destroyed." ) - AIBAIZone:__Accomplish( 1 ) -- Now they should fly back to teh patrolzone and patrol. - end - end, {}, 20, 60, 0.2 ) - -function AIBAIZone:OnAfterAbort(Controllable,From,Event,To) - BASE:E( "MISSION ABORT! Back to patrol zone." ) - MESSAGE:New("Mission ABORTED! Back to the Patrol Zone!",30,"ALERT!"):ToAll() -end - --- When the targets in the zone are destroyed, (see scheduled function), the planes will return home ... -function AIBAIZone:OnAfterAccomplish( Controllable, From, Event, To ) - BASE:E( "Test Mission: Sending the bombers back to base." ) - Check:Stop( CheckScheduleID ) - AIBAIZone:__RTB( 1 ) -end +--- +-- Name: BAI-004 - BAI in a Zone by Airplane Group - Test Abort +-- Author: FlightControl +-- Date Created: 09 May 2017 +-- +-- # Situation: +-- +-- A group of 4 bombers at patrolling north of an engage zone for 1 minute. +-- After 10 minutes, the command center orders the bombers to engage the zone and execute a BAI. +-- After 12 minutes, the mission is aborted. +-- +-- # Test cases: +-- +-- 1. Observe that the bombers is patrolling in the patrol zone, until the engage command is given. +-- 2. The bombers are not detecting any target during the patrol. +-- 3. When the bombers is commanded to engage, the group will fly to the engage zone +-- 3.1. The approach speed to the engage zone is set to 350 km/h. +-- 3.2. The altitude to the engage zone and BAI execution is set to 4000 meters. +-- 4. Observe the mission being aborted. A message will be sent. +-- 5. The bombers will go back patrolling. + + + +-- Create a local variable (in this case called BAIEngagementZone) and +-- using the ZONE function find the pre-defined zone called "Engagement Zone" +-- currently on the map and assign it to this variable +BAIEngagementZone = ZONE:New( "Engagement Zone" ) + +-- Create a local variable (in this case called BAIPlane) and +-- using the GROUP function find the aircraft group called "Plane" and assign to this variable +BAIPlane = GROUP:FindByName( "Plane" ) + +-- Create a local Variable (in this cased called PatrolZone and +-- using the ZONE function find the pre-defined zone called "Patrol Zone" and assign it to this variable +PatrolZone = ZONE:New( "Patrol Zone" ) + +-- Create and object (in this case called AIBAIZone) and +-- using the functions AI_BAI_ZONE assign the parameters that define this object +-- (in this case PatrolZone, 500, 1000, 500, 600, BAIEngagementZone) +AIBAIZone = AI_BAI_ZONE:New( PatrolZone, 500, 1000, 500, 600, BAIEngagementZone ) + +-- Create an object (in this case called Targets) and +-- using the GROUP function find the group labeled "Targets" and assign it to this object +Targets = GROUP:FindByName("Targets") + + +-- Tell the program to use the object (in this case called BAIPlane) as the group to use in the BAI function +AIBAIZone:SetControllable( BAIPlane ) + +-- Tell the group BAIPlane to start the mission in 1 second. +AIBAIZone:__Start( 1 ) -- They should statup, and start patrolling in the PatrolZone. + +-- After 10 minutes, tell the group BAIPlane to engage the targets located in the engagement zone called BAIEngagement Zone. (600 is 600 seconds) +AIBAIZone:__Engage( 600, 350, 4000 ) -- Engage after 10 minutes with a speed of 350 km/h and an altitude of 4000 meters. + +-- After 12 minutes, tell the group BAIPlane to abort the engagement. +AIBAIZone:__Abort( 720 ) -- Abort the engagement. + +-- Check every 60 seconds whether the Targets have been eliminated. +-- When the trigger completed has been fired, the Plane will go back to the Patrol Zone. +Check, CheckScheduleID = SCHEDULER:New(nil, + function() + if Targets:IsAlive() and Targets:GetSize() > 5 then + BASE:E( "Test Mission: " .. Targets:GetSize() .. " targets left to be destroyed.") + else + BASE:E( "Test Mission: The required targets are destroyed." ) + AIBAIZone:__Accomplish( 1 ) -- Now they should fly back to teh patrolzone and patrol. + end + end, {}, 20, 60, 0.2 ) + +function AIBAIZone:OnAfterAbort(Controllable,From,Event,To) + BASE:E( "MISSION ABORT! Back to patrol zone." ) + MESSAGE:New("Mission ABORTED! Back to the Patrol Zone!",30,"ALERT!"):ToAll() +end + +-- When the targets in the zone are destroyed, (see scheduled function), the planes will return home ... +function AIBAIZone:OnAfterAccomplish( Controllable, From, Event, To ) + BASE:E( "Test Mission: Sending the bombers back to base." ) + Check:Stop( CheckScheduleID ) + AIBAIZone:__RTB( 1 ) +end diff --git a/BAI - Battlefield Air Interdiction/BAI-004 - BAI in a Zone by Airplane Group - Test Abort/BAI-004 - BAI in a Zone by Airplane Group - Test Abort.miz b/BAI - Battlefield Air Interdiction/BAI-004 - BAI in a Zone by Airplane Group - Test Abort/BAI-004 - BAI in a Zone by Airplane Group - Test Abort.miz index f7c033fa8e..ce4c13f354 100644 Binary files a/BAI - Battlefield Air Interdiction/BAI-004 - BAI in a Zone by Airplane Group - Test Abort/BAI-004 - BAI in a Zone by Airplane Group - Test Abort.miz and b/BAI - Battlefield Air Interdiction/BAI-004 - BAI in a Zone by Airplane Group - Test Abort/BAI-004 - BAI in a Zone by Airplane Group - Test Abort.miz differ diff --git a/BAI - Battlefield Air Interdiction/BAI-005 - BAI in a Zone by Airplane Group - Engage with WeaponExpend/BAI-005 - BAI in a Zone by Airplane Group - Engage with WeaponExpend.lua b/BAI - Battlefield Air Interdiction/BAI-005 - BAI in a Zone by Airplane Group - Engage with WeaponExpend/BAI-005 - BAI in a Zone by Airplane Group - Engage with WeaponExpend.lua index 85468404d9..f6b85b0478 100644 --- a/BAI - Battlefield Air Interdiction/BAI-005 - BAI in a Zone by Airplane Group - Engage with WeaponExpend/BAI-005 - BAI in a Zone by Airplane Group - Engage with WeaponExpend.lua +++ b/BAI - Battlefield Air Interdiction/BAI-005 - BAI in a Zone by Airplane Group - Engage with WeaponExpend/BAI-005 - BAI in a Zone by Airplane Group - Engage with WeaponExpend.lua @@ -1,78 +1,78 @@ ---- --- Name: BAI-005 - BAI in a Zone by Airplane Group - Engage with WeaponExpend --- Author: FlightControl --- Date Created: 09 May 2017 --- --- # Situation: --- --- A group of 4 bombers at patrolling north of an engage zone for 1 minute. --- After 1 minute, the command center orders the bombers to engage the zone and execute a BAI. --- The planes should expend 4 weapons per run. --- --- # Test cases: --- --- 1. Observe that the bombers is patrolling in the patrol zone, until the engage command is given. --- 2. The bombers are not detecting any target during the patrol. --- 3. When the bombers is commanded to engage, the group will fly to the engage zone --- 3.1. The approach speed to the engage zone is set to 400 km/h. --- 3.2. The altitude to the engage zone and BAI execution is set to 500 meters. --- 3.3. The planes should expend 4 weapons per run. --- 4. Detection is activated and detected targets within the engage zone are assigned for BAI. --- 5. Observe the bombers eliminating the targets. --- 6. Observe the bombers defenses. --- 7. When all targets within the engage zone are destroyed, the bombers BAI task is set to Accomplished. --- 8. The bombers will return to base. - - - --- Create a local variable (in this case called BAIEngagementZone) and --- using the ZONE function find the pre-defined zone called "Engagement Zone" --- currently on the map and assign it to this variable -BAIEngagementZone = ZONE:New( "Engagement Zone" ) - --- Create a local variable (in this case called BAIPlane) and --- using the GROUP function find the aircraft group called "Plane" and assign to this variable -BAIPlane = GROUP:FindByName( "Plane" ) - --- Create a local Variable (in this cased called PatrolZone and --- using the ZONE function find the pre-defined zone called "Patrol Zone" and assign it to this variable -PatrolZone = ZONE:New( "Patrol Zone" ) - --- Create and object (in this case called AIBAIZone) and --- using the functions AI_BAI_ZONE assign the parameters that define this object --- (in this case PatrolZone, 500, 1000, 500, 600, BAIEngagementZone) -AIBAIZone = AI_BAI_ZONE:New( PatrolZone, 500, 1000, 500, 600, BAIEngagementZone ) - --- Create an object (in this case called Targets) and --- using the GROUP function find the group labeled "Targets" and assign it to this object -Targets = GROUP:FindByName("Targets") - - --- Tell the program to use the object (in this case called BAIPlane) as the group to use in the BAI function -AIBAIZone:SetControllable( BAIPlane ) - --- Tell the group BAIPlane to start the mission in 1 second. -AIBAIZone:__Start( 1 ) -- They should statup, and start patrolling in the PatrolZone. - --- After 1 minute, tell the group BAIPlane to engage the targets located in the engagement zone called BAIEngagement Zone. (600 is 600 seconds) -AIBAIZone:__Engage( 60, 600, 8000, AI.Task.WeaponExpend.FOUR ) -- Engage with a speed of 600 km/h and an altitude of 8000 meters, weapn expend 4. - --- Check every 60 seconds whether the Targets have been eliminated. --- When the trigger completed has been fired, the Plane will go back to the Patrol Zone. -Check, CheckScheduleID = SCHEDULER:New(nil, - function() - if Targets:IsAlive() and Targets:GetSize() > 5 then - BASE:E( "Test Mission: " .. Targets:GetSize() .. " targets left to be destroyed.") - else - BASE:E( "Test Mission: The required targets are destroyed." ) - AIBAIZone:__Accomplish( 1 ) -- Now they should fly back to teh patrolzone and patrol. - end - end, {}, 20, 60, 0.2 ) - - --- When the targets in the zone are destroyed, (see scheduled function), the planes will return home ... -function AIBAIZone:OnAfterAccomplish( Controllable, From, Event, To ) - BASE:E( "Test Mission: Sending the bombers back to base." ) - Check:Stop( CheckScheduleID ) - AIBAIZone:__RTB( 1 ) -end +--- +-- Name: BAI-005 - BAI in a Zone by Airplane Group - Engage with WeaponExpend +-- Author: FlightControl +-- Date Created: 09 May 2017 +-- +-- # Situation: +-- +-- A group of 4 bombers at patrolling north of an engage zone for 1 minute. +-- After 1 minute, the command center orders the bombers to engage the zone and execute a BAI. +-- The planes should expend 4 weapons per run. +-- +-- # Test cases: +-- +-- 1. Observe that the bombers is patrolling in the patrol zone, until the engage command is given. +-- 2. The bombers are not detecting any target during the patrol. +-- 3. When the bombers is commanded to engage, the group will fly to the engage zone +-- 3.1. The approach speed to the engage zone is set to 400 km/h. +-- 3.2. The altitude to the engage zone and BAI execution is set to 500 meters. +-- 3.3. The planes should expend 4 weapons per run. +-- 4. Detection is activated and detected targets within the engage zone are assigned for BAI. +-- 5. Observe the bombers eliminating the targets. +-- 6. Observe the bombers defenses. +-- 7. When all targets within the engage zone are destroyed, the bombers BAI task is set to Accomplished. +-- 8. The bombers will return to base. + + + +-- Create a local variable (in this case called BAIEngagementZone) and +-- using the ZONE function find the pre-defined zone called "Engagement Zone" +-- currently on the map and assign it to this variable +BAIEngagementZone = ZONE:New( "Engagement Zone" ) + +-- Create a local variable (in this case called BAIPlane) and +-- using the GROUP function find the aircraft group called "Plane" and assign to this variable +BAIPlane = GROUP:FindByName( "Plane" ) + +-- Create a local Variable (in this cased called PatrolZone and +-- using the ZONE function find the pre-defined zone called "Patrol Zone" and assign it to this variable +PatrolZone = ZONE:New( "Patrol Zone" ) + +-- Create and object (in this case called AIBAIZone) and +-- using the functions AI_BAI_ZONE assign the parameters that define this object +-- (in this case PatrolZone, 500, 1000, 500, 600, BAIEngagementZone) +AIBAIZone = AI_BAI_ZONE:New( PatrolZone, 500, 1000, 500, 600, BAIEngagementZone ) + +-- Create an object (in this case called Targets) and +-- using the GROUP function find the group labeled "Targets" and assign it to this object +Targets = GROUP:FindByName("Targets") + + +-- Tell the program to use the object (in this case called BAIPlane) as the group to use in the BAI function +AIBAIZone:SetControllable( BAIPlane ) + +-- Tell the group BAIPlane to start the mission in 1 second. +AIBAIZone:__Start( 1 ) -- They should statup, and start patrolling in the PatrolZone. + +-- After 1 minute, tell the group BAIPlane to engage the targets located in the engagement zone called BAIEngagement Zone. (600 is 600 seconds) +AIBAIZone:__Engage( 60, 600, 8000, AI.Task.WeaponExpend.FOUR ) -- Engage with a speed of 600 km/h and an altitude of 8000 meters, weapn expend 4. + +-- Check every 60 seconds whether the Targets have been eliminated. +-- When the trigger completed has been fired, the Plane will go back to the Patrol Zone. +Check, CheckScheduleID = SCHEDULER:New(nil, + function() + if Targets:IsAlive() and Targets:GetSize() > 5 then + BASE:E( "Test Mission: " .. Targets:GetSize() .. " targets left to be destroyed.") + else + BASE:E( "Test Mission: The required targets are destroyed." ) + AIBAIZone:__Accomplish( 1 ) -- Now they should fly back to teh patrolzone and patrol. + end + end, {}, 20, 60, 0.2 ) + + +-- When the targets in the zone are destroyed, (see scheduled function), the planes will return home ... +function AIBAIZone:OnAfterAccomplish( Controllable, From, Event, To ) + BASE:E( "Test Mission: Sending the bombers back to base." ) + Check:Stop( CheckScheduleID ) + AIBAIZone:__RTB( 1 ) +end diff --git a/BAI - Battlefield Air Interdiction/BAI-005 - BAI in a Zone by Airplane Group - Engage with WeaponExpend/BAI-005 - BAI in a Zone by Airplane Group - Engage with WeaponExpend.miz b/BAI - Battlefield Air Interdiction/BAI-005 - BAI in a Zone by Airplane Group - Engage with WeaponExpend/BAI-005 - BAI in a Zone by Airplane Group - Engage with WeaponExpend.miz index 1a5c17eb0b..de4760cf93 100644 Binary files a/BAI - Battlefield Air Interdiction/BAI-005 - BAI in a Zone by Airplane Group - Engage with WeaponExpend/BAI-005 - BAI in a Zone by Airplane Group - Engage with WeaponExpend.miz and b/BAI - Battlefield Air Interdiction/BAI-005 - BAI in a Zone by Airplane Group - Engage with WeaponExpend/BAI-005 - BAI in a Zone by Airplane Group - Engage with WeaponExpend.miz differ diff --git a/BAI - Battlefield Air Interdiction/BAI-100 - BAI of a Bridge/BAI-100 - BAI of a Bridge.lua b/BAI - Battlefield Air Interdiction/BAI-100 - BAI of a Bridge/BAI-100 - BAI of a Bridge.lua index f6f922876e..b3d8c0ec34 100644 --- a/BAI - Battlefield Air Interdiction/BAI-100 - BAI of a Bridge/BAI-100 - BAI of a Bridge.lua +++ b/BAI - Battlefield Air Interdiction/BAI-100 - BAI of a Bridge/BAI-100 - BAI of a Bridge.lua @@ -1,76 +1,76 @@ ---- --- Name: BAI-100 - BAI of a Bridge --- Author: FlightControl --- Date Created: 09 May 2017 --- --- # Situation: --- --- A group of 2 bombers are patrolling north of an engage zone. --- The command center orders the bombers to engage the zone and execute a BAI strike on a bridge. --- --- # Test cases: --- --- 1. Observe that the bombers is patrolling in the patrol zone, until the engage command is given. --- 2. The bombers are not detecting any target during the patrol. --- 3. When the bombers is commanded to engage, the group will fly to the engage zone. --- 4. Detection is activated and detected targets within the engage zone are assigned for BAI. --- 5. Observe the bombers eliminating the bridge. --- 6. Observe the bombers defenses. --- 7. When the bridge within the engage zone is destroyed, the bombers BAI task is set to Accomplished. --- 8. The bombers will return to base. - - - --- Create a local variable (in this case called BAIEngagementZone) and --- using the ZONE function find the pre-defined zone called "Engagement Zone" --- currently on the map and assign it to this variable -BAIEngagementZone = ZONE:New( "Engagement Zone" ) - --- Create a local variable (in this case called BAIPlane) and --- using the GROUP function find the aircraft group called "Plane" and assign to this variable -BAIPlane = GROUP:FindByName( "Plane" ) - --- Create a local Variable (in this cased called PatrolZone and --- using the ZONE function find the pre-defined zone called "Patrol Zone" and assign it to this variable -PatrolZone = ZONE:New( "Patrol Zone" ) - --- Create and object (in this case called AIBAIZone) and --- using the functions AI_BAI_ZONE assign the parameters that define this object --- (in this case PatrolZone, 500, 1000, 500, 600, BAIEngagementZone) -AIBAIZone = AI_BAI_ZONE:New( PatrolZone, 500, 1000, 500, 600, BAIEngagementZone ) - --- Create an object (in this case called Targets) and --- using the GROUP function find the group labeled "Targets" and assign it to this object -Targets = GROUP:FindByName("Targets") - --- Tell the program to use the object (in this case called BAIPlane) as the group to use in the BAI function -AIBAIZone:SetControllable( BAIPlane ) - --- Tell the BAI not to search for potential targets in the BAIEngagementZone, but rather use the center of the BAIEngagementZone as the bombing location. -AIBAIZone:SearchOff() - --- Tell the group BAIPlane to start the mission in 1 second. -AIBAIZone:__Start( 1 ) -- They should statup, and start patrolling in the PatrolZone. - --- After 10 minutes, tell the group BAIPlane to engage the targets located in the engagement zone called BAIEngagement Zone. -AIBAIZone:__Engage( 10 ) - --- Check every 60 seconds whether the Targets have been eliminated. --- When the trigger completed has been fired, the Plane will go back to the Patrol Zone. -Check, CheckScheduleID = SCHEDULER:New(nil, - function() - if Targets:IsAlive() and Targets:GetSize() ~= 0 then - BASE:E( "Test Mission: " .. Targets:GetSize() .. " targets left to be destroyed.") - else - BASE:E( "Test Mission: The bridge is destroyed." ) - AIBAIZone:__Accomplish( 1 ) -- Now they should fly back to the patrolzone and patrol. - end - end, {}, 20, 60, 0.2 ) - - --- When the targets in the zone are destroyed, (see scheduled function), the planes will return home ... -function AIBAIZone:OnAfterAccomplish( Controllable, From, Event, To ) - BASE:E( "Test Mission: Sending the bombers back to base." ) - Check:Stop( CheckScheduleID ) - AIBAIZone:__RTB( 1 ) -end +--- +-- Name: BAI-100 - BAI of a Bridge +-- Author: FlightControl +-- Date Created: 09 May 2017 +-- +-- # Situation: +-- +-- A group of 2 bombers are patrolling north of an engage zone. +-- The command center orders the bombers to engage the zone and execute a BAI strike on a bridge. +-- +-- # Test cases: +-- +-- 1. Observe that the bombers is patrolling in the patrol zone, until the engage command is given. +-- 2. The bombers are not detecting any target during the patrol. +-- 3. When the bombers is commanded to engage, the group will fly to the engage zone. +-- 4. Detection is activated and detected targets within the engage zone are assigned for BAI. +-- 5. Observe the bombers eliminating the bridge. +-- 6. Observe the bombers defenses. +-- 7. When the bridge within the engage zone is destroyed, the bombers BAI task is set to Accomplished. +-- 8. The bombers will return to base. + + + +-- Create a local variable (in this case called BAIEngagementZone) and +-- using the ZONE function find the pre-defined zone called "Engagement Zone" +-- currently on the map and assign it to this variable +BAIEngagementZone = ZONE:New( "Engagement Zone" ) + +-- Create a local variable (in this case called BAIPlane) and +-- using the GROUP function find the aircraft group called "Plane" and assign to this variable +BAIPlane = GROUP:FindByName( "Plane" ) + +-- Create a local Variable (in this cased called PatrolZone and +-- using the ZONE function find the pre-defined zone called "Patrol Zone" and assign it to this variable +PatrolZone = ZONE:New( "Patrol Zone" ) + +-- Create and object (in this case called AIBAIZone) and +-- using the functions AI_BAI_ZONE assign the parameters that define this object +-- (in this case PatrolZone, 500, 1000, 500, 600, BAIEngagementZone) +AIBAIZone = AI_BAI_ZONE:New( PatrolZone, 500, 1000, 500, 600, BAIEngagementZone ) + +-- Create an object (in this case called Targets) and +-- using the GROUP function find the group labeled "Targets" and assign it to this object +Targets = GROUP:FindByName("Targets") + +-- Tell the program to use the object (in this case called BAIPlane) as the group to use in the BAI function +AIBAIZone:SetControllable( BAIPlane ) + +-- Tell the BAI not to search for potential targets in the BAIEngagementZone, but rather use the center of the BAIEngagementZone as the bombing location. +AIBAIZone:SearchOff() + +-- Tell the group BAIPlane to start the mission in 1 second. +AIBAIZone:__Start( 1 ) -- They should statup, and start patrolling in the PatrolZone. + +-- After 10 minutes, tell the group BAIPlane to engage the targets located in the engagement zone called BAIEngagement Zone. +AIBAIZone:__Engage( 10 ) + +-- Check every 60 seconds whether the Targets have been eliminated. +-- When the trigger completed has been fired, the Plane will go back to the Patrol Zone. +Check, CheckScheduleID = SCHEDULER:New(nil, + function() + if Targets:IsAlive() and Targets:GetSize() ~= 0 then + BASE:E( "Test Mission: " .. Targets:GetSize() .. " targets left to be destroyed.") + else + BASE:E( "Test Mission: The bridge is destroyed." ) + AIBAIZone:__Accomplish( 1 ) -- Now they should fly back to the patrolzone and patrol. + end + end, {}, 20, 60, 0.2 ) + + +-- When the targets in the zone are destroyed, (see scheduled function), the planes will return home ... +function AIBAIZone:OnAfterAccomplish( Controllable, From, Event, To ) + BASE:E( "Test Mission: Sending the bombers back to base." ) + Check:Stop( CheckScheduleID ) + AIBAIZone:__RTB( 1 ) +end diff --git a/BAI - Battlefield Air Interdiction/BAI-100 - BAI of a Bridge/BAI-100 - BAI of a Bridge.miz b/BAI - Battlefield Air Interdiction/BAI-100 - BAI of a Bridge/BAI-100 - BAI of a Bridge.miz index 62149b6053..d4f5a38ca1 100644 Binary files a/BAI - Battlefield Air Interdiction/BAI-100 - BAI of a Bridge/BAI-100 - BAI of a Bridge.miz and b/BAI - Battlefield Air Interdiction/BAI-100 - BAI of a Bridge/BAI-100 - BAI of a Bridge.miz differ diff --git a/CAP - Combat Air Patrol/CAP-001 - Combat Air Patrol/CAP-001 - Combat Air Patrol.lua b/CAP - Combat Air Patrol/CAP-001 - Combat Air Patrol/CAP-001 - Combat Air Patrol.lua index 12abd4eb47..2ac13846ea 100644 --- a/CAP - Combat Air Patrol/CAP-001 - Combat Air Patrol/CAP-001 - Combat Air Patrol.lua +++ b/CAP - Combat Air Patrol/CAP-001 - Combat Air Patrol/CAP-001 - Combat Air Patrol.lua @@ -1,23 +1,23 @@ ---- --- Name: CAP-001 - Combat Air Patrol --- Author: FlightControl --- Date Created: 16 January 2017 --- --- # Situation: --- The Su-27 airplane will patrol in PatrolZone. --- It will not engage any enemy automatically. --- --- # Test cases: --- --- 1. Observe the Su-27 patrolling. --- - -local CapPlane = GROUP:FindByName( "Plane" ) - -local PatrolZone = ZONE:New( "Patrol Zone" ) - -AICapZone = AI_CAP_ZONE:New( PatrolZone, 500, 1000, 500, 600 ) - -AICapZone:SetControllable( CapPlane ) - -AICapZone:__Start( 1 ) -- They should statup, and start patrolling in the PatrolZone. +--- +-- Name: CAP-001 - Combat Air Patrol +-- Author: FlightControl +-- Date Created: 16 January 2017 +-- +-- # Situation: +-- The Su-27 airplane will patrol in PatrolZone. +-- It will not engage any enemy automatically. +-- +-- # Test cases: +-- +-- 1. Observe the Su-27 patrolling. +-- + +local CapPlane = GROUP:FindByName( "Plane" ) + +local PatrolZone = ZONE:New( "Patrol Zone" ) + +AICapZone = AI_CAP_ZONE:New( PatrolZone, 500, 1000, 500, 600 ) + +AICapZone:SetControllable( CapPlane ) + +AICapZone:__Start( 1 ) -- They should statup, and start patrolling in the PatrolZone. diff --git a/CAP - Combat Air Patrol/CAP-001 - Combat Air Patrol/CAP-001 - Combat Air Patrol.miz b/CAP - Combat Air Patrol/CAP-001 - Combat Air Patrol/CAP-001 - Combat Air Patrol.miz index e33bc68eb5..09173d098f 100644 Binary files a/CAP - Combat Air Patrol/CAP-001 - Combat Air Patrol/CAP-001 - Combat Air Patrol.miz and b/CAP - Combat Air Patrol/CAP-001 - Combat Air Patrol/CAP-001 - Combat Air Patrol.miz differ diff --git a/CAP - Combat Air Patrol/CAP-010 - CAP and Engage within Range/CAP-010 - CAP and Engage within Range.lua b/CAP - Combat Air Patrol/CAP-010 - CAP and Engage within Range/CAP-010 - CAP and Engage within Range.lua index 87189c8c5b..57a062f7cc 100644 --- a/CAP - Combat Air Patrol/CAP-010 - CAP and Engage within Range/CAP-010 - CAP and Engage within Range.lua +++ b/CAP - Combat Air Patrol/CAP-010 - CAP and Engage within Range/CAP-010 - CAP and Engage within Range.lua @@ -1,27 +1,27 @@ ---- --- Name: CAP-010 - CAP and Engage within Range --- Author: FlightControl --- Date Created: 16 January 2017 --- --- # Situation: --- --- The Su-27 airplane will patrol in PatrolZone. --- It will engage when it detects the airplane and when the A-10C is within the engage range. --- --- # Test cases: --- --- 1. Observe the Su-27 patrolling. --- 2. Observe that, when the A-10C is within the engage range, it will engage. --- 3. After engage, observe that the Su-27 returns to the PatrolZone. --- 4. If you want, you can wait until the Su-27 is out of fuel and will land. - -CapPlane = GROUP:FindByName( "Plane" ) - -PatrolZone = ZONE:New( "Patrol Zone" ) - -AICapZone = AI_CAP_ZONE:New( PatrolZone, 500, 1000, 500, 600 ) - -AICapZone:SetControllable( CapPlane ) -AICapZone:SetEngageRange( 20000 ) -- Set the Engage Range to 20.000 meters. The AI won't engage when the enemy is beyond 20.000 meters. - -AICapZone:__Start( 1 ) -- They should statup, and start patrolling in the PatrolZone. +--- +-- Name: CAP-010 - CAP and Engage within Range +-- Author: FlightControl +-- Date Created: 16 January 2017 +-- +-- # Situation: +-- +-- The Su-27 airplane will patrol in PatrolZone. +-- It will engage when it detects the airplane and when the A-10C is within the engage range. +-- +-- # Test cases: +-- +-- 1. Observe the Su-27 patrolling. +-- 2. Observe that, when the A-10C is within the engage range, it will engage. +-- 3. After engage, observe that the Su-27 returns to the PatrolZone. +-- 4. If you want, you can wait until the Su-27 is out of fuel and will land. + +CapPlane = GROUP:FindByName( "Plane" ) + +PatrolZone = ZONE:New( "Patrol Zone" ) + +AICapZone = AI_CAP_ZONE:New( PatrolZone, 500, 1000, 500, 600 ) + +AICapZone:SetControllable( CapPlane ) +AICapZone:SetEngageRange( 20000 ) -- Set the Engage Range to 20.000 meters. The AI won't engage when the enemy is beyond 20.000 meters. + +AICapZone:__Start( 1 ) -- They should statup, and start patrolling in the PatrolZone. diff --git a/CAP - Combat Air Patrol/CAP-010 - CAP and Engage within Range/CAP-010 - CAP and Engage within Range.miz b/CAP - Combat Air Patrol/CAP-010 - CAP and Engage within Range/CAP-010 - CAP and Engage within Range.miz index d21ebc74da..6d8057b030 100644 Binary files a/CAP - Combat Air Patrol/CAP-010 - CAP and Engage within Range/CAP-010 - CAP and Engage within Range.miz and b/CAP - Combat Air Patrol/CAP-010 - CAP and Engage within Range/CAP-010 - CAP and Engage within Range.miz differ diff --git a/CAP - Combat Air Patrol/CAP-011 - CAP and Engage within Zone/CAP-010 - CAP and Engage within Zone.lua b/CAP - Combat Air Patrol/CAP-011 - CAP and Engage within Zone/CAP-010 - CAP and Engage within Zone.lua new file mode 100644 index 0000000000..d85726d32c --- /dev/null +++ b/CAP - Combat Air Patrol/CAP-011 - CAP and Engage within Zone/CAP-010 - CAP and Engage within Zone.lua @@ -0,0 +1,23 @@ +-- Name: CAP-001 - Combat Air Patrol +-- Author: FlightControl +-- Date Created: 16 January 2017 +-- +-- # Situation: +-- +-- # Test cases: +-- + +local CapPlane = GROUP:FindByName( "Plane" ) + +local PatrolZone = ZONE:New( "Patrol Zone" ) + +local AICapZone = AI_CAP_ZONE:New( PatrolZone, 500, 1000, 500, 600 ) + +local EngageZoneGroup = GROUP:FindByName( "Engage Zone" ) + +local CapEngageZone = ZONE_POLYGON:New( "Engage Zone", EngageZoneGroup ) + +AICapZone:SetControllable( CapPlane ) +AICapZone:SetEngageZone( CapEngageZone ) -- Set the Engage Zone. The AI will only engage when the bogeys are within the CapEngageZone. + +AICapZone:__Start( 1 ) -- They should statup, and start patrolling in the PatrolZone. diff --git a/CAP - Combat Air Patrol/CAP-011 - CAP and Engage within Zone/CAP-011 - CAP and Engage within Zone.lua b/CAP - Combat Air Patrol/CAP-011 - CAP and Engage within Zone/CAP-011 - CAP and Engage within Zone.lua index 9c6d374153..bdb66f93f0 100644 --- a/CAP - Combat Air Patrol/CAP-011 - CAP and Engage within Zone/CAP-011 - CAP and Engage within Zone.lua +++ b/CAP - Combat Air Patrol/CAP-011 - CAP and Engage within Zone/CAP-011 - CAP and Engage within Zone.lua @@ -1,32 +1,32 @@ ---- --- Name: CAP-011 - CAP and Engage within Zone --- Author: FlightControl --- Date Created: 16 January 2017 --- --- # Situation: --- --- The Su-27 airplane will patrol in PatrolZone. --- It will engage when it detects the airplane and when the A-10C is within the CapEngageZone. --- --- # Test cases: --- --- 1. Observe the Su-27 patrolling. --- 2. Observe that, when the A-10C is within the engage zone, it will engage. --- 3. After engage, observe that the Su-27 returns to the PatrolZone. --- 4. If you want, you can wait until the Su-27 is out of fuel and will land. - - -CapPlane = GROUP:FindByName( "Plane" ) - -PatrolZone = ZONE:New( "Patrol Zone" ) - -AICapZone = AI_CAP_ZONE:New( PatrolZone, 500, 1000, 500, 600 ) - -EngageZoneGroup = GROUP:FindByName( "Engage Zone" ) - -CapEngageZone = ZONE_POLYGON:New( "Engage Zone", EngageZoneGroup ) - -AICapZone:SetControllable( CapPlane ) -AICapZone:SetEngageZone( CapEngageZone ) -- Set the Engage Zone. The AI will only engage when the bogeys are within the CapEngageZone. - -AICapZone:__Start( 1 ) -- They should statup, and start patrolling in the PatrolZone. +--- +-- Name: CAP-011 - CAP and Engage within Zone +-- Author: FlightControl +-- Date Created: 16 January 2017 +-- +-- # Situation: +-- +-- The Su-27 airplane will patrol in PatrolZone. +-- It will engage when it detects the airplane and when the A-10C is within the CapEngageZone. +-- +-- # Test cases: +-- +-- 1. Observe the Su-27 patrolling. +-- 2. Observe that, when the A-10C is within the engage zone, it will engage. +-- 3. After engage, observe that the Su-27 returns to the PatrolZone. +-- 4. If you want, you can wait until the Su-27 is out of fuel and will land. + + +CapPlane = GROUP:FindByName( "Plane" ) + +PatrolZone = ZONE:New( "Patrol Zone" ) + +AICapZone = AI_CAP_ZONE:New( PatrolZone, 500, 1000, 500, 600 ) + +EngageZoneGroup = GROUP:FindByName( "Engage Zone" ) + +CapEngageZone = ZONE_POLYGON:New( "Engage Zone", EngageZoneGroup ) + +AICapZone:SetControllable( CapPlane ) +AICapZone:SetEngageZone( CapEngageZone ) -- Set the Engage Zone. The AI will only engage when the bogeys are within the CapEngageZone. + +AICapZone:__Start( 1 ) -- They should statup, and start patrolling in the PatrolZone. diff --git a/CAP - Combat Air Patrol/CAP-011 - CAP and Engage within Zone/CAP-011 - CAP and Engage within Zone.miz b/CAP - Combat Air Patrol/CAP-011 - CAP and Engage within Zone/CAP-011 - CAP and Engage within Zone.miz index fbd8d37f2a..ca4ec5fe03 100644 Binary files a/CAP - Combat Air Patrol/CAP-011 - CAP and Engage within Zone/CAP-011 - CAP and Engage within Zone.miz and b/CAP - Combat Air Patrol/CAP-011 - CAP and Engage within Zone/CAP-011 - CAP and Engage within Zone.miz differ diff --git a/CAP - Combat Air Patrol/CAP-012 - CAP - Test Abort/CAP-012 - CAP - Test Abort.lua b/CAP - Combat Air Patrol/CAP-012 - CAP - Test Abort/CAP-012 - CAP - Test Abort.lua index 3b0ad84bc6..dc423e74d7 100644 --- a/CAP - Combat Air Patrol/CAP-012 - CAP - Test Abort/CAP-012 - CAP - Test Abort.lua +++ b/CAP - Combat Air Patrol/CAP-012 - CAP - Test Abort/CAP-012 - CAP - Test Abort.lua @@ -1,43 +1,43 @@ ---- --- Name: CAP-012 - CAP - Test Abort --- Author: FlightControl --- Date Created: 14 Mar 2017 --- --- # Situation: --- --- The Su-27 airplane will patrol in PatrolZone. --- It will engage when it detects the airplane and when the A-10C is within the CapEngageZone. --- It will abort the engagement after 1 minute and return to the patrol zone. --- --- # Test cases: --- --- 1. Observe the Su-27 patrolling. --- 2. Observe that, when the A-10C is within the engage zone, it will engage. --- 3. After engage, observe that the Su-27 returns to the PatrolZone. --- 4. When it engages, it will abort the engagement after 1 minute. - - -CapPlane = GROUP:FindByName( "Plane" ) - -PatrolZone = ZONE:New( "Patrol Zone" ) - -AICapZone = AI_CAP_ZONE:New( PatrolZone, 500, 1000, 500, 600 ) - -EngageZoneGroup = GROUP:FindByName( "Engage Zone" ) - -CapEngageZone = ZONE_POLYGON:New( "Engage Zone", EngageZoneGroup ) - -AICapZone:SetControllable( CapPlane ) -AICapZone:SetEngageZone( CapEngageZone ) -- Set the Engage Zone. The AI will only engage when the bogeys are within the CapEngageZone. - -AICapZone:__Start( 1 ) -- They should statup, and start patrolling in the PatrolZone. - -function AICapZone:OnAfterEngage(Controllable,From,Event,To) - AICapZone:__Abort( 60 ) -end - -function AICapZone:OnAfterAbort(Controllable,From,Event,To) - BASE:E("MISSION ABORTED! Returning to Patrol Zone!") - MESSAGE:New("MISSION ABORTED! Returning to Patrol Zone!",30,"ALERT!") -end - +--- +-- Name: CAP-012 - CAP - Test Abort +-- Author: FlightControl +-- Date Created: 14 Mar 2017 +-- +-- # Situation: +-- +-- The Su-27 airplane will patrol in PatrolZone. +-- It will engage when it detects the airplane and when the A-10C is within the CapEngageZone. +-- It will abort the engagement after 1 minute and return to the patrol zone. +-- +-- # Test cases: +-- +-- 1. Observe the Su-27 patrolling. +-- 2. Observe that, when the A-10C is within the engage zone, it will engage. +-- 3. After engage, observe that the Su-27 returns to the PatrolZone. +-- 4. When it engages, it will abort the engagement after 1 minute. + + +CapPlane = GROUP:FindByName( "Plane" ) + +PatrolZone = ZONE:New( "Patrol Zone" ) + +AICapZone = AI_CAP_ZONE:New( PatrolZone, 500, 1000, 500, 600 ) + +EngageZoneGroup = GROUP:FindByName( "Engage Zone" ) + +CapEngageZone = ZONE_POLYGON:New( "Engage Zone", EngageZoneGroup ) + +AICapZone:SetControllable( CapPlane ) +AICapZone:SetEngageZone( CapEngageZone ) -- Set the Engage Zone. The AI will only engage when the bogeys are within the CapEngageZone. + +AICapZone:__Start( 1 ) -- They should statup, and start patrolling in the PatrolZone. + +function AICapZone:OnAfterEngage(Controllable,From,Event,To) + AICapZone:__Abort( 60 ) +end + +function AICapZone:OnAfterAbort(Controllable,From,Event,To) + BASE:E("MISSION ABORTED! Returning to Patrol Zone!") + MESSAGE:New("MISSION ABORTED! Returning to Patrol Zone!",30,"ALERT!") +end + diff --git a/CAP - Combat Air Patrol/CAP-012 - CAP - Test Abort/CAP-012 - CAP - Test Abort.miz b/CAP - Combat Air Patrol/CAP-012 - CAP - Test Abort/CAP-012 - CAP - Test Abort.miz index 4e6ed52a3c..3035da225c 100644 Binary files a/CAP - Combat Air Patrol/CAP-012 - CAP - Test Abort/CAP-012 - CAP - Test Abort.miz and b/CAP - Combat Air Patrol/CAP-012 - CAP - Test Abort/CAP-012 - CAP - Test Abort.miz differ diff --git a/CAP - Combat Air Patrol/CAP-020 - Combat Air Patrol RTB Test/CAP-020 - Combat Air Patrol RTB Test.lua b/CAP - Combat Air Patrol/CAP-020 - Combat Air Patrol RTB Test/CAP-020 - Combat Air Patrol RTB Test.lua index 16f456f049..8f59293722 100644 --- a/CAP - Combat Air Patrol/CAP-020 - Combat Air Patrol RTB Test/CAP-020 - Combat Air Patrol RTB Test.lua +++ b/CAP - Combat Air Patrol/CAP-020 - Combat Air Patrol RTB Test/CAP-020 - Combat Air Patrol RTB Test.lua @@ -1,27 +1,27 @@ ---- --- Name: CAP-020 - Combat Air Patrol RTB Test --- Author: FlightControl --- Date Created: 14 February 2017 --- --- # Situation: --- The Su-27 airplane will patrol in PatrolZone. --- It will return to base when out of fuel. --- --- # Test cases: --- --- 1. Observe the Su-27 patrolling. --- 2. It should return to base when out of fuel. --- - -CapSpawn = SPAWN:New( "Plane" ):InitLimit(1,2):InitRepeatOnLanding() - -CapGroup = CapSpawn:Spawn() - -PatrolZone = ZONE:New( "Patrol Zone" ) - -AICapZone = AI_CAP_ZONE:New( PatrolZone, 500, 1000, 500, 600 ) - -AICapZone:SetControllable( CapGroup ) - -AICapZone:__Start( 1 ) -- They should statup, and start patrolling in the PatrolZone. - +--- +-- Name: CAP-020 - Combat Air Patrol RTB Test +-- Author: FlightControl +-- Date Created: 14 February 2017 +-- +-- # Situation: +-- The Su-27 airplane will patrol in PatrolZone. +-- It will return to base when out of fuel. +-- +-- # Test cases: +-- +-- 1. Observe the Su-27 patrolling. +-- 2. It should return to base when out of fuel. +-- + +CapSpawn = SPAWN:New( "Plane" ):InitLimit(1,2):InitRepeatOnLanding() + +CapGroup = CapSpawn:Spawn() + +PatrolZone = ZONE:New( "Patrol Zone" ) + +AICapZone = AI_CAP_ZONE:New( PatrolZone, 500, 1000, 500, 600 ) + +AICapZone:SetControllable( CapGroup ) + +AICapZone:__Start( 1 ) -- They should statup, and start patrolling in the PatrolZone. + diff --git a/CAP - Combat Air Patrol/CAP-020 - Combat Air Patrol RTB Test/CAP-020 - Combat Air Patrol RTB Test.miz b/CAP - Combat Air Patrol/CAP-020 - Combat Air Patrol RTB Test/CAP-020 - Combat Air Patrol RTB Test.miz index d149e09ada..8fb5b8dff3 100644 Binary files a/CAP - Combat Air Patrol/CAP-020 - Combat Air Patrol RTB Test/CAP-020 - Combat Air Patrol RTB Test.miz and b/CAP - Combat Air Patrol/CAP-020 - Combat Air Patrol RTB Test/CAP-020 - Combat Air Patrol RTB Test.miz differ diff --git a/CAP - Combat Air Patrol/CAP-100 - AI_A2A_CAP - Normal CAP/CAP-100 - AI_A2A_CAP - Normal CAP.lua b/CAP - Combat Air Patrol/CAP-100 - AI_A2A_CAP - Normal CAP/CAP-100 - AI_A2A_CAP - Normal CAP.lua index 7b5db069a6..926acdfda2 100644 --- a/CAP - Combat Air Patrol/CAP-100 - AI_A2A_CAP - Normal CAP/CAP-100 - AI_A2A_CAP - Normal CAP.lua +++ b/CAP - Combat Air Patrol/CAP-100 - AI_A2A_CAP - Normal CAP/CAP-100 - AI_A2A_CAP - Normal CAP.lua @@ -1,26 +1,26 @@ ---- --- Name: CAP-100 - AI_A2A_CAP - Normal CAP --- Author: FlightControl --- Date Created: 30 May 2017 --- --- # Situation: --- The Su-27 airplane will patrol in PatrolZone. --- It will not engage any enemy automatically. --- --- # Test cases: --- --- 1. Observe the Su-27 patrolling. --- - -local CapPlane = GROUP:FindByName( "Plane" ) - -local PatrolZone = ZONE:New( "Patrol Zone" ) - -A2ACap = AI_A2A_CAP:New( CapPlane, PatrolZone, 500, 1000, 500, 600 ) - -A2ACap:Patrol() - -local IntruderUnit = UNIT:FindByName( "Intruder" ) - - +--- +-- Name: CAP-100 - AI_A2A_CAP - Normal CAP +-- Author: FlightControl +-- Date Created: 30 May 2017 +-- +-- # Situation: +-- The Su-27 airplane will patrol in PatrolZone. +-- It will not engage any enemy automatically. +-- +-- # Test cases: +-- +-- 1. Observe the Su-27 patrolling. +-- + +local CapPlane = GROUP:FindByName( "Plane" ) + +local PatrolZone = ZONE:New( "Patrol Zone" ) + +A2ACap = AI_A2A_CAP:New( CapPlane, PatrolZone, 500, 1000, 500, 600 ) + +A2ACap:Patrol() + +local IntruderUnit = UNIT:FindByName( "Intruder" ) + + A2ACap:__Engage( 120, { IntruderUnit } ) \ No newline at end of file diff --git a/CAP - Combat Air Patrol/CAP-100 - AI_A2A_CAP - Normal CAP/CAP-100 - AI_A2A_CAP - Normal CAP.miz b/CAP - Combat Air Patrol/CAP-100 - AI_A2A_CAP - Normal CAP/CAP-100 - AI_A2A_CAP - Normal CAP.miz index a49d3caebb..7bea15f8f0 100644 Binary files a/CAP - Combat Air Patrol/CAP-100 - AI_A2A_CAP - Normal CAP/CAP-100 - AI_A2A_CAP - Normal CAP.miz and b/CAP - Combat Air Patrol/CAP-100 - AI_A2A_CAP - Normal CAP/CAP-100 - AI_A2A_CAP - Normal CAP.miz differ diff --git a/CAS - Close Air Support/CAS-001 - CAS in a Zone by Airplane Group/CAS-001 - CAS in a Zone by Airplane Group.lua b/CAS - Close Air Support/CAS-001 - CAS in a Zone by Airplane Group/CAS-001 - CAS in a Zone by Airplane Group.lua index fea4b81e98..2dc0d39eeb 100644 --- a/CAS - Close Air Support/CAS-001 - CAS in a Zone by Airplane Group/CAS-001 - CAS in a Zone by Airplane Group.lua +++ b/CAS - Close Air Support/CAS-001 - CAS in a Zone by Airplane Group/CAS-001 - CAS in a Zone by Airplane Group.lua @@ -1,74 +1,74 @@ ---- --- Name: CAS-001 - CAS in a Zone by Airplane Group --- Author: FlightControl --- Date Created: 13 January 2017 --- --- # Situation: --- --- A group of 4 Su-25T at patrolling north of an engage zone for 10 minutes. --- After 10 minutes, the command center orders the Su-25T to engage the zone and execute a CAS. --- --- # Test cases: --- --- 1. Observe that the Su-25T is patrolling in the patrol zone, until the engage command is given. --- 2. The Su-25T are not detecting any target during the patrol. --- 3. When the Su-25T is commanded to engage, the group will fly to the engage zone. --- 4. Detection is activated and detected targets within the engage zone are assigned for CAS. --- 5. Observe the Su-25T eliminating the targets. --- 6. Observe the Su-25T defenses. --- 7. When all targets within the engage zone are destroyed, the Su-25T CAS task is set to Accomplished. --- 8. The Su-25T will return to base. - - - --- Create a local variable (in this case called CASEngagementZone) and --- using the ZONE function find the pre-defined zone called "Engagement Zone" --- currently on the map and assign it to this variable -CASEngagementZone = ZONE:New( "Engagement Zone" ) - --- Create a local variable (in this case called CASPlane) and --- using the GROUP function find the aircraft group called "Plane" and assign to this variable -CASPlane = GROUP:FindByName( "Plane" ) - --- Create a local Variable (in this cased called PatrolZone and --- using the ZONE function find the pre-defined zone called "Patrol Zone" and assign it to this variable -PatrolZone = ZONE:New( "Patrol Zone" ) - --- Create and object (in this case called AICasZone) and --- using the functions AI_CAS_ZONE assign the parameters that define this object --- (in this case PatrolZone, 500, 1000, 500, 600, CASEngagementZone) -AICasZone = AI_CAS_ZONE:New( PatrolZone, 500, 1000, 500, 600, CASEngagementZone ) - --- Create an object (in this case called Targets) and --- using the GROUP function find the group labeled "Targets" and assign it to this object -Targets = GROUP:FindByName("Targets") - - --- Tell the program to use the object (in this case called CASPlane) as the group to use in the CAS function -AICasZone:SetControllable( CASPlane ) - --- Tell the group CASPlane to start the mission in 1 second. -AICasZone:__Start( 1 ) -- They should statup, and start patrolling in the PatrolZone. - --- After 10 minutes, tell the group CASPlane to engage the targets located in the engagement zone called CASEngagement Zone. (600 is 600 seconds) -AICasZone:__Engage( 600 ) - --- Check every 60 seconds whether the Targets have been eliminated. --- When the trigger completed has been fired, the Plane will go back to the Patrol Zone. -Check, CheckScheduleID = SCHEDULER:New(nil, - function() - if Targets:IsAlive() and Targets:GetSize() > 5 then - BASE:E( "Test Mission: " .. Targets:GetSize() .. " targets left to be destroyed.") - else - BASE:E( "Test Mission: The required targets are destroyed." ) - AICasZone:__Accomplish( 1 ) -- Now they should fly back to the patrolzone and patrol. - end - end, {}, 20, 60, 0.2 ) - - --- When the targets in the zone are destroyed, (see scheduled function), the planes will return home ... -function AICasZone:OnAfterAccomplish( Controllable, From, Event, To ) - BASE:E( "Test Mission: Sending the Su-25T back to base." ) - Check:Stop( CheckScheduleID ) - AICasZone:__RTB( 1 ) -end +--- +-- Name: CAS-001 - CAS in a Zone by Airplane Group +-- Author: FlightControl +-- Date Created: 13 January 2017 +-- +-- # Situation: +-- +-- A group of 4 Su-25T at patrolling north of an engage zone for 10 minutes. +-- After 10 minutes, the command center orders the Su-25T to engage the zone and execute a CAS. +-- +-- # Test cases: +-- +-- 1. Observe that the Su-25T is patrolling in the patrol zone, until the engage command is given. +-- 2. The Su-25T are not detecting any target during the patrol. +-- 3. When the Su-25T is commanded to engage, the group will fly to the engage zone. +-- 4. Detection is activated and detected targets within the engage zone are assigned for CAS. +-- 5. Observe the Su-25T eliminating the targets. +-- 6. Observe the Su-25T defenses. +-- 7. When all targets within the engage zone are destroyed, the Su-25T CAS task is set to Accomplished. +-- 8. The Su-25T will return to base. + +--test + +-- Create a local variable (in this case called CASEngagementZone) and +-- using the ZONE function find the pre-defined zone called "Engagement Zone" +-- currently on the map and assign it to this variable +CASEngagementZone = ZONE:New( "Engagement Zone" ) + +-- Create a local variable (in this case called CASPlane) and +-- using the GROUP function find the aircraft group called "Plane" and assign to this variable +CASPlane = GROUP:FindByName( "Plane" ) + +-- Create a local Variable (in this cased called PatrolZone and +-- using the ZONE function find the pre-defined zone called "Patrol Zone" and assign it to this variable +PatrolZone = ZONE:New( "Patrol Zone" ) + +-- Create and object (in this case called AICasZone) and +-- using the functions AI_CAS_ZONE assign the parameters that define this object +-- (in this case PatrolZone, 500, 1000, 500, 600, CASEngagementZone) +AICasZone = AI_CAS_ZONE:New( PatrolZone, 500, 1000, 500, 600, CASEngagementZone ) + +-- Create an object (in this case called Targets) and +-- using the GROUP function find the group labeled "Targets" and assign it to this object +Targets = GROUP:FindByName("Targets") + + +-- Tell the program to use the object (in this case called CASPlane) as the group to use in the CAS function +AICasZone:SetControllable( CASPlane ) + +-- Tell the group CASPlane to start the mission in 1 second. +AICasZone:__Start( 1 ) -- They should statup, and start patrolling in the PatrolZone. + +-- After 10 minutes, tell the group CASPlane to engage the targets located in the engagement zone called CASEngagement Zone. (600 is 600 seconds) +AICasZone:__Engage( 600 ) + +-- Check every 60 seconds whether the Targets have been eliminated. +-- When the trigger completed has been fired, the Plane will go back to the Patrol Zone. +Check, CheckScheduleID = SCHEDULER:New(nil, + function() + if Targets:IsAlive() and Targets:GetSize() > 5 then + BASE:E( "Test Mission: " .. Targets:GetSize() .. " targets left to be destroyed.") + else + BASE:E( "Test Mission: The required targets are destroyed." ) + AICasZone:__Accomplish( 1 ) -- Now they should fly back to the patrolzone and patrol. + end + end, {}, 20, 60, 0.2 ) + + +-- When the targets in the zone are destroyed, (see scheduled function), the planes will return home ... +function AICasZone:OnAfterAccomplish( Controllable, From, Event, To ) + BASE:E( "Test Mission: Sending the Su-25T back to base." ) + Check:Stop( CheckScheduleID ) + AICasZone:__RTB( 1 ) +end diff --git a/CAS - Close Air Support/CAS-001 - CAS in a Zone by Airplane Group/CAS-001 - CAS in a Zone by Airplane Group.miz b/CAS - Close Air Support/CAS-001 - CAS in a Zone by Airplane Group/CAS-001 - CAS in a Zone by Airplane Group.miz index ef77b094bf..ccff8f3e57 100644 Binary files a/CAS - Close Air Support/CAS-001 - CAS in a Zone by Airplane Group/CAS-001 - CAS in a Zone by Airplane Group.miz and b/CAS - Close Air Support/CAS-001 - CAS in a Zone by Airplane Group/CAS-001 - CAS in a Zone by Airplane Group.miz differ diff --git a/CAS - Close Air Support/CAS-002 - CAS in a Zone by Airplane Group - Engage with Speed/CAS-002 - CAS in a Zone by Airplane Group - Engage with Speed.lua b/CAS - Close Air Support/CAS-002 - CAS in a Zone by Airplane Group - Engage with Speed/CAS-002 - CAS in a Zone by Airplane Group - Engage with Speed.lua index fad0bea38c..f9bd0aee24 100644 --- a/CAS - Close Air Support/CAS-002 - CAS in a Zone by Airplane Group - Engage with Speed/CAS-002 - CAS in a Zone by Airplane Group - Engage with Speed.lua +++ b/CAS - Close Air Support/CAS-002 - CAS in a Zone by Airplane Group - Engage with Speed/CAS-002 - CAS in a Zone by Airplane Group - Engage with Speed.lua @@ -1,75 +1,75 @@ ---- --- Name: CAS-002 - CAS in a Zone by Airplane Group - Engage with Speed --- Author: FlightControl --- Date Created: 06 February 2017 --- --- # Situation: --- --- A group of 4 Su-25T at patrolling north of an engage zone for 1 minute. --- After 1 minute, the command center orders the Su-25T to engage the zone and execute a CAS. --- --- # Test cases: --- --- 1. Observe that the Su-25T is patrolling in the patrol zone, until the engage command is given. --- 2. The Su-25T are not detecting any target during the patrol. --- 3. When the Su-25T is commanded to engage, the group will fly to the engage zone. --- 3.1. The approach speed to the engage zone is set to 400 km/h. --- 4. Detection is activated and detected targets within the engage zone are assigned for CAS. --- 5. Observe the Su-25T eliminating the targets. --- 6. Observe the Su-25T defenses. --- 7. When all targets within the engage zone are destroyed, the Su-25T CAS task is set to Accomplished. --- 8. The Su-25T will return to base. - - - --- Create a local variable (in this case called CASEngagementZone) and --- using the ZONE function find the pre-defined zone called "Engagement Zone" --- currently on the map and assign it to this variable -CASEngagementZone = ZONE:New( "Engagement Zone" ) - --- Create a local variable (in this case called CASPlane) and --- using the GROUP function find the aircraft group called "Plane" and assign to this variable -CASPlane = GROUP:FindByName( "Plane" ) - --- Create a local Variable (in this cased called PatrolZone and --- using the ZONE function find the pre-defined zone called "Patrol Zone" and assign it to this variable -PatrolZone = ZONE:New( "Patrol Zone" ) - --- Create and object (in this case called AICasZone) and --- using the functions AI_CAS_ZONE assign the parameters that define this object --- (in this case PatrolZone, 500, 1000, 500, 600, CASEngagementZone) -AICasZone = AI_CAS_ZONE:New( PatrolZone, 500, 1000, 500, 600, CASEngagementZone ) - --- Create an object (in this case called Targets) and --- using the GROUP function find the group labeled "Targets" and assign it to this object -Targets = GROUP:FindByName("Targets") - - --- Tell the program to use the object (in this case called CASPlane) as the group to use in the CAS function -AICasZone:SetControllable( CASPlane ) - --- Tell the group CASPlane to start the mission in 1 second. -AICasZone:__Start( 1 ) -- They should statup, and start patrolling in the PatrolZone. - --- After 10 minutes, tell the group CASPlane to engage the targets located in the engagement zone called CASEngagement Zone. (600 is 600 seconds) -AICasZone:__Engage( 60, 400 ) -- Engage after one minute with a speed of 400 km/h. - --- Check every 60 seconds whether the Targets have been eliminated. --- When the trigger completed has been fired, the Plane will go back to the Patrol Zone. -Check, CheckScheduleID = SCHEDULER:New(nil, - function() - if Targets:IsAlive() and Targets:GetSize() > 5 then - BASE:E( "Test Mission: " .. Targets:GetSize() .. " targets left to be destroyed.") - else - BASE:E( "Test Mission: The required targets are destroyed." ) - AICasZone:__Accomplish( 1 ) -- Now they should fly back to teh patrolzone and patrol. - end - end, {}, 20, 60, 0.2 ) - - --- When the targets in the zone are destroyed, (see scheduled function), the planes will return home ... -function AICasZone:OnAfterAccomplish( Controllable, From, Event, To ) - BASE:E( "Test Mission: Sending the Su-25T back to base." ) - Check:Stop( CheckScheduleID ) - AICasZone:__RTB( 1 ) -end +--- +-- Name: CAS-002 - CAS in a Zone by Airplane Group - Engage with Speed +-- Author: FlightControl +-- Date Created: 06 February 2017 +-- +-- # Situation: +-- +-- A group of 4 Su-25T at patrolling north of an engage zone for 1 minute. +-- After 1 minute, the command center orders the Su-25T to engage the zone and execute a CAS. +-- +-- # Test cases: +-- +-- 1. Observe that the Su-25T is patrolling in the patrol zone, until the engage command is given. +-- 2. The Su-25T are not detecting any target during the patrol. +-- 3. When the Su-25T is commanded to engage, the group will fly to the engage zone. +-- 3.1. The approach speed to the engage zone is set to 400 km/h. +-- 4. Detection is activated and detected targets within the engage zone are assigned for CAS. +-- 5. Observe the Su-25T eliminating the targets. +-- 6. Observe the Su-25T defenses. +-- 7. When all targets within the engage zone are destroyed, the Su-25T CAS task is set to Accomplished. +-- 8. The Su-25T will return to base. + + + +-- Create a local variable (in this case called CASEngagementZone) and +-- using the ZONE function find the pre-defined zone called "Engagement Zone" +-- currently on the map and assign it to this variable +CASEngagementZone = ZONE:New( "Engagement Zone" ) + +-- Create a local variable (in this case called CASPlane) and +-- using the GROUP function find the aircraft group called "Plane" and assign to this variable +CASPlane = GROUP:FindByName( "Plane" ) + +-- Create a local Variable (in this cased called PatrolZone and +-- using the ZONE function find the pre-defined zone called "Patrol Zone" and assign it to this variable +PatrolZone = ZONE:New( "Patrol Zone" ) + +-- Create and object (in this case called AICasZone) and +-- using the functions AI_CAS_ZONE assign the parameters that define this object +-- (in this case PatrolZone, 500, 1000, 500, 600, CASEngagementZone) +AICasZone = AI_CAS_ZONE:New( PatrolZone, 500, 1000, 500, 600, CASEngagementZone ) + +-- Create an object (in this case called Targets) and +-- using the GROUP function find the group labeled "Targets" and assign it to this object +Targets = GROUP:FindByName("Targets") + + +-- Tell the program to use the object (in this case called CASPlane) as the group to use in the CAS function +AICasZone:SetControllable( CASPlane ) + +-- Tell the group CASPlane to start the mission in 1 second. +AICasZone:__Start( 1 ) -- They should statup, and start patrolling in the PatrolZone. + +-- After 10 minutes, tell the group CASPlane to engage the targets located in the engagement zone called CASEngagement Zone. (600 is 600 seconds) +AICasZone:__Engage( 60, 400 ) -- Engage after one minute with a speed of 400 km/h. + +-- Check every 60 seconds whether the Targets have been eliminated. +-- When the trigger completed has been fired, the Plane will go back to the Patrol Zone. +Check, CheckScheduleID = SCHEDULER:New(nil, + function() + if Targets:IsAlive() and Targets:GetSize() > 5 then + BASE:E( "Test Mission: " .. Targets:GetSize() .. " targets left to be destroyed.") + else + BASE:E( "Test Mission: The required targets are destroyed." ) + AICasZone:__Accomplish( 1 ) -- Now they should fly back to teh patrolzone and patrol. + end + end, {}, 20, 60, 0.2 ) + + +-- When the targets in the zone are destroyed, (see scheduled function), the planes will return home ... +function AICasZone:OnAfterAccomplish( Controllable, From, Event, To ) + BASE:E( "Test Mission: Sending the Su-25T back to base." ) + Check:Stop( CheckScheduleID ) + AICasZone:__RTB( 1 ) +end diff --git a/CAS - Close Air Support/CAS-002 - CAS in a Zone by Airplane Group - Engage with Speed/CAS-002 - CAS in a Zone by Airplane Group - Engage with Speed.miz b/CAS - Close Air Support/CAS-002 - CAS in a Zone by Airplane Group - Engage with Speed/CAS-002 - CAS in a Zone by Airplane Group - Engage with Speed.miz index dd1f0fe57c..5806f9e8b1 100644 Binary files a/CAS - Close Air Support/CAS-002 - CAS in a Zone by Airplane Group - Engage with Speed/CAS-002 - CAS in a Zone by Airplane Group - Engage with Speed.miz and b/CAS - Close Air Support/CAS-002 - CAS in a Zone by Airplane Group - Engage with Speed/CAS-002 - CAS in a Zone by Airplane Group - Engage with Speed.miz differ diff --git a/CAS - Close Air Support/CAS-003 - CAS in a Zone by Airplane Group - Engage with Speed and Altitude/CAS-003 - CAS in a Zone by Airplane Group - Engage with Speed and Altitude.lua b/CAS - Close Air Support/CAS-003 - CAS in a Zone by Airplane Group - Engage with Speed and Altitude/CAS-003 - CAS in a Zone by Airplane Group - Engage with Speed and Altitude.lua index 8af2ca77e8..60c91bbaf7 100644 --- a/CAS - Close Air Support/CAS-003 - CAS in a Zone by Airplane Group - Engage with Speed and Altitude/CAS-003 - CAS in a Zone by Airplane Group - Engage with Speed and Altitude.lua +++ b/CAS - Close Air Support/CAS-003 - CAS in a Zone by Airplane Group - Engage with Speed and Altitude/CAS-003 - CAS in a Zone by Airplane Group - Engage with Speed and Altitude.lua @@ -1,76 +1,76 @@ ---- --- Name: CAS-003 - CAS in a Zone by Airplane Group - Engage with Speed and Altitude --- Author: FlightControl --- Date Created: 6 February 2017 --- --- # Situation: --- --- A group of 4 Su-25T at patrolling north of an engage zone for 1 minute. --- After 1 minute, the command center orders the Su-25T to engage the zone and execute a CAS. --- --- # Test cases: --- --- 1. Observe that the Su-25T is patrolling in the patrol zone, until the engage command is given. --- 2. The Su-25T are not detecting any target during the patrol. --- 3. When the Su-25T is commanded to engage, the group will fly to the engage zone --- 3.1. The approach speed to the engage zone is set to 400 km/h. --- 3.2. The altitude to the engage zone and CAS execution is set to 500 meters. --- 4. Detection is activated and detected targets within the engage zone are assigned for CAS. --- 5. Observe the Su-25T eliminating the targets. --- 6. Observe the Su-25T defenses. --- 7. When all targets within the engage zone are destroyed, the Su-25T CAS task is set to Accomplished. --- 8. The Su-25T will return to base. - - - --- Create a local variable (in this case called CASEngagementZone) and --- using the ZONE function find the pre-defined zone called "Engagement Zone" --- currently on the map and assign it to this variable -CASEngagementZone = ZONE:New( "Engagement Zone" ) - --- Create a local variable (in this case called CASPlane) and --- using the GROUP function find the aircraft group called "Plane" and assign to this variable -CASPlane = GROUP:FindByName( "Plane" ) - --- Create a local Variable (in this cased called PatrolZone and --- using the ZONE function find the pre-defined zone called "Patrol Zone" and assign it to this variable -PatrolZone = ZONE:New( "Patrol Zone" ) - --- Create and object (in this case called AICasZone) and --- using the functions AI_CAS_ZONE assign the parameters that define this object --- (in this case PatrolZone, 500, 1000, 500, 600, CASEngagementZone) -AICasZone = AI_CAS_ZONE:New( PatrolZone, 500, 1000, 500, 600, CASEngagementZone ) - --- Create an object (in this case called Targets) and --- using the GROUP function find the group labeled "Targets" and assign it to this object -Targets = GROUP:FindByName("Targets") - - --- Tell the program to use the object (in this case called CASPlane) as the group to use in the CAS function -AICasZone:SetControllable( CASPlane ) - --- Tell the group CASPlane to start the mission in 1 second. -AICasZone:__Start( 1 ) -- They should statup, and start patrolling in the PatrolZone. - --- After 10 minutes, tell the group CASPlane to engage the targets located in the engagement zone called CASEngagement Zone. (600 is 600 seconds) -AICasZone:__Engage( 600, 350, 4000 ) -- Engage after 10 minutes with a speed of 350 km/h and an altitude of 4000 meters. - --- Check every 60 seconds whether the Targets have been eliminated. --- When the trigger completed has been fired, the Plane will go back to the Patrol Zone. -Check, CheckScheduleID = SCHEDULER:New(nil, - function() - if Targets:IsAlive() and Targets:GetSize() > 5 then - BASE:E( "Test Mission: " .. Targets:GetSize() .. " targets left to be destroyed.") - else - BASE:E( "Test Mission: The required targets are destroyed." ) - AICasZone:__Accomplish( 1 ) -- Now they should fly back to teh patrolzone and patrol. - end - end, {}, 20, 60, 0.2 ) - - --- When the targets in the zone are destroyed, (see scheduled function), the planes will return home ... -function AICasZone:OnAfterAccomplish( Controllable, From, Event, To ) - BASE:E( "Test Mission: Sending the Su-25T back to base." ) - Check:Stop( CheckScheduleID ) - AICasZone:__RTB( 1 ) -end +--- +-- Name: CAS-003 - CAS in a Zone by Airplane Group - Engage with Speed and Altitude +-- Author: FlightControl +-- Date Created: 6 February 2017 +-- +-- # Situation: +-- +-- A group of 4 Su-25T at patrolling north of an engage zone for 1 minute. +-- After 1 minute, the command center orders the Su-25T to engage the zone and execute a CAS. +-- +-- # Test cases: +-- +-- 1. Observe that the Su-25T is patrolling in the patrol zone, until the engage command is given. +-- 2. The Su-25T are not detecting any target during the patrol. +-- 3. When the Su-25T is commanded to engage, the group will fly to the engage zone +-- 3.1. The approach speed to the engage zone is set to 400 km/h. +-- 3.2. The altitude to the engage zone and CAS execution is set to 500 meters. +-- 4. Detection is activated and detected targets within the engage zone are assigned for CAS. +-- 5. Observe the Su-25T eliminating the targets. +-- 6. Observe the Su-25T defenses. +-- 7. When all targets within the engage zone are destroyed, the Su-25T CAS task is set to Accomplished. +-- 8. The Su-25T will return to base. + + + +-- Create a local variable (in this case called CASEngagementZone) and +-- using the ZONE function find the pre-defined zone called "Engagement Zone" +-- currently on the map and assign it to this variable +CASEngagementZone = ZONE:New( "Engagement Zone" ) + +-- Create a local variable (in this case called CASPlane) and +-- using the GROUP function find the aircraft group called "Plane" and assign to this variable +CASPlane = GROUP:FindByName( "Plane" ) + +-- Create a local Variable (in this cased called PatrolZone and +-- using the ZONE function find the pre-defined zone called "Patrol Zone" and assign it to this variable +PatrolZone = ZONE:New( "Patrol Zone" ) + +-- Create and object (in this case called AICasZone) and +-- using the functions AI_CAS_ZONE assign the parameters that define this object +-- (in this case PatrolZone, 500, 1000, 500, 600, CASEngagementZone) +AICasZone = AI_CAS_ZONE:New( PatrolZone, 500, 1000, 500, 600, CASEngagementZone ) + +-- Create an object (in this case called Targets) and +-- using the GROUP function find the group labeled "Targets" and assign it to this object +Targets = GROUP:FindByName("Targets") + + +-- Tell the program to use the object (in this case called CASPlane) as the group to use in the CAS function +AICasZone:SetControllable( CASPlane ) + +-- Tell the group CASPlane to start the mission in 1 second. +AICasZone:__Start( 1 ) -- They should statup, and start patrolling in the PatrolZone. + +-- After 10 minutes, tell the group CASPlane to engage the targets located in the engagement zone called CASEngagement Zone. (600 is 600 seconds) +AICasZone:__Engage( 600, 350, 4000 ) -- Engage after 10 minutes with a speed of 350 km/h and an altitude of 4000 meters. + +-- Check every 60 seconds whether the Targets have been eliminated. +-- When the trigger completed has been fired, the Plane will go back to the Patrol Zone. +Check, CheckScheduleID = SCHEDULER:New(nil, + function() + if Targets:IsAlive() and Targets:GetSize() > 5 then + BASE:E( "Test Mission: " .. Targets:GetSize() .. " targets left to be destroyed.") + else + BASE:E( "Test Mission: The required targets are destroyed." ) + AICasZone:__Accomplish( 1 ) -- Now they should fly back to teh patrolzone and patrol. + end + end, {}, 20, 60, 0.2 ) + + +-- When the targets in the zone are destroyed, (see scheduled function), the planes will return home ... +function AICasZone:OnAfterAccomplish( Controllable, From, Event, To ) + BASE:E( "Test Mission: Sending the Su-25T back to base." ) + Check:Stop( CheckScheduleID ) + AICasZone:__RTB( 1 ) +end diff --git a/CAS - Close Air Support/CAS-003 - CAS in a Zone by Airplane Group - Engage with Speed and Altitude/CAS-003 - CAS in a Zone by Airplane Group - Engage with Speed and Altitude.miz b/CAS - Close Air Support/CAS-003 - CAS in a Zone by Airplane Group - Engage with Speed and Altitude/CAS-003 - CAS in a Zone by Airplane Group - Engage with Speed and Altitude.miz index 3a927d2c43..5e1d589e6b 100644 Binary files a/CAS - Close Air Support/CAS-003 - CAS in a Zone by Airplane Group - Engage with Speed and Altitude/CAS-003 - CAS in a Zone by Airplane Group - Engage with Speed and Altitude.miz and b/CAS - Close Air Support/CAS-003 - CAS in a Zone by Airplane Group - Engage with Speed and Altitude/CAS-003 - CAS in a Zone by Airplane Group - Engage with Speed and Altitude.miz differ diff --git a/CAS - Close Air Support/CAS-004 - CAS in a Zone by Airplane Group - Test Abort/CAS-004 - CAS in a Zone by Airplane Group - Test Abort.lua b/CAS - Close Air Support/CAS-004 - CAS in a Zone by Airplane Group - Test Abort/CAS-004 - CAS in a Zone by Airplane Group - Test Abort.lua index 295b7d11d8..dba517912a 100644 --- a/CAS - Close Air Support/CAS-004 - CAS in a Zone by Airplane Group - Test Abort/CAS-004 - CAS in a Zone by Airplane Group - Test Abort.lua +++ b/CAS - Close Air Support/CAS-004 - CAS in a Zone by Airplane Group - Test Abort/CAS-004 - CAS in a Zone by Airplane Group - Test Abort.lua @@ -1,81 +1,81 @@ ---- --- Name: CAS-004 - CAS in a Zone by Airplane Group - Test Abort --- Author: FlightControl --- Date Created: 14 Mar 2017 --- --- # Situation: --- --- A group of 4 Su-25T at patrolling north of an engage zone for 1 minute. --- After 10 minutes, the command center orders the Su-25T to engage the zone and execute a CAS. --- After 12 minutes, the mission is aborted. --- --- # Test cases: --- --- 1. Observe that the Su-25T is patrolling in the patrol zone, until the engage command is given. --- 2. The Su-25T are not detecting any target during the patrol. --- 3. When the Su-25T is commanded to engage, the group will fly to the engage zone --- 3.1. The approach speed to the engage zone is set to 350 km/h. --- 3.2. The altitude to the engage zone and CAS execution is set to 4000 meters. --- 4. Observe the mission being aborted. A message will be sent. --- 5. The Su-25T will go back patrolling. - - - --- Create a local variable (in this case called CASEngagementZone) and --- using the ZONE function find the pre-defined zone called "Engagement Zone" --- currently on the map and assign it to this variable -CASEngagementZone = ZONE:New( "Engagement Zone" ) - --- Create a local variable (in this case called CASPlane) and --- using the GROUP function find the aircraft group called "Plane" and assign to this variable -CASPlane = GROUP:FindByName( "Plane" ) - --- Create a local Variable (in this cased called PatrolZone and --- using the ZONE function find the pre-defined zone called "Patrol Zone" and assign it to this variable -PatrolZone = ZONE:New( "Patrol Zone" ) - --- Create and object (in this case called AICasZone) and --- using the functions AI_CAS_ZONE assign the parameters that define this object --- (in this case PatrolZone, 500, 1000, 500, 600, CASEngagementZone) -AICasZone = AI_CAS_ZONE:New( PatrolZone, 500, 1000, 500, 600, CASEngagementZone ) - --- Create an object (in this case called Targets) and --- using the GROUP function find the group labeled "Targets" and assign it to this object -Targets = GROUP:FindByName("Targets") - - --- Tell the program to use the object (in this case called CASPlane) as the group to use in the CAS function -AICasZone:SetControllable( CASPlane ) - --- Tell the group CASPlane to start the mission in 1 second. -AICasZone:__Start( 1 ) -- They should statup, and start patrolling in the PatrolZone. - --- After 10 minutes, tell the group CASPlane to engage the targets located in the engagement zone called CASEngagement Zone. (600 is 600 seconds) -AICasZone:__Engage( 600, 350, 4000 ) -- Engage after 10 minutes with a speed of 350 km/h and an altitude of 4000 meters. - --- After 12 minutes, tell the group CASPlane to abort the engagement. -AICasZone:__Abort( 720 ) -- Abort the engagement. - --- Check every 60 seconds whether the Targets have been eliminated. --- When the trigger completed has been fired, the Plane will go back to the Patrol Zone. -Check, CheckScheduleID = SCHEDULER:New(nil, - function() - if Targets:IsAlive() and Targets:GetSize() > 5 then - BASE:E( "Test Mission: " .. Targets:GetSize() .. " targets left to be destroyed.") - else - BASE:E( "Test Mission: The required targets are destroyed." ) - AICasZone:__Accomplish( 1 ) -- Now they should fly back to teh patrolzone and patrol. - end - end, {}, 20, 60, 0.2 ) - -function AICasZone:OnAfterAbort(Controllable,From,Event,To) - BASE:E( "MISSION ABORT! Back to patrol zone." ) - MESSAGE:New("Mission ABORTED! Back to the Patrol Zone!",30,"ALERT!"):ToAll() -end - --- When the targets in the zone are destroyed, (see scheduled function), the planes will return home ... -function AICasZone:OnAfterAccomplish( Controllable, From, Event, To ) - BASE:E( "Test Mission: Sending the Su-25T back to base." ) - Check:Stop( CheckScheduleID ) - AICasZone:__RTB( 1 ) -end +--- +-- Name: CAS-004 - CAS in a Zone by Airplane Group - Test Abort +-- Author: FlightControl +-- Date Created: 14 Mar 2017 +-- +-- # Situation: +-- +-- A group of 4 Su-25T at patrolling north of an engage zone for 1 minute. +-- After 10 minutes, the command center orders the Su-25T to engage the zone and execute a CAS. +-- After 12 minutes, the mission is aborted. +-- +-- # Test cases: +-- +-- 1. Observe that the Su-25T is patrolling in the patrol zone, until the engage command is given. +-- 2. The Su-25T are not detecting any target during the patrol. +-- 3. When the Su-25T is commanded to engage, the group will fly to the engage zone +-- 3.1. The approach speed to the engage zone is set to 350 km/h. +-- 3.2. The altitude to the engage zone and CAS execution is set to 4000 meters. +-- 4. Observe the mission being aborted. A message will be sent. +-- 5. The Su-25T will go back patrolling. + + + +-- Create a local variable (in this case called CASEngagementZone) and +-- using the ZONE function find the pre-defined zone called "Engagement Zone" +-- currently on the map and assign it to this variable +CASEngagementZone = ZONE:New( "Engagement Zone" ) + +-- Create a local variable (in this case called CASPlane) and +-- using the GROUP function find the aircraft group called "Plane" and assign to this variable +CASPlane = GROUP:FindByName( "Plane" ) + +-- Create a local Variable (in this cased called PatrolZone and +-- using the ZONE function find the pre-defined zone called "Patrol Zone" and assign it to this variable +PatrolZone = ZONE:New( "Patrol Zone" ) + +-- Create and object (in this case called AICasZone) and +-- using the functions AI_CAS_ZONE assign the parameters that define this object +-- (in this case PatrolZone, 500, 1000, 500, 600, CASEngagementZone) +AICasZone = AI_CAS_ZONE:New( PatrolZone, 500, 1000, 500, 600, CASEngagementZone ) + +-- Create an object (in this case called Targets) and +-- using the GROUP function find the group labeled "Targets" and assign it to this object +Targets = GROUP:FindByName("Targets") + + +-- Tell the program to use the object (in this case called CASPlane) as the group to use in the CAS function +AICasZone:SetControllable( CASPlane ) + +-- Tell the group CASPlane to start the mission in 1 second. +AICasZone:__Start( 1 ) -- They should statup, and start patrolling in the PatrolZone. + +-- After 10 minutes, tell the group CASPlane to engage the targets located in the engagement zone called CASEngagement Zone. (600 is 600 seconds) +AICasZone:__Engage( 600, 350, 4000 ) -- Engage after 10 minutes with a speed of 350 km/h and an altitude of 4000 meters. + +-- After 12 minutes, tell the group CASPlane to abort the engagement. +AICasZone:__Abort( 720 ) -- Abort the engagement. + +-- Check every 60 seconds whether the Targets have been eliminated. +-- When the trigger completed has been fired, the Plane will go back to the Patrol Zone. +Check, CheckScheduleID = SCHEDULER:New(nil, + function() + if Targets:IsAlive() and Targets:GetSize() > 5 then + BASE:E( "Test Mission: " .. Targets:GetSize() .. " targets left to be destroyed.") + else + BASE:E( "Test Mission: The required targets are destroyed." ) + AICasZone:__Accomplish( 1 ) -- Now they should fly back to teh patrolzone and patrol. + end + end, {}, 20, 60, 0.2 ) + +function AICasZone:OnAfterAbort(Controllable,From,Event,To) + BASE:E( "MISSION ABORT! Back to patrol zone." ) + MESSAGE:New("Mission ABORTED! Back to the Patrol Zone!",30,"ALERT!"):ToAll() +end + +-- When the targets in the zone are destroyed, (see scheduled function), the planes will return home ... +function AICasZone:OnAfterAccomplish( Controllable, From, Event, To ) + BASE:E( "Test Mission: Sending the Su-25T back to base." ) + Check:Stop( CheckScheduleID ) + AICasZone:__RTB( 1 ) +end diff --git a/CAS - Close Air Support/CAS-004 - CAS in a Zone by Airplane Group - Test Abort/CAS-004 - CAS in a Zone by Airplane Group - Test Abort.miz b/CAS - Close Air Support/CAS-004 - CAS in a Zone by Airplane Group - Test Abort/CAS-004 - CAS in a Zone by Airplane Group - Test Abort.miz index 3b1972769c..89ace107ae 100644 Binary files a/CAS - Close Air Support/CAS-004 - CAS in a Zone by Airplane Group - Test Abort/CAS-004 - CAS in a Zone by Airplane Group - Test Abort.miz and b/CAS - Close Air Support/CAS-004 - CAS in a Zone by Airplane Group - Test Abort/CAS-004 - CAS in a Zone by Airplane Group - Test Abort.miz differ diff --git a/CAS - Close Air Support/CAS-005 - CAS in a Zone by Airplane Group - Engage with WeaponExpend/CAS-005 - CAS in a Zone by Airplane Group - Engage with WeaponExpend.lua b/CAS - Close Air Support/CAS-005 - CAS in a Zone by Airplane Group - Engage with WeaponExpend/CAS-005 - CAS in a Zone by Airplane Group - Engage with WeaponExpend.lua index 203eed00a8..727e88c871 100644 --- a/CAS - Close Air Support/CAS-005 - CAS in a Zone by Airplane Group - Engage with WeaponExpend/CAS-005 - CAS in a Zone by Airplane Group - Engage with WeaponExpend.lua +++ b/CAS - Close Air Support/CAS-005 - CAS in a Zone by Airplane Group - Engage with WeaponExpend/CAS-005 - CAS in a Zone by Airplane Group - Engage with WeaponExpend.lua @@ -1,78 +1,78 @@ ---- --- Name: CAS-005 - CAS in a Zone by Airplane Group - Engage with WeaponExpend --- Author: FlightControl --- Date Created: 18 Mar 2017 --- --- # Situation: --- --- A group of 4 Su-25T at patrolling north of an engage zone for 1 minute. --- After 1 minute, the command center orders the Su-25T to engage the zone and execute a CAS. --- The planes should expend 4 weapons per run. --- --- # Test cases: --- --- 1. Observe that the Su-25T is patrolling in the patrol zone, until the engage command is given. --- 2. The Su-25T are not detecting any target during the patrol. --- 3. When the Su-25T is commanded to engage, the group will fly to the engage zone --- 3.1. The approach speed to the engage zone is set to 400 km/h. --- 3.2. The altitude to the engage zone and CAS execution is set to 500 meters. --- 3.3. The planes should expend 4 weapons per run. --- 4. Detection is activated and detected targets within the engage zone are assigned for CAS. --- 5. Observe the Su-25T eliminating the targets. --- 6. Observe the Su-25T defenses. --- 7. When all targets within the engage zone are destroyed, the Su-25T CAS task is set to Accomplished. --- 8. The Su-25T will return to base. - - - --- Create a local variable (in this case called CASEngagementZone) and --- using the ZONE function find the pre-defined zone called "Engagement Zone" --- currently on the map and assign it to this variable -CASEngagementZone = ZONE:New( "Engagement Zone" ) - --- Create a local variable (in this case called CASPlane) and --- using the GROUP function find the aircraft group called "Plane" and assign to this variable -CASPlane = GROUP:FindByName( "Plane" ) - --- Create a local Variable (in this cased called PatrolZone and --- using the ZONE function find the pre-defined zone called "Patrol Zone" and assign it to this variable -PatrolZone = ZONE:New( "Patrol Zone" ) - --- Create and object (in this case called AICasZone) and --- using the functions AI_CAS_ZONE assign the parameters that define this object --- (in this case PatrolZone, 500, 1000, 500, 600, CASEngagementZone) -AICasZone = AI_CAS_ZONE:New( PatrolZone, 500, 1000, 500, 600, CASEngagementZone ) - --- Create an object (in this case called Targets) and --- using the GROUP function find the group labeled "Targets" and assign it to this object -Targets = GROUP:FindByName("Targets") - - --- Tell the program to use the object (in this case called CASPlane) as the group to use in the CAS function -AICasZone:SetControllable( CASPlane ) - --- Tell the group CASPlane to start the mission in 1 second. -AICasZone:__Start( 1 ) -- They should statup, and start patrolling in the PatrolZone. - --- After 1 minute, tell the group CASPlane to engage the targets located in the engagement zone called CASEngagement Zone. (600 is 600 seconds) -AICasZone:__Engage( 60, 600, 8000, AI.Task.WeaponExpend.FOUR ) -- Engage with a speed of 600 km/h and an altitude of 8000 meters, weapn expend 4. - --- Check every 60 seconds whether the Targets have been eliminated. --- When the trigger completed has been fired, the Plane will go back to the Patrol Zone. -Check, CheckScheduleID = SCHEDULER:New(nil, - function() - if Targets:IsAlive() and Targets:GetSize() > 5 then - BASE:E( "Test Mission: " .. Targets:GetSize() .. " targets left to be destroyed.") - else - BASE:E( "Test Mission: The required targets are destroyed." ) - AICasZone:__Accomplish( 1 ) -- Now they should fly back to teh patrolzone and patrol. - end - end, {}, 20, 60, 0.2 ) - - --- When the targets in the zone are destroyed, (see scheduled function), the planes will return home ... -function AICasZone:OnAfterAccomplish( Controllable, From, Event, To ) - BASE:E( "Test Mission: Sending the Su-25T back to base." ) - Check:Stop( CheckScheduleID ) - AICasZone:__RTB( 1 ) -end +--- +-- Name: CAS-005 - CAS in a Zone by Airplane Group - Engage with WeaponExpend +-- Author: FlightControl +-- Date Created: 18 Mar 2017 +-- +-- # Situation: +-- +-- A group of 4 Su-25T at patrolling north of an engage zone for 1 minute. +-- After 1 minute, the command center orders the Su-25T to engage the zone and execute a CAS. +-- The planes should expend 4 weapons per run. +-- +-- # Test cases: +-- +-- 1. Observe that the Su-25T is patrolling in the patrol zone, until the engage command is given. +-- 2. The Su-25T are not detecting any target during the patrol. +-- 3. When the Su-25T is commanded to engage, the group will fly to the engage zone +-- 3.1. The approach speed to the engage zone is set to 400 km/h. +-- 3.2. The altitude to the engage zone and CAS execution is set to 500 meters. +-- 3.3. The planes should expend 4 weapons per run. +-- 4. Detection is activated and detected targets within the engage zone are assigned for CAS. +-- 5. Observe the Su-25T eliminating the targets. +-- 6. Observe the Su-25T defenses. +-- 7. When all targets within the engage zone are destroyed, the Su-25T CAS task is set to Accomplished. +-- 8. The Su-25T will return to base. + + + +-- Create a local variable (in this case called CASEngagementZone) and +-- using the ZONE function find the pre-defined zone called "Engagement Zone" +-- currently on the map and assign it to this variable +CASEngagementZone = ZONE:New( "Engagement Zone" ) + +-- Create a local variable (in this case called CASPlane) and +-- using the GROUP function find the aircraft group called "Plane" and assign to this variable +CASPlane = GROUP:FindByName( "Plane" ) + +-- Create a local Variable (in this cased called PatrolZone and +-- using the ZONE function find the pre-defined zone called "Patrol Zone" and assign it to this variable +PatrolZone = ZONE:New( "Patrol Zone" ) + +-- Create and object (in this case called AICasZone) and +-- using the functions AI_CAS_ZONE assign the parameters that define this object +-- (in this case PatrolZone, 500, 1000, 500, 600, CASEngagementZone) +AICasZone = AI_CAS_ZONE:New( PatrolZone, 500, 1000, 500, 600, CASEngagementZone ) + +-- Create an object (in this case called Targets) and +-- using the GROUP function find the group labeled "Targets" and assign it to this object +Targets = GROUP:FindByName("Targets") + + +-- Tell the program to use the object (in this case called CASPlane) as the group to use in the CAS function +AICasZone:SetControllable( CASPlane ) + +-- Tell the group CASPlane to start the mission in 1 second. +AICasZone:__Start( 1 ) -- They should statup, and start patrolling in the PatrolZone. + +-- After 1 minute, tell the group CASPlane to engage the targets located in the engagement zone called CASEngagement Zone. (600 is 600 seconds) +AICasZone:__Engage( 60, 600, 8000, AI.Task.WeaponExpend.FOUR ) -- Engage with a speed of 600 km/h and an altitude of 8000 meters, weapn expend 4. + +-- Check every 60 seconds whether the Targets have been eliminated. +-- When the trigger completed has been fired, the Plane will go back to the Patrol Zone. +Check, CheckScheduleID = SCHEDULER:New(nil, + function() + if Targets:IsAlive() and Targets:GetSize() > 5 then + BASE:E( "Test Mission: " .. Targets:GetSize() .. " targets left to be destroyed.") + else + BASE:E( "Test Mission: The required targets are destroyed." ) + AICasZone:__Accomplish( 1 ) -- Now they should fly back to teh patrolzone and patrol. + end + end, {}, 20, 60, 0.2 ) + + +-- When the targets in the zone are destroyed, (see scheduled function), the planes will return home ... +function AICasZone:OnAfterAccomplish( Controllable, From, Event, To ) + BASE:E( "Test Mission: Sending the Su-25T back to base." ) + Check:Stop( CheckScheduleID ) + AICasZone:__RTB( 1 ) +end diff --git a/CAS - Close Air Support/CAS-005 - CAS in a Zone by Airplane Group - Engage with WeaponExpend/CAS-005 - CAS in a Zone by Airplane Group - Engage with WeaponExpend.miz b/CAS - Close Air Support/CAS-005 - CAS in a Zone by Airplane Group - Engage with WeaponExpend/CAS-005 - CAS in a Zone by Airplane Group - Engage with WeaponExpend.miz index 043fd6a26a..46edf7b9b9 100644 Binary files a/CAS - Close Air Support/CAS-005 - CAS in a Zone by Airplane Group - Engage with WeaponExpend/CAS-005 - CAS in a Zone by Airplane Group - Engage with WeaponExpend.miz and b/CAS - Close Air Support/CAS-005 - CAS in a Zone by Airplane Group - Engage with WeaponExpend/CAS-005 - CAS in a Zone by Airplane Group - Engage with WeaponExpend.miz differ diff --git a/CAS - Close Air Support/CAS-010 - CAS in a Zone by Helicopter/CAS-010 - CAS in a Zone by Helicopter.lua b/CAS - Close Air Support/CAS-010 - CAS in a Zone by Helicopter/CAS-010 - CAS in a Zone by Helicopter.lua index 42f76f38f6..f046c2e9ee 100644 --- a/CAS - Close Air Support/CAS-010 - CAS in a Zone by Helicopter/CAS-010 - CAS in a Zone by Helicopter.lua +++ b/CAS - Close Air Support/CAS-010 - CAS in a Zone by Helicopter/CAS-010 - CAS in a Zone by Helicopter.lua @@ -1,76 +1,76 @@ ---- --- Name: CAS-010 - CAS in a Zone by Helicopter --- Author: FlightControl --- Date Created: 6 February 2017 --- --- # Situation: --- --- A group of 1 Ka-50 patrolling north of an engage zone for 1 minute. --- After 1 minute, the command center orders the Ka-50 to engage the zone and execute a CAS. --- --- # Test cases: --- --- 1. Observe that the Ka-50 is patrolling in the patrol zone, until the engage command is given. --- 2. The Ka-50 are not detecting any target during the patrol. --- 3. When the Ka-50 is commanded to engage, the group will fly to the engage zone. --- 3.1. Engage Speed is set to 100 km/h. --- 3.2. Engage Altitude is set to 150 meters. --- 4. Detection is activated and detected targets within the engage zone are assigned for CAS. --- 5. Observe the Ka-50 eliminating the targets. --- 6. Observe the Ka-50 defenses. --- 7. When all targets within the engage zone are destroyed, the Ka-50 CAS task is set to Accomplished. --- 8. The Ka-50 will return to base. - - - --- Create a local variable (in this case called CASEngagementZone) and --- using the ZONE function find the pre-defined zone called "Engagement Zone" --- currently on the map and assign it to this variable -CASEngagementZone = ZONE:New( "Engagement Zone" ) - --- Create a local variable (in this case called CASPlane) and --- using the GROUP function find the aircraft group called "Plane" and assign to this variable -CASPlane = GROUP:FindByName( "Helicopter" ) - --- Create a local Variable (in this cased called PatrolZone and --- using the ZONE function find the pre-defined zone called "Patrol Zone" and assign it to this variable -PatrolZone = ZONE:New( "Patrol Zone" ) - --- Create and object (in this case called AICasZone) and --- using the functions AI_CAS_ZONE assign the parameters that define this object --- (in this case PatrolZone, 500, 1000, 500, 600, CASEngagementZone) -AICasZone = AI_CAS_ZONE:New( PatrolZone, 500, 1000, 500, 600, CASEngagementZone ) - --- Create an object (in this case called Targets) and --- using the GROUP function find the group labeled "Targets" and assign it to this object -Targets = GROUP:FindByName("Targets") - - --- Tell the program to use the object (in this case called CASPlane) as the group to use in the CAS function -AICasZone:SetControllable( CASPlane ) - --- Tell the group CASPlane to start the mission in 1 second. -AICasZone:__Start( 1 ) -- They should statup, and start patrolling in the PatrolZone. - --- After 10 minutes, tell the group CASPlane to engage the targets located in the engagement zone called CASEngagement Zone. (600 is 600 seconds) -AICasZone:__Engage( 60, 100, 150 ) - --- Check every 60 seconds whether the Targets have been eliminated. --- When the trigger completed has been fired, the Plane will go back to the Patrol Zone. -Check, CheckScheduleID = SCHEDULER:New(nil, - function() - if Targets:IsAlive() and Targets:GetSize() > 5 then - BASE:E( "Test Mission: " .. Targets:GetSize() .. " targets left to be destroyed.") - else - BASE:E( "Test Mission: The required targets are destroyed." ) - AICasZone:__Accomplish( 1 ) -- Now they should fly back to teh patrolzone and patrol. - end - end, {}, 20, 60, 0.2 ) - - --- When the targets in the zone are destroyed, (see scheduled function), the planes will return home ... -function AICasZone:OnAfterAccomplish( Controllable, From, Event, To ) - BASE:E( "Test Mission: Sending the Su-25T back to base." ) - Check:Stop( CheckScheduleID ) - AICasZone:__RTB( 1 ) -end +--- +-- Name: CAS-010 - CAS in a Zone by Helicopter +-- Author: FlightControl +-- Date Created: 6 February 2017 +-- +-- # Situation: +-- +-- A group of 1 Ka-50 patrolling north of an engage zone for 1 minute. +-- After 1 minute, the command center orders the Ka-50 to engage the zone and execute a CAS. +-- +-- # Test cases: +-- +-- 1. Observe that the Ka-50 is patrolling in the patrol zone, until the engage command is given. +-- 2. The Ka-50 are not detecting any target during the patrol. +-- 3. When the Ka-50 is commanded to engage, the group will fly to the engage zone. +-- 3.1. Engage Speed is set to 100 km/h. +-- 3.2. Engage Altitude is set to 150 meters. +-- 4. Detection is activated and detected targets within the engage zone are assigned for CAS. +-- 5. Observe the Ka-50 eliminating the targets. +-- 6. Observe the Ka-50 defenses. +-- 7. When all targets within the engage zone are destroyed, the Ka-50 CAS task is set to Accomplished. +-- 8. The Ka-50 will return to base. + + + +-- Create a local variable (in this case called CASEngagementZone) and +-- using the ZONE function find the pre-defined zone called "Engagement Zone" +-- currently on the map and assign it to this variable +CASEngagementZone = ZONE:New( "Engagement Zone" ) + +-- Create a local variable (in this case called CASPlane) and +-- using the GROUP function find the aircraft group called "Plane" and assign to this variable +CASPlane = GROUP:FindByName( "Helicopter" ) + +-- Create a local Variable (in this cased called PatrolZone and +-- using the ZONE function find the pre-defined zone called "Patrol Zone" and assign it to this variable +PatrolZone = ZONE:New( "Patrol Zone" ) + +-- Create and object (in this case called AICasZone) and +-- using the functions AI_CAS_ZONE assign the parameters that define this object +-- (in this case PatrolZone, 500, 1000, 500, 600, CASEngagementZone) +AICasZone = AI_CAS_ZONE:New( PatrolZone, 500, 1000, 500, 600, CASEngagementZone ) + +-- Create an object (in this case called Targets) and +-- using the GROUP function find the group labeled "Targets" and assign it to this object +Targets = GROUP:FindByName("Targets") + + +-- Tell the program to use the object (in this case called CASPlane) as the group to use in the CAS function +AICasZone:SetControllable( CASPlane ) + +-- Tell the group CASPlane to start the mission in 1 second. +AICasZone:__Start( 1 ) -- They should statup, and start patrolling in the PatrolZone. + +-- After 10 minutes, tell the group CASPlane to engage the targets located in the engagement zone called CASEngagement Zone. (600 is 600 seconds) +AICasZone:__Engage( 60, 100, 150 ) + +-- Check every 60 seconds whether the Targets have been eliminated. +-- When the trigger completed has been fired, the Plane will go back to the Patrol Zone. +Check, CheckScheduleID = SCHEDULER:New(nil, + function() + if Targets:IsAlive() and Targets:GetSize() > 5 then + BASE:E( "Test Mission: " .. Targets:GetSize() .. " targets left to be destroyed.") + else + BASE:E( "Test Mission: The required targets are destroyed." ) + AICasZone:__Accomplish( 1 ) -- Now they should fly back to teh patrolzone and patrol. + end + end, {}, 20, 60, 0.2 ) + + +-- When the targets in the zone are destroyed, (see scheduled function), the planes will return home ... +function AICasZone:OnAfterAccomplish( Controllable, From, Event, To ) + BASE:E( "Test Mission: Sending the Su-25T back to base." ) + Check:Stop( CheckScheduleID ) + AICasZone:__RTB( 1 ) +end diff --git a/CAS - Close Air Support/CAS-010 - CAS in a Zone by Helicopter/CAS-010 - CAS in a Zone by Helicopter.miz b/CAS - Close Air Support/CAS-010 - CAS in a Zone by Helicopter/CAS-010 - CAS in a Zone by Helicopter.miz index 3518528976..63e7999e0d 100644 Binary files a/CAS - Close Air Support/CAS-010 - CAS in a Zone by Helicopter/CAS-010 - CAS in a Zone by Helicopter.miz and b/CAS - Close Air Support/CAS-010 - CAS in a Zone by Helicopter/CAS-010 - CAS in a Zone by Helicopter.miz differ diff --git a/CAS - Close Air Support/CAS-011 - CAS in a Zone by Helicopter Group/CAS-011 - CAS in a Zone by Helicopter Group.lua b/CAS - Close Air Support/CAS-011 - CAS in a Zone by Helicopter Group/CAS-011 - CAS in a Zone by Helicopter Group.lua index dbf2bcb055..edce960d68 100644 --- a/CAS - Close Air Support/CAS-011 - CAS in a Zone by Helicopter Group/CAS-011 - CAS in a Zone by Helicopter Group.lua +++ b/CAS - Close Air Support/CAS-011 - CAS in a Zone by Helicopter Group/CAS-011 - CAS in a Zone by Helicopter Group.lua @@ -1,75 +1,75 @@ ---- --- Name: CAS-011 - CAS in a Zone by Helicopter Group --- Author: FlightControl --- Date Created: 6 February 2017 --- --- # Situation: --- --- A group of 4 Ka-50 patrolling north of an engage zone for 1 minute. --- After 1 minute, the command center orders the Ka-50 to engage the zone and execute a CAS. --- --- # Test cases: --- --- 1. Observe that the Ka-50 is patrolling in the patrol zone, until the engage command is given. --- 2. The Ka-50 are not detecting any target during the patrol. --- 3. When the Ka-50 is commanded to engage, the group will fly to the engage zone. --- 3.1. Engage Speed is set to 100 km/h. --- 3.2. Engage Altitude is set to 150 meters. --- 4. Detection is activated and detected targets within the engage zone are assigned for CAS. --- 5. Observe the Ka-50 eliminating the targets. --- 6. Observe the Ka-50 defenses. --- 7. When all targets within the engage zone are destroyed, the Ka-50 CAS task is set to Accomplished. --- 8. The Ka-50 will return to base. - - --- Create a local variable (in this case called CASEngagementZone) and --- using the ZONE function find the pre-defined zone called "Engagement Zone" --- currently on the map and assign it to this variable -CASEngagementZone = ZONE:New( "Engagement Zone" ) - --- Create a local variable (in this case called CASPlane) and --- using the GROUP function find the aircraft group called "Plane" and assign to this variable -CASPlane = GROUP:FindByName( "Helicopter" ) - --- Create a local Variable (in this cased called PatrolZone and --- using the ZONE function find the pre-defined zone called "Patrol Zone" and assign it to this variable -PatrolZone = ZONE:New( "Patrol Zone" ) - --- Create and object (in this case called AICasZone) and --- using the functions AI_CAS_ZONE assign the parameters that define this object --- (in this case PatrolZone, 500, 1000, 500, 600, CASEngagementZone) -AICasZone = AI_CAS_ZONE:New( PatrolZone, 500, 1000, 500, 600, CASEngagementZone ) - --- Create an object (in this case called Targets) and --- using the GROUP function find the group labeled "Targets" and assign it to this object -Targets = GROUP:FindByName("Targets") - - --- Tell the program to use the object (in this case called CASPlane) as the group to use in the CAS function -AICasZone:SetControllable( CASPlane ) - --- Tell the group CASPlane to start the mission in 1 second. -AICasZone:__Start( 1 ) -- They should statup, and start patrolling in the PatrolZone. - --- After 10 minutes, tell the group CASPlane to engage the targets located in the engagement zone called CASEngagement Zone. (600 is 600 seconds) -AICasZone:__Engage( 60, 100, 150 ) - --- Check every 60 seconds whether the Targets have been eliminated. --- When the trigger completed has been fired, the Plane will go back to the Patrol Zone. -Check, CheckScheduleID = SCHEDULER:New(nil, - function() - if Targets:IsAlive() and Targets:GetSize() > 5 then - BASE:E( "Test Mission: " .. Targets:GetSize() .. " targets left to be destroyed.") - else - BASE:E( "Test Mission: The required targets are destroyed." ) - AICasZone:__Accomplish( 1 ) -- Now they should fly back to teh patrolzone and patrol. - end - end, {}, 20, 60, 0.2 ) - - --- When the targets in the zone are destroyed, (see scheduled function), the planes will return home ... -function AICasZone:OnAfterAccomplish( Controllable, From, Event, To ) - BASE:E( "Test Mission: Sending the Su-25T back to base." ) - Check:Stop( CheckScheduleID ) - AICasZone:__RTB( 1 ) -end +--- +-- Name: CAS-011 - CAS in a Zone by Helicopter Group +-- Author: FlightControl +-- Date Created: 6 February 2017 +-- +-- # Situation: +-- +-- A group of 4 Ka-50 patrolling north of an engage zone for 1 minute. +-- After 1 minute, the command center orders the Ka-50 to engage the zone and execute a CAS. +-- +-- # Test cases: +-- +-- 1. Observe that the Ka-50 is patrolling in the patrol zone, until the engage command is given. +-- 2. The Ka-50 are not detecting any target during the patrol. +-- 3. When the Ka-50 is commanded to engage, the group will fly to the engage zone. +-- 3.1. Engage Speed is set to 100 km/h. +-- 3.2. Engage Altitude is set to 150 meters. +-- 4. Detection is activated and detected targets within the engage zone are assigned for CAS. +-- 5. Observe the Ka-50 eliminating the targets. +-- 6. Observe the Ka-50 defenses. +-- 7. When all targets within the engage zone are destroyed, the Ka-50 CAS task is set to Accomplished. +-- 8. The Ka-50 will return to base. + + +-- Create a local variable (in this case called CASEngagementZone) and +-- using the ZONE function find the pre-defined zone called "Engagement Zone" +-- currently on the map and assign it to this variable +CASEngagementZone = ZONE:New( "Engagement Zone" ) + +-- Create a local variable (in this case called CASPlane) and +-- using the GROUP function find the aircraft group called "Plane" and assign to this variable +CASPlane = GROUP:FindByName( "Helicopter" ) + +-- Create a local Variable (in this cased called PatrolZone and +-- using the ZONE function find the pre-defined zone called "Patrol Zone" and assign it to this variable +PatrolZone = ZONE:New( "Patrol Zone" ) + +-- Create and object (in this case called AICasZone) and +-- using the functions AI_CAS_ZONE assign the parameters that define this object +-- (in this case PatrolZone, 500, 1000, 500, 600, CASEngagementZone) +AICasZone = AI_CAS_ZONE:New( PatrolZone, 500, 1000, 500, 600, CASEngagementZone ) + +-- Create an object (in this case called Targets) and +-- using the GROUP function find the group labeled "Targets" and assign it to this object +Targets = GROUP:FindByName("Targets") + + +-- Tell the program to use the object (in this case called CASPlane) as the group to use in the CAS function +AICasZone:SetControllable( CASPlane ) + +-- Tell the group CASPlane to start the mission in 1 second. +AICasZone:__Start( 1 ) -- They should statup, and start patrolling in the PatrolZone. + +-- After 10 minutes, tell the group CASPlane to engage the targets located in the engagement zone called CASEngagement Zone. (600 is 600 seconds) +AICasZone:__Engage( 60, 100, 150 ) + +-- Check every 60 seconds whether the Targets have been eliminated. +-- When the trigger completed has been fired, the Plane will go back to the Patrol Zone. +Check, CheckScheduleID = SCHEDULER:New(nil, + function() + if Targets:IsAlive() and Targets:GetSize() > 5 then + BASE:E( "Test Mission: " .. Targets:GetSize() .. " targets left to be destroyed.") + else + BASE:E( "Test Mission: The required targets are destroyed." ) + AICasZone:__Accomplish( 1 ) -- Now they should fly back to teh patrolzone and patrol. + end + end, {}, 20, 60, 0.2 ) + + +-- When the targets in the zone are destroyed, (see scheduled function), the planes will return home ... +function AICasZone:OnAfterAccomplish( Controllable, From, Event, To ) + BASE:E( "Test Mission: Sending the Su-25T back to base." ) + Check:Stop( CheckScheduleID ) + AICasZone:__RTB( 1 ) +end diff --git a/CAS - Close Air Support/CAS-011 - CAS in a Zone by Helicopter Group/CAS-011 - CAS in a Zone by Helicopter Group.miz b/CAS - Close Air Support/CAS-011 - CAS in a Zone by Helicopter Group/CAS-011 - CAS in a Zone by Helicopter Group.miz index cec209b941..878a31a3bf 100644 Binary files a/CAS - Close Air Support/CAS-011 - CAS in a Zone by Helicopter Group/CAS-011 - CAS in a Zone by Helicopter Group.miz and b/CAS - Close Air Support/CAS-011 - CAS in a Zone by Helicopter Group/CAS-011 - CAS in a Zone by Helicopter Group.miz differ diff --git a/CAS - Close Air Support/CAS-111 - Multiple CAS in 1 Radius Zone by Helicopter and AirPlane Groups/CAS-111 - Multiple CAS in 1 Radius Zone by Helicopter and AirPlane Groups.lua b/CAS - Close Air Support/CAS-111 - Multiple CAS in 1 Radius Zone by Helicopter and AirPlane Groups/CAS-111 - Multiple CAS in 1 Radius Zone by Helicopter and AirPlane Groups.lua index 05d2beba9d..87e53937b8 100644 --- a/CAS - Close Air Support/CAS-111 - Multiple CAS in 1 Radius Zone by Helicopter and AirPlane Groups/CAS-111 - Multiple CAS in 1 Radius Zone by Helicopter and AirPlane Groups.lua +++ b/CAS - Close Air Support/CAS-111 - Multiple CAS in 1 Radius Zone by Helicopter and AirPlane Groups/CAS-111 - Multiple CAS in 1 Radius Zone by Helicopter and AirPlane Groups.lua @@ -1,91 +1,91 @@ ---- --- Name: CAS-111 - Multiple CAS in 1 Radius Zone by Helicopter and AirPlane Groups --- Author: FlightControl --- Date Created: 6 February 2017 --- --- # Situation: --- --- A group of 4 Ka-50 and 5 Su-25T are patrolling north in two engage zone for 5 minutes. --- After 5 minutes, the command center orders the groups to engage the zone and execute a CAS. --- --- # Test cases: --- --- 1. Observe that the groups is patrolling in the patrol zone, until the engage command is given. --- 2. The groups are not detecting any target during the patrol. --- 3. When the groups is commanded to engage, the group will fly to the engage zone. --- 3.1. Engage Speed for the Su-25T is set to 350 km/h. --- 3.2. Engage Altitude for the Su-25T is set to 1500 meters. --- 3.3. Engage Speed for the Ka-50 is set to 100 km/h. --- 3.4. Engage Altitude for the Ka-50 is set to 150 meters. --- 4. Detection is activated and detected targets within the engage zone are assigned for CAS. --- 5. Observe the groups eliminating the targets. --- 6. Observe the groups defenses. --- 7. When all targets within the engage zone are destroyed, the groups CAS task is set to Accomplished. --- 8. The groups will return to base. - - - --- Create a local variable (in this case called CASEngagementZone) and --- using the ZONE function find the pre-defined zone called "Engagement Zone" --- currently on the map and assign it to this variable -CASEngagementZone = ZONE:New( "Engagement Zone" ) - --- Create a local variables (in this case called CASPlane and CASHelicopters) and --- using the GROUP function find the aircraft group called "Plane" and "Helicopter" and assign to these variables -CASPlane = GROUP:FindByName( "Plane" ) -CASHelicopter = GROUP:FindByName( "Helicopter" ) - --- Create two patrol zones, one for the Planes and one for the Helicopters. -PatrolZonePlanes = ZONE:New( "Patrol Zone Planes" ) -PatrolZoneHelicopters = ZONE:New( "Patrol Zone Helicopters" ) - --- Create and object (in this case called AICasZone) and --- using the functions AI_CAS_ZONE assign the parameters that define this object --- (in this case PatrolZone, 500, 1000, 500, 600, CASEngagementZone) -AICasZonePlanes = AI_CAS_ZONE:New( PatrolZonePlanes, 400, 500, 500, 2500, CASEngagementZone ) -AICasZoneHelicopters = AI_CAS_ZONE:New( PatrolZoneHelicopters, 100, 250, 300, 1000, CASEngagementZone ) - --- Create an object (in this case called Targets) and --- using the GROUP function find the group labeled "Targets" and assign it to this object -Targets = GROUP:FindByName("Targets") - - --- Tell the program to use the object (in this case called CASPlane) as the group to use in the CAS function -AICasZonePlanes:SetControllable( CASPlane ) -AICasZoneHelicopters:SetControllable( CASHelicopter ) - --- Tell the group CASPlane to start the mission in 1 second. -AICasZonePlanes:__Start( 1 ) -- They should startup, and start patrolling in the PatrolZone. -AICasZoneHelicopters:__Start( 1 ) -- They should startup, and start patrolling in the PatrolZone. - --- After 10 minutes, tell the group CASPlanes and CASHelicopters to engage the targets located in the engagement zone called CASEngagement Zone. -AICasZonePlanes:__Engage( 300, 350, 1500 ) -- Engage with a speed of 350 km/h and 1500 meter altitude. -AICasZoneHelicopters:__Engage( 300, 100, 150 ) -- Engage with a speed of 100 km/h and 150 meter altitude. - - --- Check every 60 seconds whether the Targets have been eliminated. --- When the trigger completed has been fired, the Planes and Helicopters will go back to the Patrol Zone. -Check, CheckScheduleID = SCHEDULER:New(nil, - function() - if Targets:IsAlive() and Targets:GetSize() > 5 then - BASE:E( "Test Mission: " .. Targets:GetSize() .. " targets left to be destroyed.") - else - BASE:E( "Test Mission: The required targets are destroyed." ) - Check:Stop( CheckScheduleID ) - AICasZonePlanes:__Accomplish( 1 ) -- Now they should fly back to teh patrolzone and patrol. - AICasZoneHelicopters:__Accomplish( 1 ) -- Now they should fly back to teh patrolzone and patrol. - end - end, {}, 20, 60, 0.2 ) - - --- When the targets in the zone are destroyed, (see scheduled function), the planes will return home ... -function AICasZonePlanes:OnAfterAccomplish( Controllable, From, Event, To ) - BASE:E( "Test Mission: Sending the Su-25T back to base." ) - AICasZonePlanes:__RTB( 1 ) -end - --- When the targets in the zone are destroyed, (see scheduled function), the helicpters will return home ... -function AICasZoneHelicopters:OnAfterAccomplish( Controllable, From, Event, To ) - BASE:E( "Test Mission: Sending the Ka-50 back to base." ) - AICasZoneHelicopters:__RTB( 1 ) -end +--- +-- Name: CAS-111 - Multiple CAS in 1 Radius Zone by Helicopter and AirPlane Groups +-- Author: FlightControl +-- Date Created: 6 February 2017 +-- +-- # Situation: +-- +-- A group of 4 Ka-50 and 5 Su-25T are patrolling north in two engage zone for 5 minutes. +-- After 5 minutes, the command center orders the groups to engage the zone and execute a CAS. +-- +-- # Test cases: +-- +-- 1. Observe that the groups is patrolling in the patrol zone, until the engage command is given. +-- 2. The groups are not detecting any target during the patrol. +-- 3. When the groups is commanded to engage, the group will fly to the engage zone. +-- 3.1. Engage Speed for the Su-25T is set to 350 km/h. +-- 3.2. Engage Altitude for the Su-25T is set to 1500 meters. +-- 3.3. Engage Speed for the Ka-50 is set to 100 km/h. +-- 3.4. Engage Altitude for the Ka-50 is set to 150 meters. +-- 4. Detection is activated and detected targets within the engage zone are assigned for CAS. +-- 5. Observe the groups eliminating the targets. +-- 6. Observe the groups defenses. +-- 7. When all targets within the engage zone are destroyed, the groups CAS task is set to Accomplished. +-- 8. The groups will return to base. + + + +-- Create a local variable (in this case called CASEngagementZone) and +-- using the ZONE function find the pre-defined zone called "Engagement Zone" +-- currently on the map and assign it to this variable +CASEngagementZone = ZONE:New( "Engagement Zone" ) + +-- Create a local variables (in this case called CASPlane and CASHelicopters) and +-- using the GROUP function find the aircraft group called "Plane" and "Helicopter" and assign to these variables +CASPlane = GROUP:FindByName( "Plane" ) +CASHelicopter = GROUP:FindByName( "Helicopter" ) + +-- Create two patrol zones, one for the Planes and one for the Helicopters. +PatrolZonePlanes = ZONE:New( "Patrol Zone Planes" ) +PatrolZoneHelicopters = ZONE:New( "Patrol Zone Helicopters" ) + +-- Create and object (in this case called AICasZone) and +-- using the functions AI_CAS_ZONE assign the parameters that define this object +-- (in this case PatrolZone, 500, 1000, 500, 600, CASEngagementZone) +AICasZonePlanes = AI_CAS_ZONE:New( PatrolZonePlanes, 400, 500, 500, 2500, CASEngagementZone ) +AICasZoneHelicopters = AI_CAS_ZONE:New( PatrolZoneHelicopters, 100, 250, 300, 1000, CASEngagementZone ) + +-- Create an object (in this case called Targets) and +-- using the GROUP function find the group labeled "Targets" and assign it to this object +Targets = GROUP:FindByName("Targets") + + +-- Tell the program to use the object (in this case called CASPlane) as the group to use in the CAS function +AICasZonePlanes:SetControllable( CASPlane ) +AICasZoneHelicopters:SetControllable( CASHelicopter ) + +-- Tell the group CASPlane to start the mission in 1 second. +AICasZonePlanes:__Start( 1 ) -- They should startup, and start patrolling in the PatrolZone. +AICasZoneHelicopters:__Start( 1 ) -- They should startup, and start patrolling in the PatrolZone. + +-- After 10 minutes, tell the group CASPlanes and CASHelicopters to engage the targets located in the engagement zone called CASEngagement Zone. +AICasZonePlanes:__Engage( 300, 350, 1500 ) -- Engage with a speed of 350 km/h and 1500 meter altitude. +AICasZoneHelicopters:__Engage( 300, 100, 150 ) -- Engage with a speed of 100 km/h and 150 meter altitude. + + +-- Check every 60 seconds whether the Targets have been eliminated. +-- When the trigger completed has been fired, the Planes and Helicopters will go back to the Patrol Zone. +Check, CheckScheduleID = SCHEDULER:New(nil, + function() + if Targets:IsAlive() and Targets:GetSize() > 5 then + BASE:E( "Test Mission: " .. Targets:GetSize() .. " targets left to be destroyed.") + else + BASE:E( "Test Mission: The required targets are destroyed." ) + Check:Stop( CheckScheduleID ) + AICasZonePlanes:__Accomplish( 1 ) -- Now they should fly back to teh patrolzone and patrol. + AICasZoneHelicopters:__Accomplish( 1 ) -- Now they should fly back to teh patrolzone and patrol. + end + end, {}, 20, 60, 0.2 ) + + +-- When the targets in the zone are destroyed, (see scheduled function), the planes will return home ... +function AICasZonePlanes:OnAfterAccomplish( Controllable, From, Event, To ) + BASE:E( "Test Mission: Sending the Su-25T back to base." ) + AICasZonePlanes:__RTB( 1 ) +end + +-- When the targets in the zone are destroyed, (see scheduled function), the helicpters will return home ... +function AICasZoneHelicopters:OnAfterAccomplish( Controllable, From, Event, To ) + BASE:E( "Test Mission: Sending the Ka-50 back to base." ) + AICasZoneHelicopters:__RTB( 1 ) +end diff --git a/CAS - Close Air Support/CAS-111 - Multiple CAS in 1 Radius Zone by Helicopter and AirPlane Groups/CAS-111 - Multiple CAS in 1 Radius Zone by Helicopter and AirPlane Groups.miz b/CAS - Close Air Support/CAS-111 - Multiple CAS in 1 Radius Zone by Helicopter and AirPlane Groups/CAS-111 - Multiple CAS in 1 Radius Zone by Helicopter and AirPlane Groups.miz index 21f646a1ba..f8a9f910c7 100644 Binary files a/CAS - Close Air Support/CAS-111 - Multiple CAS in 1 Radius Zone by Helicopter and AirPlane Groups/CAS-111 - Multiple CAS in 1 Radius Zone by Helicopter and AirPlane Groups.miz and b/CAS - Close Air Support/CAS-111 - Multiple CAS in 1 Radius Zone by Helicopter and AirPlane Groups/CAS-111 - Multiple CAS in 1 Radius Zone by Helicopter and AirPlane Groups.miz differ diff --git a/CAZ - Capture Zones/CAZ-001 - Capture Zone/CAZ-001 - Capture Zone.lua b/CAZ - Capture Zones/CAZ-001 - Capture Zone/CAZ-001 - Capture Zone.lua index 97d158449e..8b5203d3e9 100644 --- a/CAZ - Capture Zones/CAZ-001 - Capture Zone/CAZ-001 - Capture Zone.lua +++ b/CAZ - Capture Zones/CAZ-001 - Capture Zone/CAZ-001 - Capture Zone.lua @@ -1,110 +1,110 @@ ---- --- Name: CAZ-001 - Capture Zone --- Author: FlightControl --- Date Created: 13 January 2017 --- --- # Situation: --- --- # Test cases: --- - -do -- Setup the Command Centers - - RU_CC = COMMANDCENTER:New( GROUP:FindByName( "REDHQ" ), "Russia HQ" ) - US_CC = COMMANDCENTER:New( GROUP:FindByName( "BLUEHQ" ), "USA 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 - - - - - - -CaptureZone = ZONE:New( "CaptureZone" ) - -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:__Guard( 1 ) - -ZoneCaptureCoalition:Start( 30, 30 ) - - - +--- +-- Name: CAZ-001 - Capture Zone +-- Author: FlightControl +-- Date Created: 13 January 2017 +-- +-- # Situation: +-- +-- # Test cases: +-- + +do -- Setup the Command Centers + + RU_CC = COMMANDCENTER:New( GROUP:FindByName( "REDHQ" ), "Russia HQ" ) + US_CC = COMMANDCENTER:New( GROUP:FindByName( "BLUEHQ" ), "USA 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 + + + + + + +CaptureZone = ZONE:New( "CaptureZone" ) + +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:__Guard( 1 ) + +ZoneCaptureCoalition:Start( 30, 30 ) + + + diff --git a/CAZ - Capture Zones/CAZ-001 - Capture Zone/CAZ-001 - Capture Zone.miz b/CAZ - Capture Zones/CAZ-001 - Capture Zone/CAZ-001 - Capture Zone.miz index 42d9ea8297..b1af26eac5 100644 Binary files a/CAZ - Capture Zones/CAZ-001 - Capture Zone/CAZ-001 - Capture Zone.miz and b/CAZ - Capture Zones/CAZ-001 - Capture Zone/CAZ-001 - Capture Zone.miz differ diff --git a/CAZ - Capture Zones/CAZ-002 - Attack Zone/CAZ-002 - Attack Zone.lua b/CAZ - Capture Zones/CAZ-002 - Attack Zone/CAZ-002 - Attack Zone.lua index 97d158449e..8b5203d3e9 100644 --- a/CAZ - Capture Zones/CAZ-002 - Attack Zone/CAZ-002 - Attack Zone.lua +++ b/CAZ - Capture Zones/CAZ-002 - Attack Zone/CAZ-002 - Attack Zone.lua @@ -1,110 +1,110 @@ ---- --- Name: CAZ-001 - Capture Zone --- Author: FlightControl --- Date Created: 13 January 2017 --- --- # Situation: --- --- # Test cases: --- - -do -- Setup the Command Centers - - RU_CC = COMMANDCENTER:New( GROUP:FindByName( "REDHQ" ), "Russia HQ" ) - US_CC = COMMANDCENTER:New( GROUP:FindByName( "BLUEHQ" ), "USA 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 - - - - - - -CaptureZone = ZONE:New( "CaptureZone" ) - -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:__Guard( 1 ) - -ZoneCaptureCoalition:Start( 30, 30 ) - - - +--- +-- Name: CAZ-001 - Capture Zone +-- Author: FlightControl +-- Date Created: 13 January 2017 +-- +-- # Situation: +-- +-- # Test cases: +-- + +do -- Setup the Command Centers + + RU_CC = COMMANDCENTER:New( GROUP:FindByName( "REDHQ" ), "Russia HQ" ) + US_CC = COMMANDCENTER:New( GROUP:FindByName( "BLUEHQ" ), "USA 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 + + + + + + +CaptureZone = ZONE:New( "CaptureZone" ) + +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:__Guard( 1 ) + +ZoneCaptureCoalition:Start( 30, 30 ) + + + diff --git a/CAZ - Capture Zones/CAZ-002 - Attack Zone/CAZ-002 - Attack Zone.miz b/CAZ - Capture Zones/CAZ-002 - Attack Zone/CAZ-002 - Attack Zone.miz index ef51d91e5a..c7345d4ba1 100644 Binary files a/CAZ - Capture Zones/CAZ-002 - Attack Zone/CAZ-002 - Attack Zone.miz and b/CAZ - Capture Zones/CAZ-002 - Attack Zone/CAZ-002 - Attack Zone.miz differ diff --git a/CAZ - Capture Zones/CAZ-003 - Attack Zone Polygon/CAZ-003 - Attack Zone Polygon.miz b/CAZ - Capture Zones/CAZ-003 - Attack Zone Polygon/CAZ-003 - Attack Zone Polygon.miz index 55376be0bc..eb587dd158 100644 Binary files a/CAZ - Capture Zones/CAZ-003 - Attack Zone Polygon/CAZ-003 - Attack Zone Polygon.miz and b/CAZ - Capture Zones/CAZ-003 - Attack Zone Polygon/CAZ-003 - Attack Zone Polygon.miz differ diff --git a/CAZ - Capture Zones/CAZ-500 - Task Capture Zone/CAZ-500 - Task Capture Zone.lua b/CAZ - Capture Zones/CAZ-500 - Task Capture Zone/CAZ-500 - Task Capture Zone.lua index 7a477de451..4d7d737db2 100644 --- a/CAZ - Capture Zones/CAZ-500 - Task Capture Zone/CAZ-500 - Task Capture Zone.lua +++ b/CAZ - Capture Zones/CAZ-500 - Task Capture Zone/CAZ-500 - Task Capture Zone.lua @@ -1,114 +1,114 @@ ---- --- Name: CAZ-500 - Task Capture Zone --- Author: FlightControl --- Date Created: 13 January 2017 --- --- # Situation: --- --- # Test cases: --- - -do -- Setup the Command Centers - - RU_CC = COMMANDCENTER:New( GROUP:FindByName( "REDHQ" ), "Russia HQ" ) - US_CC = COMMANDCENTER:New( GROUP:FindByName( "BLUEHQ" ), "USA 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 - - - - - - -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 ) - --- Create the tasks under the mission - -local ZoneCaptureGroupSet = SET_GROUP:New():FilterCoalitions("blue"):FilterStart() - -local US_Task_Zone_Capture = TASK_ZONE_CAPTURE:New( US_Mission_EchoBay, ZoneCaptureGroupSet, ZoneCaptureCoalition:GetZoneName(), ZoneCaptureCoalition ) - +--- +-- Name: CAZ-500 - Task Capture Zone +-- Author: FlightControl +-- Date Created: 13 January 2017 +-- +-- # Situation: +-- +-- # Test cases: +-- + +do -- Setup the Command Centers + + RU_CC = COMMANDCENTER:New( GROUP:FindByName( "REDHQ" ), "Russia HQ" ) + US_CC = COMMANDCENTER:New( GROUP:FindByName( "BLUEHQ" ), "USA 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 + + + + + + +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 ) + +-- Create the tasks under the mission + +local ZoneCaptureGroupSet = SET_GROUP:New():FilterCoalitions("blue"):FilterStart() + +local US_Task_Zone_Capture = TASK_ZONE_CAPTURE:New( US_Mission_EchoBay, ZoneCaptureGroupSet, ZoneCaptureCoalition:GetZoneName(), ZoneCaptureCoalition ) + US_CC:SetMenu() \ No newline at end of file diff --git a/CAZ - Capture Zones/CAZ-500 - Task Capture Zone/CAZ-500 - Task Capture Zone.miz b/CAZ - Capture Zones/CAZ-500 - Task Capture Zone/CAZ-500 - Task Capture Zone.miz index ce4141ac19..250bb2b59e 100644 Binary files a/CAZ - Capture Zones/CAZ-500 - Task Capture Zone/CAZ-500 - Task Capture Zone.miz and b/CAZ - Capture Zones/CAZ-500 - Task Capture Zone/CAZ-500 - Task Capture Zone.miz differ diff --git a/CGO - Cargo/CGO-001 - Unit Boarding/CGO-001 - Unit Boarding.lua b/CGO - Cargo/CGO-001 - Unit Boarding/CGO-001 - Unit Boarding.lua index 4df5cc8d0f..d1f6e4350c 100644 --- a/CGO - Cargo/CGO-001 - Unit Boarding/CGO-001 - Unit Boarding.lua +++ b/CGO - Cargo/CGO-001 - Unit Boarding/CGO-001 - Unit Boarding.lua @@ -1,11 +1,11 @@ - -CargoEngineer = UNIT:FindByName( "Engineer" ) -InfantryCargo = AI_CARGO_UNIT:New( CargoEngineer, "Engineer", "Engineer Sven", "81", 2000, 25 ) - -CargoCarrier = UNIT:FindByName( "Carrier" ) - --- This call will make the Cargo run to the CargoCarrier. --- Upon arrival at the CargoCarrier, the Cargo will be Loaded into the Carrier. --- This process is now fully automated. -InfantryCargo:Board( CargoCarrier ) - + +CargoEngineer = UNIT:FindByName( "Engineer" ) +InfantryCargo = AI_CARGO_UNIT:New( CargoEngineer, "Engineer", "Engineer Sven", "81", 2000, 25 ) + +CargoCarrier = UNIT:FindByName( "Carrier" ) + +-- This call will make the Cargo run to the CargoCarrier. +-- Upon arrival at the CargoCarrier, the Cargo will be Loaded into the Carrier. +-- This process is now fully automated. +InfantryCargo:Board( CargoCarrier ) + diff --git a/CGO - Cargo/CGO-001 - Unit Boarding/CGO-001 - Unit Boarding.miz b/CGO - Cargo/CGO-001 - Unit Boarding/CGO-001 - Unit Boarding.miz index b3817405a7..5524ffbf02 100644 Binary files a/CGO - Cargo/CGO-001 - Unit Boarding/CGO-001 - Unit Boarding.miz and b/CGO - Cargo/CGO-001 - Unit Boarding/CGO-001 - Unit Boarding.miz differ diff --git a/CGO - Cargo/CGO-002 - Unit Unboarding/CGO-002 - Unit Unboarding.lua b/CGO - Cargo/CGO-002 - Unit Unboarding/CGO-002 - Unit Unboarding.lua index bbc6edc586..451ba67388 100644 --- a/CGO - Cargo/CGO-002 - Unit Unboarding/CGO-002 - Unit Unboarding.lua +++ b/CGO - Cargo/CGO-002 - Unit Unboarding/CGO-002 - Unit Unboarding.lua @@ -1,11 +1,11 @@ - -CargoEngineer = UNIT:FindByName( "Engineer" ) -InfantryCargo = AI_CARGO_UNIT:New( CargoEngineer, "Engineer", "Engineer Sven", "81", 2000, 25 ) - -CargoCarrier = UNIT:FindByName( "Carrier" ) - --- This will Load immediately the Cargo into the Carrier, regardless where the Cargo is. -InfantryCargo:Load( CargoCarrier ) - --- This will Unboard the Cargo from the Carrier. + +CargoEngineer = UNIT:FindByName( "Engineer" ) +InfantryCargo = AI_CARGO_UNIT:New( CargoEngineer, "Engineer", "Engineer Sven", "81", 2000, 25 ) + +CargoCarrier = UNIT:FindByName( "Carrier" ) + +-- This will Load immediately the Cargo into the Carrier, regardless where the Cargo is. +InfantryCargo:Load( CargoCarrier ) + +-- This will Unboard the Cargo from the Carrier. InfantryCargo:UnBoard() \ No newline at end of file diff --git a/CGO - Cargo/CGO-002 - Unit Unboarding/CGO-002 - Unit Unboarding.miz b/CGO - Cargo/CGO-002 - Unit Unboarding/CGO-002 - Unit Unboarding.miz index e8f70190ff..2bd2b23220 100644 Binary files a/CGO - Cargo/CGO-002 - Unit Unboarding/CGO-002 - Unit Unboarding.miz and b/CGO - Cargo/CGO-002 - Unit Unboarding/CGO-002 - Unit Unboarding.miz differ diff --git a/CGO - Cargo/CGO-003 - Unit Transferring/CGO-003 - Unit Transferring.lua b/CGO - Cargo/CGO-003 - Unit Transferring/CGO-003 - Unit Transferring.lua index 6cf1b1f696..9bb3e6ec97 100644 --- a/CGO - Cargo/CGO-003 - Unit Transferring/CGO-003 - Unit Transferring.lua +++ b/CGO - Cargo/CGO-003 - Unit Transferring/CGO-003 - Unit Transferring.lua @@ -1,25 +1,25 @@ - -CargoEngineer = UNIT:FindByName( "Engineer" ) -InfantryCargo = AI_CARGO_UNIT:New( CargoEngineer, "Engineer", "Engineer Sven", "81", 2000, 25 ) - -CargoCarrierFrom = UNIT:FindByName( "CarrierFrom" ) - -CargoCarrierTo = UNIT:FindByName( "CarrierTo" ) - --- This call will make the Cargo run to the CargoCarrier. --- Upon arrival at the CargoCarrier, the Cargo will be Loaded into the Carrier. --- This process is now fully automated. -InfantryCargo:Board( CargoCarrierFrom ) - --- Once the Cargo has been loaded into the Carrier, drive to a point and unload the Cargo. -function InfantryCargo:OnEnterLoaded() - self:__UnBoard( 1 ) - self.OnEnterLoaded = nil -end - --- Once the Cargo has been unloaded from the Carrier (the Cargo has arrived to the unload gathering point), OnBoard the Cargo in the other Carrier. -function InfantryCargo:OnEnterUnLoaded() - self:__Board( 1, CargoCarrierTo ) - self.OnEnterUnLoaded = nil -end - + +CargoEngineer = UNIT:FindByName( "Engineer" ) +InfantryCargo = AI_CARGO_UNIT:New( CargoEngineer, "Engineer", "Engineer Sven", "81", 2000, 25 ) + +CargoCarrierFrom = UNIT:FindByName( "CarrierFrom" ) + +CargoCarrierTo = UNIT:FindByName( "CarrierTo" ) + +-- This call will make the Cargo run to the CargoCarrier. +-- Upon arrival at the CargoCarrier, the Cargo will be Loaded into the Carrier. +-- This process is now fully automated. +InfantryCargo:Board( CargoCarrierFrom ) + +-- Once the Cargo has been loaded into the Carrier, drive to a point and unload the Cargo. +function InfantryCargo:OnEnterLoaded() + self:__UnBoard( 1 ) + self.OnEnterLoaded = nil +end + +-- Once the Cargo has been unloaded from the Carrier (the Cargo has arrived to the unload gathering point), OnBoard the Cargo in the other Carrier. +function InfantryCargo:OnEnterUnLoaded() + self:__Board( 1, CargoCarrierTo ) + self.OnEnterUnLoaded = nil +end + diff --git a/CGO - Cargo/CGO-003 - Unit Transferring/CGO-003 - Unit Transferring.miz b/CGO - Cargo/CGO-003 - Unit Transferring/CGO-003 - Unit Transferring.miz index 53ab47ba66..00b06db507 100644 Binary files a/CGO - Cargo/CGO-003 - Unit Transferring/CGO-003 - Unit Transferring.miz and b/CGO - Cargo/CGO-003 - Unit Transferring/CGO-003 - Unit Transferring.miz differ diff --git a/CGO - Cargo/CGO-101 - Group Boarding/CGO-101 - Group Boarding.lua b/CGO - Cargo/CGO-101 - Group Boarding/CGO-101 - Group Boarding.lua index 041dcb92e7..e4364054f4 100644 --- a/CGO - Cargo/CGO-101 - Group Boarding/CGO-101 - Group Boarding.lua +++ b/CGO - Cargo/CGO-101 - Group Boarding/CGO-101 - Group Boarding.lua @@ -1,25 +1,25 @@ ---- --- Name: CGO-101 - Group Boarding --- Author: FlightControl --- Date Created: 13 Apr 2017 --- --- # Situation: --- --- A cargo group called Infantry with Engineers is boarding the Carrier "Carrier". --- --- # Test cases: --- --- 1. Observe that the cargo is boarding. --- - -local InfantryGroup = GROUP:FindByName( "Infantry" ) - -local InfantryCargo = CARGO_GROUP:New( InfantryGroup, "Engineers", "Infantry Engineers", 2000 ) - -local CargoCarrier = UNIT:FindByName( "Carrier" ) - --- This call will make the Cargo run to the CargoCarrier. --- Upon arrival at the CargoCarrier, the Cargo will be Loaded into the Carrier. --- This process is now fully automated. -InfantryCargo:Board( CargoCarrier, 25 ) - +--- +-- Name: CGO-101 - Group Boarding +-- Author: FlightControl +-- Date Created: 13 Apr 2017 +-- +-- # Situation: +-- +-- A cargo group called Infantry with Engineers is boarding the Carrier "Carrier". +-- +-- # Test cases: +-- +-- 1. Observe that the cargo is boarding. +-- + +local InfantryGroup = GROUP:FindByName( "Infantry" ) + +local InfantryCargo = CARGO_GROUP:New( InfantryGroup, "Engineers", "Infantry Engineers", 2000 ) + +local CargoCarrier = UNIT:FindByName( "Carrier" ) + +-- This call will make the Cargo run to the CargoCarrier. +-- Upon arrival at the CargoCarrier, the Cargo will be Loaded into the Carrier. +-- This process is now fully automated. +InfantryCargo:Board( CargoCarrier, 25 ) + diff --git a/CGO - Cargo/CGO-101 - Group Boarding/CGO-101 - Group Boarding.miz b/CGO - Cargo/CGO-101 - Group Boarding/CGO-101 - Group Boarding.miz index ce765c0e89..3c684d0d09 100644 Binary files a/CGO - Cargo/CGO-101 - Group Boarding/CGO-101 - Group Boarding.miz and b/CGO - Cargo/CGO-101 - Group Boarding/CGO-101 - Group Boarding.miz differ diff --git a/CGO - Cargo/CGO-102 - Group Unboarding/CGO-102 - Group Unboarding.lua b/CGO - Cargo/CGO-102 - Group Unboarding/CGO-102 - Group Unboarding.lua index 562338d8d8..24ba927e4b 100644 --- a/CGO - Cargo/CGO-102 - Group Unboarding/CGO-102 - Group Unboarding.lua +++ b/CGO - Cargo/CGO-102 - Group Unboarding/CGO-102 - Group Unboarding.lua @@ -1,25 +1,25 @@ ---- --- Name: CGO-102 - Group Unboarding --- Author: FlightControl --- Date Created: 13 Apr 2017 --- --- # Situation: --- --- A cargo group called Infantry with Engineers is unboarding the Carrier "Carrier". --- --- # Test cases: --- --- 1. Observe that the cargo is unboarding. --- - -local InfantryGroup = GROUP:FindByName( "Infantry" ) - -local InfantryCargo = CARGO_GROUP:New( InfantryGroup, "Engineers", "Infantry Engineers", 2000 ) - -local CargoCarrier = UNIT:FindByName( "Carrier" ) - --- This will Load immediately the Cargo into the Carrier, regardless where the Cargo is. -InfantryCargo:Load( CargoCarrier ) - --- This will Unboard the Cargo from the Carrier. +--- +-- Name: CGO-102 - Group Unboarding +-- Author: FlightControl +-- Date Created: 13 Apr 2017 +-- +-- # Situation: +-- +-- A cargo group called Infantry with Engineers is unboarding the Carrier "Carrier". +-- +-- # Test cases: +-- +-- 1. Observe that the cargo is unboarding. +-- + +local InfantryGroup = GROUP:FindByName( "Infantry" ) + +local InfantryCargo = CARGO_GROUP:New( InfantryGroup, "Engineers", "Infantry Engineers", 2000 ) + +local CargoCarrier = UNIT:FindByName( "Carrier" ) + +-- This will Load immediately the Cargo into the Carrier, regardless where the Cargo is. +InfantryCargo:Load( CargoCarrier ) + +-- This will Unboard the Cargo from the Carrier. InfantryCargo:UnBoard() \ No newline at end of file diff --git a/CGO - Cargo/CGO-102 - Group Unboarding/CGO-102 - Group Unboarding.miz b/CGO - Cargo/CGO-102 - Group Unboarding/CGO-102 - Group Unboarding.miz index e88bf03edc..a001a2d76c 100644 Binary files a/CGO - Cargo/CGO-102 - Group Unboarding/CGO-102 - Group Unboarding.miz and b/CGO - Cargo/CGO-102 - Group Unboarding/CGO-102 - Group Unboarding.miz differ diff --git a/CGO - Cargo/CGO-103 - Group Transferring/CGO-103 - Group Transferring.lua b/CGO - Cargo/CGO-103 - Group Transferring/CGO-103 - Group Transferring.lua index 61176ff873..9500e28fd0 100644 --- a/CGO - Cargo/CGO-103 - Group Transferring/CGO-103 - Group Transferring.lua +++ b/CGO - Cargo/CGO-103 - Group Transferring/CGO-103 - Group Transferring.lua @@ -1,40 +1,40 @@ ---- --- Name: CGO-103 - Group Tranferring --- Author: FlightControl --- Date Created: 13 Apr 2017 --- --- # Situation: --- --- A cargo group called Infantry with Engineers is tranferring from the APC "CarrierFrom" to the APC "CarrierTo". --- --- # Test cases: --- --- 1. Observe that the cargo is boarding the APC "CarrierFrom". --- 2. Observe that the cargo is unboarding the APC "CarrierFrom". --- 3. Observe that the cargo is boarding the APC "CarrierTo". --- - -local InfantryGroup = GROUP:FindByName( "Infantry" ) - -local InfantryCargo = CARGO_GROUP:New( InfantryGroup, "Engineers", "Infantry Engineers", 2000 ) - -local CargoCarrierFrom = UNIT:FindByName( "CarrierFrom" ) - -local CargoCarrierTo = UNIT:FindByName( "CarrierTo" ) - --- This call will make the Cargo run to the CargoCarrier. --- Upon arrival at the CargoCarrier, the Cargo will be Loaded into the Carrier. --- This process is now fully automated. -InfantryCargo:Board( CargoCarrierFrom, 20 ) - --- Once the Cargo has been loaded into the Carrier, drive to a point and unload the Cargo. -function InfantryCargo:OnEnterLoaded() - self:__UnBoard( 1 ) - self.OnEnterLoaded = nil -end - --- Once the Cargo has been unloaded from the Carrier (the Cargo has arrived to the unload gathering point), OnBoard the Cargo in the other Carrier. -function InfantryCargo:OnEnterUnLoaded() - self:__Board( 1, CargoCarrierTo, 20 ) - self.OnEnterUnLoaded = nil -end +--- +-- Name: CGO-103 - Group Tranferring +-- Author: FlightControl +-- Date Created: 13 Apr 2017 +-- +-- # Situation: +-- +-- A cargo group called Infantry with Engineers is tranferring from the APC "CarrierFrom" to the APC "CarrierTo". +-- +-- # Test cases: +-- +-- 1. Observe that the cargo is boarding the APC "CarrierFrom". +-- 2. Observe that the cargo is unboarding the APC "CarrierFrom". +-- 3. Observe that the cargo is boarding the APC "CarrierTo". +-- + +local InfantryGroup = GROUP:FindByName( "Infantry" ) + +local InfantryCargo = CARGO_GROUP:New( InfantryGroup, "Engineers", "Infantry Engineers", 2000 ) + +local CargoCarrierFrom = UNIT:FindByName( "CarrierFrom" ) + +local CargoCarrierTo = UNIT:FindByName( "CarrierTo" ) + +-- This call will make the Cargo run to the CargoCarrier. +-- Upon arrival at the CargoCarrier, the Cargo will be Loaded into the Carrier. +-- This process is now fully automated. +InfantryCargo:Board( CargoCarrierFrom, 20 ) + +-- Once the Cargo has been loaded into the Carrier, drive to a point and unload the Cargo. +function InfantryCargo:OnEnterLoaded() + self:__UnBoard( 1 ) + self.OnEnterLoaded = nil +end + +-- Once the Cargo has been unloaded from the Carrier (the Cargo has arrived to the unload gathering point), OnBoard the Cargo in the other Carrier. +function InfantryCargo:OnEnterUnLoaded() + self:__Board( 1, CargoCarrierTo, 20 ) + self.OnEnterUnLoaded = nil +end diff --git a/CGO - Cargo/CGO-103 - Group Transferring/CGO-103 - Group Transferring.miz b/CGO - Cargo/CGO-103 - Group Transferring/CGO-103 - Group Transferring.miz index 3859d14ff5..3e7c77813a 100644 Binary files a/CGO - Cargo/CGO-103 - Group Transferring/CGO-103 - Group Transferring.miz and b/CGO - Cargo/CGO-103 - Group Transferring/CGO-103 - Group Transferring.miz differ diff --git a/CGO - Cargo/CGO-110 - Group Respawn/CGO-110 - Group Respawn.lua b/CGO - Cargo/CGO-110 - Group Respawn/CGO-110 - Group Respawn.lua index a7f0a688d6..acb6b45b01 100644 --- a/CGO - Cargo/CGO-110 - Group Respawn/CGO-110 - Group Respawn.lua +++ b/CGO - Cargo/CGO-110 - Group Respawn/CGO-110 - Group Respawn.lua @@ -1,29 +1,29 @@ ---- --- Name: CGO-110 - Group Respawn --- Author: FlightControl --- Date Created: 07 Jul 2017 --- --- # Situation: --- --- A cargo group called Infantry with Engineers is Respawned after boarding the carrier. --- --- # Test cases: --- --- 1. Observe that the cargo is Respawned after boarding the Carrier. --- - -local InfantryGroup = GROUP:FindByName( "Infantry" ) - -local InfantryCargo = CARGO_GROUP:New( InfantryGroup, "Engineers", "Infantry Engineers", 2000 ) - -local CargoCarrier = UNIT:FindByName( "Carrier" ) - --- This call will make the Cargo run to the CargoCarrier. --- Upon arrival at the CargoCarrier, the Cargo will be Loaded into the Carrier. --- This process is now fully automated. -InfantryCargo:Board( CargoCarrier, 25 ) - -function InfantryCargo:OnEnterLoaded() - InfantryCargo:Respawn() - InfantryCargo:Board( CargoCarrier, 25 ) +--- +-- Name: CGO-110 - Group Respawn +-- Author: FlightControl +-- Date Created: 07 Jul 2017 +-- +-- # Situation: +-- +-- A cargo group called Infantry with Engineers is Respawned after boarding the carrier. +-- +-- # Test cases: +-- +-- 1. Observe that the cargo is Respawned after boarding the Carrier. +-- + +local InfantryGroup = GROUP:FindByName( "Infantry" ) + +local InfantryCargo = CARGO_GROUP:New( InfantryGroup, "Engineers", "Infantry Engineers", 2000 ) + +local CargoCarrier = UNIT:FindByName( "Carrier" ) + +-- This call will make the Cargo run to the CargoCarrier. +-- Upon arrival at the CargoCarrier, the Cargo will be Loaded into the Carrier. +-- This process is now fully automated. +InfantryCargo:Board( CargoCarrier, 25 ) + +function InfantryCargo:OnEnterLoaded() + InfantryCargo:Respawn() + InfantryCargo:Board( CargoCarrier, 25 ) end \ No newline at end of file diff --git a/CGO - Cargo/CGO-110 - Group Respawn/CGO-110 - Group Respawn.miz b/CGO - Cargo/CGO-110 - Group Respawn/CGO-110 - Group Respawn.miz index ba143c5793..4aa62d35b3 100644 Binary files a/CGO - Cargo/CGO-110 - Group Respawn/CGO-110 - Group Respawn.miz and b/CGO - Cargo/CGO-110 - Group Respawn/CGO-110 - Group Respawn.miz differ diff --git a/CGO - Cargo/CGO-201 - Package Boarding/CGO-201 - Package Boarding.lua b/CGO - Cargo/CGO-201 - Package Boarding/CGO-201 - Package Boarding.lua index c26fa24fa1..5449922014 100644 --- a/CGO - Cargo/CGO-201 - Package Boarding/CGO-201 - Package Boarding.lua +++ b/CGO - Cargo/CGO-201 - Package Boarding/CGO-201 - Package Boarding.lua @@ -1,11 +1,11 @@ - -DeliveryUnit = UNIT:FindByName( "Delivery" ) -Letter = AI_CARGO_PACKAGE:New( DeliveryUnit, "Letter", "Secret Orders", "0.3", 2000, 25 ) - -CargoCarrier = UNIT:FindByName( "Carrier" ) - --- This call will make the Cargo run to the CargoCarrier. --- Upon arrival at the CargoCarrier, the Cargo will be Loaded into the Carrier. --- This process is now fully automated. -Letter:Board( CargoCarrier, 40, 3, 25, 90 ) - + +DeliveryUnit = UNIT:FindByName( "Delivery" ) +Letter = AI_CARGO_PACKAGE:New( DeliveryUnit, "Letter", "Secret Orders", "0.3", 2000, 25 ) + +CargoCarrier = UNIT:FindByName( "Carrier" ) + +-- This call will make the Cargo run to the CargoCarrier. +-- Upon arrival at the CargoCarrier, the Cargo will be Loaded into the Carrier. +-- This process is now fully automated. +Letter:Board( CargoCarrier, 40, 3, 25, 90 ) + diff --git a/CGO - Cargo/CGO-201 - Package Boarding/CGO-201 - Package Boarding.miz b/CGO - Cargo/CGO-201 - Package Boarding/CGO-201 - Package Boarding.miz index 336ea71410..5e31fd219f 100644 Binary files a/CGO - Cargo/CGO-201 - Package Boarding/CGO-201 - Package Boarding.miz and b/CGO - Cargo/CGO-201 - Package Boarding/CGO-201 - Package Boarding.miz differ diff --git a/CGO - Cargo/CGO-202 - Package Unboarding/CGO-202 - Package Unboarding.lua b/CGO - Cargo/CGO-202 - Package Unboarding/CGO-202 - Package Unboarding.lua index 716b6186cc..bf6a623482 100644 --- a/CGO - Cargo/CGO-202 - Package Unboarding/CGO-202 - Package Unboarding.lua +++ b/CGO - Cargo/CGO-202 - Package Unboarding/CGO-202 - Package Unboarding.lua @@ -1,13 +1,13 @@ - -CargoEngineer = UNIT:FindByName( "Engineer" ) -InfantryCargo = AI_CARGO_UNIT:New( CargoEngineer, "Engineer", "Engineer Sven", "81", 2000, 25 ) - -CargoCarrier = UNIT:FindByName( "Carrier" ) - --- This will Load the Cargo into the Carrier, regardless where the Cargo is. -InfantryCargo:Load( CargoCarrier ) - --- This will Unboard the Cargo from the Carrier. --- The Cargo will run from the Carrier to a point in the NearRadius around the Carrier. --- Unboard the Cargo with a speed of 10 km/h, go to 200 meters 180 degrees from the Carrier, iin a zone of 25 meters (NearRadius). + +CargoEngineer = UNIT:FindByName( "Engineer" ) +InfantryCargo = AI_CARGO_UNIT:New( CargoEngineer, "Engineer", "Engineer Sven", "81", 2000, 25 ) + +CargoCarrier = UNIT:FindByName( "Carrier" ) + +-- This will Load the Cargo into the Carrier, regardless where the Cargo is. +InfantryCargo:Load( CargoCarrier ) + +-- This will Unboard the Cargo from the Carrier. +-- The Cargo will run from the Carrier to a point in the NearRadius around the Carrier. +-- Unboard the Cargo with a speed of 10 km/h, go to 200 meters 180 degrees from the Carrier, iin a zone of 25 meters (NearRadius). InfantryCargo:UnBoard( 10, 2, 20, 10, 180 ) \ No newline at end of file diff --git a/CGO - Cargo/CGO-202 - Package Unboarding/CGO-202 - Package Unboarding.miz b/CGO - Cargo/CGO-202 - Package Unboarding/CGO-202 - Package Unboarding.miz index 2e20bd4a36..49e4e2b385 100644 Binary files a/CGO - Cargo/CGO-202 - Package Unboarding/CGO-202 - Package Unboarding.miz and b/CGO - Cargo/CGO-202 - Package Unboarding/CGO-202 - Package Unboarding.miz differ diff --git a/CGO - Cargo/CGO-300 - Crate Boarding/CGO-300 - Crate Boarding.lua b/CGO - Cargo/CGO-300 - Crate Boarding/CGO-300 - Crate Boarding.lua index 9bedd3b72a..eb16333be9 100644 --- a/CGO - Cargo/CGO-300 - Crate Boarding/CGO-300 - Crate Boarding.lua +++ b/CGO - Cargo/CGO-300 - Crate Boarding/CGO-300 - Crate Boarding.lua @@ -1,11 +1,11 @@ - -Barrels = STATIC:FindByName( "Barrels" ) -CargoBarrels = CARGO_CRATE:New( Barrels, "EAQ-234-432" ) - -CargoCarrier = UNIT:FindByName( "Carrier" ) - --- This call will make the Cargo run to the CargoCarrier. --- Upon arrival at the CargoCarrier, the Cargo will be Loaded into the Carrier. --- This process is now fully automated. -CargoBarrels:Load( CargoCarrier ) - + +Barrels = STATIC:FindByName( "Barrels" ) +CargoBarrels = CARGO_CRATE:New( Barrels, "EAQ-234-432" ) + +CargoCarrier = UNIT:FindByName( "Carrier" ) + +-- This call will make the Cargo run to the CargoCarrier. +-- Upon arrival at the CargoCarrier, the Cargo will be Loaded into the Carrier. +-- This process is now fully automated. +CargoBarrels:Load( CargoCarrier ) + diff --git a/CGO - Cargo/CGO-300 - Crate Boarding/CGO-300 - Crate Boarding.miz b/CGO - Cargo/CGO-300 - Crate Boarding/CGO-300 - Crate Boarding.miz index 874be31502..b2d6b22c41 100644 Binary files a/CGO - Cargo/CGO-300 - Crate Boarding/CGO-300 - Crate Boarding.miz and b/CGO - Cargo/CGO-300 - Crate Boarding/CGO-300 - Crate Boarding.miz differ diff --git a/CGO - Cargo/CGO-900 - Cargo sets/CGO-900 - Cargo sets.lua b/CGO - Cargo/CGO-900 - Cargo sets/CGO-900 - Cargo sets.lua index 0db80b2cbe..52b5eaff70 100644 --- a/CGO - Cargo/CGO-900 - Cargo sets/CGO-900 - Cargo sets.lua +++ b/CGO - Cargo/CGO-900 - Cargo sets/CGO-900 - Cargo sets.lua @@ -1,3 +1,3 @@ -InfantryUnitSet = SET_UNIT:New():FilterCategories("ground"):FilterPrefixes("Infantry"):FilterOnce() -InfantryUnitSet:Flush() - +InfantryUnitSet = SET_UNIT:New():FilterCategories("ground"):FilterPrefixes("Infantry"):FilterOnce() +InfantryUnitSet:Flush() + diff --git a/CGO - Cargo/CGO-900 - Cargo sets/CGO-900 - Cargo sets.miz b/CGO - Cargo/CGO-900 - Cargo sets/CGO-900 - Cargo sets.miz index a7a422d953..d355f462b7 100644 Binary files a/CGO - Cargo/CGO-900 - Cargo sets/CGO-900 - Cargo sets.miz and b/CGO - Cargo/CGO-900 - Cargo sets/CGO-900 - Cargo sets.miz differ diff --git a/CLA - CleanUp Airbase/CLA-001 - CleanUp Airbase/CLA-001 - CleanUp Airbase.lua b/CLA - CleanUp Airbase/CLA-001 - CleanUp Airbase/CLA-001 - CleanUp Airbase.lua index 5f2b3a57cf..1c49160870 100644 --- a/CLA - CleanUp Airbase/CLA-001 - CleanUp Airbase/CLA-001 - CleanUp Airbase.lua +++ b/CLA - CleanUp Airbase/CLA-001 - CleanUp Airbase/CLA-001 - CleanUp Airbase.lua @@ -1,14 +1,14 @@ - - - - -Clean = CLEANUP_AIRBASE:New( AIRBASE.Caucasus.Batumi ) -Clean:SetCleanMissiles( false ) - - -SpawnRU = SPAWN:New( 'RU Attack Heli Batumi'):InitLimit( 2, 120 ):SpawnScheduled( 10, 0 ) - -SpawnUS = SPAWN:New( 'US Attack Heli Batumi'):InitLimit( 2, 120 ):SpawnScheduled( 10, 0 ) - -SpawnTransport = SPAWN:New( "US Transport"):SpawnScheduled( 90, 0 ) - + + + + +Clean = CLEANUP_AIRBASE:New( AIRBASE.Caucasus.Batumi ) +Clean:SetCleanMissiles( false ) + + +SpawnRU = SPAWN:New( 'RU Attack Heli Batumi'):InitLimit( 2, 120 ):SpawnScheduled( 10, 0 ) + +SpawnUS = SPAWN:New( 'US Attack Heli Batumi'):InitLimit( 2, 120 ):SpawnScheduled( 10, 0 ) + +SpawnTransport = SPAWN:New( "US Transport"):SpawnScheduled( 90, 0 ) + diff --git a/CLA - CleanUp Airbase/CLA-001 - CleanUp Airbase/CLA-001 - CleanUp Airbase.miz b/CLA - CleanUp Airbase/CLA-001 - CleanUp Airbase/CLA-001 - CleanUp Airbase.miz index 44bac5bcde..19874f527a 100644 Binary files a/CLA - CleanUp Airbase/CLA-001 - CleanUp Airbase/CLA-001 - CleanUp Airbase.miz and b/CLA - CleanUp Airbase/CLA-001 - CleanUp Airbase/CLA-001 - CleanUp Airbase.miz differ diff --git a/DEM - Demo Missions/GOV - Gori Valley/GOV - Gori Valley.lua b/DEM - Demo Missions/GOV - Gori Valley/GOV - Gori Valley.lua index 1bdca35cba..8f6a23c50f 100644 --- a/DEM - Demo Missions/GOV - Gori Valley/GOV - Gori Valley.lua +++ b/DEM - Demo Missions/GOV - Gori Valley/GOV - Gori Valley.lua @@ -1,568 +1,568 @@ ---- Gori Valley designed with the MOOSE framework for DCS World. --- Author: FlightControl - --- Define the headquarters. - -NATO_HQ = COMMANDCENTER:New( GROUP:FindByName( "HQ NATO Gori" ), "Gori" ) -CCCP_HQ = COMMANDCENTER:New( GROUP:FindByName( "HQ CCCP Tskinvali" ), "Tskinvali" ) - - --- Define the scoring object. - -Score = SCORING:New( "Gori Valley" ) - -Score:SetScaleDestroyScore( 40 ) -Score:SetScaleDestroyPenalty( 80 ) -Score:SetFratricide( 80 ) -Score:SetMessagesHit( false ) - - ---- Cargo Dispatching - -do - - local SetCargoInfantry = SET_CARGO:New():FilterTypes( "Infantry" ):FilterStart() - local SetHelicopter = SET_GROUP:New():FilterPrefixes( "US CH-47D@RAMP Troop Deployment" ):FilterStart() - local SetDeployZones = SET_ZONE:New():FilterPrefixes( "US Troops Landing Zone" ):FilterStart() - - NATO_AI_Cargo_Dispatcher_Helicopter = AI_CARGO_DISPATCHER_HELICOPTER:New( SetHelicopter, SetCargoInfantry, SetDeployZones ) - NATO_AI_Cargo_Dispatcher_Helicopter:SetPickupRadius( 50, 25 ) - NATO_AI_Cargo_Dispatcher_Helicopter:SetDeployRadius( 1000, 500 ) - NATO_AI_Cargo_Dispatcher_Helicopter:Start() - -end - --- CCCP COALITION UNITS - --- Russian helicopters engaging the battle field in Gori Valley -Spawn_RU_KA50 = SPAWN - :New( "RU KA-50@HOT-Patriot Attack" ) - :InitLimit( 1, 24 ) - :InitRandomizeRoute( 1, 1, 8000 ) - :InitCleanUp( 180 ) - :SpawnScheduled( 1200, 0.2 ) - --- Russian ground troops attacking Gori Valley -Spawn_RU_Troops = - { 'RU Attack Gori 1', - 'RU Attack Gori 2', - 'RU Attack Gori 3', - 'RU Attack Gori 4', - 'RU Attack Gori 5', - 'RU Attack Gori 6', - 'RU Attack Gori 7', - 'RU Attack Gori 8', - 'RU Attack Gori 9', - 'RU Attack Gori 10' - } - - -Spawn_RU_Troops_Left = SPAWN - :New( "RU Attack Gori Left" ) - :InitLimit( 15, 40 ) - :InitRandomizeTemplate( Spawn_RU_Troops ) - :InitRandomizeRoute( 1, 1, 2000 ) - --:InitArray( 349, 30, 20, 6 * 20 ) - :SpawnScheduled( 120, 1 ) - -Spawn_RU_Troops_Middle = SPAWN - :New( "RU Attack Gori Middle" ) - :InitLimit( 15, 40 ) - :InitRandomizeTemplate( Spawn_RU_Troops ) - :InitRandomizeRoute( 1, 1, 2000 ) - --:InitArray( 260, 50, 20, 6 * 20 ) - :SpawnScheduled( 120, 1 ) - -Spawn_RU_Troops_Right = SPAWN - :New( "RU Attack Gori Right" ) - :InitLimit( 15, 40 ) - :InitRandomizeTemplate( Spawn_RU_Troops ) - :InitRandomizeRoute( 1, 1, 2000 ) - --:InitArray( 238, 50, 20, 6 * 20 ) - :SpawnScheduled( 120, 1 ) - - --- NATO Tank Platoons invading Tskinvali - -Spawn_US_Platoon = - { 'US Tank Platoon 1', - 'US Tank Platoon 2', - 'US Tank Platoon 3', - 'US Tank Platoon 4', - 'US Tank Platoon 5', - 'US Tank Platoon 6', - 'US Tank Platoon 7', - 'US Tank Platoon 8', - 'US Tank Platoon 9', - 'US Tank Platoon 10', - 'US Tank Platoon 11', - 'US Tank Platoon 12', - 'US Tank Platoon 13' - } - -Spawn_US_Platoon_Left = SPAWN - :New( 'US Tank Platoon Left' ) - :InitLimit( 15, 40 ) - :InitRandomizeTemplate( Spawn_US_Platoon ) - :InitRandomizeRoute( 3, 1, 2000 ) - --:InitArray( 76, 20, 15, 15*6 ) - :SpawnScheduled( 120, 1 ) - -Spawn_US_Platoon_Middle = SPAWN - :New( 'US Tank Platoon Middle' ) - :InitLimit( 15, 40 ) - :InitRandomizeTemplate( Spawn_US_Platoon ) - :InitRandomizeRoute( 3, 1, 2000 ) - --:InitArray( 160, 20, 15, 15*6 ) - :SpawnScheduled( 120, 1 ) - -Spawn_US_Platoon_Right = SPAWN - :New( 'US Tank Platoon Right' ) - :InitLimit( 15, 40 ) - :InitRandomizeTemplate( Spawn_US_Platoon ) - :InitRandomizeRoute( 1, 1, 2000 ) - --:InitArray( 90, 20, 15, 15*6 ) - :SpawnScheduled( 120, 1 ) - - - -do -- NATO Air Patrol Support Mission - - - local NATO_S1 = MISSION - :New( NATO_HQ, "Intercept Intruders","Support","Intercept any intruders invading airspace from the North!", coalition.side.BLUE ) - :AddScoring( Score ) - - -- Define the Recce groups that will detect the upcoming ground forces. - local NATO_S1_EWR = SET_GROUP:New():FilterCoalitions("blue"):FilterPrefixes( "AI NATO EWR A2A" ):FilterStart() - - -- Define the detection method, we'll use here AREA detection. - local NATO_S1_EWR_Areas = DETECTION_AREAS:New( NATO_S1_EWR, 20000 ) - NATO_S1_EWR_Areas:SetFriendliesRange( 80000 ) - NATO_S1_EWR_Areas:SetRefreshTimeInterval( 30 ) - NATO_S1_EWR_Areas:SetAcceptRange( 250000 ) -- Only report targets within 250km. - - local NATO_S1_Task = SET_GROUP:New():FilterCoalitions( "blue" ):FilterPrefixes( "S1 NATO Air Patrol" ):FilterStart() - - -- Define the Task dispatcher that will define the tasks based on the detected targets. - NATO_S1_A2A = TASK_A2A_DISPATCHER:New( NATO_S1, NATO_S1_Task, NATO_S1_EWR_Areas ) - - - local NATO_AI_A2A_Support_East = { - "AI NATO Air Support East F-16A A", - "AI NATO Air Support East F-16A B", - } - - local NATO_AI_A2A_Support_West = { - "AI NATO Air Support West F-16A A", - "AI NATO Air Support West F-16A B", - } - - NATO_AI_A2A_Dispatcher = AI_A2A_DISPATCHER:New( NATO_S1_EWR_Areas ) - - NATO_AI_A2A_Dispatcher:SetTacticalDisplay( false ) - - NATO_AI_A2A_Dispatcher:SetEngageRadius( 80000 ) - NATO_AI_A2A_Dispatcher:SetGciRadius( 140000 ) - - NATO_AI_A2A_Dispatcher:SetSquadron( "Kutaisi", AIRBASE.Caucasus.Kutaisi, NATO_AI_A2A_Support_West, 20 ) - NATO_AI_A2A_Dispatcher:SetSquadronCap( "Kutaisi", ZONE_POLYGON:New( "NATO CAP EAST", GROUP:FindByName( "NATO CAP EAST") ), 4000, 8000, 450, 600, 800, 1200, "BARO" ) - NATO_AI_A2A_Dispatcher:SetSquadronCapInterval( "Kutaisi", 2, 180, 300 ) - - NATO_AI_A2A_Dispatcher:SetSquadronGci( "Kutaisi", 800, 1200 ) - - NATO_AI_A2A_Dispatcher:SetSquadron( "Vaziani", AIRBASE.Caucasus.Vaziani, NATO_AI_A2A_Support_East, 20 ) - NATO_AI_A2A_Dispatcher:SetSquadronCap( "Vaziani", ZONE_POLYGON:New( "NATO CAP WEST", GROUP:FindByName( "NATO CAP WEST" ) ), 4000, 8000, 500, 700, 800, 1200, "BARO" ) - NATO_AI_A2A_Dispatcher:SetSquadronCapInterval( "Vaziani", 2, 180, 300 ) - - NATO_AI_A2A_Dispatcher:SetSquadronGci( "Vaziani", 800, 1200 ) - -end - - -do -- NATO Mission 1 - - - local NATO_M1 = MISSION - :New( NATO_HQ, "Destroy SAM-6","Primary","Destroy SAM-6 batteries", coalition.side.BLUE ) - :AddScoring( Score ) - - - -- Define the Recce groups that will detect the upcoming ground forces. - local NATO_M1_RecceSet = SET_GROUP:New():FilterCoalitions("blue"):FilterPrefixes( "M1 NATO Recce" ):FilterStart() - - NATO_M1_Spawn_Reaper = SPAWN - :New( "M1 NATO Recce Reaper" ) - :InitLimit( 1, 5 ) - :SpawnScheduled( 300, 0 ) - - - NATO_M1_ReccePatrolArray = {} - NATO_M1_RecceSpawn_US = SPAWN - :New( "M1 NATO Recce AH-64" ) - :InitLimit( 2, 10 ) - :SpawnScheduled( 60, 0.4 ) - :InitCleanUp( 300 ) - :OnSpawnGroup( - function( SpawnGroup ) - NATO_M1_RecceSpawn_US:E( SpawnGroup.ControllableName ) - local M1_ReccePatrolZoneWP = GROUP:FindByName( "M1 US Patrol Zone@ZONE" ) - local M1_ReccePatrolZone = ZONE_POLYGON:New( "PatrolZone", M1_ReccePatrolZoneWP ) - local M1_ReccePatrol = AI_PATROL_ZONE:New( M1_ReccePatrolZone, 30, 50, 50, 100 ) - NATO_M1_ReccePatrolArray[#NATO_M1_ReccePatrolArray+1] = M1_ReccePatrol - - M1_ReccePatrol:SetControllable( SpawnGroup ) - M1_ReccePatrol:__Start( 30 ) -- It takes a bit of time for the Recce to start - end - ) - - - -- Define the detection method, we'll use here AREA detection. - local NATO_M1_DetectionAreas = DETECTION_AREAS:New( NATO_M1_RecceSet, 1000 ) - --M1_DetectionAreas:BoundDetectedZones() - - local NATO_M1_Attack = SET_GROUP:New():FilterCoalitions( "blue" ):FilterPrefixes( "M1 NATO Attack" ):FilterStart() - - -- Define the Task dispatcher that will define the tasks based on the detected targets. - NATO_M1_Task_A2G_Dispatcher = TASK_A2G_DISPATCHER:New( NATO_M1, NATO_M1_Attack, NATO_M1_DetectionAreas ) - - NATO_M1_Designate = DESIGNATE:New( NATO_HQ, NATO_M1_DetectionAreas, NATO_M1_Attack, NATO_M1 ) - - -end - - -do -- NATO Transport Task Engineers - - local NATO_M4_Patriots = MISSION - :New( NATO_HQ, - "Engineers Patriots", - "Operational", - "Transport 3 engineering teams to three strategical Patriot launch sites. " .. - "The launch sites are not yet complete and need some special launch codes to be delivered. " .. - "The engineers have the knowledge to install these launch codes. ", - coalition.side.BLUE ) - - local NATO_M4_HeloSetGroup = SET_GROUP:New():FilterPrefixes( "M4 NATO Patriot Transport" ):FilterStart() - - local NATO_M4_SetCargo = SET_CARGO:New():FilterTypes( { "Patriot Engineers" } ):FilterStart() - - local EngineersCargo1 = CARGO_GROUP:New( GROUP:FindByName( "M4 NATO Engineers Bear" ), "Patriot Engineers", "Team Bear", 500 ):RespawnOnDestroyed(true) - local EngineersCargo2 = CARGO_GROUP:New( GROUP:FindByName( "M4 NATO Engineers Moose" ), "Patriot Engineers", "Team Moose", 500 ):RespawnOnDestroyed(true) - local EngineersCargo3 = CARGO_GROUP:New( GROUP:FindByName( "M4 NATO Engineers Falcon" ), "Patriot Engineers", "Team Falcon", 500 ):RespawnOnDestroyed(true) - - - -- These are the groups of the SA-6 batteries. - local Patriots1 = GROUP:FindByName( "M4 NATO Patriot North" ):SetAIOff() - local Patriots2 = GROUP:FindByName( "M4 NATO Patriot West" ):SetAIOff() - local Patriots3 = GROUP:FindByName( "M4 NATO Patriot East" ):SetAIOff() - - -- Each SA-6 battery has a zone of type ZONE_GROUP. That makes these zone moveable as they drive around the battle field! - local Zone_Patriots1 = ZONE_GROUP:New( "Patriots North", Patriots1, 600 ) - local Zone_Patriots2 = ZONE_GROUP:New( "Patriots West", Patriots2, 600 ) - local Zone_Patriots3 = ZONE_GROUP:New( "Patriots East", Patriots3, 600 ) - - NATO_M4_Cargo_Transport_Dispatcher = TASK_CARGO_DISPATCHER:New( NATO_M4_Patriots, NATO_M4_HeloSetGroup ) - - local NATO_M4_Cargo_Transport_TaskName = NATO_M4_Cargo_Transport_Dispatcher:AddTransportTask( - "Activate Patriot Batteries", - NATO_M4_SetCargo, - "Pickup Engineers Alpha, Beta and Gamma from their current location, and drop them near the Patriot launchers. " .. - "Deployment zones have been defined at each Patriot location." - ) - - NATO_M4_Cargo_Transport_Dispatcher:SetTransportDeployZones( NATO_M4_Cargo_Transport_TaskName, { Zone_Patriots1, Zone_Patriots2, Zone_Patriots3 } ) - - local NATO_M4_Cargo_Transport_Task = NATO_M4_Cargo_Transport_Dispatcher:GetTransportTask( NATO_M4_Cargo_Transport_TaskName ) - - - --- OnAfter Transition Handler for Event CargoDeployed. - -- This event will handle after deployment the activation of the SA-6 site. - -- @function [parent=#TASK_CARGO_TRANSPORT] OnAfterCargoDeployed - -- @param Tasking.Task_CARGO#TASK_CARGO_TRANSPORT self - -- @param #string From The From State string. - -- @param #string Event The Event string. - -- @param #string To The To State string. - -- @param Wrapper.Unit#UNIT TaskUnit The Unit (Client) that Deployed the cargo. You can use this to retrieve the PlayerName etc. - -- @param Core.Cargo#CARGO Cargo The Cargo that got PickedUp by the TaskUnit. You can use this to check Cargo Status. - -- @param Core.Zone#ZONE DeployZone The zone where the Cargo got Deployed or UnBoarded. - function NATO_M4_Cargo_Transport_Task:OnAfterCargoDeployed( From, Event, To, TaskUnit, Cargo, DeployZone ) - self:E( { From, Event, To, TaskUnit, Cargo, DeployZone } ) - - local DeployZoneName = DeployZone:GetName() - local CargoName = Cargo:GetName() - - - NATO_HQ:MessageToCoalition( - string.format( "Engineers %s are successfully transported to patriot site %s.", - CargoName, - DeployZoneName - ) - ) - - if DeployZoneName == Zone_Patriots1:GetName() then - if Patriots1 and not Patriots1:IsAlive() then - local Template = Patriots1:GetTemplate() - Template.lateActivation = false - Template.Visible = false - Patriots1:Respawn(Template) - --Patriots1:SetAIOn() - end - end - - if DeployZoneName == Zone_Patriots2:GetName() then - if Patriots2 and not Patriots2:IsAlive() then - local Template = Patriots2:GetTemplate() - Template.lateActivation = false - Template.Visible = false - Patriots2:Respawn(Template) - --Patriots2:SetAIOn() - end - end - - if DeployZoneName == Zone_Patriots3:GetName() then - if Patriots3 and not Patriots3:IsAlive() then - local Template = Patriots3:GetTemplate() - Template.lateActivation = false - Template.Visible = false - Patriots3:Respawn(Template) - --Patriots3:SetAIOn() - end - end - - if self:IsAllCargoTransported() then - self:Success() - NATO_M4_Patriots:Complete() - end - end - -end - - - - - - -do -- CCCP Air Patrol Support Functions - - - local CCCP_S1 = MISSION - :New( CCCP_HQ, "Provide Air Support","Support","Intercept any bogeys invading airspace from the South or East!", coalition.side.RED ) - :AddScoring( Score ) - - -- Define the Recce groups that will detect the upcoming A2A intruders. - local CCCP_S1_EWR_Groups = SET_GROUP:New():FilterCoalitions("red"):FilterPrefixes( "AI CCCP EWR" ):FilterStart() - - -- Define the detection method, we'll use here AREA detection. - local CCCP_S1_EWR_Areas = DETECTION_AREAS:New( CCCP_S1_EWR_Groups, 30000 ) - CCCP_S1_EWR_Areas:SetFriendliesRange( 80000 ) - CCCP_S1_EWR_Areas:SetAcceptRange( 250000 ) -- Only report targets that are within 250km from detection. - --M1_DetectionAreas_US:BoundDetectedZones() - - local CCCP_S1_SupportGroups = SET_GROUP:New():FilterCoalitions("red"):FilterPrefixes( "S1 CCCP Air Defense" ):FilterStart() - - -- Define the Task dispatcher that will define the tasks based on the detected targets. - CCCP_S1_A2A_Task_Dispatcher = TASK_A2A_DISPATCHER:New( CCCP_S1, CCCP_S1_SupportGroups, CCCP_S1_EWR_Areas ) - - - CCCP_AI_A2A_Support_SU_27 = { - "AI CCCP Air Support SU-27 A", - "AI CCCP Air Support SU-27 B", - "AI CCCP Air Support SU-27 C", - "AI CCCP Air Support SU-27 D" - } - - CCCP_AI_A2A_Support_MIG_29S = { - "AI CCCP Air Support MIG-29S A", - "AI CCCP Air Support MIG-29S B", - "AI CCCP Air Support MIG-29S C", - "AI CCCP Air Support MIG-29S D" - } - - - CCCP_AI_A2A_Dispatcher = AI_A2A_DISPATCHER:New( CCCP_S1_EWR_Areas ) - - CCCP_AI_A2A_Dispatcher:SetTacticalDisplay( false ) - - CCCP_AI_A2A_Dispatcher:SetEngageRadius( 80000 ) - CCCP_AI_A2A_Dispatcher:SetGciRadius( 100000 ) - - -- Beslan - CCCP_AI_A2A_Dispatcher:SetSquadron( "Beslan", AIRBASE.Caucasus.Beslan, CCCP_AI_A2A_Support_SU_27, 20 ) - CCCP_AI_A2A_Dispatcher:SetSquadronCap( "Beslan", ZONE_POLYGON:New( "CCCP CAP EAST", GROUP:FindByName( "CCCP CAP EAST") ), 4000, 8000, 450, 600, 800, 1200, "BARO" ) - CCCP_AI_A2A_Dispatcher:SetSquadronCapInterval( "Beslan", 2, 180, 300 ) - CCCP_AI_A2A_Dispatcher:SetSquadronTakeoffInAir( "Beslan" ) - - -- Mozdok - CCCP_AI_A2A_Dispatcher:SetSquadron( "Mozdok", AIRBASE.Caucasus.Mozdok, CCCP_AI_A2A_Support_SU_27, 20 ) - CCCP_AI_A2A_Dispatcher:SetSquadronGci( "Mozdok", 800, 1200 ) - - CCCP_AI_A2A_Dispatcher:SetSquadron( "Nalchik", AIRBASE.Caucasus.Nalchik, CCCP_AI_A2A_Support_MIG_29S, 20 ) - CCCP_AI_A2A_Dispatcher:SetSquadronCap( "Nalchik", ZONE_POLYGON:New( "CCCP CAP WEST", GROUP:FindByName( "CCCP CAP WEST" ) ), 4000, 8000, 500, 700, 800, 1200, "BARO" ) - CCCP_AI_A2A_Dispatcher:SetSquadronCapInterval( "Nalchik", 2, 180, 300 ) - CCCP_AI_A2A_Dispatcher:SetSquadronGci( "Nalchik", 800, 1200 ) - -end - -do -- CCCP Destroy Patriots - - local CCCP_M1 = MISSION - :New( CCCP_HQ, - "Destroy Patriots", - "Primary", - "Destroy Patriot batteries.", - coalition.side.RED - ) - :AddScoring( Score ) - - -- Define the Recce groups that will detect the upcoming ground forces. - local CCCP_M1_RecceSet = SET_GROUP:New():FilterCoalitions( "red" ):FilterPrefixes( "M1 CCCP Recce" ):FilterStart() - - CCCP_M1_Spawn_SU25MR = SPAWN - :New( "M1 CCCP Recce SU-25MR" ) - :InitLimit( 1, 5 ) - :SpawnScheduled( 300, 0.5 ) - - - CCCP_M1_ReccePatrolArray = {} - CCCP_M1_RecceSpawn = SPAWN - :New( "M1 CCCP Recce MI-28N" ) - :InitLimit( 2, 10 ) - :SpawnScheduled( 60, 0.4 ) - :OnSpawnGroup( - function( SpawnGroup ) - local M1_ReccePatrolZoneWP = GROUP:FindByName( "M1 RU Patrol Zone@ZONE" ) - local M1_ReccePatrolZone = ZONE_POLYGON:New( "PatrolZone", M1_ReccePatrolZoneWP ) - local M1_ReccePatrol = AI_PATROL_ZONE:New( M1_ReccePatrolZone, 30, 50, 50, 100 ) - CCCP_M1_ReccePatrolArray[#CCCP_M1_ReccePatrolArray+1] = M1_ReccePatrol - - M1_ReccePatrol:SetControllable( SpawnGroup ) - M1_ReccePatrol:__Start( 20 ) -- It takes a bit of time for the Recce to start - end - ) - - - -- Define the detection method, we'll use here AREA detection. - local CCCP_M1_DetectionAreas = DETECTION_AREAS:New( CCCP_M1_RecceSet, 1000 ) - --M1_DetectionAreas_US:BoundDetectedZones() - - local CCCP_M1_Attack = SET_GROUP:New():FilterCoalitions( "red" ):FilterPrefixes( "M1 CCCP Attack" ):FilterStart() - CCCP_M1_Attack:Flush() - - -- Define the Task dispatcher that will define the tasks based on the detected targets. - CCCP_M1_Task_A2G_Dispatcher = TASK_A2G_DISPATCHER:New( CCCP_M1, CCCP_M1_Attack, CCCP_M1_DetectionAreas ) - -end - -do -- CCCP Transport Task Engineers - - local CCCP_M4_SA6 = MISSION - :New( CCCP_HQ, - "Engineers SA-6", - "Operational", - "Transport 3 engineering teams to three strategical SA-6 launch sites. " .. - "The launch sites are not yet complete and need some special launch codes to be delivered. " .. - "The engineers have the knowledge to install these launch codes. ", - coalition.side.RED ) - :AddScoring( Score ) - - local CCCP_M4_HeloSetGroup = SET_GROUP:New():FilterPrefixes( "M4 CCCP SA6 Transport" ):FilterStart() - - local CCCP_M4_SA6_SetCargo = SET_CARGO:New():FilterTypes( { "SA6 Engineers" } ):FilterStart() - - local EngineersCargoAlpha = CARGO_GROUP:New( GROUP:FindByName( "M4 CCCP Engineers Alpha" ), "SA6 Engineers", "Team Alpha", 500 ) - local EngineersCargoBeta = CARGO_GROUP:New( GROUP:FindByName( "M4 CCCP Engineers Beta" ), "SA6 Engineers", "Team Beta", 500 ) - local EngineersCargoGamma = CARGO_GROUP:New( GROUP:FindByName( "M4 CCCP Engineers Gamma" ), "SA6 Engineers", "Team Gamma", 500 ) - - CCCP_M4_Cargo_Transport_Dispatcher = TASK_CARGO_DISPATCHER:New( CCCP_M4_SA6, CCCP_M4_HeloSetGroup ) - - local CCCP_M4_Cargo_Transport_TaskName = CCCP_M4_Cargo_Transport_Dispatcher:AddTransportTask( - "Transport SA-6 Engineers", - CCCP_M4_SA6_SetCargo, - "Pickup Engineers Alpha, Beta and Gamma from their current location, and drop them near the SA-6 launchers. " .. - "Deployment zones have been defined at each SA-6 location." - ) - - -- These are the groups of the SA-6 batteries. - local SA6_1 = GROUP:FindByName( "M4 CCCP SA6 Kub Moskva" ):SetAIOff() - local SA6_2 = GROUP:FindByName( "M4 CCCP SA6 Kub Niznij" ):SetAIOff() - local SA6_3 = GROUP:FindByName( "M4 CCCP SA6 Kub Yaroslavl" ):SetAIOff() - - -- Each SA-6 battery has a zone of type ZONE_GROUP. That makes these zone moveable as they drive around the battle field! - local Zone_SA6_1 = ZONE_GROUP:New( "SA6 Moskva", SA6_1, 500 ) - local Zone_SA6_2 = ZONE_GROUP:New( "SA6 Niznij", SA6_2, 500 ) - local Zone_SA6_3 = ZONE_GROUP:New( "SA6 Yaroslavl", SA6_3, 500 ) - - CCCP_M4_Cargo_Transport_Dispatcher:SetTransportDeployZones( CCCP_M4_Cargo_Transport_TaskName, { Zone_SA6_1, Zone_SA6_2, Zone_SA6_3 } ) - local CCCP_M4_Cargo_Transport_Task = CCCP_M4_Cargo_Transport_Dispatcher:GetTransportTask( CCCP_M4_Cargo_Transport_TaskName ) - - --- OnAfter Transition Handler for Event CargoDeployed. - -- This event will handle after deployment the activation of the SA-6 site. - -- @function [parent=#TASK_CARGO_TRANSPORT] OnAfterCargoDeployed - -- @param Tasking.Task_CARGO#TASK_CARGO_TRANSPORT self - -- @param #string From The From State string. - -- @param #string Event The Event string. - -- @param #string To The To State string. - -- @param Wrapper.Unit#UNIT TaskUnit The Unit (Client) that Deployed the cargo. You can use this to retrieve the PlayerName etc. - -- @param Core.Cargo#CARGO Cargo The Cargo that got PickedUp by the TaskUnit. You can use this to check Cargo Status. - -- @param Core.Zone#ZONE DeployZone The zone where the Cargo got Deployed or UnBoarded. - function CCCP_M4_Cargo_Transport_Task:OnAfterCargoDeployed( From, Event, To, TaskUnit, Cargo, DeployZone ) - - self:E( { From, Event, To, TaskUnit:GetName(), Cargo:GetName(), DeployZone:GetName() } ) - - local DeployZoneName = DeployZone:GetName() - local CargoName = Cargo:GetName() - - - CCCP_HQ:MessageToCoalition( - string.format( "Engineers %s are successfully transported to SA-6 site %s.", - CargoName, - DeployZoneName - ) - ) - - if DeployZoneName == Zone_SA6_1:GetName() then - if SA6_1 and not SA6_1:IsAlive() then - self:E( { GroupActivated = SA6_1:GetName() } ) - local Template = SA6_1:GetTemplate() - Template.lateActivation = false - Template.Visible = false - SA6_1:Respawn(Template) - --SA6_1:SetAIOn() - end - end - - if DeployZoneName == Zone_SA6_2:GetName() then - if SA6_2 and not SA6_2:IsAlive() then - self:E( { GroupActivated = SA6_2:GetName() } ) - local Template = SA6_2:GetTemplate() - Template.lateActivation = false - Template.Visible = false - SA6_2:Respawn(Template) - --SA6_2:SetAIOn() - end - end - - if DeployZoneName == Zone_SA6_3:GetName() then - if SA6_3 and not SA6_3:IsAlive() then - self:E( { GroupActivated = SA6_3:GetName() } ) - local Template = SA6_3:GetTemplate() - Template.lateActivation = false - Template.Visible = false - SA6_3:Respawn(Template) - --SA6_3:SetAIOn() - end - end - - if self:IsAllCargoTransported() then - self:Success() - CCCP_M4_SA6:Complete() - end - end - -end - -MissileTrainer = MISSILETRAINER:New( 100, "Helps with missile tracking" ) - - - +--- Gori Valley designed with the MOOSE framework for DCS World. +-- Author: FlightControl + +-- Define the headquarters. + +NATO_HQ = COMMANDCENTER:New( GROUP:FindByName( "HQ NATO Gori" ), "Gori" ) +CCCP_HQ = COMMANDCENTER:New( GROUP:FindByName( "HQ CCCP Tskinvali" ), "Tskinvali" ) + + +-- Define the scoring object. + +Score = SCORING:New( "Gori Valley" ) + +Score:SetScaleDestroyScore( 40 ) +Score:SetScaleDestroyPenalty( 80 ) +Score:SetFratricide( 80 ) +Score:SetMessagesHit( false ) + + +--- Cargo Dispatching + +do + + local SetCargoInfantry = SET_CARGO:New():FilterTypes( "Infantry" ):FilterStart() + local SetHelicopter = SET_GROUP:New():FilterPrefixes( "US CH-47D@RAMP Troop Deployment" ):FilterStart() + local SetDeployZones = SET_ZONE:New():FilterPrefixes( "US Troops Landing Zone" ):FilterStart() + + NATO_AI_Cargo_Dispatcher_Helicopter = AI_CARGO_DISPATCHER_HELICOPTER:New( SetHelicopter, SetCargoInfantry, SetDeployZones ) + NATO_AI_Cargo_Dispatcher_Helicopter:SetPickupRadius( 50, 25 ) + NATO_AI_Cargo_Dispatcher_Helicopter:SetDeployRadius( 1000, 500 ) + NATO_AI_Cargo_Dispatcher_Helicopter:Start() + +end + +-- CCCP COALITION UNITS + +-- Russian helicopters engaging the battle field in Gori Valley +Spawn_RU_KA50 = SPAWN + :New( "RU KA-50@HOT-Patriot Attack" ) + :InitLimit( 1, 24 ) + :InitRandomizeRoute( 1, 1, 8000 ) + :InitCleanUp( 180 ) + :SpawnScheduled( 1200, 0.2 ) + +-- Russian ground troops attacking Gori Valley +Spawn_RU_Troops = + { 'RU Attack Gori 1', + 'RU Attack Gori 2', + 'RU Attack Gori 3', + 'RU Attack Gori 4', + 'RU Attack Gori 5', + 'RU Attack Gori 6', + 'RU Attack Gori 7', + 'RU Attack Gori 8', + 'RU Attack Gori 9', + 'RU Attack Gori 10' + } + + +Spawn_RU_Troops_Left = SPAWN + :New( "RU Attack Gori Left" ) + :InitLimit( 15, 40 ) + :InitRandomizeTemplate( Spawn_RU_Troops ) + :InitRandomizeRoute( 1, 1, 2000 ) + --:InitArray( 349, 30, 20, 6 * 20 ) + :SpawnScheduled( 120, 1 ) + +Spawn_RU_Troops_Middle = SPAWN + :New( "RU Attack Gori Middle" ) + :InitLimit( 15, 40 ) + :InitRandomizeTemplate( Spawn_RU_Troops ) + :InitRandomizeRoute( 1, 1, 2000 ) + --:InitArray( 260, 50, 20, 6 * 20 ) + :SpawnScheduled( 120, 1 ) + +Spawn_RU_Troops_Right = SPAWN + :New( "RU Attack Gori Right" ) + :InitLimit( 15, 40 ) + :InitRandomizeTemplate( Spawn_RU_Troops ) + :InitRandomizeRoute( 1, 1, 2000 ) + --:InitArray( 238, 50, 20, 6 * 20 ) + :SpawnScheduled( 120, 1 ) + + +-- NATO Tank Platoons invading Tskinvali + +Spawn_US_Platoon = + { 'US Tank Platoon 1', + 'US Tank Platoon 2', + 'US Tank Platoon 3', + 'US Tank Platoon 4', + 'US Tank Platoon 5', + 'US Tank Platoon 6', + 'US Tank Platoon 7', + 'US Tank Platoon 8', + 'US Tank Platoon 9', + 'US Tank Platoon 10', + 'US Tank Platoon 11', + 'US Tank Platoon 12', + 'US Tank Platoon 13' + } + +Spawn_US_Platoon_Left = SPAWN + :New( 'US Tank Platoon Left' ) + :InitLimit( 15, 40 ) + :InitRandomizeTemplate( Spawn_US_Platoon ) + :InitRandomizeRoute( 3, 1, 2000 ) + --:InitArray( 76, 20, 15, 15*6 ) + :SpawnScheduled( 120, 1 ) + +Spawn_US_Platoon_Middle = SPAWN + :New( 'US Tank Platoon Middle' ) + :InitLimit( 15, 40 ) + :InitRandomizeTemplate( Spawn_US_Platoon ) + :InitRandomizeRoute( 3, 1, 2000 ) + --:InitArray( 160, 20, 15, 15*6 ) + :SpawnScheduled( 120, 1 ) + +Spawn_US_Platoon_Right = SPAWN + :New( 'US Tank Platoon Right' ) + :InitLimit( 15, 40 ) + :InitRandomizeTemplate( Spawn_US_Platoon ) + :InitRandomizeRoute( 1, 1, 2000 ) + --:InitArray( 90, 20, 15, 15*6 ) + :SpawnScheduled( 120, 1 ) + + + +do -- NATO Air Patrol Support Mission + + + local NATO_S1 = MISSION + :New( NATO_HQ, "Intercept Intruders","Support","Intercept any intruders invading airspace from the North!", coalition.side.BLUE ) + :AddScoring( Score ) + + -- Define the Recce groups that will detect the upcoming ground forces. + local NATO_S1_EWR = SET_GROUP:New():FilterCoalitions("blue"):FilterPrefixes( "AI NATO EWR A2A" ):FilterStart() + + -- Define the detection method, we'll use here AREA detection. + local NATO_S1_EWR_Areas = DETECTION_AREAS:New( NATO_S1_EWR, 20000 ) + NATO_S1_EWR_Areas:SetFriendliesRange( 80000 ) + NATO_S1_EWR_Areas:SetRefreshTimeInterval( 30 ) + NATO_S1_EWR_Areas:SetAcceptRange( 250000 ) -- Only report targets within 250km. + + local NATO_S1_Task = SET_GROUP:New():FilterCoalitions( "blue" ):FilterPrefixes( "S1 NATO Air Patrol" ):FilterStart() + + -- Define the Task dispatcher that will define the tasks based on the detected targets. + NATO_S1_A2A = TASK_A2A_DISPATCHER:New( NATO_S1, NATO_S1_Task, NATO_S1_EWR_Areas ) + + + local NATO_AI_A2A_Support_East = { + "AI NATO Air Support East F-16A A", + "AI NATO Air Support East F-16A B", + } + + local NATO_AI_A2A_Support_West = { + "AI NATO Air Support West F-16A A", + "AI NATO Air Support West F-16A B", + } + + NATO_AI_A2A_Dispatcher = AI_A2A_DISPATCHER:New( NATO_S1_EWR_Areas ) + + NATO_AI_A2A_Dispatcher:SetTacticalDisplay( false ) + + NATO_AI_A2A_Dispatcher:SetEngageRadius( 80000 ) + NATO_AI_A2A_Dispatcher:SetGciRadius( 140000 ) + + NATO_AI_A2A_Dispatcher:SetSquadron( "Kutaisi", AIRBASE.Caucasus.Kutaisi, NATO_AI_A2A_Support_West, 20 ) + NATO_AI_A2A_Dispatcher:SetSquadronCap( "Kutaisi", ZONE_POLYGON:New( "NATO CAP EAST", GROUP:FindByName( "NATO CAP EAST") ), 4000, 8000, 450, 600, 800, 1200, "BARO" ) + NATO_AI_A2A_Dispatcher:SetSquadronCapInterval( "Kutaisi", 2, 180, 300 ) + + NATO_AI_A2A_Dispatcher:SetSquadronGci( "Kutaisi", 800, 1200 ) + + NATO_AI_A2A_Dispatcher:SetSquadron( "Vaziani", AIRBASE.Caucasus.Vaziani, NATO_AI_A2A_Support_East, 20 ) + NATO_AI_A2A_Dispatcher:SetSquadronCap( "Vaziani", ZONE_POLYGON:New( "NATO CAP WEST", GROUP:FindByName( "NATO CAP WEST" ) ), 4000, 8000, 500, 700, 800, 1200, "BARO" ) + NATO_AI_A2A_Dispatcher:SetSquadronCapInterval( "Vaziani", 2, 180, 300 ) + + NATO_AI_A2A_Dispatcher:SetSquadronGci( "Vaziani", 800, 1200 ) + +end + + +do -- NATO Mission 1 + + + local NATO_M1 = MISSION + :New( NATO_HQ, "Destroy SAM-6","Primary","Destroy SAM-6 batteries", coalition.side.BLUE ) + :AddScoring( Score ) + + + -- Define the Recce groups that will detect the upcoming ground forces. + local NATO_M1_RecceSet = SET_GROUP:New():FilterCoalitions("blue"):FilterPrefixes( "M1 NATO Recce" ):FilterStart() + + NATO_M1_Spawn_Reaper = SPAWN + :New( "M1 NATO Recce Reaper" ) + :InitLimit( 1, 5 ) + :SpawnScheduled( 300, 0 ) + + + NATO_M1_ReccePatrolArray = {} + NATO_M1_RecceSpawn_US = SPAWN + :New( "M1 NATO Recce AH-64" ) + :InitLimit( 2, 10 ) + :SpawnScheduled( 60, 0.4 ) + :InitCleanUp( 300 ) + :OnSpawnGroup( + function( SpawnGroup ) + NATO_M1_RecceSpawn_US:E( SpawnGroup.ControllableName ) + local M1_ReccePatrolZoneWP = GROUP:FindByName( "M1 US Patrol Zone@ZONE" ) + local M1_ReccePatrolZone = ZONE_POLYGON:New( "PatrolZone", M1_ReccePatrolZoneWP ) + local M1_ReccePatrol = AI_PATROL_ZONE:New( M1_ReccePatrolZone, 30, 50, 50, 100 ) + NATO_M1_ReccePatrolArray[#NATO_M1_ReccePatrolArray+1] = M1_ReccePatrol + + M1_ReccePatrol:SetControllable( SpawnGroup ) + M1_ReccePatrol:__Start( 30 ) -- It takes a bit of time for the Recce to start + end + ) + + + -- Define the detection method, we'll use here AREA detection. + local NATO_M1_DetectionAreas = DETECTION_AREAS:New( NATO_M1_RecceSet, 1000 ) + --M1_DetectionAreas:BoundDetectedZones() + + local NATO_M1_Attack = SET_GROUP:New():FilterCoalitions( "blue" ):FilterPrefixes( "M1 NATO Attack" ):FilterStart() + + -- Define the Task dispatcher that will define the tasks based on the detected targets. + NATO_M1_Task_A2G_Dispatcher = TASK_A2G_DISPATCHER:New( NATO_M1, NATO_M1_Attack, NATO_M1_DetectionAreas ) + + NATO_M1_Designate = DESIGNATE:New( NATO_HQ, NATO_M1_DetectionAreas, NATO_M1_Attack, NATO_M1 ) + + +end + + +do -- NATO Transport Task Engineers + + local NATO_M4_Patriots = MISSION + :New( NATO_HQ, + "Engineers Patriots", + "Operational", + "Transport 3 engineering teams to three strategical Patriot launch sites. " .. + "The launch sites are not yet complete and need some special launch codes to be delivered. " .. + "The engineers have the knowledge to install these launch codes. ", + coalition.side.BLUE ) + + local NATO_M4_HeloSetGroup = SET_GROUP:New():FilterPrefixes( "M4 NATO Patriot Transport" ):FilterStart() + + local NATO_M4_SetCargo = SET_CARGO:New():FilterTypes( { "Patriot Engineers" } ):FilterStart() + + local EngineersCargo1 = CARGO_GROUP:New( GROUP:FindByName( "M4 NATO Engineers Bear" ), "Patriot Engineers", "Team Bear", 500 ):RespawnOnDestroyed(true) + local EngineersCargo2 = CARGO_GROUP:New( GROUP:FindByName( "M4 NATO Engineers Moose" ), "Patriot Engineers", "Team Moose", 500 ):RespawnOnDestroyed(true) + local EngineersCargo3 = CARGO_GROUP:New( GROUP:FindByName( "M4 NATO Engineers Falcon" ), "Patriot Engineers", "Team Falcon", 500 ):RespawnOnDestroyed(true) + + + -- These are the groups of the SA-6 batteries. + local Patriots1 = GROUP:FindByName( "M4 NATO Patriot North" ):SetAIOff() + local Patriots2 = GROUP:FindByName( "M4 NATO Patriot West" ):SetAIOff() + local Patriots3 = GROUP:FindByName( "M4 NATO Patriot East" ):SetAIOff() + + -- Each SA-6 battery has a zone of type ZONE_GROUP. That makes these zone moveable as they drive around the battle field! + local Zone_Patriots1 = ZONE_GROUP:New( "Patriots North", Patriots1, 600 ) + local Zone_Patriots2 = ZONE_GROUP:New( "Patriots West", Patriots2, 600 ) + local Zone_Patriots3 = ZONE_GROUP:New( "Patriots East", Patriots3, 600 ) + + NATO_M4_Cargo_Transport_Dispatcher = TASK_CARGO_DISPATCHER:New( NATO_M4_Patriots, NATO_M4_HeloSetGroup ) + + local NATO_M4_Cargo_Transport_TaskName = NATO_M4_Cargo_Transport_Dispatcher:AddTransportTask( + "Activate Patriot Batteries", + NATO_M4_SetCargo, + "Pickup Engineers Alpha, Beta and Gamma from their current location, and drop them near the Patriot launchers. " .. + "Deployment zones have been defined at each Patriot location." + ) + + NATO_M4_Cargo_Transport_Dispatcher:SetTransportDeployZones( NATO_M4_Cargo_Transport_TaskName, { Zone_Patriots1, Zone_Patriots2, Zone_Patriots3 } ) + + local NATO_M4_Cargo_Transport_Task = NATO_M4_Cargo_Transport_Dispatcher:GetTransportTask( NATO_M4_Cargo_Transport_TaskName ) + + + --- OnAfter Transition Handler for Event CargoDeployed. + -- This event will handle after deployment the activation of the SA-6 site. + -- @function [parent=#TASK_CARGO_TRANSPORT] OnAfterCargoDeployed + -- @param Tasking.Task_CARGO#TASK_CARGO_TRANSPORT self + -- @param #string From The From State string. + -- @param #string Event The Event string. + -- @param #string To The To State string. + -- @param Wrapper.Unit#UNIT TaskUnit The Unit (Client) that Deployed the cargo. You can use this to retrieve the PlayerName etc. + -- @param Core.Cargo#CARGO Cargo The Cargo that got PickedUp by the TaskUnit. You can use this to check Cargo Status. + -- @param Core.Zone#ZONE DeployZone The zone where the Cargo got Deployed or UnBoarded. + function NATO_M4_Cargo_Transport_Task:OnAfterCargoDeployed( From, Event, To, TaskUnit, Cargo, DeployZone ) + self:E( { From, Event, To, TaskUnit, Cargo, DeployZone } ) + + local DeployZoneName = DeployZone:GetName() + local CargoName = Cargo:GetName() + + + NATO_HQ:MessageToCoalition( + string.format( "Engineers %s are successfully transported to patriot site %s.", + CargoName, + DeployZoneName + ) + ) + + if DeployZoneName == Zone_Patriots1:GetName() then + if Patriots1 and not Patriots1:IsAlive() then + local Template = Patriots1:GetTemplate() + Template.lateActivation = false + Template.Visible = false + Patriots1:Respawn(Template) + --Patriots1:SetAIOn() + end + end + + if DeployZoneName == Zone_Patriots2:GetName() then + if Patriots2 and not Patriots2:IsAlive() then + local Template = Patriots2:GetTemplate() + Template.lateActivation = false + Template.Visible = false + Patriots2:Respawn(Template) + --Patriots2:SetAIOn() + end + end + + if DeployZoneName == Zone_Patriots3:GetName() then + if Patriots3 and not Patriots3:IsAlive() then + local Template = Patriots3:GetTemplate() + Template.lateActivation = false + Template.Visible = false + Patriots3:Respawn(Template) + --Patriots3:SetAIOn() + end + end + + if self:IsAllCargoTransported() then + self:Success() + NATO_M4_Patriots:Complete() + end + end + +end + + + + + + +do -- CCCP Air Patrol Support Functions + + + local CCCP_S1 = MISSION + :New( CCCP_HQ, "Provide Air Support","Support","Intercept any bogeys invading airspace from the South or East!", coalition.side.RED ) + :AddScoring( Score ) + + -- Define the Recce groups that will detect the upcoming A2A intruders. + local CCCP_S1_EWR_Groups = SET_GROUP:New():FilterCoalitions("red"):FilterPrefixes( "AI CCCP EWR" ):FilterStart() + + -- Define the detection method, we'll use here AREA detection. + local CCCP_S1_EWR_Areas = DETECTION_AREAS:New( CCCP_S1_EWR_Groups, 30000 ) + CCCP_S1_EWR_Areas:SetFriendliesRange( 80000 ) + CCCP_S1_EWR_Areas:SetAcceptRange( 250000 ) -- Only report targets that are within 250km from detection. + --M1_DetectionAreas_US:BoundDetectedZones() + + local CCCP_S1_SupportGroups = SET_GROUP:New():FilterCoalitions("red"):FilterPrefixes( "S1 CCCP Air Defense" ):FilterStart() + + -- Define the Task dispatcher that will define the tasks based on the detected targets. + CCCP_S1_A2A_Task_Dispatcher = TASK_A2A_DISPATCHER:New( CCCP_S1, CCCP_S1_SupportGroups, CCCP_S1_EWR_Areas ) + + + CCCP_AI_A2A_Support_SU_27 = { + "AI CCCP Air Support SU-27 A", + "AI CCCP Air Support SU-27 B", + "AI CCCP Air Support SU-27 C", + "AI CCCP Air Support SU-27 D" + } + + CCCP_AI_A2A_Support_MIG_29S = { + "AI CCCP Air Support MIG-29S A", + "AI CCCP Air Support MIG-29S B", + "AI CCCP Air Support MIG-29S C", + "AI CCCP Air Support MIG-29S D" + } + + + CCCP_AI_A2A_Dispatcher = AI_A2A_DISPATCHER:New( CCCP_S1_EWR_Areas ) + + CCCP_AI_A2A_Dispatcher:SetTacticalDisplay( false ) + + CCCP_AI_A2A_Dispatcher:SetEngageRadius( 80000 ) + CCCP_AI_A2A_Dispatcher:SetGciRadius( 100000 ) + + -- Beslan + CCCP_AI_A2A_Dispatcher:SetSquadron( "Beslan", AIRBASE.Caucasus.Beslan, CCCP_AI_A2A_Support_SU_27, 20 ) + CCCP_AI_A2A_Dispatcher:SetSquadronCap( "Beslan", ZONE_POLYGON:New( "CCCP CAP EAST", GROUP:FindByName( "CCCP CAP EAST") ), 4000, 8000, 450, 600, 800, 1200, "BARO" ) + CCCP_AI_A2A_Dispatcher:SetSquadronCapInterval( "Beslan", 2, 180, 300 ) + CCCP_AI_A2A_Dispatcher:SetSquadronTakeoffInAir( "Beslan" ) + + -- Mozdok + CCCP_AI_A2A_Dispatcher:SetSquadron( "Mozdok", AIRBASE.Caucasus.Mozdok, CCCP_AI_A2A_Support_SU_27, 20 ) + CCCP_AI_A2A_Dispatcher:SetSquadronGci( "Mozdok", 800, 1200 ) + + CCCP_AI_A2A_Dispatcher:SetSquadron( "Nalchik", AIRBASE.Caucasus.Nalchik, CCCP_AI_A2A_Support_MIG_29S, 20 ) + CCCP_AI_A2A_Dispatcher:SetSquadronCap( "Nalchik", ZONE_POLYGON:New( "CCCP CAP WEST", GROUP:FindByName( "CCCP CAP WEST" ) ), 4000, 8000, 500, 700, 800, 1200, "BARO" ) + CCCP_AI_A2A_Dispatcher:SetSquadronCapInterval( "Nalchik", 2, 180, 300 ) + CCCP_AI_A2A_Dispatcher:SetSquadronGci( "Nalchik", 800, 1200 ) + +end + +do -- CCCP Destroy Patriots + + local CCCP_M1 = MISSION + :New( CCCP_HQ, + "Destroy Patriots", + "Primary", + "Destroy Patriot batteries.", + coalition.side.RED + ) + :AddScoring( Score ) + + -- Define the Recce groups that will detect the upcoming ground forces. + local CCCP_M1_RecceSet = SET_GROUP:New():FilterCoalitions( "red" ):FilterPrefixes( "M1 CCCP Recce" ):FilterStart() + + CCCP_M1_Spawn_SU25MR = SPAWN + :New( "M1 CCCP Recce SU-25MR" ) + :InitLimit( 1, 5 ) + :SpawnScheduled( 300, 0.5 ) + + + CCCP_M1_ReccePatrolArray = {} + CCCP_M1_RecceSpawn = SPAWN + :New( "M1 CCCP Recce MI-28N" ) + :InitLimit( 2, 10 ) + :SpawnScheduled( 60, 0.4 ) + :OnSpawnGroup( + function( SpawnGroup ) + local M1_ReccePatrolZoneWP = GROUP:FindByName( "M1 RU Patrol Zone@ZONE" ) + local M1_ReccePatrolZone = ZONE_POLYGON:New( "PatrolZone", M1_ReccePatrolZoneWP ) + local M1_ReccePatrol = AI_PATROL_ZONE:New( M1_ReccePatrolZone, 30, 50, 50, 100 ) + CCCP_M1_ReccePatrolArray[#CCCP_M1_ReccePatrolArray+1] = M1_ReccePatrol + + M1_ReccePatrol:SetControllable( SpawnGroup ) + M1_ReccePatrol:__Start( 20 ) -- It takes a bit of time for the Recce to start + end + ) + + + -- Define the detection method, we'll use here AREA detection. + local CCCP_M1_DetectionAreas = DETECTION_AREAS:New( CCCP_M1_RecceSet, 1000 ) + --M1_DetectionAreas_US:BoundDetectedZones() + + local CCCP_M1_Attack = SET_GROUP:New():FilterCoalitions( "red" ):FilterPrefixes( "M1 CCCP Attack" ):FilterStart() + CCCP_M1_Attack:Flush() + + -- Define the Task dispatcher that will define the tasks based on the detected targets. + CCCP_M1_Task_A2G_Dispatcher = TASK_A2G_DISPATCHER:New( CCCP_M1, CCCP_M1_Attack, CCCP_M1_DetectionAreas ) + +end + +do -- CCCP Transport Task Engineers + + local CCCP_M4_SA6 = MISSION + :New( CCCP_HQ, + "Engineers SA-6", + "Operational", + "Transport 3 engineering teams to three strategical SA-6 launch sites. " .. + "The launch sites are not yet complete and need some special launch codes to be delivered. " .. + "The engineers have the knowledge to install these launch codes. ", + coalition.side.RED ) + :AddScoring( Score ) + + local CCCP_M4_HeloSetGroup = SET_GROUP:New():FilterPrefixes( "M4 CCCP SA6 Transport" ):FilterStart() + + local CCCP_M4_SA6_SetCargo = SET_CARGO:New():FilterTypes( { "SA6 Engineers" } ):FilterStart() + + local EngineersCargoAlpha = CARGO_GROUP:New( GROUP:FindByName( "M4 CCCP Engineers Alpha" ), "SA6 Engineers", "Team Alpha", 500 ) + local EngineersCargoBeta = CARGO_GROUP:New( GROUP:FindByName( "M4 CCCP Engineers Beta" ), "SA6 Engineers", "Team Beta", 500 ) + local EngineersCargoGamma = CARGO_GROUP:New( GROUP:FindByName( "M4 CCCP Engineers Gamma" ), "SA6 Engineers", "Team Gamma", 500 ) + + CCCP_M4_Cargo_Transport_Dispatcher = TASK_CARGO_DISPATCHER:New( CCCP_M4_SA6, CCCP_M4_HeloSetGroup ) + + local CCCP_M4_Cargo_Transport_TaskName = CCCP_M4_Cargo_Transport_Dispatcher:AddTransportTask( + "Transport SA-6 Engineers", + CCCP_M4_SA6_SetCargo, + "Pickup Engineers Alpha, Beta and Gamma from their current location, and drop them near the SA-6 launchers. " .. + "Deployment zones have been defined at each SA-6 location." + ) + + -- These are the groups of the SA-6 batteries. + local SA6_1 = GROUP:FindByName( "M4 CCCP SA6 Kub Moskva" ):SetAIOff() + local SA6_2 = GROUP:FindByName( "M4 CCCP SA6 Kub Niznij" ):SetAIOff() + local SA6_3 = GROUP:FindByName( "M4 CCCP SA6 Kub Yaroslavl" ):SetAIOff() + + -- Each SA-6 battery has a zone of type ZONE_GROUP. That makes these zone moveable as they drive around the battle field! + local Zone_SA6_1 = ZONE_GROUP:New( "SA6 Moskva", SA6_1, 500 ) + local Zone_SA6_2 = ZONE_GROUP:New( "SA6 Niznij", SA6_2, 500 ) + local Zone_SA6_3 = ZONE_GROUP:New( "SA6 Yaroslavl", SA6_3, 500 ) + + CCCP_M4_Cargo_Transport_Dispatcher:SetTransportDeployZones( CCCP_M4_Cargo_Transport_TaskName, { Zone_SA6_1, Zone_SA6_2, Zone_SA6_3 } ) + local CCCP_M4_Cargo_Transport_Task = CCCP_M4_Cargo_Transport_Dispatcher:GetTransportTask( CCCP_M4_Cargo_Transport_TaskName ) + + --- OnAfter Transition Handler for Event CargoDeployed. + -- This event will handle after deployment the activation of the SA-6 site. + -- @function [parent=#TASK_CARGO_TRANSPORT] OnAfterCargoDeployed + -- @param Tasking.Task_CARGO#TASK_CARGO_TRANSPORT self + -- @param #string From The From State string. + -- @param #string Event The Event string. + -- @param #string To The To State string. + -- @param Wrapper.Unit#UNIT TaskUnit The Unit (Client) that Deployed the cargo. You can use this to retrieve the PlayerName etc. + -- @param Core.Cargo#CARGO Cargo The Cargo that got PickedUp by the TaskUnit. You can use this to check Cargo Status. + -- @param Core.Zone#ZONE DeployZone The zone where the Cargo got Deployed or UnBoarded. + function CCCP_M4_Cargo_Transport_Task:OnAfterCargoDeployed( From, Event, To, TaskUnit, Cargo, DeployZone ) + + self:E( { From, Event, To, TaskUnit:GetName(), Cargo:GetName(), DeployZone:GetName() } ) + + local DeployZoneName = DeployZone:GetName() + local CargoName = Cargo:GetName() + + + CCCP_HQ:MessageToCoalition( + string.format( "Engineers %s are successfully transported to SA-6 site %s.", + CargoName, + DeployZoneName + ) + ) + + if DeployZoneName == Zone_SA6_1:GetName() then + if SA6_1 and not SA6_1:IsAlive() then + self:E( { GroupActivated = SA6_1:GetName() } ) + local Template = SA6_1:GetTemplate() + Template.lateActivation = false + Template.Visible = false + SA6_1:Respawn(Template) + --SA6_1:SetAIOn() + end + end + + if DeployZoneName == Zone_SA6_2:GetName() then + if SA6_2 and not SA6_2:IsAlive() then + self:E( { GroupActivated = SA6_2:GetName() } ) + local Template = SA6_2:GetTemplate() + Template.lateActivation = false + Template.Visible = false + SA6_2:Respawn(Template) + --SA6_2:SetAIOn() + end + end + + if DeployZoneName == Zone_SA6_3:GetName() then + if SA6_3 and not SA6_3:IsAlive() then + self:E( { GroupActivated = SA6_3:GetName() } ) + local Template = SA6_3:GetTemplate() + Template.lateActivation = false + Template.Visible = false + SA6_3:Respawn(Template) + --SA6_3:SetAIOn() + end + end + + if self:IsAllCargoTransported() then + self:Success() + CCCP_M4_SA6:Complete() + end + end + +end + +MissileTrainer = MISSILETRAINER:New( 100, "Helps with missile tracking" ) + + + diff --git a/DEM - Demo Missions/GOV - Gori Valley/GOV - Gori Valley.miz b/DEM - Demo Missions/GOV - Gori Valley/GOV - Gori Valley.miz index db8c725f51..6d985ed0f5 100644 Binary files a/DEM - Demo Missions/GOV - Gori Valley/GOV - Gori Valley.miz and b/DEM - Demo Missions/GOV - Gori Valley/GOV - Gori Valley.miz differ diff --git a/DEM - Demo Missions/MED - Medical Transport/MED - Medical Transport.miz b/DEM - Demo Missions/MED - Medical Transport/MED - Medical Transport.miz index c0f1ac1bfc..5eae68904c 100644 Binary files a/DEM - Demo Missions/MED - Medical Transport/MED - Medical Transport.miz and b/DEM - Demo Missions/MED - Medical Transport/MED - Medical Transport.miz differ diff --git a/DES - Designation/DES-010 - Designation of AREAS - Threat Level Prioritization/DES-010 - Designation of AREAS - Threat Level Prioritization.lua b/DES - Designation/DES-010 - Designation of AREAS - Threat Level Prioritization/DES-010 - Designation of AREAS - Threat Level Prioritization.lua index 8905e43c35..6b0c4d52a6 100644 --- a/DES - Designation/DES-010 - Designation of AREAS - Threat Level Prioritization/DES-010 - Designation of AREAS - Threat Level Prioritization.lua +++ b/DES - Designation/DES-010 - Designation of AREAS - Threat Level Prioritization/DES-010 - Designation of AREAS - Threat Level Prioritization.lua @@ -1,43 +1,43 @@ ---- --- Name: DES-010 - Designation of AREAS - Threat Level Prioritization --- Author: FlightControl --- Date Created: 24 Apr 2017 --- --- # Situation: --- --- Demonstrates the designation of units, which are grouped in AREAs. --- --- A Set of Recce are detecting a large group of units. --- This test is about the prioritization. First the SAMs should be designated, then the rest. --- --- # Test cases: --- --- - Check if the SAMs are designated first. - - -RecceSetGroup = SET_GROUP:New():FilterPrefixes( "Recce" ):FilterStart() - -HQ = GROUP:FindByName( "HQ" ) - -CC = COMMANDCENTER:New( HQ, "HQ" ) - --- Let the RecceSetGroup vehicles in the collection detect targets and group them in AREAS of 1000 meters. -RecceDetection = DETECTION_AREAS:New( RecceSetGroup, 1000 ) - --- Create a Attack Set, which contains the human player client slots and CA vehicles. -AttackSet = SET_GROUP:New():FilterPrefixes("Attack"):FilterStart() - -RecceDesignation = DESIGNATE:New( CC, RecceDetection, AttackSet ) - --- This sets the threat level prioritization on -RecceDesignation:SetThreatLevelPrioritization( true ) - --- Set the possible laser codes. -RecceDesignation:GenerateLaserCodes() - -RecceDesignation:AddMenuLaserCode( 1113, "Lase with %d for Su-25T" ) -RecceDesignation:AddMenuLaserCode( 1680, "Lase with %d for A-10A" ) - --- Start the detection process in 5 seconds. -RecceDesignation:__Detect( -5 ) - +--- +-- Name: DES-010 - Designation of AREAS - Threat Level Prioritization +-- Author: FlightControl +-- Date Created: 24 Apr 2017 +-- +-- # Situation: +-- +-- Demonstrates the designation of units, which are grouped in AREAs. +-- +-- A Set of Recce are detecting a large group of units. +-- This test is about the prioritization. First the SAMs should be designated, then the rest. +-- +-- # Test cases: +-- +-- - Check if the SAMs are designated first. + + +RecceSetGroup = SET_GROUP:New():FilterPrefixes( "Recce" ):FilterStart() + +HQ = GROUP:FindByName( "HQ" ) + +CC = COMMANDCENTER:New( HQ, "HQ" ) + +-- Let the RecceSetGroup vehicles in the collection detect targets and group them in AREAS of 1000 meters. +RecceDetection = DETECTION_AREAS:New( RecceSetGroup, 1000 ) + +-- Create a Attack Set, which contains the human player client slots and CA vehicles. +AttackSet = SET_GROUP:New():FilterPrefixes("Attack"):FilterStart() + +RecceDesignation = DESIGNATE:New( CC, RecceDetection, AttackSet ) + +-- This sets the threat level prioritization on +RecceDesignation:SetThreatLevelPrioritization( true ) + +-- Set the possible laser codes. +RecceDesignation:GenerateLaserCodes() + +RecceDesignation:AddMenuLaserCode( 1113, "Lase with %d for Su-25T" ) +RecceDesignation:AddMenuLaserCode( 1680, "Lase with %d for A-10A" ) + +-- Start the detection process in 5 seconds. +RecceDesignation:__Detect( -5 ) + diff --git a/DES - Designation/DES-010 - Designation of AREAS - Threat Level Prioritization/DES-010 - Designation of AREAS - Threat Level Prioritization.miz b/DES - Designation/DES-010 - Designation of AREAS - Threat Level Prioritization/DES-010 - Designation of AREAS - Threat Level Prioritization.miz index 4a34b23aaf..b51510ea02 100644 Binary files a/DES - Designation/DES-010 - Designation of AREAS - Threat Level Prioritization/DES-010 - Designation of AREAS - Threat Level Prioritization.miz and b/DES - Designation/DES-010 - Designation of AREAS - Threat Level Prioritization/DES-010 - Designation of AREAS - Threat Level Prioritization.miz differ diff --git a/DES - Designation/DES-011 - Designation of AREAS - Empty Set with Threat Levels/DES-011 - Designation of AREAS - Empty Set with Threat Levels.lua b/DES - Designation/DES-011 - Designation of AREAS - Empty Set with Threat Levels/DES-011 - Designation of AREAS - Empty Set with Threat Levels.lua index 81c46290c2..d25850745d 100644 --- a/DES - Designation/DES-011 - Designation of AREAS - Empty Set with Threat Levels/DES-011 - Designation of AREAS - Empty Set with Threat Levels.lua +++ b/DES - Designation/DES-011 - Designation of AREAS - Empty Set with Threat Levels/DES-011 - Designation of AREAS - Empty Set with Threat Levels.lua @@ -1,40 +1,40 @@ ---- --- Name: DES-011 - Designation of AREAS - Empty Set with Threat Levels --- Author: FlightControl --- Date Created: 15 May 2017 --- --- # Situation: --- --- Demonstrates the designation of units, which are grouped in AREAs. --- --- A Set of Recce are detecting a large group of units. --- This test is about not failing the process when the Detected Set is empty, and the LaseOn is activated ... --- --- # Test cases: --- --- - Check nothing is detected, and put lase on. - - -RecceSetGroup = SET_GROUP:New():FilterPrefixes( "Recce" ):FilterStart() - -HQ = GROUP:FindByName( "HQ" ) - -CC = COMMANDCENTER:New( HQ, "HQ" ) - --- Let the RecceSetGroup vehicles in the collection detect targets and group them in AREAS of 1000 meters. -RecceDetection = DETECTION_AREAS:New( RecceSetGroup, 1000 ) - --- Create a Attack Set, which contains the human player client slots and CA vehicles. -AttackSet = SET_GROUP:New():FilterPrefixes("Attack"):FilterStart() - -RecceDesignation = DESIGNATE:New( CC, RecceDetection, AttackSet ) - --- This sets the threat level prioritization on -RecceDesignation:SetThreatLevelPrioritization( true ) - --- Set the possible laser codes. -RecceDesignation:SetLaserCodes({1113,1131,1256}) - --- Start the detection process in 5 seconds. -RecceDesignation:__Detect( -5 ) - +--- +-- Name: DES-011 - Designation of AREAS - Empty Set with Threat Levels +-- Author: FlightControl +-- Date Created: 15 May 2017 +-- +-- # Situation: +-- +-- Demonstrates the designation of units, which are grouped in AREAs. +-- +-- A Set of Recce are detecting a large group of units. +-- This test is about not failing the process when the Detected Set is empty, and the LaseOn is activated ... +-- +-- # Test cases: +-- +-- - Check nothing is detected, and put lase on. + + +RecceSetGroup = SET_GROUP:New():FilterPrefixes( "Recce" ):FilterStart() + +HQ = GROUP:FindByName( "HQ" ) + +CC = COMMANDCENTER:New( HQ, "HQ" ) + +-- Let the RecceSetGroup vehicles in the collection detect targets and group them in AREAS of 1000 meters. +RecceDetection = DETECTION_AREAS:New( RecceSetGroup, 1000 ) + +-- Create a Attack Set, which contains the human player client slots and CA vehicles. +AttackSet = SET_GROUP:New():FilterPrefixes("Attack"):FilterStart() + +RecceDesignation = DESIGNATE:New( CC, RecceDetection, AttackSet ) + +-- This sets the threat level prioritization on +RecceDesignation:SetThreatLevelPrioritization( true ) + +-- Set the possible laser codes. +RecceDesignation:SetLaserCodes({1113,1131,1256}) + +-- Start the detection process in 5 seconds. +RecceDesignation:__Detect( -5 ) + diff --git a/DES - Designation/DES-011 - Designation of AREAS - Empty Set with Threat Levels/DES-011 - Designation of AREAS - Empty Set with Threat Levels.miz b/DES - Designation/DES-011 - Designation of AREAS - Empty Set with Threat Levels/DES-011 - Designation of AREAS - Empty Set with Threat Levels.miz index bfdc3081d5..f5af7d3e38 100644 Binary files a/DES - Designation/DES-011 - Designation of AREAS - Empty Set with Threat Levels/DES-011 - Designation of AREAS - Empty Set with Threat Levels.miz and b/DES - Designation/DES-011 - Designation of AREAS - Empty Set with Threat Levels/DES-011 - Designation of AREAS - Empty Set with Threat Levels.miz differ diff --git a/DES - Designation/DES-020 - Designation of AREAS - Status Menu Flash Activate/DES-010 - Designation of AREAS - Threat Level Prioritization.lua b/DES - Designation/DES-020 - Designation of AREAS - Status Menu Flash Activate/DES-010 - Designation of AREAS - Threat Level Prioritization.lua new file mode 100644 index 0000000000..672f452a8e --- /dev/null +++ b/DES - Designation/DES-020 - Designation of AREAS - Status Menu Flash Activate/DES-010 - Designation of AREAS - Threat Level Prioritization.lua @@ -0,0 +1,40 @@ +--- +-- Name: DES-010 - Designation of AREAS - Threat Level Prioritization +-- Author: FlightControl +-- Date Created: 24 Apr 2017 +-- +-- # Situation: +-- +-- Demonstrates the designation of units, which are grouped in AREAs. +-- +-- A Set of Recce are detecting a large group of units. +-- This test is about the prioritization. First the SAMs should be designated, then the rest. +-- +-- # Test cases: +-- +-- - Check if the SAMs are designated first. + + +RecceSetGroup = SET_GROUP:New():FilterPrefixes( "Recce" ):FilterStart() + +HQ = GROUP:FindByName( "HQ" ) + +CC = COMMANDCENTER:New( HQ, "HQ" ) + +-- Let the RecceSetGroup vehicles in the collection detect targets and group them in AREAS of 1000 meters. +RecceDetection = DETECTION_AREAS:New( RecceSetGroup, 1000 ) + +-- Create a Attack Set, which contains the human player client slots and CA vehicles. +AttackSet = SET_GROUP:New():FilterPrefixes("Attack"):FilterStart() + +RecceDesignation = DESIGNATE:New( CC, RecceDetection, AttackSet ) + +-- This sets the threat level prioritization on +RecceDesignation:SetThreatLevelPrioritization( true ) + +-- Set the possible laser codes. +RecceDesignation:SetLaserCodes({1113,1131,1256}) + +-- Start the detection process in 5 seconds. +RecceDesignation:__Detect( -5 ) + diff --git a/DES - Designation/DES-020 - Designation of AREAS - Status Menu Flash Activate/DES-020 - Designation of AREAS - Status Menu Flash Activate.lua b/DES - Designation/DES-020 - Designation of AREAS - Status Menu Flash Activate/DES-020 - Designation of AREAS - Status Menu Flash Activate.lua index 9777d1e676..4e270ee7cb 100644 --- a/DES - Designation/DES-020 - Designation of AREAS - Status Menu Flash Activate/DES-020 - Designation of AREAS - Status Menu Flash Activate.lua +++ b/DES - Designation/DES-020 - Designation of AREAS - Status Menu Flash Activate/DES-020 - Designation of AREAS - Status Menu Flash Activate.lua @@ -1,40 +1,40 @@ ---- --- Name: DES-020 - Designation of AREAS - Status Menu Flash Activate --- Author: FlightControl --- Date Created: 24 Apr 2017 --- --- # Situation: --- --- Demonstrates the designation of units, which are grouped in AREAs. --- --- A Set of Recce are detecting a large group of units. --- This test is about the prioritization. First the SAMs should be designated, then the rest. --- --- # Test cases: --- --- - Check if the SAMs are designated first. - - -RecceSetGroup = SET_GROUP:New():FilterPrefixes( "Recce" ):FilterStart() - -HQ = GROUP:FindByName( "HQ" ) - -CC = COMMANDCENTER:New( HQ, "HQ" ) - --- Let the RecceSetGroup vehicles in the collection detect targets and group them in AREAS of 1000 meters. -RecceDetection = DETECTION_AREAS:New( RecceSetGroup, 1000 ) - --- Create a Attack Set, which contains the human player client slots and CA vehicles. -AttackSet = SET_GROUP:New():FilterPrefixes("Attack"):FilterStart() - -RecceDesignation = DESIGNATE:New( CC, RecceDetection, AttackSet ) - --- This sets the current status menu flashing on -RecceDesignation:SetFlashStatusMenu( true ) - --- Set the possible laser codes. -RecceDesignation:SetLaserCodes({1113,1131,1256}) - --- Start the detection process in 5 seconds. -RecceDesignation:__Detect( -5 ) - +--- +-- Name: DES-020 - Designation of AREAS - Status Menu Flash Activate +-- Author: FlightControl +-- Date Created: 24 Apr 2017 +-- +-- # Situation: +-- +-- Demonstrates the designation of units, which are grouped in AREAs. +-- +-- A Set of Recce are detecting a large group of units. +-- This test is about the prioritization. First the SAMs should be designated, then the rest. +-- +-- # Test cases: +-- +-- - Check if the SAMs are designated first. + + +RecceSetGroup = SET_GROUP:New():FilterPrefixes( "Recce" ):FilterStart() + +HQ = GROUP:FindByName( "HQ" ) + +CC = COMMANDCENTER:New( HQ, "HQ" ) + +-- Let the RecceSetGroup vehicles in the collection detect targets and group them in AREAS of 1000 meters. +RecceDetection = DETECTION_AREAS:New( RecceSetGroup, 1000 ) + +-- Create a Attack Set, which contains the human player client slots and CA vehicles. +AttackSet = SET_GROUP:New():FilterPrefixes("Attack"):FilterStart() + +RecceDesignation = DESIGNATE:New( CC, RecceDetection, AttackSet ) + +-- This sets the current status menu flashing on +RecceDesignation:SetFlashStatusMenu( true ) + +-- Set the possible laser codes. +RecceDesignation:SetLaserCodes({1113,1131,1256}) + +-- Start the detection process in 5 seconds. +RecceDesignation:__Detect( -5 ) + diff --git a/DES - Designation/DES-020 - Designation of AREAS - Status Menu Flash Activate/DES-020 - Designation of AREAS - Status Menu Flash Activate.miz b/DES - Designation/DES-020 - Designation of AREAS - Status Menu Flash Activate/DES-020 - Designation of AREAS - Status Menu Flash Activate.miz index d532d95a9f..fc5549205b 100644 Binary files a/DES - Designation/DES-020 - Designation of AREAS - Status Menu Flash Activate/DES-020 - Designation of AREAS - Status Menu Flash Activate.miz and b/DES - Designation/DES-020 - Designation of AREAS - Status Menu Flash Activate/DES-020 - Designation of AREAS - Status Menu Flash Activate.miz differ diff --git a/DES - Designation/DES-100 - UNITS - Night Test/DES-100 - UNITS - Night Test.lua b/DES - Designation/DES-100 - UNITS - Night Test/DES-100 - UNITS - Night Test.lua index 6123068b22..fa691bc5c1 100644 --- a/DES - Designation/DES-100 - UNITS - Night Test/DES-100 - UNITS - Night Test.lua +++ b/DES - Designation/DES-100 - UNITS - Night Test/DES-100 - UNITS - Night Test.lua @@ -1,58 +1,58 @@ --- Name: DES-100 - UNITS - Night Test --- Author: FlightControl --- Date Created: 23 Apr 2017 --- --- Demonstrates the designation of units, which are grouped per detected UNIT. --- So each DetectedItem contains one detected unit only. --- A Set of Recce are detecting a large group of units. --- --- - Wait until all units are detected by the recce. A report should appear. --- - Once the report appears, the Designation Menu should be generated. In the communication menu, Press F10 and select F1. Designation. --- - Test if one DetectionItem (a designated group) is lased by selecting a Target group from the Designation menu. --- - If a target group is not lased, it should start with "Designate". --- - If a target group is lased, the menu should start with "Lasing". --- - If a target group is smoked, the menu should start with "Smoking". --- - If a target group is illuminated, the menu should start with "Illuminating". --- - Jump into a ground vehicle with the group name "Attack", and activate night vision (FLIR) (N key). --- - With FLIR activated in a ground vehicle, search for the laser beams. --- - Watch the laser beams alternate as targets are being detected or not detected... --- The Recce will try to lase as many targets as possible, --- but only for those targets to be lased, --- and until sufficient laser codes are available. --- - While the target group is lased, check if the available Recce are lasing the most possible targets. --- - Check if all laser codes are being used, but not twice. --- - Check if once a target has been destoyed, that after a while a Recce selects a new target. --- - Check that if all targets are destroyed, that the Recce reports that. --- - Check that while a Recce is lasing a target, that it is marking the target. --- - Check that when you deactive the lasing, that the Recce report the deactivation. --- - Check that when you illuminate a target group, that a message appears that the Recce is illuminating the target. --- - Check that when you illuminate a target group, that the target area gets illuminated after a while. - - -RecceSetGroup = SET_GROUP:New():FilterPrefixes( "Recce" ):FilterStart() - -HQ = GROUP:FindByName( "HQ" ) - -CC = COMMANDCENTER:New( HQ, "HQ" ) - --- Let the RecceSetGroup vehicles in the collection detect targets and group them in AREAS of 1000 meters. -RecceDetection = DETECTION_UNITS:New( RecceSetGroup ) - --- Create a -AttackSet = SET_GROUP:New():FilterPrefixes("Attack"):FilterStart() - --- Setup Designation for the AttackSet. -RecceDesignation = DESIGNATE:New( CC, RecceDetection, AttackSet ) - --- Generate the random laser codes. -RecceDesignation:GenerateLaserCodes() - --- The su-25T uses a specific laser code to guide its laser guides rockets. --- The code is 1113. A special menu option will be added that allows to lase with 1113. -RecceDesignation:AddMenuLaserCode( 1113, "Lase for SU-25T (%d)" ) - --- The A-10A etc use a specific laser code to guide its laser guides rockets. --- The code is 1680. A special menu option will be added that allows to lase with 1680. -RecceDesignation:AddMenuLaserCode( 1680, "Lase for A-10A (%d)" ) - - +-- Name: DES-100 - UNITS - Night Test +-- Author: FlightControl +-- Date Created: 23 Apr 2017 +-- +-- Demonstrates the designation of units, which are grouped per detected UNIT. +-- So each DetectedItem contains one detected unit only. +-- A Set of Recce are detecting a large group of units. +-- +-- - Wait until all units are detected by the recce. A report should appear. +-- - Once the report appears, the Designation Menu should be generated. In the communication menu, Press F10 and select F1. Designation. +-- - Test if one DetectionItem (a designated group) is lased by selecting a Target group from the Designation menu. +-- - If a target group is not lased, it should start with "Designate". +-- - If a target group is lased, the menu should start with "Lasing". +-- - If a target group is smoked, the menu should start with "Smoking". +-- - If a target group is illuminated, the menu should start with "Illuminating". +-- - Jump into a ground vehicle with the group name "Attack", and activate night vision (FLIR) (N key). +-- - With FLIR activated in a ground vehicle, search for the laser beams. +-- - Watch the laser beams alternate as targets are being detected or not detected... +-- The Recce will try to lase as many targets as possible, +-- but only for those targets to be lased, +-- and until sufficient laser codes are available. +-- - While the target group is lased, check if the available Recce are lasing the most possible targets. +-- - Check if all laser codes are being used, but not twice. +-- - Check if once a target has been destoyed, that after a while a Recce selects a new target. +-- - Check that if all targets are destroyed, that the Recce reports that. +-- - Check that while a Recce is lasing a target, that it is marking the target. +-- - Check that when you deactive the lasing, that the Recce report the deactivation. +-- - Check that when you illuminate a target group, that a message appears that the Recce is illuminating the target. +-- - Check that when you illuminate a target group, that the target area gets illuminated after a while. + + +RecceSetGroup = SET_GROUP:New():FilterPrefixes( "Recce" ):FilterStart() + +HQ = GROUP:FindByName( "HQ" ) + +CC = COMMANDCENTER:New( HQ, "HQ" ) + +-- Let the RecceSetGroup vehicles in the collection detect targets and group them in AREAS of 1000 meters. +RecceDetection = DETECTION_UNITS:New( RecceSetGroup ) + +-- Create a +AttackSet = SET_GROUP:New():FilterPrefixes("Attack"):FilterStart() + +-- Setup Designation for the AttackSet. +RecceDesignation = DESIGNATE:New( CC, RecceDetection, AttackSet ) + +-- Generate the random laser codes. +RecceDesignation:GenerateLaserCodes() + +-- The su-25T uses a specific laser code to guide its laser guides rockets. +-- The code is 1113. A special menu option will be added that allows to lase with 1113. +RecceDesignation:AddMenuLaserCode( 1113, "Lase for SU-25T (%d)" ) + +-- The A-10A etc use a specific laser code to guide its laser guides rockets. +-- The code is 1680. A special menu option will be added that allows to lase with 1680. +RecceDesignation:AddMenuLaserCode( 1680, "Lase for A-10A (%d)" ) + + diff --git a/DES - Designation/DES-100 - UNITS - Night Test/DES-100 - UNITS - Night Test.miz b/DES - Designation/DES-100 - UNITS - Night Test/DES-100 - UNITS - Night Test.miz index f3c20fcb2c..0dcc2fe534 100644 Binary files a/DES - Designation/DES-100 - UNITS - Night Test/DES-100 - UNITS - Night Test.miz and b/DES - Designation/DES-100 - UNITS - Night Test/DES-100 - UNITS - Night Test.miz differ diff --git a/DES - Designation/DES-101 - UNITS - Day Test/DES-101 - UNITS - Day Test.lua b/DES - Designation/DES-101 - UNITS - Day Test/DES-101 - UNITS - Day Test.lua index 9526575366..6409fccf51 100644 --- a/DES - Designation/DES-101 - UNITS - Day Test/DES-101 - UNITS - Day Test.lua +++ b/DES - Designation/DES-101 - UNITS - Day Test/DES-101 - UNITS - Day Test.lua @@ -1,58 +1,58 @@ --- Name: DES-101 - UNITS - Day Test --- Author: FlightControl --- Date Created: 14 Mar 2018 --- --- Demonstrates the designation of units, which are grouped per detected UNIT. --- So each DetectedItem contains one detected unit only. --- A Set of Recce are detecting a large group of units. --- --- - Wait until all units are detected by the recce. A report should appear. --- - Once the report appears, the Designation Menu should be generated. In the communication menu, Press F10 and select F1. Designation. --- - Test if one DetectionItem (a designated group) is lased by selecting a Target group from the Designation menu. --- - If a target group is not lased, it should start with "Designate". --- - If a target group is lased, the menu should start with "Lasing". --- - If a target group is smoked, the menu should start with "Smoking". --- - If a target group is illuminated, the menu should start with "Illuminating". --- - Jump into a ground vehicle with the group name "Attack", and activate night vision (FLIR) (N key). --- - With FLIR activated in a ground vehicle, search for the laser beams. --- - Watch the laser beams alternate as targets are being detected or not detected... --- The Recce will try to lase as many targets as possible, --- but only for those targets to be lased, --- and until sufficient laser codes are available. --- - While the target group is lased, check if the available Recce are lasing the most possible targets. --- - Check if all laser codes are being used, but not twice. --- - Check if once a target has been destoyed, that after a while a Recce selects a new target. --- - Check that if all targets are destroyed, that the Recce reports that. --- - Check that while a Recce is lasing a target, that it is marking the target. --- - Check that when you deactive the lasing, that the Recce report the deactivation. --- - Check that when you smoke a target, that a message appears that the Recce is smoking the target. --- - Check that when you smoke a target, that a smoke appears at the target. - - -RecceSetGroup = SET_GROUP:New():FilterPrefixes( "Recce" ):FilterStart() - -HQ = GROUP:FindByName( "HQ" ) - -CC = COMMANDCENTER:New( HQ, "HQ" ) - --- Let the RecceSetGroup vehicles in the collection detect targets and group them in AREAS of 1000 meters. -RecceDetection = DETECTION_UNITS:New( RecceSetGroup ) - --- Create a -AttackSet = SET_GROUP:New():FilterPrefixes("Attack"):FilterStart() - --- Setup Designation for the AttackSet. -RecceDesignation = DESIGNATE:New( CC, RecceDetection, AttackSet ) - --- Generate the random laser codes. -RecceDesignation:GenerateLaserCodes() - --- The su-25T uses a specific laser code to guide its laser guides rockets. --- The code is 1113. A special menu option will be added that allows to lase with 1113. -RecceDesignation:AddMenuLaserCode( 1113, "Lase for SU-25T (%d)" ) - --- The A-10A etc use a specific laser code to guide its laser guides rockets. --- The code is 1680. A special menu option will be added that allows to lase with 1680. -RecceDesignation:AddMenuLaserCode( 1680, "Lase for A-10A (%d)" ) - - +-- Name: DES-101 - UNITS - Day Test +-- Author: FlightControl +-- Date Created: 14 Mar 2018 +-- +-- Demonstrates the designation of units, which are grouped per detected UNIT. +-- So each DetectedItem contains one detected unit only. +-- A Set of Recce are detecting a large group of units. +-- +-- - Wait until all units are detected by the recce. A report should appear. +-- - Once the report appears, the Designation Menu should be generated. In the communication menu, Press F10 and select F1. Designation. +-- - Test if one DetectionItem (a designated group) is lased by selecting a Target group from the Designation menu. +-- - If a target group is not lased, it should start with "Designate". +-- - If a target group is lased, the menu should start with "Lasing". +-- - If a target group is smoked, the menu should start with "Smoking". +-- - If a target group is illuminated, the menu should start with "Illuminating". +-- - Jump into a ground vehicle with the group name "Attack", and activate night vision (FLIR) (N key). +-- - With FLIR activated in a ground vehicle, search for the laser beams. +-- - Watch the laser beams alternate as targets are being detected or not detected... +-- The Recce will try to lase as many targets as possible, +-- but only for those targets to be lased, +-- and until sufficient laser codes are available. +-- - While the target group is lased, check if the available Recce are lasing the most possible targets. +-- - Check if all laser codes are being used, but not twice. +-- - Check if once a target has been destoyed, that after a while a Recce selects a new target. +-- - Check that if all targets are destroyed, that the Recce reports that. +-- - Check that while a Recce is lasing a target, that it is marking the target. +-- - Check that when you deactive the lasing, that the Recce report the deactivation. +-- - Check that when you smoke a target, that a message appears that the Recce is smoking the target. +-- - Check that when you smoke a target, that a smoke appears at the target. + + +RecceSetGroup = SET_GROUP:New():FilterPrefixes( "Recce" ):FilterStart() + +HQ = GROUP:FindByName( "HQ" ) + +CC = COMMANDCENTER:New( HQ, "HQ" ) + +-- Let the RecceSetGroup vehicles in the collection detect targets and group them in AREAS of 1000 meters. +RecceDetection = DETECTION_UNITS:New( RecceSetGroup ) + +-- Create a +AttackSet = SET_GROUP:New():FilterPrefixes("Attack"):FilterStart() + +-- Setup Designation for the AttackSet. +RecceDesignation = DESIGNATE:New( CC, RecceDetection, AttackSet ) + +-- Generate the random laser codes. +RecceDesignation:GenerateLaserCodes() + +-- The su-25T uses a specific laser code to guide its laser guides rockets. +-- The code is 1113. A special menu option will be added that allows to lase with 1113. +RecceDesignation:AddMenuLaserCode( 1113, "Lase for SU-25T (%d)" ) + +-- The A-10A etc use a specific laser code to guide its laser guides rockets. +-- The code is 1680. A special menu option will be added that allows to lase with 1680. +RecceDesignation:AddMenuLaserCode( 1680, "Lase for A-10A (%d)" ) + + diff --git a/DES - Designation/DES-101 - UNITS - Day Test/DES-101 - UNITS - Day Test.miz b/DES - Designation/DES-101 - UNITS - Day Test/DES-101 - UNITS - Day Test.miz index e43797443b..7c27a642a9 100644 Binary files a/DES - Designation/DES-101 - UNITS - Day Test/DES-101 - UNITS - Day Test.miz and b/DES - Designation/DES-101 - UNITS - Day Test/DES-101 - UNITS - Day Test.miz differ diff --git a/DES - Designation/DES-110 - UNITS - Stress Test/DES-110 - UNITS - Stress Test.lua b/DES - Designation/DES-110 - UNITS - Stress Test/DES-110 - UNITS - Stress Test.lua index 9526575366..6409fccf51 100644 --- a/DES - Designation/DES-110 - UNITS - Stress Test/DES-110 - UNITS - Stress Test.lua +++ b/DES - Designation/DES-110 - UNITS - Stress Test/DES-110 - UNITS - Stress Test.lua @@ -1,58 +1,58 @@ --- Name: DES-101 - UNITS - Day Test --- Author: FlightControl --- Date Created: 14 Mar 2018 --- --- Demonstrates the designation of units, which are grouped per detected UNIT. --- So each DetectedItem contains one detected unit only. --- A Set of Recce are detecting a large group of units. --- --- - Wait until all units are detected by the recce. A report should appear. --- - Once the report appears, the Designation Menu should be generated. In the communication menu, Press F10 and select F1. Designation. --- - Test if one DetectionItem (a designated group) is lased by selecting a Target group from the Designation menu. --- - If a target group is not lased, it should start with "Designate". --- - If a target group is lased, the menu should start with "Lasing". --- - If a target group is smoked, the menu should start with "Smoking". --- - If a target group is illuminated, the menu should start with "Illuminating". --- - Jump into a ground vehicle with the group name "Attack", and activate night vision (FLIR) (N key). --- - With FLIR activated in a ground vehicle, search for the laser beams. --- - Watch the laser beams alternate as targets are being detected or not detected... --- The Recce will try to lase as many targets as possible, --- but only for those targets to be lased, --- and until sufficient laser codes are available. --- - While the target group is lased, check if the available Recce are lasing the most possible targets. --- - Check if all laser codes are being used, but not twice. --- - Check if once a target has been destoyed, that after a while a Recce selects a new target. --- - Check that if all targets are destroyed, that the Recce reports that. --- - Check that while a Recce is lasing a target, that it is marking the target. --- - Check that when you deactive the lasing, that the Recce report the deactivation. --- - Check that when you smoke a target, that a message appears that the Recce is smoking the target. --- - Check that when you smoke a target, that a smoke appears at the target. - - -RecceSetGroup = SET_GROUP:New():FilterPrefixes( "Recce" ):FilterStart() - -HQ = GROUP:FindByName( "HQ" ) - -CC = COMMANDCENTER:New( HQ, "HQ" ) - --- Let the RecceSetGroup vehicles in the collection detect targets and group them in AREAS of 1000 meters. -RecceDetection = DETECTION_UNITS:New( RecceSetGroup ) - --- Create a -AttackSet = SET_GROUP:New():FilterPrefixes("Attack"):FilterStart() - --- Setup Designation for the AttackSet. -RecceDesignation = DESIGNATE:New( CC, RecceDetection, AttackSet ) - --- Generate the random laser codes. -RecceDesignation:GenerateLaserCodes() - --- The su-25T uses a specific laser code to guide its laser guides rockets. --- The code is 1113. A special menu option will be added that allows to lase with 1113. -RecceDesignation:AddMenuLaserCode( 1113, "Lase for SU-25T (%d)" ) - --- The A-10A etc use a specific laser code to guide its laser guides rockets. --- The code is 1680. A special menu option will be added that allows to lase with 1680. -RecceDesignation:AddMenuLaserCode( 1680, "Lase for A-10A (%d)" ) - - +-- Name: DES-101 - UNITS - Day Test +-- Author: FlightControl +-- Date Created: 14 Mar 2018 +-- +-- Demonstrates the designation of units, which are grouped per detected UNIT. +-- So each DetectedItem contains one detected unit only. +-- A Set of Recce are detecting a large group of units. +-- +-- - Wait until all units are detected by the recce. A report should appear. +-- - Once the report appears, the Designation Menu should be generated. In the communication menu, Press F10 and select F1. Designation. +-- - Test if one DetectionItem (a designated group) is lased by selecting a Target group from the Designation menu. +-- - If a target group is not lased, it should start with "Designate". +-- - If a target group is lased, the menu should start with "Lasing". +-- - If a target group is smoked, the menu should start with "Smoking". +-- - If a target group is illuminated, the menu should start with "Illuminating". +-- - Jump into a ground vehicle with the group name "Attack", and activate night vision (FLIR) (N key). +-- - With FLIR activated in a ground vehicle, search for the laser beams. +-- - Watch the laser beams alternate as targets are being detected or not detected... +-- The Recce will try to lase as many targets as possible, +-- but only for those targets to be lased, +-- and until sufficient laser codes are available. +-- - While the target group is lased, check if the available Recce are lasing the most possible targets. +-- - Check if all laser codes are being used, but not twice. +-- - Check if once a target has been destoyed, that after a while a Recce selects a new target. +-- - Check that if all targets are destroyed, that the Recce reports that. +-- - Check that while a Recce is lasing a target, that it is marking the target. +-- - Check that when you deactive the lasing, that the Recce report the deactivation. +-- - Check that when you smoke a target, that a message appears that the Recce is smoking the target. +-- - Check that when you smoke a target, that a smoke appears at the target. + + +RecceSetGroup = SET_GROUP:New():FilterPrefixes( "Recce" ):FilterStart() + +HQ = GROUP:FindByName( "HQ" ) + +CC = COMMANDCENTER:New( HQ, "HQ" ) + +-- Let the RecceSetGroup vehicles in the collection detect targets and group them in AREAS of 1000 meters. +RecceDetection = DETECTION_UNITS:New( RecceSetGroup ) + +-- Create a +AttackSet = SET_GROUP:New():FilterPrefixes("Attack"):FilterStart() + +-- Setup Designation for the AttackSet. +RecceDesignation = DESIGNATE:New( CC, RecceDetection, AttackSet ) + +-- Generate the random laser codes. +RecceDesignation:GenerateLaserCodes() + +-- The su-25T uses a specific laser code to guide its laser guides rockets. +-- The code is 1113. A special menu option will be added that allows to lase with 1113. +RecceDesignation:AddMenuLaserCode( 1113, "Lase for SU-25T (%d)" ) + +-- The A-10A etc use a specific laser code to guide its laser guides rockets. +-- The code is 1680. A special menu option will be added that allows to lase with 1680. +RecceDesignation:AddMenuLaserCode( 1680, "Lase for A-10A (%d)" ) + + diff --git a/DES - Designation/DES-110 - UNITS - Stress Test/DES-110 - UNITS - Stress Test.miz b/DES - Designation/DES-110 - UNITS - Stress Test/DES-110 - UNITS - Stress Test.miz index 87d65cbd8e..db7b677dba 100644 Binary files a/DES - Designation/DES-110 - UNITS - Stress Test/DES-110 - UNITS - Stress Test.miz and b/DES - Designation/DES-110 - UNITS - Stress Test/DES-110 - UNITS - Stress Test.miz differ diff --git a/DES - Designation/DES-200 - AREAS - Night Test/DES-200 - AREAS - Night Test.lua b/DES - Designation/DES-200 - AREAS - Night Test/DES-200 - AREAS - Night Test.lua index e465a98e9b..6c9f5b7ae3 100644 --- a/DES - Designation/DES-200 - AREAS - Night Test/DES-200 - AREAS - Night Test.lua +++ b/DES - Designation/DES-200 - AREAS - Night Test/DES-200 - AREAS - Night Test.lua @@ -1,57 +1,57 @@ --- Name: DES-200 - AREAS - Night Test --- Author: FlightControl --- Date Created: 23 Apr 2017 --- --- Demonstrates the designation of units, which are grouped in AREAs. --- A Set of Recce are detecting a large group of units. --- --- - Wait until all units are detected by the recce. A report should appear. --- - Once the report appears, the Designation Menu should be generated. In the communication menu, Press F10 and select F1. Designation. --- - Test if one DetectionItem (a designated group) is lased by selecting a Target group from the Designation menu. --- - If a target group is not lased, it should start with "Designate". --- - If a target group is lased, the menu should start with "Lasing". --- - If a target group is smoked, the menu should start with "Smoking". --- - If a target group is illuminated, the menu should start with "Illuminating". --- - Jump into a ground vehicle with the group name "Attack", and activate night vision (FLIR) (N key). --- - With FLIR activated in a ground vehicle, search for the laser beams. --- - Watch the laser beams alternate as targets are being detected or not detected... --- The Recce will try to lase as many targets as possible, --- but only for those targets to be lased, --- and until sufficient laser codes are available. --- - While the target group is lased, check if the available Recce are lasing the most possible targets. --- - Check if all laser codes are being used, but not twice. --- - Check if once a target has been destoyed, that after a while a Recce selects a new target. --- - Check that if all targets are destroyed, that the Recce reports that. --- - Check that while a Recce is lasing a target, that it is marking the target. --- - Check that when you deactive the lasing, that the Recce report the deactivation. --- - Check that when you illuminate a target group, that a message appears that the Recce is illuminating the target. --- - Check that when you illuminate a target group, that the target area gets illuminated after a while. - - -RecceSetGroup = SET_GROUP:New():FilterPrefixes( "Recce" ):FilterStart() - -HQ = GROUP:FindByName( "HQ" ) - -CC = COMMANDCENTER:New( HQ, "HQ" ) - --- Let the RecceSetGroup vehicles in the collection detect targets and group them in AREAS of 1000 meters. -RecceDetection = DETECTION_AREAS:New( RecceSetGroup, 1000 ) - --- Create a -AttackSet = SET_GROUP:New():FilterPrefixes("Attack"):FilterStart() - --- Setup Designation for the AttackSet. -RecceDesignation = DESIGNATE:New( CC, RecceDetection, AttackSet ) - --- Generate the random laser codes. -RecceDesignation:GenerateLaserCodes() - --- The su-25T uses a specific laser code to guide its laser guides rockets. --- The code is 1113. A special menu option will be added that allows to lase with 1113. -RecceDesignation:AddMenuLaserCode( 1113, "Lase for SU-25T (%d)" ) - --- The A-10A etc use a specific laser code to guide its laser guides rockets. --- The code is 1680. A special menu option will be added that allows to lase with 1680. -RecceDesignation:AddMenuLaserCode( 1680, "Lase for A-10A (%d)" ) - - +-- Name: DES-200 - AREAS - Night Test +-- Author: FlightControl +-- Date Created: 23 Apr 2017 +-- +-- Demonstrates the designation of units, which are grouped in AREAs. +-- A Set of Recce are detecting a large group of units. +-- +-- - Wait until all units are detected by the recce. A report should appear. +-- - Once the report appears, the Designation Menu should be generated. In the communication menu, Press F10 and select F1. Designation. +-- - Test if one DetectionItem (a designated group) is lased by selecting a Target group from the Designation menu. +-- - If a target group is not lased, it should start with "Designate". +-- - If a target group is lased, the menu should start with "Lasing". +-- - If a target group is smoked, the menu should start with "Smoking". +-- - If a target group is illuminated, the menu should start with "Illuminating". +-- - Jump into a ground vehicle with the group name "Attack", and activate night vision (FLIR) (N key). +-- - With FLIR activated in a ground vehicle, search for the laser beams. +-- - Watch the laser beams alternate as targets are being detected or not detected... +-- The Recce will try to lase as many targets as possible, +-- but only for those targets to be lased, +-- and until sufficient laser codes are available. +-- - While the target group is lased, check if the available Recce are lasing the most possible targets. +-- - Check if all laser codes are being used, but not twice. +-- - Check if once a target has been destoyed, that after a while a Recce selects a new target. +-- - Check that if all targets are destroyed, that the Recce reports that. +-- - Check that while a Recce is lasing a target, that it is marking the target. +-- - Check that when you deactive the lasing, that the Recce report the deactivation. +-- - Check that when you illuminate a target group, that a message appears that the Recce is illuminating the target. +-- - Check that when you illuminate a target group, that the target area gets illuminated after a while. + + +RecceSetGroup = SET_GROUP:New():FilterPrefixes( "Recce" ):FilterStart() + +HQ = GROUP:FindByName( "HQ" ) + +CC = COMMANDCENTER:New( HQ, "HQ" ) + +-- Let the RecceSetGroup vehicles in the collection detect targets and group them in AREAS of 1000 meters. +RecceDetection = DETECTION_AREAS:New( RecceSetGroup, 1000 ) + +-- Create a +AttackSet = SET_GROUP:New():FilterPrefixes("Attack"):FilterStart() + +-- Setup Designation for the AttackSet. +RecceDesignation = DESIGNATE:New( CC, RecceDetection, AttackSet ) + +-- Generate the random laser codes. +RecceDesignation:GenerateLaserCodes() + +-- The su-25T uses a specific laser code to guide its laser guides rockets. +-- The code is 1113. A special menu option will be added that allows to lase with 1113. +RecceDesignation:AddMenuLaserCode( 1113, "Lase for SU-25T (%d)" ) + +-- The A-10A etc use a specific laser code to guide its laser guides rockets. +-- The code is 1680. A special menu option will be added that allows to lase with 1680. +RecceDesignation:AddMenuLaserCode( 1680, "Lase for A-10A (%d)" ) + + diff --git a/DES - Designation/DES-200 - AREAS - Night Test/DES-200 - AREAS - Night Test.miz b/DES - Designation/DES-200 - AREAS - Night Test/DES-200 - AREAS - Night Test.miz index c805cb02c3..18234d7f02 100644 Binary files a/DES - Designation/DES-200 - AREAS - Night Test/DES-200 - AREAS - Night Test.miz and b/DES - Designation/DES-200 - AREAS - Night Test/DES-200 - AREAS - Night Test.miz differ diff --git a/DES - Designation/DES-201 - AREAS - Day Test/DES-201 - AREAS - Day Test.lua b/DES - Designation/DES-201 - AREAS - Day Test/DES-201 - AREAS - Day Test.lua index 6b5e8e1790..a3b316b7e4 100644 --- a/DES - Designation/DES-201 - AREAS - Day Test/DES-201 - AREAS - Day Test.lua +++ b/DES - Designation/DES-201 - AREAS - Day Test/DES-201 - AREAS - Day Test.lua @@ -1,57 +1,57 @@ --- Name: DES-201 - AREAS - Day Test --- Author: FlightControl --- Date Created: 23 Apr 2017 --- --- Demonstrates the designation of units, which are grouped in AREAs. --- A Set of Recce are detecting a large group of units. --- --- - Wait until all units are detected by the recce. A report should appear. --- - Once the report appears, the Designation Menu should be generated. In the communication menu, Press F10 and select F1. Designation. --- - Test if one DetectionItem (a designated group) is lased by selecting a Target group from the Designation menu. --- - If a target group is not lased, it should start with "Designate". --- - If a target group is lased, the menu should start with "Lasing". --- - If a target group is smoked, the menu should start with "Smoking". --- - If a target group is illuminated, the menu should start with "Illuminating". --- - Jump into a ground vehicle with the group name "Attack", and activate night vision (FLIR) (N key). --- - With FLIR activated in a ground vehicle, search for the laser beams. --- - Watch the laser beams alternate as targets are being detected or not detected... --- The Recce will try to lase as many targets as possible, --- but only for those targets to be lased, --- and until sufficient laser codes are available. --- - While the target group is lased, check if the available Recce are lasing the most possible targets. --- - Check if all laser codes are being used, but not twice. --- - Check if once a target has been destoyed, that after a while a Recce selects a new target. --- - Check that if all targets are destroyed, that the Recce reports that. --- - Check that while a Recce is lasing a target, that it is marking the target. --- - Check that when you deactive the lasing, that the Recce report the deactivation. --- - Check that when you smoke a target, that a message appears that the Recce is smoking the target. --- - Check that when you smoke a target, that a smoke appears at the target. - - -RecceSetGroup = SET_GROUP:New():FilterPrefixes( "Recce" ):FilterStart() - -HQ = GROUP:FindByName( "HQ" ) - -CC = COMMANDCENTER:New( HQ, "HQ" ) - --- Let the RecceSetGroup vehicles in the collection detect targets and group them in AREAS of 1000 meters. -RecceDetection = DETECTION_AREAS:New( RecceSetGroup, 1000 ) - --- Create a -AttackSet = SET_GROUP:New():FilterPrefixes("Attack"):FilterStart() - --- Setup Designation for the AttackSet. -RecceDesignation = DESIGNATE:New( CC, RecceDetection, AttackSet ) - --- Generate the random laser codes. -RecceDesignation:GenerateLaserCodes() - --- The su-25T uses a specific laser code to guide its laser guides rockets. --- The code is 1113. A special menu option will be added that allows to lase with 1113. -RecceDesignation:AddMenuLaserCode( 1113, "Lase for SU-25T (%d)" ) - --- The A-10A etc use a specific laser code to guide its laser guides rockets. --- The code is 1680. A special menu option will be added that allows to lase with 1680. -RecceDesignation:AddMenuLaserCode( 1680, "Lase for A-10A (%d)" ) - - +-- Name: DES-201 - AREAS - Day Test +-- Author: FlightControl +-- Date Created: 23 Apr 2017 +-- +-- Demonstrates the designation of units, which are grouped in AREAs. +-- A Set of Recce are detecting a large group of units. +-- +-- - Wait until all units are detected by the recce. A report should appear. +-- - Once the report appears, the Designation Menu should be generated. In the communication menu, Press F10 and select F1. Designation. +-- - Test if one DetectionItem (a designated group) is lased by selecting a Target group from the Designation menu. +-- - If a target group is not lased, it should start with "Designate". +-- - If a target group is lased, the menu should start with "Lasing". +-- - If a target group is smoked, the menu should start with "Smoking". +-- - If a target group is illuminated, the menu should start with "Illuminating". +-- - Jump into a ground vehicle with the group name "Attack", and activate night vision (FLIR) (N key). +-- - With FLIR activated in a ground vehicle, search for the laser beams. +-- - Watch the laser beams alternate as targets are being detected or not detected... +-- The Recce will try to lase as many targets as possible, +-- but only for those targets to be lased, +-- and until sufficient laser codes are available. +-- - While the target group is lased, check if the available Recce are lasing the most possible targets. +-- - Check if all laser codes are being used, but not twice. +-- - Check if once a target has been destoyed, that after a while a Recce selects a new target. +-- - Check that if all targets are destroyed, that the Recce reports that. +-- - Check that while a Recce is lasing a target, that it is marking the target. +-- - Check that when you deactive the lasing, that the Recce report the deactivation. +-- - Check that when you smoke a target, that a message appears that the Recce is smoking the target. +-- - Check that when you smoke a target, that a smoke appears at the target. + + +RecceSetGroup = SET_GROUP:New():FilterPrefixes( "Recce" ):FilterStart() + +HQ = GROUP:FindByName( "HQ" ) + +CC = COMMANDCENTER:New( HQ, "HQ" ) + +-- Let the RecceSetGroup vehicles in the collection detect targets and group them in AREAS of 1000 meters. +RecceDetection = DETECTION_AREAS:New( RecceSetGroup, 1000 ) + +-- Create a +AttackSet = SET_GROUP:New():FilterPrefixes("Attack"):FilterStart() + +-- Setup Designation for the AttackSet. +RecceDesignation = DESIGNATE:New( CC, RecceDetection, AttackSet ) + +-- Generate the random laser codes. +RecceDesignation:GenerateLaserCodes() + +-- The su-25T uses a specific laser code to guide its laser guides rockets. +-- The code is 1113. A special menu option will be added that allows to lase with 1113. +RecceDesignation:AddMenuLaserCode( 1113, "Lase for SU-25T (%d)" ) + +-- The A-10A etc use a specific laser code to guide its laser guides rockets. +-- The code is 1680. A special menu option will be added that allows to lase with 1680. +RecceDesignation:AddMenuLaserCode( 1680, "Lase for A-10A (%d)" ) + + diff --git a/DES - Designation/DES-201 - AREAS - Day Test/DES-201 - AREAS - Day Test.miz b/DES - Designation/DES-201 - AREAS - Day Test/DES-201 - AREAS - Day Test.miz index b665f87356..03484ae9a1 100644 Binary files a/DES - Designation/DES-201 - AREAS - Day Test/DES-201 - AREAS - Day Test.miz and b/DES - Designation/DES-201 - AREAS - Day Test/DES-201 - AREAS - Day Test.miz differ diff --git a/DES - Designation/DES-300 - TYPES - Night Test/DES-300 - TYPES - Night Test.lua b/DES - Designation/DES-300 - TYPES - Night Test/DES-300 - TYPES - Night Test.lua index 605f1b4d24..4ab7e0c208 100644 --- a/DES - Designation/DES-300 - TYPES - Night Test/DES-300 - TYPES - Night Test.lua +++ b/DES - Designation/DES-300 - TYPES - Night Test/DES-300 - TYPES - Night Test.lua @@ -1,57 +1,57 @@ --- Name: DES-300 - TYPES - Night Test --- Author: FlightControl --- Date Created: 23 Apr 2017 --- --- Demonstrates the designation of units, which are grouped per TYPES of the detected units. --- A Set of Recce are detecting a large group of units. --- --- - Wait until all units are detected by the recce. A report should appear. --- - Once the report appears, the Designation Menu should be generated. In the communication menu, Press F10 and select F1. Designation. --- - Test if one DetectionItem (a designated group) is lased by selecting a Target group from the Designation menu. --- - If a target group is not lased, it should start with "Designate". --- - If a target group is lased, the menu should start with "Lasing". --- - If a target group is smoked, the menu should start with "Smoking". --- - If a target group is illuminated, the menu should start with "Illuminating". --- - Jump into a ground vehicle with the group name "Attack", and activate night vision (FLIR) (N key). --- - With FLIR activated in a ground vehicle, search for the laser beams. --- - Watch the laser beams alternate as targets are being detected or not detected... --- The Recce will try to lase as many targets as possible, --- but only for those targets to be lased, --- and until sufficient laser codes are available. --- - While the target group is lased, check if the available Recce are lasing the most possible targets. --- - Check if all laser codes are being used, but not twice. --- - Check if once a target has been destoyed, that after a while a Recce selects a new target. --- - Check that if all targets are destroyed, that the Recce reports that. --- - Check that while a Recce is lasing a target, that it is marking the target. --- - Check that when you deactive the lasing, that the Recce report the deactivation. --- - Check that when you illuminate a target group, that a message appears that the Recce is illuminating the target. --- - Check that when you illuminate a target group, that the target area gets illuminated after a while. - - -RecceSetGroup = SET_GROUP:New():FilterPrefixes( "Recce" ):FilterStart() - -HQ = GROUP:FindByName( "HQ" ) - -CC = COMMANDCENTER:New( HQ, "HQ" ) - --- Let the RecceSetGroup vehicles in the collection detect targets and group them in AREAS of 1000 meters. -RecceDetection = DETECTION_TYPES:New( RecceSetGroup ) - --- Create a -AttackSet = SET_GROUP:New():FilterPrefixes("Attack"):FilterStart() - --- Setup Designation for the AttackSet. -RecceDesignation = DESIGNATE:New( CC, RecceDetection, AttackSet ) - --- Generate the random laser codes. -RecceDesignation:GenerateLaserCodes() - --- The su-25T uses a specific laser code to guide its laser guides rockets. --- The code is 1113. A special menu option will be added that allows to lase with 1113. -RecceDesignation:AddMenuLaserCode( 1113, "Lase for SU-25T (%d)" ) - --- The A-10A etc use a specific laser code to guide its laser guides rockets. --- The code is 1680. A special menu option will be added that allows to lase with 1680. -RecceDesignation:AddMenuLaserCode( 1680, "Lase for A-10A (%d)" ) - - +-- Name: DES-300 - TYPES - Night Test +-- Author: FlightControl +-- Date Created: 23 Apr 2017 +-- +-- Demonstrates the designation of units, which are grouped per TYPES of the detected units. +-- A Set of Recce are detecting a large group of units. +-- +-- - Wait until all units are detected by the recce. A report should appear. +-- - Once the report appears, the Designation Menu should be generated. In the communication menu, Press F10 and select F1. Designation. +-- - Test if one DetectionItem (a designated group) is lased by selecting a Target group from the Designation menu. +-- - If a target group is not lased, it should start with "Designate". +-- - If a target group is lased, the menu should start with "Lasing". +-- - If a target group is smoked, the menu should start with "Smoking". +-- - If a target group is illuminated, the menu should start with "Illuminating". +-- - Jump into a ground vehicle with the group name "Attack", and activate night vision (FLIR) (N key). +-- - With FLIR activated in a ground vehicle, search for the laser beams. +-- - Watch the laser beams alternate as targets are being detected or not detected... +-- The Recce will try to lase as many targets as possible, +-- but only for those targets to be lased, +-- and until sufficient laser codes are available. +-- - While the target group is lased, check if the available Recce are lasing the most possible targets. +-- - Check if all laser codes are being used, but not twice. +-- - Check if once a target has been destoyed, that after a while a Recce selects a new target. +-- - Check that if all targets are destroyed, that the Recce reports that. +-- - Check that while a Recce is lasing a target, that it is marking the target. +-- - Check that when you deactive the lasing, that the Recce report the deactivation. +-- - Check that when you illuminate a target group, that a message appears that the Recce is illuminating the target. +-- - Check that when you illuminate a target group, that the target area gets illuminated after a while. + + +RecceSetGroup = SET_GROUP:New():FilterPrefixes( "Recce" ):FilterStart() + +HQ = GROUP:FindByName( "HQ" ) + +CC = COMMANDCENTER:New( HQ, "HQ" ) + +-- Let the RecceSetGroup vehicles in the collection detect targets and group them in AREAS of 1000 meters. +RecceDetection = DETECTION_TYPES:New( RecceSetGroup ) + +-- Create a +AttackSet = SET_GROUP:New():FilterPrefixes("Attack"):FilterStart() + +-- Setup Designation for the AttackSet. +RecceDesignation = DESIGNATE:New( CC, RecceDetection, AttackSet ) + +-- Generate the random laser codes. +RecceDesignation:GenerateLaserCodes() + +-- The su-25T uses a specific laser code to guide its laser guides rockets. +-- The code is 1113. A special menu option will be added that allows to lase with 1113. +RecceDesignation:AddMenuLaserCode( 1113, "Lase for SU-25T (%d)" ) + +-- The A-10A etc use a specific laser code to guide its laser guides rockets. +-- The code is 1680. A special menu option will be added that allows to lase with 1680. +RecceDesignation:AddMenuLaserCode( 1680, "Lase for A-10A (%d)" ) + + diff --git a/DES - Designation/DES-300 - TYPES - Night Test/DES-300 - TYPES - Night Test.miz b/DES - Designation/DES-300 - TYPES - Night Test/DES-300 - TYPES - Night Test.miz index 00db8d38da..1c221e1668 100644 Binary files a/DES - Designation/DES-300 - TYPES - Night Test/DES-300 - TYPES - Night Test.miz and b/DES - Designation/DES-300 - TYPES - Night Test/DES-300 - TYPES - Night Test.miz differ diff --git a/DES - Designation/DES-301 - TYPES - Day Test/DES-301 - TYPES - Day Test.lua b/DES - Designation/DES-301 - TYPES - Day Test/DES-301 - TYPES - Day Test.lua index 0b5c8ddde0..5af0822548 100644 --- a/DES - Designation/DES-301 - TYPES - Day Test/DES-301 - TYPES - Day Test.lua +++ b/DES - Designation/DES-301 - TYPES - Day Test/DES-301 - TYPES - Day Test.lua @@ -1,57 +1,57 @@ --- Name: DES-301 - TYPES - Day Test --- Author: FlightControl --- Date Created: 14 Mar 2018 --- --- Demonstrates the designation of units, which are grouped per TYPES of the detected units. --- A Set of Recce are detecting a large group of units. --- --- - Wait until all units are detected by the recce. A report should appear. --- - Once the report appears, the Designation Menu should be generated. In the communication menu, Press F10 and select F1. Designation. --- - Test if one DetectionItem (a designated group) is lased by selecting a Target group from the Designation menu. --- - If a target group is not lased, it should start with "Designate". --- - If a target group is lased, the menu should start with "Lasing". --- - If a target group is smoked, the menu should start with "Smoking". --- - If a target group is illuminated, the menu should start with "Illuminating". --- - Jump into a ground vehicle with the group name "Attack", and activate night vision (FLIR) (N key). --- - With FLIR activated in a ground vehicle, search for the laser beams. --- - Watch the laser beams alternate as targets are being detected or not detected... --- The Recce will try to lase as many targets as possible, --- but only for those targets to be lased, --- and until sufficient laser codes are available. --- - While the target group is lased, check if the available Recce are lasing the most possible targets. --- - Check if all laser codes are being used, but not twice. --- - Check if once a target has been destoyed, that after a while a Recce selects a new target. --- - Check that if all targets are destroyed, that the Recce reports that. --- - Check that while a Recce is lasing a target, that it is marking the target. --- - Check that when you deactive the lasing, that the Recce report the deactivation. --- - Check that when you smoke a target, that a message appears that the Recce is smoking the target. --- - Check that when you smoke a target, that a smoke appears at the target. - - -RecceSetGroup = SET_GROUP:New():FilterPrefixes( "Recce" ):FilterStart() - -HQ = GROUP:FindByName( "HQ" ) - -CC = COMMANDCENTER:New( HQ, "HQ" ) - --- Let the RecceSetGroup vehicles in the collection detect targets and group them in AREAS of 1000 meters. -RecceDetection = DETECTION_TYPES:New( RecceSetGroup ) - --- Create a -AttackSet = SET_GROUP:New():FilterPrefixes("Attack"):FilterStart() - --- Setup Designation for the AttackSet. -RecceDesignation = DESIGNATE:New( CC, RecceDetection, AttackSet ) - --- Generate the random laser codes. -RecceDesignation:GenerateLaserCodes() - --- The su-25T uses a specific laser code to guide its laser guides rockets. --- The code is 1113. A special menu option will be added that allows to lase with 1113. -RecceDesignation:AddMenuLaserCode( 1113, "Lase for SU-25T (%d)" ) - --- The A-10A etc use a specific laser code to guide its laser guides rockets. --- The code is 1680. A special menu option will be added that allows to lase with 1680. -RecceDesignation:AddMenuLaserCode( 1680, "Lase for A-10A (%d)" ) - - +-- Name: DES-301 - TYPES - Day Test +-- Author: FlightControl +-- Date Created: 14 Mar 2018 +-- +-- Demonstrates the designation of units, which are grouped per TYPES of the detected units. +-- A Set of Recce are detecting a large group of units. +-- +-- - Wait until all units are detected by the recce. A report should appear. +-- - Once the report appears, the Designation Menu should be generated. In the communication menu, Press F10 and select F1. Designation. +-- - Test if one DetectionItem (a designated group) is lased by selecting a Target group from the Designation menu. +-- - If a target group is not lased, it should start with "Designate". +-- - If a target group is lased, the menu should start with "Lasing". +-- - If a target group is smoked, the menu should start with "Smoking". +-- - If a target group is illuminated, the menu should start with "Illuminating". +-- - Jump into a ground vehicle with the group name "Attack", and activate night vision (FLIR) (N key). +-- - With FLIR activated in a ground vehicle, search for the laser beams. +-- - Watch the laser beams alternate as targets are being detected or not detected... +-- The Recce will try to lase as many targets as possible, +-- but only for those targets to be lased, +-- and until sufficient laser codes are available. +-- - While the target group is lased, check if the available Recce are lasing the most possible targets. +-- - Check if all laser codes are being used, but not twice. +-- - Check if once a target has been destoyed, that after a while a Recce selects a new target. +-- - Check that if all targets are destroyed, that the Recce reports that. +-- - Check that while a Recce is lasing a target, that it is marking the target. +-- - Check that when you deactive the lasing, that the Recce report the deactivation. +-- - Check that when you smoke a target, that a message appears that the Recce is smoking the target. +-- - Check that when you smoke a target, that a smoke appears at the target. + + +RecceSetGroup = SET_GROUP:New():FilterPrefixes( "Recce" ):FilterStart() + +HQ = GROUP:FindByName( "HQ" ) + +CC = COMMANDCENTER:New( HQ, "HQ" ) + +-- Let the RecceSetGroup vehicles in the collection detect targets and group them in AREAS of 1000 meters. +RecceDetection = DETECTION_TYPES:New( RecceSetGroup ) + +-- Create a +AttackSet = SET_GROUP:New():FilterPrefixes("Attack"):FilterStart() + +-- Setup Designation for the AttackSet. +RecceDesignation = DESIGNATE:New( CC, RecceDetection, AttackSet ) + +-- Generate the random laser codes. +RecceDesignation:GenerateLaserCodes() + +-- The su-25T uses a specific laser code to guide its laser guides rockets. +-- The code is 1113. A special menu option will be added that allows to lase with 1113. +RecceDesignation:AddMenuLaserCode( 1113, "Lase for SU-25T (%d)" ) + +-- The A-10A etc use a specific laser code to guide its laser guides rockets. +-- The code is 1680. A special menu option will be added that allows to lase with 1680. +RecceDesignation:AddMenuLaserCode( 1680, "Lase for A-10A (%d)" ) + + diff --git a/DES - Designation/DES-301 - TYPES - Day Test/DES-301 - TYPES - Day Test.miz b/DES - Designation/DES-301 - TYPES - Day Test/DES-301 - TYPES - Day Test.miz index bc3a0634a3..cd11a1aeee 100644 Binary files a/DES - Designation/DES-301 - TYPES - Day Test/DES-301 - TYPES - Day Test.miz and b/DES - Designation/DES-301 - TYPES - Day Test/DES-301 - TYPES - Day Test.miz differ diff --git a/DET - Detection/DET-001 - Detection Areas/DET-001 - Detection Areas.lua b/DET - Detection/DET-001 - Detection Areas/DET-001 - Detection Areas.lua index 7afca5c499..3c8ce24b69 100644 --- a/DET - Detection/DET-001 - Detection Areas/DET-001 - Detection Areas.lua +++ b/DET - Detection/DET-001 - Detection Areas/DET-001 - Detection Areas.lua @@ -1,24 +1,24 @@ ---- --- Name: DET-001 - Detection Areas --- Author: FlightControl --- Date Created: 04 Feb 2017 --- --- # Situation: --- --- A small blue vehicle with laser detection methods is detecting targets. --- Targets are grouped within areas. A detection range and zone range is given to group the detected units. --- This demo will group 5 red vehicles in areas. One vehicle is diving from one group to the other. --- --- # Test cases: --- --- 1. Observe the flaring of the areas formed --- 2. Observe the smoking of the units detected --- 3. Observe the areas being flexibly changed very detection run. --- 4. The truck driving from the one group to the other, will leave the first area, and will join the second. --- 5. While driving in between the areas, it will have a separate area. - -FACSetGroup = SET_GROUP:New():FilterPrefixes( "FAC Group" ):FilterStart() - -FACDetection = DETECTION_AREAS:New( FACSetGroup, 150, 250 ):BoundDetectedZones():SmokeDetectedUnits() - +--- +-- Name: DET-001 - Detection Areas +-- Author: FlightControl +-- Date Created: 04 Feb 2017 +-- +-- # Situation: +-- +-- A small blue vehicle with laser detection methods is detecting targets. +-- Targets are grouped within areas. A detection range and zone range is given to group the detected units. +-- This demo will group 5 red vehicles in areas. One vehicle is diving from one group to the other. +-- +-- # Test cases: +-- +-- 1. Observe the flaring of the areas formed +-- 2. Observe the smoking of the units detected +-- 3. Observe the areas being flexibly changed very detection run. +-- 4. The truck driving from the one group to the other, will leave the first area, and will join the second. +-- 5. While driving in between the areas, it will have a separate area. + +FACSetGroup = SET_GROUP:New():FilterPrefixes( "FAC Group" ):FilterStart() + +FACDetection = DETECTION_AREAS:New( FACSetGroup, 150, 250 ):BoundDetectedZones():SmokeDetectedUnits() + FACDetection:__Start( 5 ) \ No newline at end of file diff --git a/DET - Detection/DET-001 - Detection Areas/DET-001 - Detection Areas.miz b/DET - Detection/DET-001 - Detection Areas/DET-001 - Detection Areas.miz index 2280809ecd..36828de158 100644 Binary files a/DET - Detection/DET-001 - Detection Areas/DET-001 - Detection Areas.miz and b/DET - Detection/DET-001 - Detection Areas/DET-001 - Detection Areas.miz differ diff --git a/DET - Detection/DET-002 - Detection only Visible Units/DET-002 - Detection only Visible Units.lua b/DET - Detection/DET-002 - Detection only Visible Units/DET-002 - Detection only Visible Units.lua index 7afca5c499..3c8ce24b69 100644 --- a/DET - Detection/DET-002 - Detection only Visible Units/DET-002 - Detection only Visible Units.lua +++ b/DET - Detection/DET-002 - Detection only Visible Units/DET-002 - Detection only Visible Units.lua @@ -1,24 +1,24 @@ ---- --- Name: DET-001 - Detection Areas --- Author: FlightControl --- Date Created: 04 Feb 2017 --- --- # Situation: --- --- A small blue vehicle with laser detection methods is detecting targets. --- Targets are grouped within areas. A detection range and zone range is given to group the detected units. --- This demo will group 5 red vehicles in areas. One vehicle is diving from one group to the other. --- --- # Test cases: --- --- 1. Observe the flaring of the areas formed --- 2. Observe the smoking of the units detected --- 3. Observe the areas being flexibly changed very detection run. --- 4. The truck driving from the one group to the other, will leave the first area, and will join the second. --- 5. While driving in between the areas, it will have a separate area. - -FACSetGroup = SET_GROUP:New():FilterPrefixes( "FAC Group" ):FilterStart() - -FACDetection = DETECTION_AREAS:New( FACSetGroup, 150, 250 ):BoundDetectedZones():SmokeDetectedUnits() - +--- +-- Name: DET-001 - Detection Areas +-- Author: FlightControl +-- Date Created: 04 Feb 2017 +-- +-- # Situation: +-- +-- A small blue vehicle with laser detection methods is detecting targets. +-- Targets are grouped within areas. A detection range and zone range is given to group the detected units. +-- This demo will group 5 red vehicles in areas. One vehicle is diving from one group to the other. +-- +-- # Test cases: +-- +-- 1. Observe the flaring of the areas formed +-- 2. Observe the smoking of the units detected +-- 3. Observe the areas being flexibly changed very detection run. +-- 4. The truck driving from the one group to the other, will leave the first area, and will join the second. +-- 5. While driving in between the areas, it will have a separate area. + +FACSetGroup = SET_GROUP:New():FilterPrefixes( "FAC Group" ):FilterStart() + +FACDetection = DETECTION_AREAS:New( FACSetGroup, 150, 250 ):BoundDetectedZones():SmokeDetectedUnits() + FACDetection:__Start( 5 ) \ No newline at end of file diff --git a/DET - Detection/DET-002 - Detection only Visible Units/DET-002 - Detection only Visible Units.miz b/DET - Detection/DET-002 - Detection only Visible Units/DET-002 - Detection only Visible Units.miz index b6ea845470..ef4395630e 100644 Binary files a/DET - Detection/DET-002 - Detection only Visible Units/DET-002 - Detection only Visible Units.miz and b/DET - Detection/DET-002 - Detection only Visible Units/DET-002 - Detection only Visible Units.miz differ diff --git a/DET - Detection/DET-100 - Detection Probability Distance/DET-100 - Detection Probability Distance.lua b/DET - Detection/DET-100 - Detection Probability Distance/DET-100 - Detection Probability Distance.lua index 7fcc33cc62..3a02c7349c 100644 --- a/DET - Detection/DET-100 - Detection Probability Distance/DET-100 - Detection Probability Distance.lua +++ b/DET - Detection/DET-100 - Detection Probability Distance/DET-100 - Detection Probability Distance.lua @@ -1,56 +1,56 @@ ---- --- Name: DET-100 - Detection Probability Distance --- Author: FlightControl --- Date Created: 04 Feb 2017 --- --- # Situation: --- --- Demonstrates the DistanceProbability factor during the detection of units. --- --- Two JTAC are detecting 4 units, which are 10 km away. --- The first JTAC has no DistanceProbability set. --- The second JTAC has a DistanceProbability set. --- --- # Test cases: --- --- 1. Observe the reporting of both the first and second JTAC. The second should report slower the detection than the first. --- 2. Eventually all units should be detected by both JTAC. - -RecceSetGroup1 = SET_GROUP:New():FilterPrefixes( "Recce 1" ):FilterStart() -RecceSetGroup2 = SET_GROUP:New():FilterPrefixes( "Recce 2" ):FilterStart() - -HQ = GROUP:FindByName( "HQ" ) - -CC = COMMANDCENTER:New( HQ, "HQ" ) - -RecceDetection1 = DETECTION_UNITS:New( RecceSetGroup1 ) - -RecceDetection2 = DETECTION_UNITS:New( RecceSetGroup2 ) -RecceDetection2:SetDistanceProbability( 0.2 ) -- Set a 20% probability that a vehicle can be detected at 4km distance. - -RecceDetection1:Start() -RecceDetection2:Start() - ---- OnAfter Transition Handler for Event Detect. --- @param Functional.Detection#DETECTION_UNITS self --- @param #string From The From State string. --- @param #string Event The Event string. --- @param #string To The To State string. -function RecceDetection1:OnAfterDetect(From,Event,To) - - local DetectionReport = RecceDetection1:DetectedReportDetailed() - - HQ:MessageToAll( DetectionReport, 15, "Detection 1 - No distance Probability" ) -end - ---- OnAfter Transition Handler for Event Detect. --- @param Functional.Detection#DETECTION_UNITS self --- @param #string From The From State string. --- @param #string Event The Event string. --- @param #string To The To State string. -function RecceDetection2:OnAfterDetect(From,Event,To) - - local DetectionReport = RecceDetection2:DetectedReportDetailed() - - HQ:MessageToAll( DetectionReport, 15, "Detection 2 - Distance Probability" ) -end +--- +-- Name: DET-100 - Detection Probability Distance +-- Author: FlightControl +-- Date Created: 04 Feb 2017 +-- +-- # Situation: +-- +-- Demonstrates the DistanceProbability factor during the detection of units. +-- +-- Two JTAC are detecting 4 units, which are 10 km away. +-- The first JTAC has no DistanceProbability set. +-- The second JTAC has a DistanceProbability set. +-- +-- # Test cases: +-- +-- 1. Observe the reporting of both the first and second JTAC. The second should report slower the detection than the first. +-- 2. Eventually all units should be detected by both JTAC. + +RecceSetGroup1 = SET_GROUP:New():FilterPrefixes( "Recce 1" ):FilterStart() +RecceSetGroup2 = SET_GROUP:New():FilterPrefixes( "Recce 2" ):FilterStart() + +HQ = GROUP:FindByName( "HQ" ) + +CC = COMMANDCENTER:New( HQ, "HQ" ) + +RecceDetection1 = DETECTION_UNITS:New( RecceSetGroup1 ) + +RecceDetection2 = DETECTION_UNITS:New( RecceSetGroup2 ) +RecceDetection2:SetDistanceProbability( 0.2 ) -- Set a 20% probability that a vehicle can be detected at 4km distance. + +RecceDetection1:Start() +RecceDetection2:Start() + +--- OnAfter Transition Handler for Event Detect. +-- @param Functional.Detection#DETECTION_UNITS self +-- @param #string From The From State string. +-- @param #string Event The Event string. +-- @param #string To The To State string. +function RecceDetection1:OnAfterDetect(From,Event,To) + + local DetectionReport = RecceDetection1:DetectedReportDetailed() + + HQ:MessageToAll( DetectionReport, 15, "Detection 1 - No distance Probability" ) +end + +--- OnAfter Transition Handler for Event Detect. +-- @param Functional.Detection#DETECTION_UNITS self +-- @param #string From The From State string. +-- @param #string Event The Event string. +-- @param #string To The To State string. +function RecceDetection2:OnAfterDetect(From,Event,To) + + local DetectionReport = RecceDetection2:DetectedReportDetailed() + + HQ:MessageToAll( DetectionReport, 15, "Detection 2 - Distance Probability" ) +end diff --git a/DET - Detection/DET-100 - Detection Probability Distance/DET-100 - Detection Probability Distance.miz b/DET - Detection/DET-100 - Detection Probability Distance/DET-100 - Detection Probability Distance.miz index 32eeb0c918..4d4ea75261 100644 Binary files a/DET - Detection/DET-100 - Detection Probability Distance/DET-100 - Detection Probability Distance.miz and b/DET - Detection/DET-100 - Detection Probability Distance/DET-100 - Detection Probability Distance.miz differ diff --git a/DET - Detection/DET-101 - Detection Reporting/DET-101 - Detection Reporting.lua b/DET - Detection/DET-101 - Detection Reporting/DET-101 - Detection Reporting.lua index a09bef36dd..061c468740 100644 --- a/DET - Detection/DET-101 - Detection Reporting/DET-101 - Detection Reporting.lua +++ b/DET - Detection/DET-101 - Detection Reporting/DET-101 - Detection Reporting.lua @@ -1,9 +1,9 @@ - - -FACSetGroup = SET_GROUP:New():FilterPrefixes( "FAC Group" ):FilterStart() - -FACDetection = DETECTION_AREAS:New( FACSetGroup, 1000, 250 ) -SeadClientSet = SET_CLIENT:New():FilterCoalitions( "blue" ):FilterStart() -DestroyClientSet = SET_CLIENT:New():FilterCoalitions( "blue" ):FilterStart() - -FACReporting = FAC_REPORTING:New( FACClientSet, FACDetection ) + + +FACSetGroup = SET_GROUP:New():FilterPrefixes( "FAC Group" ):FilterStart() + +FACDetection = DETECTION_AREAS:New( FACSetGroup, 1000, 250 ) +SeadClientSet = SET_CLIENT:New():FilterCoalitions( "blue" ):FilterStart() +DestroyClientSet = SET_CLIENT:New():FilterCoalitions( "blue" ):FilterStart() + +FACReporting = FAC_REPORTING:New( FACClientSet, FACDetection ) diff --git a/DET - Detection/DET-101 - Detection Reporting/DET-101 - Detection Reporting.miz b/DET - Detection/DET-101 - Detection Reporting/DET-101 - Detection Reporting.miz index a1a11c9ca5..b2bdbce64d 100644 Binary files a/DET - Detection/DET-101 - Detection Reporting/DET-101 - Detection Reporting.miz and b/DET - Detection/DET-101 - Detection Reporting/DET-101 - Detection Reporting.miz differ diff --git a/DET - Detection/DET-120 - Detection Probability Zones/DET-120 - Detection Probability Zones.lua b/DET - Detection/DET-120 - Detection Probability Zones/DET-120 - Detection Probability Zones.lua index 6659d2c08c..c381743a31 100644 --- a/DET - Detection/DET-120 - Detection Probability Zones/DET-120 - Detection Probability Zones.lua +++ b/DET - Detection/DET-120 - Detection Probability Zones/DET-120 - Detection Probability Zones.lua @@ -1,62 +1,62 @@ ---- --- Name: DET-120 - Detection Probability Zones --- Author: FlightControl --- Date Created: 04 Feb 2017 --- --- # Situation: --- --- Demonstrates the DistanceProbability factor during the detection of units. --- --- Two JTAC are detecting 4 units, which are 10 km away. --- The first JTAC has no DistanceProbability set. --- The second JTAC has a DistanceProbability set. --- --- # Test cases: --- --- 1. Observe the reporting of both the first and second JTAC. The second should report slower the detection than the first. --- 2. Eventually all units should be detected by both JTAC. - -RecceSetGroup1 = SET_GROUP:New():FilterPrefixes( "Recce 1" ):FilterStart() -RecceSetGroup2 = SET_GROUP:New():FilterPrefixes( "Recce 2" ):FilterStart() - -HQ = GROUP:FindByName( "HQ" ) - -CC = COMMANDCENTER:New( HQ, "HQ" ) - -RecceDetection1 = DETECTION_UNITS:New( RecceSetGroup1 ) - -RecceDetection2 = DETECTION_UNITS:New( RecceSetGroup2 ) - -ForestZone = ZONE_POLYGON:New( "ForestZone", GROUP:FindByName( "ForestZone" ) ) - -RecceDetection2:SetZoneProbability( { { ForestZone, 0.1 } } ) -- Set a 10% probability that a vehicle can be detected within the forest. - - -RecceDetection1:Start() -RecceDetection2:Start() - ---- OnAfter Transition Handler for Event Detect. --- @param Functional.Detection#DETECTION_UNITS self --- @param #string From The From State string. --- @param #string Event The Event string. --- @param #string To The To State string. -function RecceDetection1:OnAfterDetect(From,Event,To) - - local DetectionReport = self:DetectedReportDetailed() - - HQ:MessageToAll( DetectionReport, 15, "Detection 1 - No Zone Probability" ) -end - ---- OnAfter Transition Handler for Event Detect. --- @param Functional.Detection#DETECTION_UNITS self --- @param #string From The From State string. --- @param #string Event The Event string. --- @param #string To The To State string. -function RecceDetection2:OnAfterDetect(From,Event,To) - - local DetectionReport = self:DetectedReportDetailed() - - HQ:MessageToAll( DetectionReport, 15, "Detection 2 - Forest Zone Probability" ) -end - -garbagecollect() +--- +-- Name: DET-120 - Detection Probability Zones +-- Author: FlightControl +-- Date Created: 04 Feb 2017 +-- +-- # Situation: +-- +-- Demonstrates the DistanceProbability factor during the detection of units. +-- +-- Two JTAC are detecting 4 units, which are 10 km away. +-- The first JTAC has no DistanceProbability set. +-- The second JTAC has a DistanceProbability set. +-- +-- # Test cases: +-- +-- 1. Observe the reporting of both the first and second JTAC. The second should report slower the detection than the first. +-- 2. Eventually all units should be detected by both JTAC. + +RecceSetGroup1 = SET_GROUP:New():FilterPrefixes( "Recce 1" ):FilterStart() +RecceSetGroup2 = SET_GROUP:New():FilterPrefixes( "Recce 2" ):FilterStart() + +HQ = GROUP:FindByName( "HQ" ) + +CC = COMMANDCENTER:New( HQ, "HQ" ) + +RecceDetection1 = DETECTION_UNITS:New( RecceSetGroup1 ) + +RecceDetection2 = DETECTION_UNITS:New( RecceSetGroup2 ) + +ForestZone = ZONE_POLYGON:New( "ForestZone", GROUP:FindByName( "ForestZone" ) ) + +RecceDetection2:SetZoneProbability( { { ForestZone, 0.1 } } ) -- Set a 10% probability that a vehicle can be detected within the forest. + + +RecceDetection1:Start() +RecceDetection2:Start() + +--- OnAfter Transition Handler for Event Detect. +-- @param Functional.Detection#DETECTION_UNITS self +-- @param #string From The From State string. +-- @param #string Event The Event string. +-- @param #string To The To State string. +function RecceDetection1:OnAfterDetect(From,Event,To) + + local DetectionReport = self:DetectedReportDetailed() + + HQ:MessageToAll( DetectionReport, 15, "Detection 1 - No Zone Probability" ) +end + +--- OnAfter Transition Handler for Event Detect. +-- @param Functional.Detection#DETECTION_UNITS self +-- @param #string From The From State string. +-- @param #string Event The Event string. +-- @param #string To The To State string. +function RecceDetection2:OnAfterDetect(From,Event,To) + + local DetectionReport = self:DetectedReportDetailed() + + HQ:MessageToAll( DetectionReport, 15, "Detection 2 - Forest Zone Probability" ) +end + +garbagecollect() diff --git a/DET - Detection/DET-120 - Detection Probability Zones/DET-120 - Detection Probability Zones.miz b/DET - Detection/DET-120 - Detection Probability Zones/DET-120 - Detection Probability Zones.miz index 5c9e5c6072..d11d565aa4 100644 Binary files a/DET - Detection/DET-120 - Detection Probability Zones/DET-120 - Detection Probability Zones.miz and b/DET - Detection/DET-120 - Detection Probability Zones/DET-120 - Detection Probability Zones.miz differ diff --git a/DET - Detection/DET-200 - Detection UNITS/DET-200 - Detection UNITS.lua b/DET - Detection/DET-200 - Detection UNITS/DET-200 - Detection UNITS.lua index 00fd71b742..1a5cb6af12 100644 --- a/DET - Detection/DET-200 - Detection UNITS/DET-200 - Detection UNITS.lua +++ b/DET - Detection/DET-200 - Detection UNITS/DET-200 - Detection UNITS.lua @@ -1,42 +1,42 @@ ---- --- Name: DET-200 - Detection UNITS --- Author: FlightControl --- Date Created: 13 Feb 2017 --- --- # Situation: --- --- Demonstrates the detection of units. --- --- A Set of Recce are detecting a large group of units, which are 5 km away. --- Select one of the blue Recce, and press F7. Watch the reporting of the detection evolve. --- The enemy is approaching. --- --- # Test cases: --- --- 1. Observe the detection reporting of both the Recce. --- 2. Eventually all units should be detected by both Recce. - -RecceSetGroup = SET_GROUP:New():FilterPrefixes( "Recce" ):FilterStart() - -HQ = GROUP:FindByName( "HQ" ) - -CC = COMMANDCENTER:New( HQ, "HQ" ) - -RecceDetection = DETECTION_UNITS:New( RecceSetGroup ) - -RecceDetection:Start() - ---- OnAfter Transition Handler for Event Detect. --- @param Functional.Detection#DETECTION_UNITS self --- @param #string From The From State string. --- @param #string Event The Event string. --- @param #string To The To State string. -function RecceDetection:OnAfterDetect(From,Event,To) - - self:E("Detect") - - local DetectionReport = RecceDetection:DetectedReportDetailed() - - CC:MessageToAll( DetectionReport, 15, "" ) -end - +--- +-- Name: DET-200 - Detection UNITS +-- Author: FlightControl +-- Date Created: 13 Feb 2017 +-- +-- # Situation: +-- +-- Demonstrates the detection of units. +-- +-- A Set of Recce are detecting a large group of units, which are 5 km away. +-- Select one of the blue Recce, and press F7. Watch the reporting of the detection evolve. +-- The enemy is approaching. +-- +-- # Test cases: +-- +-- 1. Observe the detection reporting of both the Recce. +-- 2. Eventually all units should be detected by both Recce. + +RecceSetGroup = SET_GROUP:New():FilterPrefixes( "Recce" ):FilterStart() + +HQ = GROUP:FindByName( "HQ" ) + +CC = COMMANDCENTER:New( HQ, "HQ" ) + +RecceDetection = DETECTION_UNITS:New( RecceSetGroup ) + +RecceDetection:Start() + +--- OnAfter Transition Handler for Event Detect. +-- @param Functional.Detection#DETECTION_UNITS self +-- @param #string From The From State string. +-- @param #string Event The Event string. +-- @param #string To The To State string. +function RecceDetection:OnAfterDetect(From,Event,To) + + self:E("Detect") + + local DetectionReport = RecceDetection:DetectedReportDetailed() + + CC:MessageToAll( DetectionReport, 15, "" ) +end + diff --git a/DET - Detection/DET-200 - Detection UNITS/DET-200 - Detection UNITS.miz b/DET - Detection/DET-200 - Detection UNITS/DET-200 - Detection UNITS.miz index 42ac364583..ac27103ba9 100644 Binary files a/DET - Detection/DET-200 - Detection UNITS/DET-200 - Detection UNITS.miz and b/DET - Detection/DET-200 - Detection UNITS/DET-200 - Detection UNITS.miz differ diff --git a/DET - Detection/DET-201 - Detection UNITS - Air/DET-201 - Detection UNITS - Air.lua b/DET - Detection/DET-201 - Detection UNITS - Air/DET-201 - Detection UNITS - Air.lua index 6f4bee12a7..0b92220ad2 100644 --- a/DET - Detection/DET-201 - Detection UNITS - Air/DET-201 - Detection UNITS - Air.lua +++ b/DET - Detection/DET-201 - Detection UNITS - Air/DET-201 - Detection UNITS - Air.lua @@ -1,43 +1,43 @@ ---- --- Name: DET-201 - Detection UNITS - Air --- Author: FlightControl --- Date Created: 03 May 2017 --- --- # Situation: --- --- Demonstrates the detection of units. --- --- A Set of Recce are detecting a approaching airplanes. --- Select one of the blue Recce, and press F7. Watch the reporting of the detection evolve. --- The enemy is approaching. --- --- # Test cases: --- --- 1. Observe the detection reporting of both the Recce. --- 2. Eventually all units should be detected by both Recce. - -RecceSetGroup = SET_GROUP:New():FilterPrefixes( "Recce" ):FilterStart() - -HQ = GROUP:FindByName( "HQ" ) - -CC = COMMANDCENTER:New( HQ, "HQ" ) - -RecceDetection = DETECTION_UNITS:New( RecceSetGroup ) -RecceDetection:InitDetectRadar(true) - -RecceDetection:Start() - ---- OnAfter Transition Handler for Event Detect. --- @param Functional.Detection#DETECTION_UNITS self --- @param #string From The From State string. --- @param #string Event The Event string. --- @param #string To The To State string. -function RecceDetection:OnAfterDetect(From,Event,To) - - self:E("Detect") - - local DetectionReport = RecceDetection:DetectedReportDetailed() - - CC:MessageToAll( DetectionReport, 15, "" ) -end - +--- +-- Name: DET-201 - Detection UNITS - Air +-- Author: FlightControl +-- Date Created: 03 May 2017 +-- +-- # Situation: +-- +-- Demonstrates the detection of units. +-- +-- A Set of Recce are detecting a approaching airplanes. +-- Select one of the blue Recce, and press F7. Watch the reporting of the detection evolve. +-- The enemy is approaching. +-- +-- # Test cases: +-- +-- 1. Observe the detection reporting of both the Recce. +-- 2. Eventually all units should be detected by both Recce. + +RecceSetGroup = SET_GROUP:New():FilterPrefixes( "Recce" ):FilterStart() + +HQ = GROUP:FindByName( "HQ" ) + +CC = COMMANDCENTER:New( HQ, "HQ" ) + +RecceDetection = DETECTION_UNITS:New( RecceSetGroup ) +RecceDetection:InitDetectRadar(true) + +RecceDetection:Start() + +--- OnAfter Transition Handler for Event Detect. +-- @param Functional.Detection#DETECTION_UNITS self +-- @param #string From The From State string. +-- @param #string Event The Event string. +-- @param #string To The To State string. +function RecceDetection:OnAfterDetect(From,Event,To) + + self:E("Detect") + + local DetectionReport = RecceDetection:DetectedReportDetailed() + + CC:MessageToAll( DetectionReport, 15, "" ) +end + diff --git a/DET - Detection/DET-201 - Detection UNITS - Air/DET-201 - Detection UNITS - Air.miz b/DET - Detection/DET-201 - Detection UNITS - Air/DET-201 - Detection UNITS - Air.miz index 9109fd0db1..f69dcb8d6a 100644 Binary files a/DET - Detection/DET-201 - Detection UNITS - Air/DET-201 - Detection UNITS - Air.miz and b/DET - Detection/DET-201 - Detection UNITS - Air/DET-201 - Detection UNITS - Air.miz differ diff --git a/DET - Detection/DET-210 - Detection TYPES/DET-210 - Detection TYPES.lua b/DET - Detection/DET-210 - Detection TYPES/DET-210 - Detection TYPES.lua index e39217d203..09aad74c36 100644 --- a/DET - Detection/DET-210 - Detection TYPES/DET-210 - Detection TYPES.lua +++ b/DET - Detection/DET-210 - Detection TYPES/DET-210 - Detection TYPES.lua @@ -1,42 +1,42 @@ ---- --- Name: DET-210 - Detection TYPES --- Author: FlightControl --- Date Created: 13 Feb 2017 --- --- # Situation: --- --- Demonstrates the detection of units. --- --- A Set of Recce are detecting a large group of units, which are 5 km away. --- Select one of the blue Recce, and press F7. Watch the reporting of the detection evolve. --- The enemy is approaching. --- --- The blue Recce will report the detected units grouped per vehicle type! --- --- # Test cases: --- --- 1. Observe the detection reporting of both the Recce. --- 2. Eventually all units should be detected by both Recce. - -RecceSetGroup = SET_GROUP:New():FilterPrefixes( "Recce" ):FilterStart() - -HQ = GROUP:FindByName( "HQ" ) - -CC = COMMANDCENTER:New( HQ, "HQ" ) - -RecceDetection = DETECTION_TYPES:New( RecceSetGroup ) - -RecceDetection:Start() - ---- OnAfter Transition Handler for Event Detect. --- @param Functional.Detection#DETECTION_UNITS self --- @param #string From The From State string. --- @param #string Event The Event string. --- @param #string To The To State string. -function RecceDetection:OnAfterDetect(From,Event,To) - - local DetectionReport = RecceDetection:DetectedReportDetailed() - - CC:MessageToAll( DetectionReport, 15, "" ) -end - +--- +-- Name: DET-210 - Detection TYPES +-- Author: FlightControl +-- Date Created: 13 Feb 2017 +-- +-- # Situation: +-- +-- Demonstrates the detection of units. +-- +-- A Set of Recce are detecting a large group of units, which are 5 km away. +-- Select one of the blue Recce, and press F7. Watch the reporting of the detection evolve. +-- The enemy is approaching. +-- +-- The blue Recce will report the detected units grouped per vehicle type! +-- +-- # Test cases: +-- +-- 1. Observe the detection reporting of both the Recce. +-- 2. Eventually all units should be detected by both Recce. + +RecceSetGroup = SET_GROUP:New():FilterPrefixes( "Recce" ):FilterStart() + +HQ = GROUP:FindByName( "HQ" ) + +CC = COMMANDCENTER:New( HQ, "HQ" ) + +RecceDetection = DETECTION_TYPES:New( RecceSetGroup ) + +RecceDetection:Start() + +--- OnAfter Transition Handler for Event Detect. +-- @param Functional.Detection#DETECTION_UNITS self +-- @param #string From The From State string. +-- @param #string Event The Event string. +-- @param #string To The To State string. +function RecceDetection:OnAfterDetect(From,Event,To) + + local DetectionReport = RecceDetection:DetectedReportDetailed() + + CC:MessageToAll( DetectionReport, 15, "" ) +end + diff --git a/DET - Detection/DET-210 - Detection TYPES/DET-210 - Detection TYPES.miz b/DET - Detection/DET-210 - Detection TYPES/DET-210 - Detection TYPES.miz index 0c0517ebf5..626b4207d4 100644 Binary files a/DET - Detection/DET-210 - Detection TYPES/DET-210 - Detection TYPES.miz and b/DET - Detection/DET-210 - Detection TYPES/DET-210 - Detection TYPES.miz differ diff --git a/DET - Detection/DET-250 - Detection AREAS/DET-250 - Detection AREAS.lua b/DET - Detection/DET-250 - Detection AREAS/DET-250 - Detection AREAS.lua index 34cf755e65..4de0f48654 100644 --- a/DET - Detection/DET-250 - Detection AREAS/DET-250 - Detection AREAS.lua +++ b/DET - Detection/DET-250 - Detection AREAS/DET-250 - Detection AREAS.lua @@ -1,58 +1,58 @@ ---- --- Name: DET-100 - Detection Probability Distance --- Author: FlightControl --- Date Created: 04 Feb 2017 --- --- # Situation: --- --- Demonstrates the DistanceProbability factor during the detection of units. --- --- Two JTAC are detecting 4 units, which are 10 km away. --- The first JTAC has no DistanceProbability set. --- The second JTAC has a DistanceProbability set. --- --- # Test cases: --- --- 1. Observe the reporting of both the first and second JTAC. The second should report slower the detection than the first. --- 2. Eventually all units should be detected by both JTAC. - -RecceSetGroup1 = SET_GROUP:New():FilterPrefixes( "Recce 1" ):FilterStart() -RecceSetGroup2 = SET_GROUP:New():FilterPrefixes( "Recce 2" ):FilterStart() - -HQ = GROUP:FindByName( "HQ" ) - -CC = COMMANDCENTER:New( HQ, "HQ" ) - -RecceDetection1 = DETECTION_AREAS:New( RecceSetGroup1, 1000 ) -RecceDetection1:BoundDetectedZones() - -RecceDetection2 = DETECTION_AREAS:New( RecceSetGroup2, 1000 ) -RecceDetection2:SetDistanceProbability( 0.2 ) -- Set a 20% probability that a vehicle can be detected at 4km distance. -RecceDetection1:BoundDetectedZones() - -RecceDetection1:Start() -RecceDetection2:Start() - ---- OnAfter Transition Handler for Event Detect. --- @param Functional.Detection#DETECTION_UNITS self --- @param #string From The From State string. --- @param #string Event The Event string. --- @param #string To The To State string. -function RecceDetection1:OnAfterDetect(From,Event,To) - - local DetectionReport = RecceDetection1:DetectedReportDetailed() - - HQ:MessageToAll( DetectionReport, 15, "Detection 1 - No distance Probability" ) -end - ---- OnAfter Transition Handler for Event Detect. --- @param Functional.Detection#DETECTION_UNITS self --- @param #string From The From State string. --- @param #string Event The Event string. --- @param #string To The To State string. -function RecceDetection2:OnAfterDetect(From,Event,To) - - local DetectionReport = RecceDetection2:DetectedReportDetailed() - - HQ:MessageToAll( DetectionReport, 15, "Detection 2 - Distance Probability" ) +--- +-- Name: DET-100 - Detection Probability Distance +-- Author: FlightControl +-- Date Created: 04 Feb 2017 +-- +-- # Situation: +-- +-- Demonstrates the DistanceProbability factor during the detection of units. +-- +-- Two JTAC are detecting 4 units, which are 10 km away. +-- The first JTAC has no DistanceProbability set. +-- The second JTAC has a DistanceProbability set. +-- +-- # Test cases: +-- +-- 1. Observe the reporting of both the first and second JTAC. The second should report slower the detection than the first. +-- 2. Eventually all units should be detected by both JTAC. + +RecceSetGroup1 = SET_GROUP:New():FilterPrefixes( "Recce 1" ):FilterStart() +RecceSetGroup2 = SET_GROUP:New():FilterPrefixes( "Recce 2" ):FilterStart() + +HQ = GROUP:FindByName( "HQ" ) + +CC = COMMANDCENTER:New( HQ, "HQ" ) + +RecceDetection1 = DETECTION_AREAS:New( RecceSetGroup1, 1000 ) +RecceDetection1:BoundDetectedZones() + +RecceDetection2 = DETECTION_AREAS:New( RecceSetGroup2, 1000 ) +RecceDetection2:SetDistanceProbability( 0.2 ) -- Set a 20% probability that a vehicle can be detected at 4km distance. +RecceDetection1:BoundDetectedZones() + +RecceDetection1:Start() +RecceDetection2:Start() + +--- OnAfter Transition Handler for Event Detect. +-- @param Functional.Detection#DETECTION_UNITS self +-- @param #string From The From State string. +-- @param #string Event The Event string. +-- @param #string To The To State string. +function RecceDetection1:OnAfterDetect(From,Event,To) + + local DetectionReport = RecceDetection1:DetectedReportDetailed() + + HQ:MessageToAll( DetectionReport, 15, "Detection 1 - No distance Probability" ) +end + +--- OnAfter Transition Handler for Event Detect. +-- @param Functional.Detection#DETECTION_UNITS self +-- @param #string From The From State string. +-- @param #string Event The Event string. +-- @param #string To The To State string. +function RecceDetection2:OnAfterDetect(From,Event,To) + + local DetectionReport = RecceDetection2:DetectedReportDetailed() + + HQ:MessageToAll( DetectionReport, 15, "Detection 2 - Distance Probability" ) end \ No newline at end of file diff --git a/DET - Detection/DET-250 - Detection AREAS/DET-250 - Detection AREAS.miz b/DET - Detection/DET-250 - Detection AREAS/DET-250 - Detection AREAS.miz index 860a38c346..be4ffc00c6 100644 Binary files a/DET - Detection/DET-250 - Detection AREAS/DET-250 - Detection AREAS.miz and b/DET - Detection/DET-250 - Detection AREAS/DET-250 - Detection AREAS.miz differ diff --git a/DET - Detection/DET-255 - Detection AEAS with Destroys/DET-255 - Detection AEAS with Destroys.lua b/DET - Detection/DET-255 - Detection AEAS with Destroys/DET-255 - Detection AEAS with Destroys.lua index cbba0418f0..40dfeae9bd 100644 --- a/DET - Detection/DET-255 - Detection AEAS with Destroys/DET-255 - Detection AEAS with Destroys.lua +++ b/DET - Detection/DET-255 - Detection AEAS with Destroys/DET-255 - Detection AEAS with Destroys.lua @@ -1,46 +1,46 @@ ---- --- Name: DET-255 - Detection AEAS with Destroys --- Author: FlightControl --- Date Created: 06 Mar 2017 --- --- # Situation: --- --- A small blue vehicle with laser detection methods is detecting targets. --- Targets are grouped within areas. A detection range and zone range is given to group the detected units. --- This demo will group red vehicles in areas. One vehicle is diving from one group to the other. --- After 30 seconds, one vehicle is destroyed in a zone. --- After 60 seconds, a vehicle is destroyed that is a leader of a zone. --- After 90 seconds, all vehicles are destroyed in a zone. --- --- # Test cases: --- --- 1. Observe the flaring of the areas formed --- 2. Observe the smoking of the units detected --- 3. Observe the areas being flexibly changed very detection run. --- 4. The truck driving from the one group to the other, will leave the first area, and will join the second. --- 5. While driving in between the areas, it will have a separate area. --- 6. Observe the correct removal or relocation of the ZONEs. - -FACSetGroup = SET_GROUP:New():FilterPrefixes( "FAC Group" ):FilterStart() - -FACDetection = DETECTION_AREAS:New( FACSetGroup, 150, 250 ):BoundDetectedZones():SmokeDetectedUnits() - -FACDetection:__Start( 5 ) - -SCHEDULER:New( nil,function() - local Target = UNIT:FindByName( "Target #004") - Target:Destroy() - end, {}, 30 - ) - -SCHEDULER:New( nil,function() - local Target = UNIT:FindByName( "Target #006") - Target:Destroy() - end, {}, 60 - ) - -SCHEDULER:New( nil,function() - local Target = UNIT:FindByName( "Target #007") - Target:Destroy() - end, {}, 90 +--- +-- Name: DET-255 - Detection AEAS with Destroys +-- Author: FlightControl +-- Date Created: 06 Mar 2017 +-- +-- # Situation: +-- +-- A small blue vehicle with laser detection methods is detecting targets. +-- Targets are grouped within areas. A detection range and zone range is given to group the detected units. +-- This demo will group red vehicles in areas. One vehicle is diving from one group to the other. +-- After 30 seconds, one vehicle is destroyed in a zone. +-- After 60 seconds, a vehicle is destroyed that is a leader of a zone. +-- After 90 seconds, all vehicles are destroyed in a zone. +-- +-- # Test cases: +-- +-- 1. Observe the flaring of the areas formed +-- 2. Observe the smoking of the units detected +-- 3. Observe the areas being flexibly changed very detection run. +-- 4. The truck driving from the one group to the other, will leave the first area, and will join the second. +-- 5. While driving in between the areas, it will have a separate area. +-- 6. Observe the correct removal or relocation of the ZONEs. + +FACSetGroup = SET_GROUP:New():FilterPrefixes( "FAC Group" ):FilterStart() + +FACDetection = DETECTION_AREAS:New( FACSetGroup, 150, 250 ):BoundDetectedZones():SmokeDetectedUnits() + +FACDetection:__Start( 5 ) + +SCHEDULER:New( nil,function() + local Target = UNIT:FindByName( "Target #004") + Target:Destroy() + end, {}, 30 + ) + +SCHEDULER:New( nil,function() + local Target = UNIT:FindByName( "Target #006") + Target:Destroy() + end, {}, 60 + ) + +SCHEDULER:New( nil,function() + local Target = UNIT:FindByName( "Target #007") + Target:Destroy() + end, {}, 90 ) \ No newline at end of file diff --git a/DET - Detection/DET-255 - Detection AEAS with Destroys/DET-255 - Detection AEAS with Destroys.miz b/DET - Detection/DET-255 - Detection AEAS with Destroys/DET-255 - Detection AEAS with Destroys.miz index 4541f80656..dedc43d9e7 100644 Binary files a/DET - Detection/DET-255 - Detection AEAS with Destroys/DET-255 - Detection AEAS with Destroys.miz and b/DET - Detection/DET-255 - Detection AEAS with Destroys/DET-255 - Detection AEAS with Destroys.miz differ diff --git a/DET - Detection/DET-300 - Dectection Filter AIRPLANE/DET-300 - Dectection Filter AIRPLANE.lua b/DET - Detection/DET-300 - Dectection Filter AIRPLANE/DET-300 - Dectection Filter AIRPLANE.lua index a543336ba7..1e86545384 100644 --- a/DET - Detection/DET-300 - Dectection Filter AIRPLANE/DET-300 - Dectection Filter AIRPLANE.lua +++ b/DET - Detection/DET-300 - Dectection Filter AIRPLANE/DET-300 - Dectection Filter AIRPLANE.lua @@ -1,36 +1,36 @@ ---- --- Name: DET-300 - Dectection Filter AIRPLANE --- Author: FlightControl --- Date Created: 12 Apr 2017 --- --- # Situation: --- --- Demonstrates the filtering of detections. --- --- # Test cases: --- --- 1. Observe the reporting only detecting the airplane, not the other units. - -SetGroup = SET_GROUP:New():FilterPrefixes( "Recce" ):FilterStart() - -HQ = GROUP:FindByName( "HQ" ) - -CC = COMMANDCENTER:New( HQ, "HQ" ) - -RecceDetection = DETECTION_UNITS:New( SetGroup ):FilterCategories( Unit.Category.AIRPLANE ) - -RecceDetection:Start() - ---- OnAfter Transition Handler for Event Detect. --- @param Functional.Detection#DETECTION_UNITS self --- @param #string From The From State string. --- @param #string Event The Event string. --- @param #string To The To State string. -function RecceDetection:OnAfterDetect(From,Event,To) - - local DetectionReport = self:DetectedReportDetailed() - - HQ:MessageToAll( DetectionReport, 15, "Detection" ) -end - -garbagecollect() +--- +-- Name: DET-300 - Dectection Filter AIRPLANE +-- Author: FlightControl +-- Date Created: 12 Apr 2017 +-- +-- # Situation: +-- +-- Demonstrates the filtering of detections. +-- +-- # Test cases: +-- +-- 1. Observe the reporting only detecting the airplane, not the other units. + +SetGroup = SET_GROUP:New():FilterPrefixes( "Recce" ):FilterStart() + +HQ = GROUP:FindByName( "HQ" ) + +CC = COMMANDCENTER:New( HQ, "HQ" ) + +RecceDetection = DETECTION_UNITS:New( SetGroup ):FilterCategories( Unit.Category.AIRPLANE ) + +RecceDetection:Start() + +--- OnAfter Transition Handler for Event Detect. +-- @param Functional.Detection#DETECTION_UNITS self +-- @param #string From The From State string. +-- @param #string Event The Event string. +-- @param #string To The To State string. +function RecceDetection:OnAfterDetect(From,Event,To) + + local DetectionReport = self:DetectedReportDetailed() + + HQ:MessageToAll( DetectionReport, 15, "Detection" ) +end + +garbagecollect() diff --git a/DET - Detection/DET-300 - Dectection Filter AIRPLANE/DET-300 - Dectection Filter AIRPLANE.miz b/DET - Detection/DET-300 - Dectection Filter AIRPLANE/DET-300 - Dectection Filter AIRPLANE.miz index 6889bdc49e..c90c27c45c 100644 Binary files a/DET - Detection/DET-300 - Dectection Filter AIRPLANE/DET-300 - Dectection Filter AIRPLANE.miz and b/DET - Detection/DET-300 - Dectection Filter AIRPLANE/DET-300 - Dectection Filter AIRPLANE.miz differ diff --git a/DET - Detection/DET-301 - Dectection Filter GROUND_UNIT/DET-301 - Dectection Filter GROUND_UNIT.lua b/DET - Detection/DET-301 - Dectection Filter GROUND_UNIT/DET-301 - Dectection Filter GROUND_UNIT.lua index 2471addbb5..7b6f7e69ae 100644 --- a/DET - Detection/DET-301 - Dectection Filter GROUND_UNIT/DET-301 - Dectection Filter GROUND_UNIT.lua +++ b/DET - Detection/DET-301 - Dectection Filter GROUND_UNIT/DET-301 - Dectection Filter GROUND_UNIT.lua @@ -1,36 +1,36 @@ ---- --- Name: DET-301 - Dectection Filter GROUND_UNIT --- Author: FlightControl --- Date Created: 12 Apr 2017 --- --- # Situation: --- --- Demonstrates the filtering of detections. --- --- # Test cases: --- --- 1. Observe the reporting only detecting the ground unit, not the other units. - -SetGroup = SET_GROUP:New():FilterPrefixes( "Recce" ):FilterStart() - -HQ = GROUP:FindByName( "HQ" ) - -CC = COMMANDCENTER:New( HQ, "HQ" ) - -RecceDetection = DETECTION_UNITS:New( SetGroup ):FilterCategories( Unit.Category.GROUND_UNIT ) - -RecceDetection:Start() - ---- OnAfter Transition Handler for Event Detect. --- @param Functional.Detection#DETECTION_UNITS self --- @param #string From The From State string. --- @param #string Event The Event string. --- @param #string To The To State string. -function RecceDetection:OnAfterDetect(From,Event,To) - - local DetectionReport = self:DetectedReportDetailed() - - HQ:MessageToAll( DetectionReport, 15, "Detection" ) -end - -garbagecollect() +--- +-- Name: DET-301 - Dectection Filter GROUND_UNIT +-- Author: FlightControl +-- Date Created: 12 Apr 2017 +-- +-- # Situation: +-- +-- Demonstrates the filtering of detections. +-- +-- # Test cases: +-- +-- 1. Observe the reporting only detecting the ground unit, not the other units. + +SetGroup = SET_GROUP:New():FilterPrefixes( "Recce" ):FilterStart() + +HQ = GROUP:FindByName( "HQ" ) + +CC = COMMANDCENTER:New( HQ, "HQ" ) + +RecceDetection = DETECTION_UNITS:New( SetGroup ):FilterCategories( Unit.Category.GROUND_UNIT ) + +RecceDetection:Start() + +--- OnAfter Transition Handler for Event Detect. +-- @param Functional.Detection#DETECTION_UNITS self +-- @param #string From The From State string. +-- @param #string Event The Event string. +-- @param #string To The To State string. +function RecceDetection:OnAfterDetect(From,Event,To) + + local DetectionReport = self:DetectedReportDetailed() + + HQ:MessageToAll( DetectionReport, 15, "Detection" ) +end + +garbagecollect() diff --git a/DET - Detection/DET-301 - Dectection Filter GROUND_UNIT/DET-301 - Dectection Filter GROUND_UNIT.miz b/DET - Detection/DET-301 - Dectection Filter GROUND_UNIT/DET-301 - Dectection Filter GROUND_UNIT.miz index 41668812d6..29a3553223 100644 Binary files a/DET - Detection/DET-301 - Dectection Filter GROUND_UNIT/DET-301 - Dectection Filter GROUND_UNIT.miz and b/DET - Detection/DET-301 - Dectection Filter GROUND_UNIT/DET-301 - Dectection Filter GROUND_UNIT.miz differ diff --git a/DET - Detection/DET-302 - Dectection Filter HELICOPTER/DET-302 - Dectection Filter HELICOPTER.lua b/DET - Detection/DET-302 - Dectection Filter HELICOPTER/DET-302 - Dectection Filter HELICOPTER.lua index 4150c5e647..0de9a38cf1 100644 --- a/DET - Detection/DET-302 - Dectection Filter HELICOPTER/DET-302 - Dectection Filter HELICOPTER.lua +++ b/DET - Detection/DET-302 - Dectection Filter HELICOPTER/DET-302 - Dectection Filter HELICOPTER.lua @@ -1,36 +1,36 @@ ---- --- Name: DET-302 - Dectection Filter HELICOPTER --- Author: FlightControl --- Date Created: 12 Apr 2017 --- --- # Situation: --- --- Demonstrates the filtering of detections. --- --- # Test cases: --- --- 1. Observe the reporting only detecting the helicopter, not the other units. - -SetGroup = SET_GROUP:New():FilterPrefixes( "Recce" ):FilterStart() - -HQ = GROUP:FindByName( "HQ" ) - -CC = COMMANDCENTER:New( HQ, "HQ" ) - -RecceDetection = DETECTION_UNITS:New( SetGroup ):FilterCategories( Unit.Category.HELICOPTER ) - -RecceDetection:Start() - ---- OnAfter Transition Handler for Event Detect. --- @param Functional.Detection#DETECTION_UNITS self --- @param #string From The From State string. --- @param #string Event The Event string. --- @param #string To The To State string. -function RecceDetection:OnAfterDetect(From,Event,To) - - local DetectionReport = self:DetectedReportDetailed() - - HQ:MessageToAll( DetectionReport, 15, "Detection" ) -end - -garbagecollect() +--- +-- Name: DET-302 - Dectection Filter HELICOPTER +-- Author: FlightControl +-- Date Created: 12 Apr 2017 +-- +-- # Situation: +-- +-- Demonstrates the filtering of detections. +-- +-- # Test cases: +-- +-- 1. Observe the reporting only detecting the helicopter, not the other units. + +SetGroup = SET_GROUP:New():FilterPrefixes( "Recce" ):FilterStart() + +HQ = GROUP:FindByName( "HQ" ) + +CC = COMMANDCENTER:New( HQ, "HQ" ) + +RecceDetection = DETECTION_UNITS:New( SetGroup ):FilterCategories( Unit.Category.HELICOPTER ) + +RecceDetection:Start() + +--- OnAfter Transition Handler for Event Detect. +-- @param Functional.Detection#DETECTION_UNITS self +-- @param #string From The From State string. +-- @param #string Event The Event string. +-- @param #string To The To State string. +function RecceDetection:OnAfterDetect(From,Event,To) + + local DetectionReport = self:DetectedReportDetailed() + + HQ:MessageToAll( DetectionReport, 15, "Detection" ) +end + +garbagecollect() diff --git a/DET - Detection/DET-302 - Dectection Filter HELICOPTER/DET-302 - Dectection Filter HELICOPTER.miz b/DET - Detection/DET-302 - Dectection Filter HELICOPTER/DET-302 - Dectection Filter HELICOPTER.miz index 6f36382e7e..1ff7aa041e 100644 Binary files a/DET - Detection/DET-302 - Dectection Filter HELICOPTER/DET-302 - Dectection Filter HELICOPTER.miz and b/DET - Detection/DET-302 - Dectection Filter HELICOPTER/DET-302 - Dectection Filter HELICOPTER.miz differ diff --git a/DET - Detection/DET-303 - Dectection Filter SHIP/DET-303 - Dectection Filter SHIP.lua b/DET - Detection/DET-303 - Dectection Filter SHIP/DET-303 - Dectection Filter SHIP.lua index 71b8ae7d0e..6a25a2978f 100644 --- a/DET - Detection/DET-303 - Dectection Filter SHIP/DET-303 - Dectection Filter SHIP.lua +++ b/DET - Detection/DET-303 - Dectection Filter SHIP/DET-303 - Dectection Filter SHIP.lua @@ -1,36 +1,36 @@ ---- --- Name: DET-303 - Dectection Filter SHIP --- Author: FlightControl --- Date Created: 12 Apr 2017 --- --- # Situation: --- --- Demonstrates the filtering of detections. --- --- # Test cases: --- --- 1. Observe the reporting only detecting the ship, not the other units. - -SetGroup = SET_GROUP:New():FilterPrefixes( "Recce" ):FilterStart() - -HQ = GROUP:FindByName( "HQ" ) - -CC = COMMANDCENTER:New( HQ, "HQ" ) - -RecceDetection = DETECTION_UNITS:New( SetGroup ):FilterCategories( Unit.Category.SHIP ) - -RecceDetection:Start() - ---- OnAfter Transition Handler for Event Detect. --- @param Functional.Detection#DETECTION_UNITS self --- @param #string From The From State string. --- @param #string Event The Event string. --- @param #string To The To State string. -function RecceDetection:OnAfterDetect(From,Event,To) - - local DetectionReport = self:DetectedReportDetailed() - - HQ:MessageToAll( DetectionReport, 15, "Detection" ) -end - -garbagecollect() +--- +-- Name: DET-303 - Dectection Filter SHIP +-- Author: FlightControl +-- Date Created: 12 Apr 2017 +-- +-- # Situation: +-- +-- Demonstrates the filtering of detections. +-- +-- # Test cases: +-- +-- 1. Observe the reporting only detecting the ship, not the other units. + +SetGroup = SET_GROUP:New():FilterPrefixes( "Recce" ):FilterStart() + +HQ = GROUP:FindByName( "HQ" ) + +CC = COMMANDCENTER:New( HQ, "HQ" ) + +RecceDetection = DETECTION_UNITS:New( SetGroup ):FilterCategories( Unit.Category.SHIP ) + +RecceDetection:Start() + +--- OnAfter Transition Handler for Event Detect. +-- @param Functional.Detection#DETECTION_UNITS self +-- @param #string From The From State string. +-- @param #string Event The Event string. +-- @param #string To The To State string. +function RecceDetection:OnAfterDetect(From,Event,To) + + local DetectionReport = self:DetectedReportDetailed() + + HQ:MessageToAll( DetectionReport, 15, "Detection" ) +end + +garbagecollect() diff --git a/DET - Detection/DET-303 - Dectection Filter SHIP/DET-303 - Dectection Filter SHIP.miz b/DET - Detection/DET-303 - Dectection Filter SHIP/DET-303 - Dectection Filter SHIP.miz index 5cc80bfb5c..ea1ef0b15a 100644 Binary files a/DET - Detection/DET-303 - Dectection Filter SHIP/DET-303 - Dectection Filter SHIP.miz and b/DET - Detection/DET-303 - Dectection Filter SHIP/DET-303 - Dectection Filter SHIP.miz differ diff --git a/DET - Detection/DET-304 - Dectection Filter STRUCTURE/DET-304 - Dectection Filter STRUCTURE.lua b/DET - Detection/DET-304 - Dectection Filter STRUCTURE/DET-304 - Dectection Filter STRUCTURE.lua index 8abd8bf5cf..32204b34da 100644 --- a/DET - Detection/DET-304 - Dectection Filter STRUCTURE/DET-304 - Dectection Filter STRUCTURE.lua +++ b/DET - Detection/DET-304 - Dectection Filter STRUCTURE/DET-304 - Dectection Filter STRUCTURE.lua @@ -1,36 +1,36 @@ ---- --- Name: DET-304 - Dectection Filter STRUCTURE --- Author: FlightControl --- Date Created: 12 Apr 2017 --- --- # Situation: --- --- Demonstrates the filtering of detections. --- --- # Test cases: --- --- 1. Observe the reporting only detecting the structure, not the other units. - -SetGroup = SET_GROUP:New():FilterPrefixes( "Recce" ):FilterStart() - -HQ = GROUP:FindByName( "HQ" ) - -CC = COMMANDCENTER:New( HQ, "HQ" ) - -RecceDetection = DETECTION_UNITS:New( SetGroup ):FilterCategories( Unit.Category.STRUCTURE ) - -RecceDetection:Start() - ---- OnAfter Transition Handler for Event Detect. --- @param Functional.Detection#DETECTION_UNITS self --- @param #string From The From State string. --- @param #string Event The Event string. --- @param #string To The To State string. -function RecceDetection:OnAfterDetect(From,Event,To) - - local DetectionReport = self:DetectedReportDetailed() - - HQ:MessageToAll( DetectionReport, 15, "Detection" ) -end - -collectgarbage() +--- +-- Name: DET-304 - Dectection Filter STRUCTURE +-- Author: FlightControl +-- Date Created: 12 Apr 2017 +-- +-- # Situation: +-- +-- Demonstrates the filtering of detections. +-- +-- # Test cases: +-- +-- 1. Observe the reporting only detecting the structure, not the other units. + +SetGroup = SET_GROUP:New():FilterPrefixes( "Recce" ):FilterStart() + +HQ = GROUP:FindByName( "HQ" ) + +CC = COMMANDCENTER:New( HQ, "HQ" ) + +RecceDetection = DETECTION_UNITS:New( SetGroup ):FilterCategories( Unit.Category.STRUCTURE ) + +RecceDetection:Start() + +--- OnAfter Transition Handler for Event Detect. +-- @param Functional.Detection#DETECTION_UNITS self +-- @param #string From The From State string. +-- @param #string Event The Event string. +-- @param #string To The To State string. +function RecceDetection:OnAfterDetect(From,Event,To) + + local DetectionReport = self:DetectedReportDetailed() + + HQ:MessageToAll( DetectionReport, 15, "Detection" ) +end + +collectgarbage() diff --git a/DET - Detection/DET-304 - Dectection Filter STRUCTURE/DET-304 - Dectection Filter STRUCTURE.miz b/DET - Detection/DET-304 - Dectection Filter STRUCTURE/DET-304 - Dectection Filter STRUCTURE.miz index e86f68c242..2e68566acb 100644 Binary files a/DET - Detection/DET-304 - Dectection Filter STRUCTURE/DET-304 - Dectection Filter STRUCTURE.miz and b/DET - Detection/DET-304 - Dectection Filter STRUCTURE/DET-304 - Dectection Filter STRUCTURE.miz differ diff --git a/DET - Detection/DET-305 - Dectection Filter ALL/DET-305 - Dectection Filter ALL.lua b/DET - Detection/DET-305 - Dectection Filter ALL/DET-305 - Dectection Filter ALL.lua index 039db9d696..654dc29ccd 100644 --- a/DET - Detection/DET-305 - Dectection Filter ALL/DET-305 - Dectection Filter ALL.lua +++ b/DET - Detection/DET-305 - Dectection Filter ALL/DET-305 - Dectection Filter ALL.lua @@ -1,44 +1,44 @@ ---- --- Name: DET-305 - Dectection Filter ALL --- Author: FlightControl --- Date Created: 12 Apr 2017 --- --- # Situation: --- --- Demonstrates the filtering of detections. --- --- # Test cases: --- --- 1. Observe the reporting detecting all the units regardless of the type. - -SetGroup = SET_GROUP:New():FilterPrefixes( "Recce" ):FilterStart() - -HQ = GROUP:FindByName( "HQ" ) - -CC = COMMANDCENTER:New( HQ, "HQ" ) - -RecceDetection = DETECTION_UNITS - :New( SetGroup ) - :FilterCategories( { - Unit.Category.AIRPLANE, - Unit.Category.GROUND_UNIT, - Unit.Category.HELICOPTER, - Unit.Category.SHIP, - Unit.Category.STRUCTURE - } ) - -RecceDetection:Start() - ---- OnAfter Transition Handler for Event Detect. --- @param Functional.Detection#DETECTION_UNITS self --- @param #string From The From State string. --- @param #string Event The Event string. --- @param #string To The To State string. -function RecceDetection:OnAfterDetect(From,Event,To) - - local DetectionReport = self:DetectedReportDetailed() - - HQ:MessageToAll( DetectionReport, 15, "Detection" ) -end - -garbagecollect() +--- +-- Name: DET-305 - Dectection Filter ALL +-- Author: FlightControl +-- Date Created: 12 Apr 2017 +-- +-- # Situation: +-- +-- Demonstrates the filtering of detections. +-- +-- # Test cases: +-- +-- 1. Observe the reporting detecting all the units regardless of the type. + +SetGroup = SET_GROUP:New():FilterPrefixes( "Recce" ):FilterStart() + +HQ = GROUP:FindByName( "HQ" ) + +CC = COMMANDCENTER:New( HQ, "HQ" ) + +RecceDetection = DETECTION_UNITS + :New( SetGroup ) + :FilterCategories( { + Unit.Category.AIRPLANE, + Unit.Category.GROUND_UNIT, + Unit.Category.HELICOPTER, + Unit.Category.SHIP, + Unit.Category.STRUCTURE + } ) + +RecceDetection:Start() + +--- OnAfter Transition Handler for Event Detect. +-- @param Functional.Detection#DETECTION_UNITS self +-- @param #string From The From State string. +-- @param #string Event The Event string. +-- @param #string To The To State string. +function RecceDetection:OnAfterDetect(From,Event,To) + + local DetectionReport = self:DetectedReportDetailed() + + HQ:MessageToAll( DetectionReport, 15, "Detection" ) +end + +garbagecollect() diff --git a/DET - Detection/DET-305 - Dectection Filter ALL/DET-305 - Dectection Filter ALL.miz b/DET - Detection/DET-305 - Dectection Filter ALL/DET-305 - Dectection Filter ALL.miz index b506d6da98..fb7f202b8f 100644 Binary files a/DET - Detection/DET-305 - Dectection Filter ALL/DET-305 - Dectection Filter ALL.miz and b/DET - Detection/DET-305 - Dectection Filter ALL/DET-305 - Dectection Filter ALL.miz differ diff --git a/DET - Detection/DET-310 - EWR - Line Of Sight/DET-310 - EWR - Line Of Sight.lua b/DET - Detection/DET-310 - EWR - Line Of Sight/DET-310 - EWR - Line Of Sight.lua index 0d6bacfba0..38bafc67d0 100644 --- a/DET - Detection/DET-310 - EWR - Line Of Sight/DET-310 - EWR - Line Of Sight.lua +++ b/DET - Detection/DET-310 - EWR - Line Of Sight/DET-310 - EWR - Line Of Sight.lua @@ -1,35 +1,40 @@ ---- --- Name: DET-310 - EWR - Line Of Sight --- Author: FlightControl --- Date Created: 12 Sep 2018 --- --- # Situation: --- --- Demonstrates the lost of line of sight using an airplane. - -SetGroup = SET_GROUP:New():FilterPrefixes( "Recce" ):FilterStart() - -HQ = GROUP:FindByName( "HQ" ) - -CC = COMMANDCENTER:New( HQ, "HQ" ) - -RecceDetection = DETECTION_UNITS - :New( SetGroup ) - :FilterCategories( { Unit.Category.AIRPLANE } ) - :InitDetectRWR(true) - -RecceDetection:Start() - ---- OnAfter Transition Handler for Event Detect. --- @param Functional.Detection#DETECTION_UNITS self --- @param #string From The From State string. --- @param #string Event The Event string. --- @param #string To The To State string. -function RecceDetection:OnAfterDetect(From,Event,To) - - local DetectionReport = self:DetectedReportDetailed() - - HQ:MessageToAll( DetectionReport, 15, "Detection" ) -end - -garbagecollect() +--- +-- Name: DET-310 - EWR - Line Of Sight +-- Author: FlightControl +-- Date Created: 12 Sep 2018 +-- +-- # Situation: +-- +-- Demonstrates the lost of line of sight using an airplane. + +SetGroup = SET_GROUP:New():FilterPrefixes( "Recce" ):FilterStart() + +HQ = GROUP:FindByName( "HQ" ) + +CC = COMMANDCENTER:New( HQ, "HQ" ) + +RecceDetection = DETECTION_UNITS + :New( SetGroup ) + :FilterCategories( { + Unit.Category.AIRPLANE, + Unit.Category.GROUND_UNIT, + Unit.Category.HELICOPTER, + Unit.Category.SHIP, + Unit.Category.STRUCTURE + } ) + +RecceDetection:Start() + +--- OnAfter Transition Handler for Event Detect. +-- @param Functional.Detection#DETECTION_UNITS self +-- @param #string From The From State string. +-- @param #string Event The Event string. +-- @param #string To The To State string. +function RecceDetection:OnAfterDetect(From,Event,To) + + local DetectionReport = self:DetectedReportDetailed() + + HQ:MessageToAll( DetectionReport, 15, "Detection" ) +end + +garbagecollect() diff --git a/DET - Detection/DET-310 - EWR - Line Of Sight/DET-310 - EWR - Line Of Sight.miz b/DET - Detection/DET-310 - EWR - Line Of Sight/DET-310 - EWR - Line Of Sight.miz index 0637508907..38368feccb 100644 Binary files a/DET - Detection/DET-310 - EWR - Line Of Sight/DET-310 - EWR - Line Of Sight.miz and b/DET - Detection/DET-310 - EWR - Line Of Sight/DET-310 - EWR - Line Of Sight.miz differ diff --git a/DET - Detection/DET-320 - EWR - Line Of Sight/DET-320 - EWR - Line Of Sight.lua b/DET - Detection/DET-320 - EWR - Line Of Sight/DET-320 - EWR - Line Of Sight.lua index 9b1b2df832..4e8d422e9f 100644 --- a/DET - Detection/DET-320 - EWR - Line Of Sight/DET-320 - EWR - Line Of Sight.lua +++ b/DET - Detection/DET-320 - EWR - Line Of Sight/DET-320 - EWR - Line Of Sight.lua @@ -1,57 +1,57 @@ ---- --- Name: DET-310 - EWR - Line Of Sight --- Author: FlightControl --- Date Created: 12 Sep 2018 --- --- # Situation: --- --- Demonstrates the lost of line of sight using an airplane. - -SetGroup = SET_GROUP:New():FilterPrefixes( "Recce" ):FilterStart() - -HQ = GROUP:FindByName( "HQ" ) - -CC = COMMANDCENTER:New( HQ, "HQ" ) - -RecceDetection = DETECTION_AREAS - :New( SetGroup, 1500 ) - :FilterCategories( { Unit.Category.AIRPLANE } ) - :InitDetectRWR(true) - -local Zones = { - ZONE:New( "Zone1" ), - ZONE:New( "Zone2" ) -} - -local Sams = { - GROUP:FindByName( "SAM1" ), - GROUP:FindByName( "SAM2" ) -} - -RecceDetection:Start() - ---- OnAfter Transition Handler for Event DetectedItem. --- @param RecceDetection self --- @param #string From The From State string. --- @param #string Event The Event string. --- @param #string To The To State string. --- @param Functional.Detection#DETECTION_BASE.DetectedItem DetectedItem -function RecceDetection:OnAfterDetectedItem(From,Event,To,DetectedItem) - - local DetectionReport = self:DetectedReportDetailed() - - HQ:MessageToAll( DetectionReport, 15, "Detection" ) - - if DetectedItem.IsDetected then - local Coordinate = DetectedItem.Coordinate -- Core.Point#COORDINATE - for ZoneID, ZoneData in pairs( Zones ) do - local Zone = ZoneData -- Core.Zone#ZONE - if Zone:IsCoordinateInZone(Coordinate) then - Sams[ZoneID]:Activate() - end - end - end - -end - -garbagecollect() +--- +-- Name: DET-310 - EWR - Line Of Sight +-- Author: FlightControl +-- Date Created: 12 Sep 2018 +-- +-- # Situation: +-- +-- Demonstrates the lost of line of sight using an airplane. + +SetGroup = SET_GROUP:New():FilterPrefixes( "Recce" ):FilterStart() + +HQ = GROUP:FindByName( "HQ" ) + +CC = COMMANDCENTER:New( HQ, "HQ" ) + +RecceDetection = DETECTION_AREAS + :New( SetGroup, 1500 ) + :FilterCategories( { Unit.Category.AIRPLANE } ) + :InitDetectRWR(true) + +local Zones = { + ZONE:New( "Zone1" ), + ZONE:New( "Zone2" ) +} + +local Sams = { + GROUP:FindByName( "SAM1" ), + GROUP:FindByName( "SAM2" ) +} + +RecceDetection:Start() + +--- OnAfter Transition Handler for Event DetectedItem. +-- @param RecceDetection self +-- @param #string From The From State string. +-- @param #string Event The Event string. +-- @param #string To The To State string. +-- @param Functional.Detection#DETECTION_BASE.DetectedItem DetectedItem +function RecceDetection:OnAfterDetectedItem(From,Event,To,DetectedItem) + + local DetectionReport = self:DetectedReportDetailed() + + HQ:MessageToAll( DetectionReport, 15, "Detection" ) + + if DetectedItem.IsDetected then + local Coordinate = DetectedItem.Coordinate -- Core.Point#COORDINATE + for ZoneID, ZoneData in pairs( Zones ) do + local Zone = ZoneData -- Core.Zone#ZONE + if Zone:IsCoordinateInZone(Coordinate) then + Sams[ZoneID]:Activate() + end + end + end + +end + +garbagecollect() diff --git a/DET - Detection/DET-320 - EWR - Line Of Sight/DET-320 - EWR - Line Of Sight.miz b/DET - Detection/DET-320 - EWR - Line Of Sight/DET-320 - EWR - Line Of Sight.miz index d77bf756f9..1025fe0088 100644 Binary files a/DET - Detection/DET-320 - EWR - Line Of Sight/DET-320 - EWR - Line Of Sight.miz and b/DET - Detection/DET-320 - EWR - Line Of Sight/DET-320 - EWR - Line Of Sight.miz differ diff --git a/DET - Detection/DET-400 - A2A - Detection methods/DET-400 - A2A - Detection methods.lua b/DET - Detection/DET-400 - A2A - Detection methods/DET-400 - A2A - Detection methods.lua index 21ce09f25e..b3264fdf8c 100644 --- a/DET - Detection/DET-400 - A2A - Detection methods/DET-400 - A2A - Detection methods.lua +++ b/DET - Detection/DET-400 - A2A - Detection methods/DET-400 - A2A - Detection methods.lua @@ -1,49 +1,49 @@ ---- --- Name: DET-310 - EWR - Line Of Sight --- Author: FlightControl --- Date Created: 12 Sep 2018 --- --- # Situation: --- --- Demonstrates the lost of line of sight using an airplane. - -SetGroup = SET_GROUP:New():FilterPrefixes( "Recce" ):FilterStart() - -HQ = GROUP:FindByName( "HQ" ) - -CC = COMMANDCENTER:New( HQ, "HQ" ) - -RecceDetection = DETECTION_AREAS - :New( SetGroup, 1500 ) - :FilterCategories( { Unit.Category.AIRPLANE } ) - --:InitDetectVisual( true ) - :InitDetectIRST( true ) - :InitDetectRadar( true ) - :InitDetectRWR( true ) - :InitDetectOptical( true ) - -RecceDetection:Start() - -_SETTINGS:SetA2A_BRAA() -_SETTINGS:SetA2G_BR() - ---- OnAfter Transition Handler for Event DetectedItem. --- @param Functional.Detection#DETECTION_AREAS RecceDetection self --- @param #string From The From State string. --- @param #string Event The Event string. --- @param #string To The To State string. --- @param Functional.Detection#DETECTION_BASE.DetectedItem DetectedItem -function RecceDetection:OnAfterDetectedItem(From,Event,To,DetectedItem) - - local DetectionReport = self:DetectedReportDetailed( SetGroup:GetFirst() ) - - HQ:MessageToAll( DetectionReport, 15, "Detection" ) - - if DetectedItem.IsDetected then - local Coordinate = DetectedItem.Coordinate -- Core.Point#COORDINATE - HQ:MessageToAll( "Detected", 15, "Detection" ) - end - -end - -garbagecollect() +--- +-- Name: DET-310 - EWR - Line Of Sight +-- Author: FlightControl +-- Date Created: 12 Sep 2018 +-- +-- # Situation: +-- +-- Demonstrates the lost of line of sight using an airplane. + +SetGroup = SET_GROUP:New():FilterPrefixes( "Recce" ):FilterStart() + +HQ = GROUP:FindByName( "HQ" ) + +CC = COMMANDCENTER:New( HQ, "HQ" ) + +RecceDetection = DETECTION_AREAS + :New( SetGroup, 1500 ) + :FilterCategories( { Unit.Category.AIRPLANE } ) + --:InitDetectVisual( true ) + :InitDetectIRST( true ) + :InitDetectRadar( true ) + :InitDetectRWR( true ) + :InitDetectOptical( true ) + +RecceDetection:Start() + +_SETTINGS:SetA2A_BRAA() +_SETTINGS:SetA2G_BR() + +--- OnAfter Transition Handler for Event DetectedItem. +-- @param Functional.Detection#DETECTION_AREAS RecceDetection self +-- @param #string From The From State string. +-- @param #string Event The Event string. +-- @param #string To The To State string. +-- @param Functional.Detection#DETECTION_BASE.DetectedItem DetectedItem +function RecceDetection:OnAfterDetectedItem(From,Event,To,DetectedItem) + + local DetectionReport = self:DetectedReportDetailed( SetGroup:GetFirst() ) + + HQ:MessageToAll( DetectionReport, 15, "Detection" ) + + if DetectedItem.IsDetected then + local Coordinate = DetectedItem.Coordinate -- Core.Point#COORDINATE + HQ:MessageToAll( "Detected", 15, "Detection" ) + end + +end + +garbagecollect() diff --git a/DET - Detection/DET-400 - A2A - Detection methods/DET-400 - A2A - Detection methods.miz b/DET - Detection/DET-400 - A2A - Detection methods/DET-400 - A2A - Detection methods.miz index 8048c9055e..3b16f8df72 100644 Binary files a/DET - Detection/DET-400 - A2A - Detection methods/DET-400 - A2A - Detection methods.miz and b/DET - Detection/DET-400 - A2A - Detection methods/DET-400 - A2A - Detection methods.miz differ diff --git a/DET - Detection/DET-500 - Handle Detected Event - Govern Artillery Demo/DET-500 - Handle Detected Event - Govern Artillery Demo.lua b/DET - Detection/DET-500 - Handle Detected Event - Govern Artillery Demo/DET-500 - Handle Detected Event - Govern Artillery Demo.lua index 6890351a4d..9d35056ce5 100644 --- a/DET - Detection/DET-500 - Handle Detected Event - Govern Artillery Demo/DET-500 - Handle Detected Event - Govern Artillery Demo.lua +++ b/DET - Detection/DET-500 - Handle Detected Event - Govern Artillery Demo/DET-500 - Handle Detected Event - Govern Artillery Demo.lua @@ -1,70 +1,70 @@ ---- --- Name: DET-500 - Handle Detected Event - Govern Artillery Demo --- Author: FlightControl --- Date Created: 13 Feb 2017 --- --- # Situation: --- --- Demonstrates the detection of units. --- --- A Set of Recces are detecting a large group of units, which are 5 km away. --- Once the Recces detect the enemy, the artilley units are controlled and will fire a missile to the target. --- --- # Test cases: --- --- 1. Observe the detected reporting of the recces. --- 2. When one Recce group detects a target, it will select an artillery unit and fire a missile. --- 3. This will run until all Recces have eliminated the targets. - -RecceSetGroup = SET_GROUP:New():FilterCoalitions( "blue" ):FilterPrefixes( "Recce" ):FilterStart() -ArtillerySetGroup = SET_GROUP:New():FilterCoalitions( "blue" ):FilterPrefixes( "Artillery" ):FilterStart() - -HQ = GROUP:FindByName( "HQ" ) - -CC = COMMANDCENTER:New( HQ, "HQ" ) - -RecceDetection = DETECTION_UNITS:New( RecceSetGroup ) -RecceDetection:SetRefreshTimeInterval( 5 ) - -RecceDetection:Start() - ---- OnAfter Transition Handler for Event Detect. --- @param Functional.Detection#DETECTION_UNITS self --- @param #string From The From State string. --- @param #string Event The Event string. --- @param #string To The To State string. -function RecceDetection:OnAfterDetect(From,Event,To) - - local DetectionReport = RecceDetection:DetectedReportDetailed() - - CC:GetPositionable():MessageToAll( DetectionReport, 15, "" ) -end - -local ArtilleryTime = {} -local ArtilleryAim = 180 - ---- OnAfter Transition Handler for Event Detect. --- @param Functional.Detection#DETECTION_UNITS self --- @param #string From The From State string. --- @param #string Event The Event string. --- @param #string To The To State string. --- @param Wrapper.Unit#UNIT DetectedUnits -function RecceDetection:OnAfterDetected( From, Event, To, DetectedUnits ) - self:E( { From, Event, To, DetectedUnits } ) - - for DetectedUnitID, DetectedUnit in pairs( DetectedUnits ) do - local DetectedUnit = DetectedUnit -- Wrapper.Unit#UNIT - local Artillery = ArtillerySetGroup:GetRandom() -- Wrapper.Group#GROUP - - if ArtilleryTime[Artillery] and ArtilleryTime[Artillery] <= timer.getTime() - ArtilleryAim then - ArtilleryTime[Artillery] = nil - end - - if not ArtilleryTime[Artillery] then - local Task = Artillery:TaskFireAtPoint( DetectedUnit:GetVec2(), 500, 4 ) -- Fire 2 rockets to the target point. - Artillery:SetTask( Task, 0.5 ) - ArtilleryTime[Artillery] = timer.getTime() - end - - end +--- +-- Name: DET-500 - Handle Detected Event - Govern Artillery Demo +-- Author: FlightControl +-- Date Created: 13 Feb 2017 +-- +-- # Situation: +-- +-- Demonstrates the detection of units. +-- +-- A Set of Recces are detecting a large group of units, which are 5 km away. +-- Once the Recces detect the enemy, the artilley units are controlled and will fire a missile to the target. +-- +-- # Test cases: +-- +-- 1. Observe the detected reporting of the recces. +-- 2. When one Recce group detects a target, it will select an artillery unit and fire a missile. +-- 3. This will run until all Recces have eliminated the targets. + +RecceSetGroup = SET_GROUP:New():FilterCoalitions( "blue" ):FilterPrefixes( "Recce" ):FilterStart() +ArtillerySetGroup = SET_GROUP:New():FilterCoalitions( "blue" ):FilterPrefixes( "Artillery" ):FilterStart() + +HQ = GROUP:FindByName( "HQ" ) + +CC = COMMANDCENTER:New( HQ, "HQ" ) + +RecceDetection = DETECTION_UNITS:New( RecceSetGroup ) +RecceDetection:SetRefreshTimeInterval( 5 ) + +RecceDetection:Start() + +--- OnAfter Transition Handler for Event Detect. +-- @param Functional.Detection#DETECTION_UNITS self +-- @param #string From The From State string. +-- @param #string Event The Event string. +-- @param #string To The To State string. +function RecceDetection:OnAfterDetect(From,Event,To) + + local DetectionReport = RecceDetection:DetectedReportDetailed() + + CC:GetPositionable():MessageToAll( DetectionReport, 15, "" ) +end + +local ArtilleryTime = {} +local ArtilleryAim = 180 + +--- OnAfter Transition Handler for Event Detect. +-- @param Functional.Detection#DETECTION_UNITS self +-- @param #string From The From State string. +-- @param #string Event The Event string. +-- @param #string To The To State string. +-- @param Wrapper.Unit#UNIT DetectedUnits +function RecceDetection:OnAfterDetected( From, Event, To, DetectedUnits ) + self:E( { From, Event, To, DetectedUnits } ) + + for DetectedUnitID, DetectedUnit in pairs( DetectedUnits ) do + local DetectedUnit = DetectedUnit -- Wrapper.Unit#UNIT + local Artillery = ArtillerySetGroup:GetRandom() -- Wrapper.Group#GROUP + + if ArtilleryTime[Artillery] and ArtilleryTime[Artillery] <= timer.getTime() - ArtilleryAim then + ArtilleryTime[Artillery] = nil + end + + if not ArtilleryTime[Artillery] then + local Task = Artillery:TaskFireAtPoint( DetectedUnit:GetVec2(), 500, 4 ) -- Fire 2 rockets to the target point. + Artillery:SetTask( Task, 0.5 ) + ArtilleryTime[Artillery] = timer.getTime() + end + + end end \ No newline at end of file diff --git a/DET - Detection/DET-500 - Handle Detected Event - Govern Artillery Demo/DET-500 - Handle Detected Event - Govern Artillery Demo.miz b/DET - Detection/DET-500 - Handle Detected Event - Govern Artillery Demo/DET-500 - Handle Detected Event - Govern Artillery Demo.miz index dfb376baff..ad10ec3554 100644 Binary files a/DET - Detection/DET-500 - Handle Detected Event - Govern Artillery Demo/DET-500 - Handle Detected Event - Govern Artillery Demo.miz and b/DET - Detection/DET-500 - Handle Detected Event - Govern Artillery Demo/DET-500 - Handle Detected Event - Govern Artillery Demo.miz differ diff --git a/DET - Detection/DET-600 - Detection Zones/DET-600 - Detection Zones.lua b/DET - Detection/DET-600 - Detection Zones/DET-600 - Detection Zones.lua index b4edf657ad..5b056e0397 100644 --- a/DET - Detection/DET-600 - Detection Zones/DET-600 - Detection Zones.lua +++ b/DET - Detection/DET-600 - Detection Zones/DET-600 - Detection Zones.lua @@ -1,16 +1,16 @@ ---- --- Name: DET-600 - Detection Zones --- Author: FlightControl --- Date Created: 15 Mar 2019 --- --- # Situation: --- --- 2 trigger zones are defined using the mission editor. --- The detection algorithm will detect the units within the zones and report them. - - -DetectionSetZones = SET_ZONE:New():FilterPrefixes( { "Detection Zone" } ):FilterOnce() - -DetectionZones = DETECTION_ZONES:New( DetectionSetZones, coalition.side.RED ):BoundDetectedZones():SmokeDetectedUnits() - +--- +-- Name: DET-600 - Detection Zones +-- Author: FlightControl +-- Date Created: 15 Mar 2019 +-- +-- # Situation: +-- +-- 2 trigger zones are defined using the mission editor. +-- The detection algorithm will detect the units within the zones and report them. + + +DetectionSetZones = SET_ZONE:New():FilterPrefixes( { "Detection Zone" } ):FilterOnce() + +DetectionZones = DETECTION_ZONES:New( DetectionSetZones, coalition.side.RED ):BoundDetectedZones():SmokeDetectedUnits() + DetectionZones:__Start( 5 ) \ No newline at end of file diff --git a/DET - Detection/DET-600 - Detection Zones/DET-600 - Detection Zones.miz b/DET - Detection/DET-600 - Detection Zones/DET-600 - Detection Zones.miz index 45d2fad04c..9188a1b72e 100644 Binary files a/DET - Detection/DET-600 - Detection Zones/DET-600 - Detection Zones.miz and b/DET - Detection/DET-600 - Detection Zones/DET-600 - Detection Zones.miz differ diff --git a/DET - Detection/DET-601 - Detection Zones_Capture_Coalition/DET-601 - Detection Zones_Capture_Coalition.lua b/DET - Detection/DET-601 - Detection Zones_Capture_Coalition/DET-601 - Detection Zones_Capture_Coalition.lua index a52d811e36..e4c30453ef 100644 --- a/DET - Detection/DET-601 - Detection Zones_Capture_Coalition/DET-601 - Detection Zones_Capture_Coalition.lua +++ b/DET - Detection/DET-601 - Detection Zones_Capture_Coalition/DET-601 - Detection Zones_Capture_Coalition.lua @@ -1,18 +1,18 @@ ---- --- Name: DET-600 - Detection Zones --- Author: FlightControl --- Date Created: 15 Mar 2019 --- --- # Situation: --- --- 2 trigger zones are defined using the mission editor. --- The detection algorithm will detect the units within the zones and report them. - - -DetectionSetZones = SET_ZONE_GOAL:New():FilterPrefixes( { "Detection Zone" } ):FilterStart() - -DetectionZone1 = ZONE_CAPTURE_COALITION:New( ZONE:New( "Detection Zone 1" ), coalition.side.RED ) - -DetectionZones = DETECTION_ZONES:New( DetectionSetZones, coalition.side.RED ):BoundDetectedZones():SmokeDetectedUnits() - +--- +-- Name: DET-600 - Detection Zones +-- Author: FlightControl +-- Date Created: 15 Mar 2019 +-- +-- # Situation: +-- +-- 2 trigger zones are defined using the mission editor. +-- The detection algorithm will detect the units within the zones and report them. + + +DetectionSetZones = SET_ZONE_GOAL:New():FilterPrefixes( { "Detection Zone" } ):FilterStart() + +DetectionZone1 = ZONE_CAPTURE_COALITION:New( ZONE:New( "Detection Zone 1" ), coalition.side.RED ) + +DetectionZones = DETECTION_ZONES:New( DetectionSetZones, coalition.side.RED ):BoundDetectedZones():SmokeDetectedUnits() + DetectionZones:__Start( 5 ) \ No newline at end of file diff --git a/DET - Detection/DET-601 - Detection Zones_Capture_Coalition/DET-601 - Detection Zones_Capture_Coalition.miz b/DET - Detection/DET-601 - Detection Zones_Capture_Coalition/DET-601 - Detection Zones_Capture_Coalition.miz index 3cf28eb5fc..830c754b29 100644 Binary files a/DET - Detection/DET-601 - Detection Zones_Capture_Coalition/DET-601 - Detection Zones_Capture_Coalition.miz and b/DET - Detection/DET-601 - Detection Zones_Capture_Coalition/DET-601 - Detection Zones_Capture_Coalition.miz differ diff --git a/DET - Detection/DET-900 - Detection Test with RED FACA/DET-900 - Detection Test with RED FACA.lua b/DET - Detection/DET-900 - Detection Test with RED FACA/DET-900 - Detection Test with RED FACA.lua index cc2969de45..80fc1ba75d 100644 --- a/DET - Detection/DET-900 - Detection Test with RED FACA/DET-900 - Detection Test with RED FACA.lua +++ b/DET - Detection/DET-900 - Detection Test with RED FACA/DET-900 - Detection Test with RED FACA.lua @@ -1,25 +1,25 @@ ---- --- Name: DET-900 - Detection Test with RED FACA --- Author: FlightControl --- Date Created: 06 Mar 2017 --- --- # Situation: --- --- A red FACA is detecting targets while airborne. --- Targets are grouped within areas. A detection range and zone range is given to group the detected units. --- This demo will group blue vehicles in areas. --- Upon the detection capabilities of the red FACA, the blue vehicles will be grouped when detected. --- All blue vehicles have ROE on hold. --- --- # Test cases: --- --- 1. Observe the tyres put around the detected areas formed --- 2. Observe the smoking of the units detected --- 3. Observe the areas being flexibly changed very detection run. - -FACSetGroup = SET_GROUP:New():FilterPrefixes( "FAC" ):FilterStart() - -FACDetection = DETECTION_AREAS:New( FACSetGroup, 2000, 250 ):BoundDetectedZones():SmokeDetectedUnits() - - -FACDetection:__Start( 5 ) +--- +-- Name: DET-900 - Detection Test with RED FACA +-- Author: FlightControl +-- Date Created: 06 Mar 2017 +-- +-- # Situation: +-- +-- A red FACA is detecting targets while airborne. +-- Targets are grouped within areas. A detection range and zone range is given to group the detected units. +-- This demo will group blue vehicles in areas. +-- Upon the detection capabilities of the red FACA, the blue vehicles will be grouped when detected. +-- All blue vehicles have ROE on hold. +-- +-- # Test cases: +-- +-- 1. Observe the tyres put around the detected areas formed +-- 2. Observe the smoking of the units detected +-- 3. Observe the areas being flexibly changed very detection run. + +FACSetGroup = SET_GROUP:New():FilterPrefixes( "FAC" ):FilterStart() + +FACDetection = DETECTION_AREAS:New( FACSetGroup, 2000, 250 ):BoundDetectedZones():SmokeDetectedUnits() + + +FACDetection:__Start( 5 ) diff --git a/DET - Detection/DET-900 - Detection Test with RED FACA/DET-900 - Detection Test with RED FACA.miz b/DET - Detection/DET-900 - Detection Test with RED FACA/DET-900 - Detection Test with RED FACA.miz index de4dba182c..57f9bb95a4 100644 Binary files a/DET - Detection/DET-900 - Detection Test with RED FACA/DET-900 - Detection Test with RED FACA.miz and b/DET - Detection/DET-900 - Detection Test with RED FACA/DET-900 - Detection Test with RED FACA.miz differ diff --git a/ESC - AI Escort/ESC-001 - Escort A2G Test/ESC-001 - Escort A2G Test.lua b/ESC - AI Escort/ESC-001 - Escort A2G Test/ESC-001 - Escort A2G Test.lua index fc0f23292a..18ec7d6402 100644 --- a/ESC - AI Escort/ESC-001 - Escort A2G Test/ESC-001 - Escort A2G Test.lua +++ b/ESC - AI Escort/ESC-001 - Escort A2G Test/ESC-001 - Escort A2G Test.lua @@ -1,9 +1,9 @@ - -local FollowGroupSet = SET_GROUP:New():FilterCategories( { "plane", "ship" } ):FilterCoalitions( "red" ):FilterPrefixes( { "Escort", "Ship Defense" } ):FilterStart() - -local LeaderUnit = UNIT:FindByName( "Leader" ) -local Escort = AI_ESCORT:New( LeaderUnit, FollowGroupSet, "Escort Attack", "Briefing" ) -Escort:FormationTrail( 750, 750 , 0 ) -Escort:MenusAirplanes() -Escort:__Start( 1 ) - + +local FollowGroupSet = SET_GROUP:New():FilterCategories( { "plane", "ship" } ):FilterCoalitions( "red" ):FilterPrefixes( { "Escort", "Ship Defense" } ):FilterStart() + +local LeaderUnit = UNIT:FindByName( "Leader" ) +local Escort = AI_ESCORT:New( LeaderUnit, FollowGroupSet, "Escort Attack", "Briefing" ) +Escort:FormationTrail( 750, 750 , 0 ) +Escort:MenusAirplanes() +Escort:__Start( 1 ) + diff --git a/ESC - AI Escort/ESC-001 - Escort A2G Test/ESC-001 - Escort A2G Test.miz b/ESC - AI Escort/ESC-001 - Escort A2G Test/ESC-001 - Escort A2G Test.miz index e61610f8d2..ba2102362a 100644 Binary files a/ESC - AI Escort/ESC-001 - Escort A2G Test/ESC-001 - Escort A2G Test.miz and b/ESC - AI Escort/ESC-001 - Escort A2G Test/ESC-001 - Escort A2G Test.miz differ diff --git a/ESC - AI Escort/ESC-002 - Escort A2G Large Formation/ESC-002 - Escort A2G Large Formation.lua b/ESC - AI Escort/ESC-002 - Escort A2G Large Formation/ESC-002 - Escort A2G Large Formation.lua index 874867cb14..658d736e2d 100644 --- a/ESC - AI Escort/ESC-002 - Escort A2G Large Formation/ESC-002 - Escort A2G Large Formation.lua +++ b/ESC - AI Escort/ESC-002 - Escort A2G Large Formation/ESC-002 - Escort A2G Large Formation.lua @@ -1,8 +1,8 @@ -local FollowGroupSet = SET_GROUP:New():FilterCategories( { "plane", "ship" } ):FilterCoalitions( "red" ):FilterPrefixes( { "Escort", "Ship Defense" } ):FilterStart() - -local LeaderUnit = UNIT:FindByName( "Leader" ) -local Escort = AI_ESCORT:New( LeaderUnit, FollowGroupSet, "Escort Attack", "Briefing" ) -Escort:FormationTrail( 750, 750 , 0 ) -Escort:MenusAirplanes() -Escort:__Start( 5 ) - +local FollowGroupSet = SET_GROUP:New():FilterCategories( { "plane", "ship" } ):FilterCoalitions( "red" ):FilterPrefixes( { "Escort", "Ship Defense" } ):FilterStart() + +local LeaderUnit = UNIT:FindByName( "Leader" ) +local Escort = AI_ESCORT:New( LeaderUnit, FollowGroupSet, "Escort Attack", "Briefing" ) +Escort:FormationTrail( 750, 750 , 0 ) +Escort:MenusAirplanes() +Escort:__Start( 5 ) + diff --git a/ESC - AI Escort/ESC-002 - Escort A2G Large Formation/ESC-002 - Escort A2G Large Formation.miz b/ESC - AI Escort/ESC-002 - Escort A2G Large Formation/ESC-002 - Escort A2G Large Formation.miz index 629c669297..937063f49f 100644 Binary files a/ESC - AI Escort/ESC-002 - Escort A2G Large Formation/ESC-002 - Escort A2G Large Formation.miz and b/ESC - AI Escort/ESC-002 - Escort A2G Large Formation/ESC-002 - Escort A2G Large Formation.miz differ diff --git a/ESC - AI Escort/ESC-003 - Escort A2G Airbase Takeoff/ESC-003 - Escort A2G Airbase Takeoff.lua b/ESC - AI Escort/ESC-003 - Escort A2G Airbase Takeoff/ESC-003 - Escort A2G Airbase Takeoff.lua index 3e4033c204..4e83ea9280 100644 --- a/ESC - AI Escort/ESC-003 - Escort A2G Airbase Takeoff/ESC-003 - Escort A2G Airbase Takeoff.lua +++ b/ESC - AI Escort/ESC-003 - Escort A2G Airbase Takeoff/ESC-003 - Escort A2G Airbase Takeoff.lua @@ -1,9 +1,9 @@ - -local FollowGroupSet = SET_GROUP:New():FilterCategories( { "plane" } ):FilterCoalitions( "blue" ):FilterPrefixes( { "Escort" } ):FilterStart() - -local LeaderUnit = UNIT:FindByName( "Leader" ) -local Escort = AI_ESCORT:New( LeaderUnit, FollowGroupSet, "Escort Attack", "Briefing" ) -Escort:FormationTrail( 100, 100 , 0 ) -Escort:MenusAirplanes() -Escort:__Start( 5 ) - + +local FollowGroupSet = SET_GROUP:New():FilterCategories( { "plane" } ):FilterCoalitions( "blue" ):FilterPrefixes( { "Escort" } ):FilterStart() + +local LeaderUnit = UNIT:FindByName( "Leader" ) +local Escort = AI_ESCORT:New( LeaderUnit, FollowGroupSet, "Escort Attack", "Briefing" ) +Escort:FormationTrail( 100, 100 , 0 ) +Escort:MenusAirplanes() +Escort:__Start( 5 ) + diff --git a/ESC - AI Escort/ESC-003 - Escort A2G Airbase Takeoff/ESC-003 - Escort A2G Airbase Takeoff.miz b/ESC - AI Escort/ESC-003 - Escort A2G Airbase Takeoff/ESC-003 - Escort A2G Airbase Takeoff.miz index 2cd6c86bc4..f1736d8258 100644 Binary files a/ESC - AI Escort/ESC-003 - Escort A2G Airbase Takeoff/ESC-003 - Escort A2G Airbase Takeoff.miz and b/ESC - AI Escort/ESC-003 - Escort A2G Airbase Takeoff/ESC-003 - Escort A2G Airbase Takeoff.miz differ diff --git a/ESC - AI Escort/ESC-004 - Escort A2G Formation/ESC-004 - Escort A2G Formation.lua b/ESC - AI Escort/ESC-004 - Escort A2G Formation/ESC-004 - Escort A2G Formation.lua index 3e4033c204..4e83ea9280 100644 --- a/ESC - AI Escort/ESC-004 - Escort A2G Formation/ESC-004 - Escort A2G Formation.lua +++ b/ESC - AI Escort/ESC-004 - Escort A2G Formation/ESC-004 - Escort A2G Formation.lua @@ -1,9 +1,9 @@ - -local FollowGroupSet = SET_GROUP:New():FilterCategories( { "plane" } ):FilterCoalitions( "blue" ):FilterPrefixes( { "Escort" } ):FilterStart() - -local LeaderUnit = UNIT:FindByName( "Leader" ) -local Escort = AI_ESCORT:New( LeaderUnit, FollowGroupSet, "Escort Attack", "Briefing" ) -Escort:FormationTrail( 100, 100 , 0 ) -Escort:MenusAirplanes() -Escort:__Start( 5 ) - + +local FollowGroupSet = SET_GROUP:New():FilterCategories( { "plane" } ):FilterCoalitions( "blue" ):FilterPrefixes( { "Escort" } ):FilterStart() + +local LeaderUnit = UNIT:FindByName( "Leader" ) +local Escort = AI_ESCORT:New( LeaderUnit, FollowGroupSet, "Escort Attack", "Briefing" ) +Escort:FormationTrail( 100, 100 , 0 ) +Escort:MenusAirplanes() +Escort:__Start( 5 ) + diff --git a/ESC - AI Escort/ESC-004 - Escort A2G Formation/ESC-004 - Escort A2G Formation.miz b/ESC - AI Escort/ESC-004 - Escort A2G Formation/ESC-004 - Escort A2G Formation.miz index fa3c0e4a0e..df44c0a29d 100644 Binary files a/ESC - AI Escort/ESC-004 - Escort A2G Formation/ESC-004 - Escort A2G Formation.miz and b/ESC - AI Escort/ESC-004 - Escort A2G Formation/ESC-004 - Escort A2G Formation.miz differ diff --git a/ESC - AI Escort/ESC-005 - Escort A2G Helicopters/ESC-005 - Escort A2G Helicopters.lua b/ESC - AI Escort/ESC-005 - Escort A2G Helicopters/ESC-005 - Escort A2G Helicopters.lua index 24588f503d..70cae94aa2 100644 --- a/ESC - AI Escort/ESC-005 - Escort A2G Helicopters/ESC-005 - Escort A2G Helicopters.lua +++ b/ESC - AI Escort/ESC-005 - Escort A2G Helicopters/ESC-005 - Escort A2G Helicopters.lua @@ -1,9 +1,9 @@ - -local FollowGroupSet = SET_GROUP:New():FilterCategories( { "helicopter" } ):FilterCoalitions( "blue" ):FilterPrefixes( { "Escort" } ):FilterStart() - -local LeaderUnit = UNIT:FindByName( "Leader" ) -local Escort = AI_ESCORT:New( LeaderUnit, FollowGroupSet, "Escort Attack", "Briefing" ) -Escort:FormationTrail( 100, 100 , 0 ) -Escort:MenusHelicopters() -Escort:__Start( 5 ) - + +local FollowGroupSet = SET_GROUP:New():FilterCategories( { "helicopter" } ):FilterCoalitions( "blue" ):FilterPrefixes( { "Escort" } ):FilterStart() + +local LeaderUnit = UNIT:FindByName( "Leader" ) +local Escort = AI_ESCORT:New( LeaderUnit, FollowGroupSet, "Escort Attack", "Briefing" ) +Escort:FormationTrail( 100, 100 , 0 ) +Escort:MenusHelicopters() +Escort:__Start( 5 ) + diff --git a/ESC - AI Escort/ESC-005 - Escort A2G Helicopters/ESC-005 - Escort A2G Helicopters.miz b/ESC - AI Escort/ESC-005 - Escort A2G Helicopters/ESC-005 - Escort A2G Helicopters.miz index 7e5da875f7..bdaa5d6ad3 100644 Binary files a/ESC - AI Escort/ESC-005 - Escort A2G Helicopters/ESC-005 - Escort A2G Helicopters.miz and b/ESC - AI Escort/ESC-005 - Escort A2G Helicopters/ESC-005 - Escort A2G Helicopters.miz differ diff --git a/ESC - AI Escort/ESC-006 - Escort ROE ROT/ESC-006 - Escort ROE ROT.lua b/ESC - AI Escort/ESC-006 - Escort ROE ROT/ESC-006 - Escort ROE ROT.lua index f1afbe7962..feb9997c4e 100644 --- a/ESC - AI Escort/ESC-006 - Escort ROE ROT/ESC-006 - Escort ROE ROT.lua +++ b/ESC - AI Escort/ESC-006 - Escort ROE ROT/ESC-006 - Escort ROE ROT.lua @@ -1,11 +1,11 @@ - -local FollowGroupSet = SET_GROUP:New():FilterCategories( { "helicopter" } ):FilterCoalitions( "blue" ):FilterPrefixes( { "Escort" } ):FilterStart() - -local LeaderUnit = UNIT:FindByName( "Leader" ) -local Escort = AI_ESCORT:New( LeaderUnit, FollowGroupSet, "Escort Test", "Use the ROE and ROT menus to test if the behaviour is working." ) - -Escort:ModeMission() - -Escort:MenusHelicopters() -Escort:__Start( 5 ) - + +local FollowGroupSet = SET_GROUP:New():FilterCategories( { "helicopter" } ):FilterCoalitions( "blue" ):FilterPrefixes( { "Escort" } ):FilterStart() + +local LeaderUnit = UNIT:FindByName( "Leader" ) +local Escort = AI_ESCORT:New( LeaderUnit, FollowGroupSet, "Escort Test", "Use the ROE and ROT menus to test if the behaviour is working." ) + +Escort:SetFlightModeMission() + +Escort:MenusHelicopters() +Escort:__Start( 5 ) + diff --git a/ESC - AI Escort/ESC-006 - Escort ROE ROT/ESC-006 - Escort ROE ROT.miz b/ESC - AI Escort/ESC-006 - Escort ROE ROT/ESC-006 - Escort ROE ROT.miz index 02474de59b..7857473a06 100644 Binary files a/ESC - AI Escort/ESC-006 - Escort ROE ROT/ESC-006 - Escort ROE ROT.miz and b/ESC - AI Escort/ESC-006 - Escort ROE ROT/ESC-006 - Escort ROE ROT.miz differ diff --git a/ESC - AI Escort/ESC-100 - Escort Request Menu - kopie/ESC-100 - Escort Request Menu - kopie.miz b/ESC - AI Escort/ESC-100 - Escort Request Menu - kopie/ESC-100 - Escort Request Menu - kopie.miz index 0b169d982a..b6ecfa5ab1 100644 Binary files a/ESC - AI Escort/ESC-100 - Escort Request Menu - kopie/ESC-100 - Escort Request Menu - kopie.miz and b/ESC - AI Escort/ESC-100 - Escort Request Menu - kopie/ESC-100 - Escort Request Menu - kopie.miz differ diff --git a/ESC - AI Escort/ESC-100 - Escort Request Menu - kopie/ESC-100 - Escort Request Menu.lua b/ESC - AI Escort/ESC-100 - Escort Request Menu - kopie/ESC-100 - Escort Request Menu.lua new file mode 100644 index 0000000000..e93482903d --- /dev/null +++ b/ESC - AI Escort/ESC-100 - Escort Request Menu - kopie/ESC-100 - Escort Request Menu.lua @@ -0,0 +1,13 @@ +-- At startup of the overall mission, we spawn 10 possible escort planes in "Uncontrolled" state. + +EscortSpawn = SPAWN:NewWithAlias( "Red A2G Escort Template", "Red A2G Escort AI" ):InitLimit( 10, 10 ) +EscortSpawn:ParkAtAirbase( AIRBASE:FindByName( AIRBASE.Caucasus.Sochi_Adler ), AIRBASE.TerminalType.OpenBig ) + + +local EscortUnit = UNIT:FindByName( "Red A2G Pilot" ) + +Escort = AI_ESCORT_REQUEST:New( EscortUnit, EscortSpawn, AIRBASE:FindByName(AIRBASE.Caucasus.Sochi_Adler), "A2G", "Briefing" ) +Escort:FormationTrail( 50, 100, 100 ) +Escort:Menus( 50, 50, 0, 0, 50, 50, 6 ) +Escort:__Start( 5 ) + diff --git a/ESC - AI Escort/ESC-100 - Escort Request Menu/ESC-100 - Escort Request Menu.lua b/ESC - AI Escort/ESC-100 - Escort Request Menu/ESC-100 - Escort Request Menu.lua index f659ad35be..43871452a7 100644 --- a/ESC - AI Escort/ESC-100 - Escort Request Menu/ESC-100 - Escort Request Menu.lua +++ b/ESC - AI Escort/ESC-100 - Escort Request Menu/ESC-100 - Escort Request Menu.lua @@ -1,13 +1,13 @@ --- At startup of the overall mission, we spawn 10 possible escort planes in "Uncontrolled" state. - -EscortSpawn = SPAWN:NewWithAlias( "Red A2G Escort Template", "Red A2G Escort AI" ):InitLimit( 10, 10 ) -EscortSpawn:ParkAtAirbase( AIRBASE:FindByName( AIRBASE.Caucasus.Sochi_Adler ), AIRBASE.TerminalType.OpenBig ) - - -local EscortUnit = UNIT:FindByName( "Red A2G Pilot" ) - -Escort = AI_ESCORT_REQUEST:New( EscortUnit, EscortSpawn, AIRBASE:FindByName(AIRBASE.Caucasus.Sochi_Adler), "A2G", "Briefing" ) -Escort:FormationTrail( 50, 100, 100 ) -Escort:MenusAirplanes( 50, 50, 0, 0, 50, 50, 6 ) -Escort:__Start( 5 ) - +-- At startup of the overall mission, we spawn 10 possible escort planes in "Uncontrolled" state. + +EscortSpawn = SPAWN:NewWithAlias( "Red A2G Escort Template", "Red A2G Escort AI" ):InitLimit( 10, 10 ) +EscortSpawn:ParkAtAirbase( AIRBASE:FindByName( AIRBASE.Caucasus.Sochi_Adler ), AIRBASE.TerminalType.OpenBig ) + + +local EscortUnit = UNIT:FindByName( "Red A2G Pilot" ) + +Escort = AI_ESCORT_REQUEST:New( EscortUnit, EscortSpawn, AIRBASE:FindByName(AIRBASE.Caucasus.Sochi_Adler), "A2G", "Briefing" ) +Escort:FormationTrail( 50, 100, 100 ) +Escort:MenusAirplanes( 50, 50, 0, 0, 50, 50, 6 ) +Escort:__Start( 5 ) + diff --git a/ESC - AI Escort/ESC-100 - Escort Request Menu/ESC-100 - Escort Request Menu.miz b/ESC - AI Escort/ESC-100 - Escort Request Menu/ESC-100 - Escort Request Menu.miz index b69db05624..332f8b75b0 100644 Binary files a/ESC - AI Escort/ESC-100 - Escort Request Menu/ESC-100 - Escort Request Menu.miz and b/ESC - AI Escort/ESC-100 - Escort Request Menu/ESC-100 - Escort Request Menu.miz differ diff --git a/ESC - AI Escort/ESC-200 - Escort Mission/ESC-200 - Escort Mission.lua b/ESC - AI Escort/ESC-200 - Escort Mission/ESC-200 - Escort Mission.lua index 355a154e2c..18d94e8e9d 100644 --- a/ESC - AI Escort/ESC-200 - Escort Mission/ESC-200 - Escort Mission.lua +++ b/ESC - AI Escort/ESC-200 - Escort Mission/ESC-200 - Escort Mission.lua @@ -1,14 +1,14 @@ --- At startup of the overall mission, we spawn 10 possible escort planes in "Uncontrolled" state. - -EscortSpawn = SPAWN:NewWithAlias( "Red A2G Escort Template", "Red A2G Escort AI" ):InitLimit( 10, 10 ) -EscortSpawn:ParkAtAirbase( AIRBASE:FindByName( AIRBASE.Caucasus.Sochi_Adler ), AIRBASE.TerminalType.OpenBig ) - - -local EscortUnit = UNIT:FindByName( "Red A2G Pilot" ) - -Escort = AI_ESCORT_REQUEST:New( EscortUnit, EscortSpawn, AIRBASE:FindByName(AIRBASE.Caucasus.Sochi_Adler), "A2G", "Briefing" ) -Escort:FormationTrail( 50, 100, 100 ) -Escort:MenusAirplanes( 50, 50, 0, 0, 50, 50, 6 ) -Escort:SetEscortSpawnMission() -Escort:__Start( 5 ) - +-- At startup of the overall mission, we spawn 10 possible escort planes in "Uncontrolled" state. + +EscortSpawn = SPAWN:NewWithAlias( "Red A2G Escort Template", "Red A2G Escort AI" ):InitLimit( 10, 10 ) +EscortSpawn:ParkAtAirbase( AIRBASE:FindByName( AIRBASE.Caucasus.Sochi_Adler ), AIRBASE.TerminalType.OpenBig ) + + +local EscortUnit = UNIT:FindByName( "Red A2G Pilot" ) + +Escort = AI_ESCORT_REQUEST:New( EscortUnit, EscortSpawn, AIRBASE:FindByName(AIRBASE.Caucasus.Sochi_Adler), "A2G", "Briefing" ) +Escort:FormationTrail( 50, 100, 100 ) +Escort:MenusAirplanes( 50, 50, 0, 0, 50, 50, 6 ) +Escort:SetEscortSpawnMission() +Escort:__Start( 5 ) + diff --git a/ESC - AI Escort/ESC-200 - Escort Mission/ESC-200 - Escort Mission.miz b/ESC - AI Escort/ESC-200 - Escort Mission/ESC-200 - Escort Mission.miz index 3282114b61..c798feb325 100644 Binary files a/ESC - AI Escort/ESC-200 - Escort Mission/ESC-200 - Escort Mission.miz and b/ESC - AI Escort/ESC-200 - Escort Mission/ESC-200 - Escort Mission.miz differ diff --git a/ESC - AI Escort/ESC-201 - Escort Mission/ESC-201 - Escort Mission.lua b/ESC - AI Escort/ESC-201 - Escort Mission/ESC-201 - Escort Mission.lua index a4ce5a3457..90fb82bfa1 100644 --- a/ESC - AI Escort/ESC-201 - Escort Mission/ESC-201 - Escort Mission.lua +++ b/ESC - AI Escort/ESC-201 - Escort Mission/ESC-201 - Escort Mission.lua @@ -1,51 +1,51 @@ --- At startup of the overall mission, we spawn 10 possible escort planes in "Uncontrolled" state. - -HQ = GROUP:FindByName( "HQ", "Bravo" ) - -CommandCenter = COMMANDCENTER - :New( HQ, "HQ" ) - -Mission = MISSION - :New( CommandCenter, "Rescue Operation", "Tactical", "Transport General Mc. Connor!", coalition.side.BLUE ) - -TransportGroups = SET_GROUP:New():FilterCoalitions( "blue" ):FilterPrefixes( "Transport" ):FilterStart() -TaskDispatcher = TASK_CARGO_DISPATCHER:New( Mission, TransportGroups ) -TaskDispatcher:SetDefaultDeployZone( ZONE:New( "HeadQuarter" ) ) - -local CargoSet = SET_CARGO:New():FilterTypes( "General" ):FilterStart() -WorkplaceTask = TaskDispatcher:AddTransportTask( "Transport Team", CargoSet, "Rescue the general and transport him to the HeadQuarter (near the airbase Gudauta)." ) - -EscortSpawn = SPAWN:NewWithAlias( "Blue A2G Escort Template" ):InitLimit( 6, 6 ) -EscortSpawn:ParkAtAirbase( AIRBASE:FindByName( AIRBASE.Caucasus.Gudauta ), AIRBASE.TerminalType.OpenMedOrBig ) - - - -local EscortUnit = UNIT:FindByName( "Transport" ) - -Escort = AI_ESCORT_REQUEST:New( EscortUnit, EscortSpawn, AIRBASE:FindByName(AIRBASE.Caucasus.Gudauta), "A2G", "Rescue the engineer from the village Lesselide near the station. Beware of enemy air defenses. Use the escorts wisely." ) -Escort:FormationTrail( 50, 100, 100 ) - -Escort:SetEscortSpawnMission() - -Escort:MenuJoinUp() - -Escort:MenuFormationTrail( 50, 50, 0 ) -Escort:MenuFormationLeftLine( 0, 0, 50, 50 ) -Escort:MenuFormationRightLine( 0, 0, 50, 50 ) - - -Escort:MenuHoldAtEscortPosition( 30, 0 ) -Escort:MenuHoldAtEscortPosition( 100, 0 ) -Escort:MenuHoldAtLeaderPosition( 30, 0 ) -Escort:MenuHoldAtLeaderPosition( 100, 0 ) - -Escort:MenuFlare() -Escort:MenuSmoke() - -Escort:MenuTargets( 60 ) -Escort:MenuROE() -Escort:MenuROT() - -Escort:__Start( 5 ) - - +-- At startup of the overall mission, we spawn 10 possible escort planes in "Uncontrolled" state. + +HQ = GROUP:FindByName( "HQ", "Bravo" ) + +CommandCenter = COMMANDCENTER + :New( HQ, "HQ" ) + +Mission = MISSION + :New( CommandCenter, "Rescue Operation", "Tactical", "Transport General Mc. Connor!", coalition.side.BLUE ) + +TransportGroups = SET_GROUP:New():FilterCoalitions( "blue" ):FilterPrefixes( "Transport" ):FilterStart() +TaskDispatcher = TASK_CARGO_DISPATCHER:New( Mission, TransportGroups ) +TaskDispatcher:SetDefaultDeployZone( ZONE:New( "HeadQuarter" ) ) + +local CargoSet = SET_CARGO:New():FilterTypes( "General" ):FilterStart() +WorkplaceTask = TaskDispatcher:AddTransportTask( "Transport Team", CargoSet, "Rescue the general and transport him to the HeadQuarter (near the airbase Gudauta)." ) + +EscortSpawn = SPAWN:NewWithAlias( "Blue A2G Escort Template" ):InitLimit( 6, 6 ) +EscortSpawn:ParkAtAirbase( AIRBASE:FindByName( AIRBASE.Caucasus.Gudauta ), AIRBASE.TerminalType.OpenMedOrBig ) + + + +local EscortUnit = UNIT:FindByName( "Transport" ) + +Escort = AI_ESCORT_REQUEST:New( EscortUnit, EscortSpawn, AIRBASE:FindByName(AIRBASE.Caucasus.Gudauta), "A2G", "Rescue the engineer from the village Lesselide near the station. Beware of enemy air defenses. Use the escorts wisely." ) +Escort:FormationTrail( 50, 100, 100 ) + +Escort:SetEscortSpawnMission() + +Escort:MenuJoinUp() + +Escort:MenuFormationTrail( 50, 50, 0 ) +Escort:MenuFormationLeftLine( 0, 0, 50, 50 ) +Escort:MenuFormationRightLine( 0, 0, 50, 50 ) + + +Escort:MenuHoldAtEscortPosition( 30, 0 ) +Escort:MenuHoldAtEscortPosition( 100, 0 ) +Escort:MenuHoldAtLeaderPosition( 30, 0 ) +Escort:MenuHoldAtLeaderPosition( 100, 0 ) + +Escort:MenuFlare() +Escort:MenuSmoke() + +Escort:MenuTargets( 60 ) +Escort:MenuROE() +Escort:MenuROT() + +Escort:__Start( 5 ) + + diff --git a/ESC - AI Escort/ESC-201 - Escort Mission/ESC-201 - Escort Mission.miz b/ESC - AI Escort/ESC-201 - Escort Mission/ESC-201 - Escort Mission.miz index 8b68780fe6..e5c7fd02c2 100644 Binary files a/ESC - AI Escort/ESC-201 - Escort Mission/ESC-201 - Escort Mission.miz and b/ESC - AI Escort/ESC-201 - Escort Mission/ESC-201 - Escort Mission.miz differ diff --git a/ESC - Escorting/ESC-001 - Escorting Helicopters/ESC-001 - Escorting Helicopters.lua b/ESC - Escorting/ESC-001 - Escorting Helicopters/ESC-001 - Escorting Helicopters.lua index 2885f61672..f2d75c832e 100644 --- a/ESC - Escorting/ESC-001 - Escorting Helicopters/ESC-001 - Escorting Helicopters.lua +++ b/ESC - Escorting/ESC-001 - Escorting Helicopters/ESC-001 - Escorting Helicopters.lua @@ -1,89 +1,89 @@ ---- --- Name: ESC-001 - Escorting Helicopters --- Author: FlightControl --- Date Created: 10 Mar 2017 --- --- # Situation: --- --- Your client helicopter is flying in the battle field. --- It is escorted by an MI-28N, which you can command... --- Use the menu options to: --- - Make the escort follow you. --- - Report detected targets. --- - Attack targets --- - Flare --- --- # Test cases: --- --- 1. When executing the commands, observe the MI-28N reactions. - -do - local function EventAliveHelicopter( Client ) - local EscortGroupHeli1 = SpawnEscortHeli:ReSpawn(1) - local EscortHeli1 = ESCORT - :New( Client, EscortGroupHeli1, "Escort Helicopter" ) - :MenuFollowAt( 100 ) - :MenuFollowAt( 200 ) - :MenuHoldAtEscortPosition( 20, 10, "Hold at %d meters for %d seconds" ) - :MenuHoldAtLeaderPosition( 120 ) - :MenuFlare( "Disperse Flares" ) - :MenuSmoke() - :MenuReportTargets( 60, 20 ) - :MenuResumeMission() - :MenuROE() - :MenuAssistedAttack() - - EscortHeli1:SetDetection( EscortHeliDetection ) - - local EscortGroupArtillery = SpawnEscortArtillery:ReSpawn(1) - local EscortArtillery = ESCORT - :New( Client, EscortGroupArtillery, "Escort Artillery" ) - :Menus() - end - - local function EventAlivePlane( Client ) - local EscortGroupPlane2 = SpawnEscortPlane:ReSpawn(1) - local EscortPlane2 = ESCORT - :New( Client, EscortGroupPlane2, "Escort Test Plane" ) - :MenuFollowAt( 100 ) - :MenuFollowAt( 200 ) - :MenuHoldAtEscortPosition( 20, 10, "Hold at %d meters for %d seconds" ) - :MenuHoldAtLeaderPosition( 120 ) - :MenuFlare( "Disperse Flares" ) - :MenuSmoke() - :MenuReportTargets( 60, 20 ) - :MenuResumeMission() - :MenuAssistedAttack() - :MenuROE() - :MenuEvasion() - - local EscortGroupGround2 = SpawnEscortGround:ReSpawn(1) - local EscortGround2 = ESCORT - :New( Client, EscortGroupGround2, "Test Ground" ) - :Menus() - - local EscortGroupShip2 = SpawnEscortShip:ReSpawn(1) - local EscortShip2 = ESCORT - :New( Client, EscortGroupShip2, "Test Ship" ) - :Menus() - end - - SpawnEscortHeli = SPAWN:New( "Escort Helicopter" ) - SpawnEscortPlane = SPAWN:New( "Escort Plane" ) - SpawnEscortGround = SPAWN:New( "Escort Ground" ) - SpawnEscortShip = SPAWN:New( "Escort Ship" ) - SpawnEscortArtillery = SPAWN:New( "Ground Attack Assistance" ) - - EscortHeliSetGroup = SET_GROUP:New():FilterPrefixes("Escort Helicopter"):FilterStart() - EscortHeliDetection = DETECTION_AREAS:New( EscortHeliSetGroup, 1000, 500 ) - - EscortHeliDetection:BoundDetectedZones() - EscortHeliDetection:SetRefreshTimeInterval( 15 ) - - EscortClientHeli = CLIENT:FindByName( "Lead Helicopter", "Fly around and observe the behaviour of the escort helicopter" ):Alive( EventAliveHelicopter ) - EscortClientPlane = CLIENT:FindByName( "Lead Plane", "Fly around and observe the behaviour of the escort airplane. Select Navigate->Joun-Up and airplane should follow you. Change speed and directions." ) - :Alive( EventAlivePlane ) - -end - -env.info( "Test Mission loaded" ) +--- +-- Name: ESC-001 - Escorting Helicopters +-- Author: FlightControl +-- Date Created: 10 Mar 2017 +-- +-- # Situation: +-- +-- Your client helicopter is flying in the battle field. +-- It is escorted by an MI-28N, which you can command... +-- Use the menu options to: +-- - Make the escort follow you. +-- - Report detected targets. +-- - Attack targets +-- - Flare +-- +-- # Test cases: +-- +-- 1. When executing the commands, observe the MI-28N reactions. + +do + local function EventAliveHelicopter( Client ) + local EscortGroupHeli1 = SpawnEscortHeli:ReSpawn(1) + local EscortHeli1 = ESCORT + :New( Client, EscortGroupHeli1, "Escort Helicopter" ) + :MenuFollowAt( 100 ) + :MenuFollowAt( 200 ) + :MenuHoldAtEscortPosition( 20, 10, "Hold at %d meters for %d seconds" ) + :MenuHoldAtLeaderPosition( 120 ) + :MenuFlare( "Disperse Flares" ) + :MenuSmoke() + :MenuReportTargets( 60, 20 ) + :MenuResumeMission() + :MenuROE() + :MenuAssistedAttack() + + EscortHeli1:SetDetection( EscortHeliDetection ) + + local EscortGroupArtillery = SpawnEscortArtillery:ReSpawn(1) + local EscortArtillery = ESCORT + :New( Client, EscortGroupArtillery, "Escort Artillery" ) + :Menus() + end + + local function EventAlivePlane( Client ) + local EscortGroupPlane2 = SpawnEscortPlane:ReSpawn(1) + local EscortPlane2 = ESCORT + :New( Client, EscortGroupPlane2, "Escort Test Plane" ) + :MenuFollowAt( 100 ) + :MenuFollowAt( 200 ) + :MenuHoldAtEscortPosition( 20, 10, "Hold at %d meters for %d seconds" ) + :MenuHoldAtLeaderPosition( 120 ) + :MenuFlare( "Disperse Flares" ) + :MenuSmoke() + :MenuReportTargets( 60, 20 ) + :MenuResumeMission() + :MenuAssistedAttack() + :MenuROE() + :MenuEvasion() + + local EscortGroupGround2 = SpawnEscortGround:ReSpawn(1) + local EscortGround2 = ESCORT + :New( Client, EscortGroupGround2, "Test Ground" ) + :Menus() + + local EscortGroupShip2 = SpawnEscortShip:ReSpawn(1) + local EscortShip2 = ESCORT + :New( Client, EscortGroupShip2, "Test Ship" ) + :Menus() + end + + SpawnEscortHeli = SPAWN:New( "Escort Helicopter" ) + SpawnEscortPlane = SPAWN:New( "Escort Plane" ) + SpawnEscortGround = SPAWN:New( "Escort Ground" ) + SpawnEscortShip = SPAWN:New( "Escort Ship" ) + SpawnEscortArtillery = SPAWN:New( "Ground Attack Assistance" ) + + EscortHeliSetGroup = SET_GROUP:New():FilterPrefixes("Escort Helicopter"):FilterStart() + EscortHeliDetection = DETECTION_AREAS:New( EscortHeliSetGroup, 1000, 500 ) + + EscortHeliDetection:BoundDetectedZones() + EscortHeliDetection:SetRefreshTimeInterval( 15 ) + + EscortClientHeli = CLIENT:FindByName( "Lead Helicopter", "Fly around and observe the behaviour of the escort helicopter" ):Alive( EventAliveHelicopter ) + EscortClientPlane = CLIENT:FindByName( "Lead Plane", "Fly around and observe the behaviour of the escort airplane. Select Navigate->Joun-Up and airplane should follow you. Change speed and directions." ) + :Alive( EventAlivePlane ) + +end + +env.info( "Test Mission loaded" ) diff --git a/ESC - Escorting/ESC-001 - Escorting Helicopters/ESC-001 - Escorting Helicopters.miz b/ESC - Escorting/ESC-001 - Escorting Helicopters/ESC-001 - Escorting Helicopters.miz index 414075fa43..1c92179a89 100644 Binary files a/ESC - Escorting/ESC-001 - Escorting Helicopters/ESC-001 - Escorting Helicopters.miz and b/ESC - Escorting/ESC-001 - Escorting Helicopters/ESC-001 - Escorting Helicopters.miz differ diff --git a/EVT - Event Handling/EVT-001 - API Demo 1/EVT-001 - API Demo 1.lua b/EVT - Event Handling/EVT-001 - API Demo 1/EVT-001 - API Demo 1.lua index b2257c66ae..5823bbe670 100644 --- a/EVT - Event Handling/EVT-001 - API Demo 1/EVT-001 - API Demo 1.lua +++ b/EVT - Event Handling/EVT-001 - API Demo 1/EVT-001 - API Demo 1.lua @@ -1,40 +1,40 @@ ---- --- Name: EVT-001 - API Demo 1 --- Author: FlightControl --- Date Created: 7 February 2017 --- --- # Situation: --- --- A task shoots another tank. If one of the is dead, the event will be catched. --- --- # Test cases: --- --- 1. Observe the tanks shooting each other. --- 2. If one of the tanks die, an event will be catched. --- 3. Observe the surviving unit smoking. - - -local Tank1 = UNIT:FindByName( "Tank A" ) -local Tank2 = UNIT:FindByName( "Tank B" ) - -Tank1:HandleEvent( EVENTS.Dead ) - -Tank2:HandleEvent( EVENTS.Dead ) - ---- @param Wrapper.Unit#UNIT self -function Tank1:OnEventDead( EventData ) - - self:SmokeGreen() -end - ---- @param Wrapper.Unit#UNIT self -function Tank2:OnEventDead( EventData ) - - self:SmokeBlue() -end - -function Tank2:OnEventCrash(EventData) - -end - - +--- +-- Name: EVT-001 - API Demo 1 +-- Author: FlightControl +-- Date Created: 7 February 2017 +-- +-- # Situation: +-- +-- A task shoots another tank. If one of the is dead, the event will be catched. +-- +-- # Test cases: +-- +-- 1. Observe the tanks shooting each other. +-- 2. If one of the tanks die, an event will be catched. +-- 3. Observe the surviving unit smoking. + + +local Tank1 = UNIT:FindByName( "Tank A" ) +local Tank2 = UNIT:FindByName( "Tank B" ) + +Tank1:HandleEvent( EVENTS.Dead ) + +Tank2:HandleEvent( EVENTS.Dead ) + +--- @param Wrapper.Unit#UNIT self +function Tank1:OnEventDead( EventData ) + + self:SmokeGreen() +end + +--- @param Wrapper.Unit#UNIT self +function Tank2:OnEventDead( EventData ) + + self:SmokeBlue() +end + +function Tank2:OnEventCrash(EventData) + +end + + diff --git a/EVT - Event Handling/EVT-001 - API Demo 1/EVT-001 - API Demo 1.miz b/EVT - Event Handling/EVT-001 - API Demo 1/EVT-001 - API Demo 1.miz index ccb4ecee96..7b9c26e42d 100644 Binary files a/EVT - Event Handling/EVT-001 - API Demo 1/EVT-001 - API Demo 1.miz and b/EVT - Event Handling/EVT-001 - API Demo 1/EVT-001 - API Demo 1.miz differ diff --git a/EVT - Event Handling/EVT-001 - UNIT OnEventShot Stability Test/EVT-001 - UNIT OnEventShot Stability Test.lua b/EVT - Event Handling/EVT-001 - UNIT OnEventShot Stability Test/EVT-001 - UNIT OnEventShot Stability Test.lua index 01d65f45ca..45b712876b 100644 --- a/EVT - Event Handling/EVT-001 - UNIT OnEventShot Stability Test/EVT-001 - UNIT OnEventShot Stability Test.lua +++ b/EVT - Event Handling/EVT-001 - UNIT OnEventShot Stability Test/EVT-001 - UNIT OnEventShot Stability Test.lua @@ -1,74 +1,74 @@ ---- --- Name: EVT-001 - UNIT OnEventShot Stability Test --- Author: FlightControl --- Date Created: 9 Apr 2017 --- --- # Situation: --- --- A couple of planes are firing to each other. Monitor the shot events. --- I am doing a collectgarbage to test the stability of the event handling. --- Also when the planes are destroyed, the event handling should stop etc. --- The tests are on GROUP level. --- --- # Test cases: --- --- 1. Observe the planes shooting the missiles. --- 2. Observe when the plane shoots the missile, a dcs.log entry is written in the logging. --- 3. Check the stability of the event handlings. - -PlaneGroupsBlue = {} - -PlaneGroupsRed = {} - -PlaneSpawnBlue = SPAWN - :New( "Planes Blue" ) - :InitLimit( 2, 0 ) - :SpawnScheduled( 10,0 ) - :OnSpawnGroup( - function( SpawnGroup ) - SpawnGroupName = SpawnGroup:GetName() - PlaneGroupsBlue[SpawnGroupName] = SpawnGroup - PlaneGroupsBlue[SpawnGroupName]:HandleEvent( EVENTS.Shot ) - PlaneGroupsBlue[SpawnGroupName]:HandleEvent( EVENTS.Hit ) - collectgarbage() - PlaneGroupsBlue[SpawnGroupName].OnEventShot = function( self, EventData ) - self:F( EventData ) - self:MessageToAll( "I just fired a missile!", 15, "Alert!" ) - end - PlaneGroupsBlue[SpawnGroupName].OnEventHit = function( self, EventData ) - self:F( EventData ) - self:MessageToAll( "I just got hit!", 15, "Alert!" ) - end - end - ) - -PlaneSpawnRed = SPAWN - :New( "Planes Red" ) - :InitLimit( 2, 0 ) - :SpawnScheduled(10,0) - :OnSpawnGroup( - function( SpawnGroup ) - SpawnGroupName = SpawnGroup:GetName() - PlaneGroupsRed[SpawnGroupName] = SpawnGroup - PlaneGroupsRed[SpawnGroupName]:HandleEvent( EVENTS.Shot ) - PlaneGroupsRed[SpawnGroupName]:HandleEvent( EVENTS.Hit ) - collectgarbage() - --- @param self - -- @param Core.Event#EVENTDATA EventData - PlaneGroupsRed[SpawnGroupName].OnEventShot = function ( self, EventData ) - self:F( EventData ) - - self:MessageToAll( "I just got hit!", 15, "Alert!" ) - end - PlaneGroupsRed[SpawnGroupName].OnEventHit = function( self, EventData ) - self:F( EventData ) - self:MessageToAll( "I just fired a missile!", 15, "Alert!" ) - end - end - ) - -collectgarbage() -BASE:E( "Collected garbage" ) - - - +--- +-- Name: EVT-001 - UNIT OnEventShot Stability Test +-- Author: FlightControl +-- Date Created: 9 Apr 2017 +-- +-- # Situation: +-- +-- A couple of planes are firing to each other. Monitor the shot events. +-- I am doing a collectgarbage to test the stability of the event handling. +-- Also when the planes are destroyed, the event handling should stop etc. +-- The tests are on GROUP level. +-- +-- # Test cases: +-- +-- 1. Observe the planes shooting the missiles. +-- 2. Observe when the plane shoots the missile, a dcs.log entry is written in the logging. +-- 3. Check the stability of the event handlings. + +PlaneGroupsBlue = {} + +PlaneGroupsRed = {} + +PlaneSpawnBlue = SPAWN + :New( "Planes Blue" ) + :InitLimit( 2, 0 ) + :SpawnScheduled( 10,0 ) + :OnSpawnGroup( + function( SpawnGroup ) + SpawnGroupName = SpawnGroup:GetName() + PlaneGroupsBlue[SpawnGroupName] = SpawnGroup + PlaneGroupsBlue[SpawnGroupName]:HandleEvent( EVENTS.Shot ) + PlaneGroupsBlue[SpawnGroupName]:HandleEvent( EVENTS.Hit ) + collectgarbage() + PlaneGroupsBlue[SpawnGroupName].OnEventShot = function( self, EventData ) + self:F( EventData ) + self:MessageToAll( "I just fired a missile!", 15, "Alert!" ) + end + PlaneGroupsBlue[SpawnGroupName].OnEventHit = function( self, EventData ) + self:F( EventData ) + self:MessageToAll( "I just got hit!", 15, "Alert!" ) + end + end + ) + +PlaneSpawnRed = SPAWN + :New( "Planes Red" ) + :InitLimit( 2, 0 ) + :SpawnScheduled(10,0) + :OnSpawnGroup( + function( SpawnGroup ) + SpawnGroupName = SpawnGroup:GetName() + PlaneGroupsRed[SpawnGroupName] = SpawnGroup + PlaneGroupsRed[SpawnGroupName]:HandleEvent( EVENTS.Shot ) + PlaneGroupsRed[SpawnGroupName]:HandleEvent( EVENTS.Hit ) + collectgarbage() + --- @param self + -- @param Core.Event#EVENTDATA EventData + PlaneGroupsRed[SpawnGroupName].OnEventShot = function ( self, EventData ) + self:F( EventData ) + + self:MessageToAll( "I just got hit!", 15, "Alert!" ) + end + PlaneGroupsRed[SpawnGroupName].OnEventHit = function( self, EventData ) + self:F( EventData ) + self:MessageToAll( "I just fired a missile!", 15, "Alert!" ) + end + end + ) + +collectgarbage() +BASE:E( "Collected garbage" ) + + + diff --git a/EVT - Event Handling/EVT-001 - UNIT OnEventShot Stability Test/EVT-001 - UNIT OnEventShot Stability Test.miz b/EVT - Event Handling/EVT-001 - UNIT OnEventShot Stability Test/EVT-001 - UNIT OnEventShot Stability Test.miz index 3b5bf510a2..a6b2a4459a 100644 Binary files a/EVT - Event Handling/EVT-001 - UNIT OnEventShot Stability Test/EVT-001 - UNIT OnEventShot Stability Test.miz and b/EVT - Event Handling/EVT-001 - UNIT OnEventShot Stability Test/EVT-001 - UNIT OnEventShot Stability Test.miz differ diff --git a/EVT - Event Handling/EVT-001 - UNIT OnEventShot Stability Test/EVT-002 - UNIT OnEventLand ReSpawn Test.lua b/EVT - Event Handling/EVT-001 - UNIT OnEventShot Stability Test/EVT-002 - UNIT OnEventLand ReSpawn Test.lua new file mode 100644 index 0000000000..99c4edd3bf --- /dev/null +++ b/EVT - Event Handling/EVT-001 - UNIT OnEventShot Stability Test/EVT-002 - UNIT OnEventLand ReSpawn Test.lua @@ -0,0 +1,40 @@ +--- +-- Name: EVT-002 - UNIT OnEventLand ReSpawn Test +-- Author: FlightControl +-- Date Created: 9 Apr 2017 +-- +-- # Situation: +-- +-- A couple of planes are taking off from an airbase. +-- When they land, they send out a message that they landed. +-- But! They are automatically respawned upon landing. +-- The 2nd time the same plane lands, they should send the message again!!! +-- +-- # Test cases: +-- +-- 1. Observe in the logging, that the event subscriptions are reset when the respawn happens! +-- 2. Observe the 2nd time the same plane lands, they should send the message again!!! +-- 3. Check the stability of the event handlings. + +PlaneBlueSpawn = SPAWN + :New( "PlaneBlue" ) + :InitLimit(2,0) + :InitRepeatOnEngineShutDown() + :SpawnScheduled(60,0) + :OnSpawnGroup( + --- @param Wrapper.Group#GROUP SpawnGroup + function( SpawnGroup ) + SpawnGroup:HandleEvent( EVENTS.Land ) + --- @param self + -- @param Core.Event#EVENTDATA EventData + function SpawnGroup:OnEventLand(EventData) + EventData.IniGroup:MessageToAll("Landed",15,"Land Event") + end + end + ) + +collectgarbage() +BASE:E( "Collected garbage" ) + + + diff --git a/EVT - Event Handling/EVT-002 - UNIT OnEventLand ReSpawn Test/EVT-001 - UNIT OnEventShot Stability Test.lua b/EVT - Event Handling/EVT-002 - UNIT OnEventLand ReSpawn Test/EVT-001 - UNIT OnEventShot Stability Test.lua new file mode 100644 index 0000000000..45b712876b --- /dev/null +++ b/EVT - Event Handling/EVT-002 - UNIT OnEventLand ReSpawn Test/EVT-001 - UNIT OnEventShot Stability Test.lua @@ -0,0 +1,74 @@ +--- +-- Name: EVT-001 - UNIT OnEventShot Stability Test +-- Author: FlightControl +-- Date Created: 9 Apr 2017 +-- +-- # Situation: +-- +-- A couple of planes are firing to each other. Monitor the shot events. +-- I am doing a collectgarbage to test the stability of the event handling. +-- Also when the planes are destroyed, the event handling should stop etc. +-- The tests are on GROUP level. +-- +-- # Test cases: +-- +-- 1. Observe the planes shooting the missiles. +-- 2. Observe when the plane shoots the missile, a dcs.log entry is written in the logging. +-- 3. Check the stability of the event handlings. + +PlaneGroupsBlue = {} + +PlaneGroupsRed = {} + +PlaneSpawnBlue = SPAWN + :New( "Planes Blue" ) + :InitLimit( 2, 0 ) + :SpawnScheduled( 10,0 ) + :OnSpawnGroup( + function( SpawnGroup ) + SpawnGroupName = SpawnGroup:GetName() + PlaneGroupsBlue[SpawnGroupName] = SpawnGroup + PlaneGroupsBlue[SpawnGroupName]:HandleEvent( EVENTS.Shot ) + PlaneGroupsBlue[SpawnGroupName]:HandleEvent( EVENTS.Hit ) + collectgarbage() + PlaneGroupsBlue[SpawnGroupName].OnEventShot = function( self, EventData ) + self:F( EventData ) + self:MessageToAll( "I just fired a missile!", 15, "Alert!" ) + end + PlaneGroupsBlue[SpawnGroupName].OnEventHit = function( self, EventData ) + self:F( EventData ) + self:MessageToAll( "I just got hit!", 15, "Alert!" ) + end + end + ) + +PlaneSpawnRed = SPAWN + :New( "Planes Red" ) + :InitLimit( 2, 0 ) + :SpawnScheduled(10,0) + :OnSpawnGroup( + function( SpawnGroup ) + SpawnGroupName = SpawnGroup:GetName() + PlaneGroupsRed[SpawnGroupName] = SpawnGroup + PlaneGroupsRed[SpawnGroupName]:HandleEvent( EVENTS.Shot ) + PlaneGroupsRed[SpawnGroupName]:HandleEvent( EVENTS.Hit ) + collectgarbage() + --- @param self + -- @param Core.Event#EVENTDATA EventData + PlaneGroupsRed[SpawnGroupName].OnEventShot = function ( self, EventData ) + self:F( EventData ) + + self:MessageToAll( "I just got hit!", 15, "Alert!" ) + end + PlaneGroupsRed[SpawnGroupName].OnEventHit = function( self, EventData ) + self:F( EventData ) + self:MessageToAll( "I just fired a missile!", 15, "Alert!" ) + end + end + ) + +collectgarbage() +BASE:E( "Collected garbage" ) + + + diff --git a/EVT - Event Handling/EVT-002 - UNIT OnEventLand ReSpawn Test/EVT-002 - UNIT OnEventLand ReSpawn Test.lua b/EVT - Event Handling/EVT-002 - UNIT OnEventLand ReSpawn Test/EVT-002 - UNIT OnEventLand ReSpawn Test.lua index 5056baa534..21a228cd8d 100644 --- a/EVT - Event Handling/EVT-002 - UNIT OnEventLand ReSpawn Test/EVT-002 - UNIT OnEventLand ReSpawn Test.lua +++ b/EVT - Event Handling/EVT-002 - UNIT OnEventLand ReSpawn Test/EVT-002 - UNIT OnEventLand ReSpawn Test.lua @@ -1,40 +1,40 @@ ---- --- Name: EVT-002 - UNIT OnEventLand ReSpawn Test --- Author: FlightControl --- Date Created: 9 Apr 2017 --- --- # Situation: --- --- A couple of planes are taking off from an airbase. --- When they land, they send out a message that they landed. --- But! They are automatically respawned upon landing. --- The 2nd time the same plane lands, they should send the message again!!! --- --- # Test cases: --- --- 1. Observe in the logging, that the event subscriptions are reset when the respawn happens! --- 2. Observe the 2nd time the same plane lands, they should send the message again!!! --- 3. Check the stability of the event handlings. - -PlaneBlueSpawn = SPAWN - :New( "PlaneBlue" ) - :InitLimit(2,0) - :InitRepeatOnEngineShutDown() - :SpawnScheduled(60,0) - :OnSpawnGroup( - --- @param Wrapper.Group#GROUP SpawnGroup - function( SpawnGroup ) - SpawnGroup:HandleEvent( EVENTS.Land ) - --- @param self - -- @param Core.Event#EVENTDATA EventData - function SpawnGroup:OnEventLand(EventData) - EventData.IniGroup:MessageToAll("Landed",15,"Land Event") - end - end - ) - -collectgarbage() -BASE:E( "Collected garbage" ) - - - +--- +-- Name: EVT-002 - UNIT OnEventLand ReSpawn Test +-- Author: FlightControl +-- Date Created: 9 Apr 2017 +-- +-- # Situation: +-- +-- A couple of planes are taking off from an airbase. +-- When they land, they send out a message that they landed. +-- But! They are automatically respawned upon landing. +-- The 2nd time the same plane lands, they should send the message again!!! +-- +-- # Test cases: +-- +-- 1. Observe in the logging, that the event subscriptions are reset when the respawn happens! +-- 2. Observe the 2nd time the same plane lands, they should send the message again!!! +-- 3. Check the stability of the event handlings. + +PlaneBlueSpawn = SPAWN + :New( "PlaneBlue" ) + :InitLimit(2,0) + :InitRepeatOnEngineShutDown() + :SpawnScheduled(60,0) + :OnSpawnGroup( + --- @param Wrapper.Group#GROUP SpawnGroup + function( SpawnGroup ) + SpawnGroup:HandleEvent( EVENTS.Land ) + --- @param self + -- @param Core.Event#EVENTDATA EventData + function SpawnGroup:OnEventLand(EventData) + EventData.IniGroup:MessageToAll("Landed",15,"Land Event") + end + end + ) + +collectgarbage() +BASE:E( "Collected garbage" ) + + + diff --git a/EVT - Event Handling/EVT-002 - UNIT OnEventLand ReSpawn Test/EVT-002 - UNIT OnEventLand ReSpawn Test.miz b/EVT - Event Handling/EVT-002 - UNIT OnEventLand ReSpawn Test/EVT-002 - UNIT OnEventLand ReSpawn Test.miz index 5317f4b272..eaa38db2f5 100644 Binary files a/EVT - Event Handling/EVT-002 - UNIT OnEventLand ReSpawn Test/EVT-002 - UNIT OnEventLand ReSpawn Test.miz and b/EVT - Event Handling/EVT-002 - UNIT OnEventLand ReSpawn Test/EVT-002 - UNIT OnEventLand ReSpawn Test.miz differ diff --git a/EVT - Event Handling/EVT-100 - UNIT OnEventShot Example/EVT-100 - UNIT OnEventShot Example.lua b/EVT - Event Handling/EVT-100 - UNIT OnEventShot Example/EVT-100 - UNIT OnEventShot Example.lua index 2f84ad795d..ecb969b15a 100644 --- a/EVT - Event Handling/EVT-100 - UNIT OnEventShot Example/EVT-100 - UNIT OnEventShot Example.lua +++ b/EVT - Event Handling/EVT-100 - UNIT OnEventShot Example/EVT-100 - UNIT OnEventShot Example.lua @@ -1,25 +1,25 @@ ---- --- Name: EVT-100 - UNIT OnEventShot Example --- Author: FlightControl --- Date Created: 7 Feb 2017 --- --- # Situation: --- --- A plane is flying in the air and shoots an missile to a ground target. --- --- # Test cases: --- --- 1. Observe the plane shooting the missile. --- 2. Observe when the plane shoots the missile, a dcs.log entry is written in the logging. --- 3. Check the contents of the fields of the S_EVENT_SHOT entry. - -Plane = UNIT:FindByName( "Plane" ) - -Plane:HandleEvent( EVENTS.Shot ) - -function Plane:OnEventShot( EventData ) - - Plane:MessageToAll( "I just fired a missile!", 15, "Alert!" ) -end - - +--- +-- Name: EVT-100 - UNIT OnEventShot Example +-- Author: FlightControl +-- Date Created: 7 Feb 2017 +-- +-- # Situation: +-- +-- A plane is flying in the air and shoots an missile to a ground target. +-- +-- # Test cases: +-- +-- 1. Observe the plane shooting the missile. +-- 2. Observe when the plane shoots the missile, a dcs.log entry is written in the logging. +-- 3. Check the contents of the fields of the S_EVENT_SHOT entry. + +Plane = UNIT:FindByName( "Plane" ) + +Plane:HandleEvent( EVENTS.Shot ) + +function Plane:OnEventShot( EventData ) + + Plane:MessageToAll( "I just fired a missile!", 15, "Alert!" ) +end + + diff --git a/EVT - Event Handling/EVT-100 - UNIT OnEventShot Example/EVT-100 - UNIT OnEventShot Example.miz b/EVT - Event Handling/EVT-100 - UNIT OnEventShot Example/EVT-100 - UNIT OnEventShot Example.miz index ffb00c6ee3..8c5a17919b 100644 Binary files a/EVT - Event Handling/EVT-100 - UNIT OnEventShot Example/EVT-100 - UNIT OnEventShot Example.miz and b/EVT - Event Handling/EVT-100 - UNIT OnEventShot Example/EVT-100 - UNIT OnEventShot Example.miz differ diff --git a/EVT - Event Handling/EVT-101 - UNIT OnEventHit Example/EVT-101 - UNIT OnEventHit Example.lua b/EVT - Event Handling/EVT-101 - UNIT OnEventHit Example/EVT-101 - UNIT OnEventHit Example.lua index 03c8435ab3..5eef52c4f5 100644 --- a/EVT - Event Handling/EVT-101 - UNIT OnEventHit Example/EVT-101 - UNIT OnEventHit Example.lua +++ b/EVT - Event Handling/EVT-101 - UNIT OnEventHit Example/EVT-101 - UNIT OnEventHit Example.lua @@ -1,32 +1,32 @@ ---- --- Name: EVT-101 - UNIT OnEventHit Example --- Author: FlightControl --- Date Created: 7 Feb 2017 --- --- # Situation: --- --- A plane is flying in the air and shoots an missile to a ground target. --- --- # Test cases: --- --- 1. Observe the plane shooting the missile. --- 2. Observe when the missile hits the target, a dcs.log entry is written in the logging. --- 3. Check the contents of the fields of the S_EVENT_HIT entry. - -Plane = UNIT:FindByName( "Plane" ) - -Tank = UNIT:FindByName( "Tank" ) - -Plane:HandleEvent( EVENTS.Hit ) -Tank:HandleEvent( EVENTS.Hit ) - -function Plane:OnEventHit( EventData ) - - Plane:MessageToAll( "I just got hit!", 15, "Alert!" ) -end - -function Tank:OnEventHit( EventData ) - Tank:MessageToAll( "I just got hit!", 15, "Alert!" ) -end - - +--- +-- Name: EVT-101 - UNIT OnEventHit Example +-- Author: FlightControl +-- Date Created: 7 Feb 2017 +-- +-- # Situation: +-- +-- A plane is flying in the air and shoots an missile to a ground target. +-- +-- # Test cases: +-- +-- 1. Observe the plane shooting the missile. +-- 2. Observe when the missile hits the target, a dcs.log entry is written in the logging. +-- 3. Check the contents of the fields of the S_EVENT_HIT entry. + +Plane = UNIT:FindByName( "Plane" ) + +Tank = UNIT:FindByName( "Tank" ) + +Plane:HandleEvent( EVENTS.Hit ) +Tank:HandleEvent( EVENTS.Hit ) + +function Plane:OnEventHit( EventData ) + + Plane:MessageToAll( "I just got hit!", 15, "Alert!" ) +end + +function Tank:OnEventHit( EventData ) + Tank:MessageToAll( "I just got hit!", 15, "Alert!" ) +end + + diff --git a/EVT - Event Handling/EVT-101 - UNIT OnEventHit Example/EVT-101 - UNIT OnEventHit Example.miz b/EVT - Event Handling/EVT-101 - UNIT OnEventHit Example/EVT-101 - UNIT OnEventHit Example.miz index e21c858f08..86f8d5a5cd 100644 Binary files a/EVT - Event Handling/EVT-101 - UNIT OnEventHit Example/EVT-101 - UNIT OnEventHit Example.miz and b/EVT - Event Handling/EVT-101 - UNIT OnEventHit Example/EVT-101 - UNIT OnEventHit Example.miz differ diff --git a/EVT - Event Handling/EVT-102 - UNIT OnEventTakeoff Example/EVT-102 - UNIT OnEventTakeoff Example.lua b/EVT - Event Handling/EVT-102 - UNIT OnEventTakeoff Example/EVT-102 - UNIT OnEventTakeoff Example.lua index 203d946db3..8f6fa59ddc 100644 --- a/EVT - Event Handling/EVT-102 - UNIT OnEventTakeoff Example/EVT-102 - UNIT OnEventTakeoff Example.lua +++ b/EVT - Event Handling/EVT-102 - UNIT OnEventTakeoff Example/EVT-102 - UNIT OnEventTakeoff Example.lua @@ -1,33 +1,33 @@ ---- --- Name: EVT-102 - UNIT OnEventTakeoff Example --- Author: FlightControl --- Date Created: 7 Feb 2017 --- --- # Situation: --- --- A human plane and an AI plane are taking off from an airfield. --- --- # Test cases: --- --- 1. Take-Off the planes from the runway. --- 2. When the planes take-off, observe the message being sent. --- 3. Check the contents of the fields of the S_EVENT_TAKEOFF entry in the dcs.log file. - -PlaneAI = UNIT:FindByName( "PlaneAI" ) - -PlaneHuman = UNIT:FindByName( "PlaneHuman" ) - -PlaneAI:HandleEvent( EVENTS.Takeoff ) -PlaneHuman:HandleEvent( EVENTS.Takeoff ) - -function PlaneAI:OnEventTakeoff( EventData ) - - PlaneHuman:MessageToAll( "AI Taking Off", 15, "Alert!" ) -end - -function PlaneHuman:OnEventTakeoff( EventData ) - - PlaneHuman:MessageToAll( "Player " .. PlaneHuman:GetPlayerName() .. " is Taking Off", 15, "Alert!" ) -end - - +--- +-- Name: EVT-102 - UNIT OnEventTakeoff Example +-- Author: FlightControl +-- Date Created: 7 Feb 2017 +-- +-- # Situation: +-- +-- A human plane and an AI plane are taking off from an airfield. +-- +-- # Test cases: +-- +-- 1. Take-Off the planes from the runway. +-- 2. When the planes take-off, observe the message being sent. +-- 3. Check the contents of the fields of the S_EVENT_TAKEOFF entry in the dcs.log file. + +PlaneAI = UNIT:FindByName( "PlaneAI" ) + +PlaneHuman = UNIT:FindByName( "PlaneHuman" ) + +PlaneAI:HandleEvent( EVENTS.Takeoff ) +PlaneHuman:HandleEvent( EVENTS.Takeoff ) + +function PlaneAI:OnEventTakeoff( EventData ) + + PlaneHuman:MessageToAll( "AI Taking Off", 15, "Alert!" ) +end + +function PlaneHuman:OnEventTakeoff( EventData ) + + PlaneHuman:MessageToAll( "Player " .. PlaneHuman:GetPlayerName() .. " is Taking Off", 15, "Alert!" ) +end + + diff --git a/EVT - Event Handling/EVT-102 - UNIT OnEventTakeoff Example/EVT-102 - UNIT OnEventTakeoff Example.miz b/EVT - Event Handling/EVT-102 - UNIT OnEventTakeoff Example/EVT-102 - UNIT OnEventTakeoff Example.miz index 5bd659c394..18bc020212 100644 Binary files a/EVT - Event Handling/EVT-102 - UNIT OnEventTakeoff Example/EVT-102 - UNIT OnEventTakeoff Example.miz and b/EVT - Event Handling/EVT-102 - UNIT OnEventTakeoff Example/EVT-102 - UNIT OnEventTakeoff Example.miz differ diff --git a/EVT - Event Handling/EVT-103 - UNIT OnEventLand Example/EVT-103 - UNIT OnEventLand Example.lua b/EVT - Event Handling/EVT-103 - UNIT OnEventLand Example/EVT-103 - UNIT OnEventLand Example.lua index ba4e7608c6..abd53b386f 100644 --- a/EVT - Event Handling/EVT-103 - UNIT OnEventLand Example/EVT-103 - UNIT OnEventLand Example.lua +++ b/EVT - Event Handling/EVT-103 - UNIT OnEventLand Example/EVT-103 - UNIT OnEventLand Example.lua @@ -1,38 +1,38 @@ ---- --- Name: EVT-103 - UNIT OnEventLand Example --- Author: FlightControl --- Date Created: 7 Feb 2017 --- --- # Situation: --- --- An AI plane is landing on an airfield. --- When the plane landed, a new plane is spawned. --- --- # Test cases: --- --- 1. Observe the plane landing. --- 2. When the AI plane lands, observe the new plane being spawned. --- 3. Check the contents of the fields of the S_EVENT_LAND entry in the dcs.log file. - --- Create a variable PlaneAI that holds a reference to UNIT object (created by moose at the beginning of the mission) with the name "PlaneAI". -PlaneAI = UNIT:FindByName( "PlaneAI" ) - --- Create a SPAWN object to spawn a new plane once the hold one lands. -SpawnPlane = SPAWN:New( "SpawnPlaneAI" ) - --- Declare a new variable that will hold the new spawned SpawnPlaneAI -local NewPlane - - --- Subscribe to the event Land. The Land event occurs when a plane lands at an airfield. -PlaneAI:HandleEvent( EVENTS.Land ) - --- Because the PlaneAI object is subscribed to the Land event, the following method will be automatically --- called when the land event is happening FOR THE PlaneAI UNIT only! -function PlaneAI:OnEventLand( EventData ) - - -- Okay, the PlaneAI has landed, now spawn the new plane ( a predator ) - NewPlane = SpawnPlane:Spawn() -end - - +--- +-- Name: EVT-103 - UNIT OnEventLand Example +-- Author: FlightControl +-- Date Created: 7 Feb 2017 +-- +-- # Situation: +-- +-- An AI plane is landing on an airfield. +-- When the plane landed, a new plane is spawned. +-- +-- # Test cases: +-- +-- 1. Observe the plane landing. +-- 2. When the AI plane lands, observe the new plane being spawned. +-- 3. Check the contents of the fields of the S_EVENT_LAND entry in the dcs.log file. + +-- Create a variable PlaneAI that holds a reference to UNIT object (created by moose at the beginning of the mission) with the name "PlaneAI". +PlaneAI = UNIT:FindByName( "PlaneAI" ) + +-- Create a SPAWN object to spawn a new plane once the hold one lands. +SpawnPlane = SPAWN:New( "SpawnPlaneAI" ) + +-- Declare a new variable that will hold the new spawned SpawnPlaneAI +local NewPlane + + +-- Subscribe to the event Land. The Land event occurs when a plane lands at an airfield. +PlaneAI:HandleEvent( EVENTS.Land ) + +-- Because the PlaneAI object is subscribed to the Land event, the following method will be automatically +-- called when the land event is happening FOR THE PlaneAI UNIT only! +function PlaneAI:OnEventLand( EventData ) + + -- Okay, the PlaneAI has landed, now spawn the new plane ( a predator ) + NewPlane = SpawnPlane:Spawn() +end + + diff --git a/EVT - Event Handling/EVT-103 - UNIT OnEventLand Example/EVT-103 - UNIT OnEventLand Example.miz b/EVT - Event Handling/EVT-103 - UNIT OnEventLand Example/EVT-103 - UNIT OnEventLand Example.miz index ce3d20e129..03dcb8edfa 100644 Binary files a/EVT - Event Handling/EVT-103 - UNIT OnEventLand Example/EVT-103 - UNIT OnEventLand Example.miz and b/EVT - Event Handling/EVT-103 - UNIT OnEventLand Example/EVT-103 - UNIT OnEventLand Example.miz differ diff --git a/EVT - Event Handling/EVT-104 - UNIT OnEventCrash Example/EVT-104 - UNIT OnEventCrash Example.lua b/EVT - Event Handling/EVT-104 - UNIT OnEventCrash Example/EVT-104 - UNIT OnEventCrash Example.lua index 9a66753157..c738bc0a61 100644 --- a/EVT - Event Handling/EVT-104 - UNIT OnEventCrash Example/EVT-104 - UNIT OnEventCrash Example.lua +++ b/EVT - Event Handling/EVT-104 - UNIT OnEventCrash Example/EVT-104 - UNIT OnEventCrash Example.lua @@ -1,35 +1,35 @@ ---- --- Name: EVT-104 - UNIT OnEventCrash Example --- Author: FlightControl --- Date Created: 7 Feb 2017 --- --- # Situation: --- --- A human plane is fyling in the air. Crash it into the ground. --- Once you are crashed into the ground, at the place where you crashed, a smoke should start burning ... --- --- # Test cases: --- --- 1. Fly the plane into the ground. --- 2. When your plane crashes, observe a smoke starting to burn right were you crashed. --- 3. Check the contents of the fields of the S_EVENT_CRASH entry in the dcs.log file. - --- Create a variable PlaneHuman that holds a reference to UNIT object (created by moose at the beginning of the mission) with the name "PlaneHuman". -PlaneHuman = UNIT:FindByName( "PlaneHuman" ) - --- Subscribe to the event Crash. The Crash event occurs when a plane crashes into the ground (or into something else). -PlaneHuman:HandleEvent( EVENTS.Crash ) - --- Because the PlaneHuman object is subscribed to the Crash event, the following method will be automatically --- called when the Crash event is happening FOR THE PlaneHuman UNIT only! - ---- @param self --- @param Core.Event#EVENTDATA EventData -function PlaneHuman:OnEventCrash( EventData ) - - -- Okay, the PlaneHuman has crashed, now smoke at the x, z position. - self:E( "Smoking at the position" ) - EventData.IniUnit:SmokeOrange() -end - - +--- +-- Name: EVT-104 - UNIT OnEventCrash Example +-- Author: FlightControl +-- Date Created: 7 Feb 2017 +-- +-- # Situation: +-- +-- A human plane is fyling in the air. Crash it into the ground. +-- Once you are crashed into the ground, at the place where you crashed, a smoke should start burning ... +-- +-- # Test cases: +-- +-- 1. Fly the plane into the ground. +-- 2. When your plane crashes, observe a smoke starting to burn right were you crashed. +-- 3. Check the contents of the fields of the S_EVENT_CRASH entry in the dcs.log file. + +-- Create a variable PlaneHuman that holds a reference to UNIT object (created by moose at the beginning of the mission) with the name "PlaneHuman". +PlaneHuman = UNIT:FindByName( "PlaneHuman" ) + +-- Subscribe to the event Crash. The Crash event occurs when a plane crashes into the ground (or into something else). +PlaneHuman:HandleEvent( EVENTS.Crash ) + +-- Because the PlaneHuman object is subscribed to the Crash event, the following method will be automatically +-- called when the Crash event is happening FOR THE PlaneHuman UNIT only! + +--- @param self +-- @param Core.Event#EVENTDATA EventData +function PlaneHuman:OnEventCrash( EventData ) + + -- Okay, the PlaneHuman has crashed, now smoke at the x, z position. + self:E( "Smoking at the position" ) + EventData.IniUnit:SmokeOrange() +end + + diff --git a/EVT - Event Handling/EVT-104 - UNIT OnEventCrash Example/EVT-104 - UNIT OnEventCrash Example.miz b/EVT - Event Handling/EVT-104 - UNIT OnEventCrash Example/EVT-104 - UNIT OnEventCrash Example.miz index 492b0d5d93..8a7998e932 100644 Binary files a/EVT - Event Handling/EVT-104 - UNIT OnEventCrash Example/EVT-104 - UNIT OnEventCrash Example.miz and b/EVT - Event Handling/EVT-104 - UNIT OnEventCrash Example/EVT-104 - UNIT OnEventCrash Example.miz differ diff --git a/EVT - Event Handling/EVT-105 - UNIT OnEventPlayerEnterUnit Example/EVT-105 - UNIT OnEventPlayerEnterUnit Example.lua b/EVT - Event Handling/EVT-105 - UNIT OnEventPlayerEnterUnit Example/EVT-105 - UNIT OnEventPlayerEnterUnit Example.lua index a65d319057..d32e50516a 100644 --- a/EVT - Event Handling/EVT-105 - UNIT OnEventPlayerEnterUnit Example/EVT-105 - UNIT OnEventPlayerEnterUnit Example.lua +++ b/EVT - Event Handling/EVT-105 - UNIT OnEventPlayerEnterUnit Example/EVT-105 - UNIT OnEventPlayerEnterUnit Example.lua @@ -1,107 +1,107 @@ ---- --- Name: EVT-105 - UNIT OnEventPlayerEnterUnit Example --- Author: FlightControl --- Date Created: 15 Dec 2017 --- --- 2 planes and 2 tanks are located on and near the airport. --- The test is about checking if S_EVENT_PLAYER_ENTER_UNIT is correctly working in DCS single player and multi player. --- The test requires you to jump into the 2 planes and into the 2 tanks using CA. --- Please execute the following scenarios in Single and Multi-Player: --- --- 1. Test in Single Player: --- --- First we need to get the mission running... To do this, do the following actions: --- - At mission startup, once you get the slots, press the ESC key... The slot selection window will disappear. --- - Then press the ESC key again, and in the window, select the menu option "Select Slot". --- --- Next, we select the 2 planes... --- - Select Plane 1 slot. Go to external view. Once you are in the SU-25T, an orange smoke and a message should appear. --- - Select Plane 2 slot. Go to external view. Once you are in the SU-25T, a red smoke and a message should appear. --- --- Next, we select the 2 tanks... Select the MAP view using F10, and: --- - Select the Tank 1 unit using the arrow. And then press RALT-J which should jump you into Tank 1. Go to external view. Once you are in the Tank, a blue smoke and a message should appear. --- - Select the Tank 2 unit using the arrow. And then press RALT-J which should jump you into Tank 2. Go to external view. Once you are in the Tank, a green smoke and a message should appear. --- --- --- 2. Test in Multi Player: --- --- Run the mission on a server, and connect to the mission with a client... --- --- On the client machine, we select the 2 planes... --- - Select Plane 1 slot. Go to external view. Once you are in the SU-25T, an orange smoke and a message should appear. --- - Select Plane 2 slot. Go to external view. Once you are in the SU-25T, a red smoke and a message should appear. --- --- On the client machine, we select the 2 tanks... Select the MAP view using F10, and: --- - Select the Tank 1 unit using the arrow. And then press RALT-J which should jump you into Tank 1. Go to external view. Once you are in the Tank, a blue smoke and a message should appear. --- - Select the Tank 2 unit using the arrow. And then press RALT-J which should jump you into Tank 2. Go to external view. Once you are in the Tank, a green smoke and a message should appear. --- --- --- If all of this is working correctly, then the fix is correctly patched! - - - --- Create a variable PlaneHuman that holds a reference to UNIT object (created by moose at the beginning of the mission) with the name "Plane x". -Plane1 = CLIENT:FindByName( "Plane 1" ) -Plane2 = CLIENT:FindByName( "Plane 2" ) - --- Subscribe to the event. The event occurs when a player enters a slot. -Plane1:HandleEvent( EVENTS.PlayerEnterUnit ) -Plane2:HandleEvent( EVENTS.PlayerEnterUnit ) - --- Because the Plane object is subscribed to the PlayerEnterUnit event, the following method will be automatically --- called when the event is happening! - ---- @param self --- @param Core.Event#EVENTDATA EventData -function Plane1:OnEventPlayerEnterUnit( EventData ) - - -- Okay, the Human has entered the unit, now smoke at the x, z position. - EventData.IniUnit:SmokeOrange() - MESSAGE:NewType( "A human has entered Plane 1", MESSAGE.Type.Information ):ToAll() -end - - ---- @param self --- @param Core.Event#EVENTDATA EventData -function Plane2:OnEventPlayerEnterUnit( EventData ) - - -- Okay, the Human has entered the unit, now smoke at the x, z position. - EventData.IniUnit:SmokeRed() - MESSAGE:NewType( "A human has entered Plane 2", MESSAGE.Type.Information ):ToAll() -end - - - - - ---- Now for the ground units -Tank1 = UNIT:FindByName( "Tank 1" ) -Tank2 = UNIT:FindByName( "Tank 2" ) - --- Subscribe to the event. The event occurs when a player enters a slot. -Tank1:HandleEvent( EVENTS.PlayerEnterUnit ) -Tank2:HandleEvent( EVENTS.PlayerEnterUnit ) - - --- Because the Tank object is subscribed to the PlayerEnterUnit event, the following method will be automatically --- called when the event is happening! - ---- @param self --- @param Core.Event#EVENTDATA EventData -function Tank1:OnEventPlayerEnterUnit( EventData ) - - -- Okay, the Human has entered the unit, now smoke at the x, z position. - EventData.IniUnit:SmokeBlue() - MESSAGE:NewType( "A human has entered Tank 1", MESSAGE.Type.Information ):ToAll() -end - - ---- @param self --- @param Core.Event#EVENTDATA EventData -function Tank2:OnEventPlayerEnterUnit( EventData ) - - -- Okay, the Human has entered the unit, now smoke at the x, z position. - EventData.IniUnit:SmokeGreen() - MESSAGE:NewType( "A human has entered Tank 2", MESSAGE.Type.Information ):ToAll() -end - +--- +-- Name: EVT-105 - UNIT OnEventPlayerEnterUnit Example +-- Author: FlightControl +-- Date Created: 15 Dec 2017 +-- +-- 2 planes and 2 tanks are located on and near the airport. +-- The test is about checking if S_EVENT_PLAYER_ENTER_UNIT is correctly working in DCS single player and multi player. +-- The test requires you to jump into the 2 planes and into the 2 tanks using CA. +-- Please execute the following scenarios in Single and Multi-Player: +-- +-- 1. Test in Single Player: +-- +-- First we need to get the mission running... To do this, do the following actions: +-- - At mission startup, once you get the slots, press the ESC key... The slot selection window will disappear. +-- - Then press the ESC key again, and in the window, select the menu option "Select Slot". +-- +-- Next, we select the 2 planes... +-- - Select Plane 1 slot. Go to external view. Once you are in the SU-25T, an orange smoke and a message should appear. +-- - Select Plane 2 slot. Go to external view. Once you are in the SU-25T, a red smoke and a message should appear. +-- +-- Next, we select the 2 tanks... Select the MAP view using F10, and: +-- - Select the Tank 1 unit using the arrow. And then press RALT-J which should jump you into Tank 1. Go to external view. Once you are in the Tank, a blue smoke and a message should appear. +-- - Select the Tank 2 unit using the arrow. And then press RALT-J which should jump you into Tank 2. Go to external view. Once you are in the Tank, a green smoke and a message should appear. +-- +-- +-- 2. Test in Multi Player: +-- +-- Run the mission on a server, and connect to the mission with a client... +-- +-- On the client machine, we select the 2 planes... +-- - Select Plane 1 slot. Go to external view. Once you are in the SU-25T, an orange smoke and a message should appear. +-- - Select Plane 2 slot. Go to external view. Once you are in the SU-25T, a red smoke and a message should appear. +-- +-- On the client machine, we select the 2 tanks... Select the MAP view using F10, and: +-- - Select the Tank 1 unit using the arrow. And then press RALT-J which should jump you into Tank 1. Go to external view. Once you are in the Tank, a blue smoke and a message should appear. +-- - Select the Tank 2 unit using the arrow. And then press RALT-J which should jump you into Tank 2. Go to external view. Once you are in the Tank, a green smoke and a message should appear. +-- +-- +-- If all of this is working correctly, then the fix is correctly patched! + + + +-- Create a variable PlaneHuman that holds a reference to UNIT object (created by moose at the beginning of the mission) with the name "Plane x". +Plane1 = CLIENT:FindByName( "Plane 1" ) +Plane2 = CLIENT:FindByName( "Plane 2" ) + +-- Subscribe to the event. The event occurs when a player enters a slot. +Plane1:HandleEvent( EVENTS.PlayerEnterUnit ) +Plane2:HandleEvent( EVENTS.PlayerEnterUnit ) + +-- Because the Plane object is subscribed to the PlayerEnterUnit event, the following method will be automatically +-- called when the event is happening! + +--- @param self +-- @param Core.Event#EVENTDATA EventData +function Plane1:OnEventPlayerEnterUnit( EventData ) + + -- Okay, the Human has entered the unit, now smoke at the x, z position. + EventData.IniUnit:SmokeOrange() + MESSAGE:NewType( "A human has entered Plane 1", MESSAGE.Type.Information ):ToAll() +end + + +--- @param self +-- @param Core.Event#EVENTDATA EventData +function Plane2:OnEventPlayerEnterUnit( EventData ) + + -- Okay, the Human has entered the unit, now smoke at the x, z position. + EventData.IniUnit:SmokeRed() + MESSAGE:NewType( "A human has entered Plane 2", MESSAGE.Type.Information ):ToAll() +end + + + + + +--- Now for the ground units +Tank1 = UNIT:FindByName( "Tank 1" ) +Tank2 = UNIT:FindByName( "Tank 2" ) + +-- Subscribe to the event. The event occurs when a player enters a slot. +Tank1:HandleEvent( EVENTS.PlayerEnterUnit ) +Tank2:HandleEvent( EVENTS.PlayerEnterUnit ) + + +-- Because the Tank object is subscribed to the PlayerEnterUnit event, the following method will be automatically +-- called when the event is happening! + +--- @param self +-- @param Core.Event#EVENTDATA EventData +function Tank1:OnEventPlayerEnterUnit( EventData ) + + -- Okay, the Human has entered the unit, now smoke at the x, z position. + EventData.IniUnit:SmokeBlue() + MESSAGE:NewType( "A human has entered Tank 1", MESSAGE.Type.Information ):ToAll() +end + + +--- @param self +-- @param Core.Event#EVENTDATA EventData +function Tank2:OnEventPlayerEnterUnit( EventData ) + + -- Okay, the Human has entered the unit, now smoke at the x, z position. + EventData.IniUnit:SmokeGreen() + MESSAGE:NewType( "A human has entered Tank 2", MESSAGE.Type.Information ):ToAll() +end + diff --git a/EVT - Event Handling/EVT-105 - UNIT OnEventPlayerEnterUnit Example/EVT-105 - UNIT OnEventPlayerEnterUnit Example.miz b/EVT - Event Handling/EVT-105 - UNIT OnEventPlayerEnterUnit Example/EVT-105 - UNIT OnEventPlayerEnterUnit Example.miz index d930d5a49d..cfe75a4527 100644 Binary files a/EVT - Event Handling/EVT-105 - UNIT OnEventPlayerEnterUnit Example/EVT-105 - UNIT OnEventPlayerEnterUnit Example.miz and b/EVT - Event Handling/EVT-105 - UNIT OnEventPlayerEnterUnit Example/EVT-105 - UNIT OnEventPlayerEnterUnit Example.miz differ diff --git a/EVT - Event Handling/EVT-200 - GROUP OnEventShot Example/EVT-200 - GROUP OnEventShot Example.lua b/EVT - Event Handling/EVT-200 - GROUP OnEventShot Example/EVT-200 - GROUP OnEventShot Example.lua index 7afed4b7d0..c4784ffef5 100644 --- a/EVT - Event Handling/EVT-200 - GROUP OnEventShot Example/EVT-200 - GROUP OnEventShot Example.lua +++ b/EVT - Event Handling/EVT-200 - GROUP OnEventShot Example/EVT-200 - GROUP OnEventShot Example.lua @@ -1,28 +1,28 @@ ---- --- Name: EVT-200 - GROUP OnEventShot Example --- Author: FlightControl --- Date Created: 07 Mar 2017 --- --- # Situation: --- --- Two groups of planes are flying in the air and shoot an missile to a multitude of ground targets. --- --- # Test cases: --- --- 1. Observe the planes shooting the missile. --- 2. Observe when the planes shoots the missile, a dcs.log entry is written in the logging. --- 3. Check the contents of the fields of the S_EVENT_SHOT entry. --- 4. The planes of GROUP "Group Plane A", should only send a message when they shoot a missile. --- 5. The planes of GROUP "Group Plane B", should NOT send a message when they shoot a missile. - -PlaneGroup = GROUP:FindByName( "Group Plane A" ) - -PlaneGroup:HandleEvent( EVENTS.Shot ) - -function PlaneGroup:OnEventShot( EventData ) - - self:E( "I just fired a missile and I am part of " .. EventData.IniGroupName ) - EventData.IniUnit:MessageToAll( "I just fired a missile and I am part of " .. EventData.IniGroupName, 15, "Alert!" ) -end - - +--- +-- Name: EVT-200 - GROUP OnEventShot Example +-- Author: FlightControl +-- Date Created: 07 Mar 2017 +-- +-- # Situation: +-- +-- Two groups of planes are flying in the air and shoot an missile to a multitude of ground targets. +-- +-- # Test cases: +-- +-- 1. Observe the planes shooting the missile. +-- 2. Observe when the planes shoots the missile, a dcs.log entry is written in the logging. +-- 3. Check the contents of the fields of the S_EVENT_SHOT entry. +-- 4. The planes of GROUP "Group Plane A", should only send a message when they shoot a missile. +-- 5. The planes of GROUP "Group Plane B", should NOT send a message when they shoot a missile. + +PlaneGroup = GROUP:FindByName( "Group Plane A" ) + +PlaneGroup:HandleEvent( EVENTS.Shot ) + +function PlaneGroup:OnEventShot( EventData ) + + self:E( "I just fired a missile and I am part of " .. EventData.IniGroupName ) + EventData.IniUnit:MessageToAll( "I just fired a missile and I am part of " .. EventData.IniGroupName, 15, "Alert!" ) +end + + diff --git a/EVT - Event Handling/EVT-200 - GROUP OnEventShot Example/EVT-200 - GROUP OnEventShot Example.miz b/EVT - Event Handling/EVT-200 - GROUP OnEventShot Example/EVT-200 - GROUP OnEventShot Example.miz index e432f7d5df..2937571c9b 100644 Binary files a/EVT - Event Handling/EVT-200 - GROUP OnEventShot Example/EVT-200 - GROUP OnEventShot Example.miz and b/EVT - Event Handling/EVT-200 - GROUP OnEventShot Example/EVT-200 - GROUP OnEventShot Example.miz differ diff --git a/EVT - Event Handling/EVT-201 - GROUP OnEventHit Example/EVT-201 - GROUP OnEventHit Example.lua b/EVT - Event Handling/EVT-201 - GROUP OnEventHit Example/EVT-201 - GROUP OnEventHit Example.lua index 765419409f..228b24814a 100644 --- a/EVT - Event Handling/EVT-201 - GROUP OnEventHit Example/EVT-201 - GROUP OnEventHit Example.lua +++ b/EVT - Event Handling/EVT-201 - GROUP OnEventHit Example/EVT-201 - GROUP OnEventHit Example.lua @@ -1,28 +1,28 @@ ---- --- Name: EVT-201 - GROUP OnEventHit Example --- Author: FlightControl --- Date Created: 08 Mar 2017 --- --- # Situation: --- --- Two groups of planes are flying in the air and shoot an missile to a multitude of ground targets. --- --- # Test cases: --- --- 1. Observe the planes shooting the missile. --- 2. Observe when the planes shoots the missile, and hit the group Tanks A, a dcs.log entry is written in the logging. --- 3. Check the contents of the fields of the S_EVENT_HIT entry. --- 4. The tanks of GROUP "Group Tanks A", should only send a message when they get hit. --- 5. The tanks of GROUP "Group Tanks B", should NOT send a message when they get hit. - -TanksGroup = GROUP:FindByName( "Group Tanks A" ) - -TanksGroup:HandleEvent( EVENTS.Hit ) - -function TanksGroup:OnEventHit( EventData ) - - self:E( "I just got hit and I am part of " .. EventData.TgtGroupName ) - EventData.TgtUnit:MessageToAll( "I just got hit and I am part of " .. EventData.TgtGroupName, 15, "Alert!" ) -end - - +--- +-- Name: EVT-201 - GROUP OnEventHit Example +-- Author: FlightControl +-- Date Created: 08 Mar 2017 +-- +-- # Situation: +-- +-- Two groups of planes are flying in the air and shoot an missile to a multitude of ground targets. +-- +-- # Test cases: +-- +-- 1. Observe the planes shooting the missile. +-- 2. Observe when the planes shoots the missile, and hit the group Tanks A, a dcs.log entry is written in the logging. +-- 3. Check the contents of the fields of the S_EVENT_HIT entry. +-- 4. The tanks of GROUP "Group Tanks A", should only send a message when they get hit. +-- 5. The tanks of GROUP "Group Tanks B", should NOT send a message when they get hit. + +TanksGroup = GROUP:FindByName( "Group Tanks A" ) + +TanksGroup:HandleEvent( EVENTS.Hit ) + +function TanksGroup:OnEventHit( EventData ) + + self:E( "I just got hit and I am part of " .. EventData.TgtGroupName ) + EventData.TgtUnit:MessageToAll( "I just got hit and I am part of " .. EventData.TgtGroupName, 15, "Alert!" ) +end + + diff --git a/EVT - Event Handling/EVT-201 - GROUP OnEventHit Example/EVT-201 - GROUP OnEventHit Example.miz b/EVT - Event Handling/EVT-201 - GROUP OnEventHit Example/EVT-201 - GROUP OnEventHit Example.miz index 65b1c991c0..486dcc7172 100644 Binary files a/EVT - Event Handling/EVT-201 - GROUP OnEventHit Example/EVT-201 - GROUP OnEventHit Example.miz and b/EVT - Event Handling/EVT-201 - GROUP OnEventHit Example/EVT-201 - GROUP OnEventHit Example.miz differ diff --git a/EVT - Event Handling/EVT-204 - GROUP OnEventCrash Example/EVT-201 - GROUP OnEventHit Example.lua b/EVT - Event Handling/EVT-204 - GROUP OnEventCrash Example/EVT-201 - GROUP OnEventHit Example.lua new file mode 100644 index 0000000000..228b24814a --- /dev/null +++ b/EVT - Event Handling/EVT-204 - GROUP OnEventCrash Example/EVT-201 - GROUP OnEventHit Example.lua @@ -0,0 +1,28 @@ +--- +-- Name: EVT-201 - GROUP OnEventHit Example +-- Author: FlightControl +-- Date Created: 08 Mar 2017 +-- +-- # Situation: +-- +-- Two groups of planes are flying in the air and shoot an missile to a multitude of ground targets. +-- +-- # Test cases: +-- +-- 1. Observe the planes shooting the missile. +-- 2. Observe when the planes shoots the missile, and hit the group Tanks A, a dcs.log entry is written in the logging. +-- 3. Check the contents of the fields of the S_EVENT_HIT entry. +-- 4. The tanks of GROUP "Group Tanks A", should only send a message when they get hit. +-- 5. The tanks of GROUP "Group Tanks B", should NOT send a message when they get hit. + +TanksGroup = GROUP:FindByName( "Group Tanks A" ) + +TanksGroup:HandleEvent( EVENTS.Hit ) + +function TanksGroup:OnEventHit( EventData ) + + self:E( "I just got hit and I am part of " .. EventData.TgtGroupName ) + EventData.TgtUnit:MessageToAll( "I just got hit and I am part of " .. EventData.TgtGroupName, 15, "Alert!" ) +end + + diff --git a/EVT - Event Handling/EVT-204 - GROUP OnEventCrash Example/EVT-204 - GROUP OnEventCrash Example.lua b/EVT - Event Handling/EVT-204 - GROUP OnEventCrash Example/EVT-204 - GROUP OnEventCrash Example.lua index 70aef8e2b6..ca8fc6eee7 100644 --- a/EVT - Event Handling/EVT-204 - GROUP OnEventCrash Example/EVT-204 - GROUP OnEventCrash Example.lua +++ b/EVT - Event Handling/EVT-204 - GROUP OnEventCrash Example/EVT-204 - GROUP OnEventCrash Example.lua @@ -1,34 +1,34 @@ ---- --- Name: EVT-204 - GROUP OnEventCrash Example --- Author: FlightControl --- Date Created: 29 May 2017 --- --- # Situation: --- --- A human plane is fyling in the air. Crash it into the ground. --- Once you are crashed into the ground, at the place where you crashed, a smoke should start burning ... --- --- # Test cases: --- --- 1. Fly the plane into the ground. --- 2. When your plane crashes, observe a smoke starting to burn right were you crashed. --- 3. Check the contents of the fields of the S_EVENT_CRASH entry in the dcs.log file. - - --- Create a variable PlaneHuman that holds a reference to UNIT object (created by moose at the beginning of the mission) with the name "PlaneHuman". -PlaneHumanGroup = GROUP:FindByName( "PlaneGroup" ) - --- Subscribe to the event Crash. The Crash event occurs when a plane crashes into the ground (or into something else). -PlaneHumanGroup:HandleEvent( EVENTS.Crash ) - --- Because the PlaneHuman object is subscribed to the Crash event, the following method will be automatically --- called when the Crash event is happening FOR THE PlaneHuman UNIT only! - ---- @param self --- @param Core.Event#EVENTDATA EventData -function PlaneHumanGroup:OnEventCrash( EventData ) - - -- Okay, the PlaneHuman has crashed, now smoke at the x, z position. - self:E( "Smoking at the position" ) - EventData.IniUnit:SmokeOrange() -end +--- +-- Name: EVT-204 - GROUP OnEventCrash Example +-- Author: FlightControl +-- Date Created: 29 May 2017 +-- +-- # Situation: +-- +-- A human plane is fyling in the air. Crash it into the ground. +-- Once you are crashed into the ground, at the place where you crashed, a smoke should start burning ... +-- +-- # Test cases: +-- +-- 1. Fly the plane into the ground. +-- 2. When your plane crashes, observe a smoke starting to burn right were you crashed. +-- 3. Check the contents of the fields of the S_EVENT_CRASH entry in the dcs.log file. + + +-- Create a variable PlaneHuman that holds a reference to UNIT object (created by moose at the beginning of the mission) with the name "PlaneHuman". +PlaneHumanGroup = GROUP:FindByName( "PlaneGroup" ) + +-- Subscribe to the event Crash. The Crash event occurs when a plane crashes into the ground (or into something else). +PlaneHumanGroup:HandleEvent( EVENTS.Crash ) + +-- Because the PlaneHuman object is subscribed to the Crash event, the following method will be automatically +-- called when the Crash event is happening FOR THE PlaneHuman UNIT only! + +--- @param self +-- @param Core.Event#EVENTDATA EventData +function PlaneHumanGroup:OnEventCrash( EventData ) + + -- Okay, the PlaneHuman has crashed, now smoke at the x, z position. + self:E( "Smoking at the position" ) + EventData.IniUnit:SmokeOrange() +end diff --git a/EVT - Event Handling/EVT-204 - GROUP OnEventCrash Example/EVT-204 - GROUP OnEventCrash Example.miz b/EVT - Event Handling/EVT-204 - GROUP OnEventCrash Example/EVT-204 - GROUP OnEventCrash Example.miz index 2b9bbd7e6b..7299c6ef7e 100644 Binary files a/EVT - Event Handling/EVT-204 - GROUP OnEventCrash Example/EVT-204 - GROUP OnEventCrash Example.miz and b/EVT - Event Handling/EVT-204 - GROUP OnEventCrash Example/EVT-204 - GROUP OnEventCrash Example.miz differ diff --git a/EVT - Event Handling/EVT-205 - GROUP OnEventDead Example/EVT-205 - GROUP OnEventDead Example.lua b/EVT - Event Handling/EVT-205 - GROUP OnEventDead Example/EVT-205 - GROUP OnEventDead Example.lua index 0552161ee1..eec47c6658 100644 --- a/EVT - Event Handling/EVT-205 - GROUP OnEventDead Example/EVT-205 - GROUP OnEventDead Example.lua +++ b/EVT - Event Handling/EVT-205 - GROUP OnEventDead Example/EVT-205 - GROUP OnEventDead Example.lua @@ -1,28 +1,28 @@ ---- --- Name: EVT-205 - GROUP OnEventDead Example --- Author: FlightControl --- Date Created: 29 May 2017 --- --- # Situation: --- --- Two groups of planes are flying in the air and shoot an missile to a multitude of ground targets. --- --- # Test cases: --- --- 1. Observe the planes shooting the missile. --- 2. Observe when the planes shoots the missile, and hit the group Tanks A, a dcs.log entry is written in the logging. --- 3. Check the contents of the fields of the S_EVENT_HIT entry. --- 4. The tanks of GROUP "Group Tanks A", should only send a message when they get hit. --- 5. The tanks of GROUP "Group Tanks B", should NOT send a message when they get hit. - -TanksGroup = GROUP:FindByName( "Group Tanks A" ) - -TanksGroup:HandleEvent( EVENTS.Dead ) - -function TanksGroup:OnEventDead( EventData ) - - self:E( "I just got dead and I am part of " .. EventData.IniGroupName ) - EventData.IniUnit:MessageToAll( "I just got dead and I am part of " .. EventData.IniGroupName, 15, "Alert!" ) -end - - +--- +-- Name: EVT-205 - GROUP OnEventDead Example +-- Author: FlightControl +-- Date Created: 29 May 2017 +-- +-- # Situation: +-- +-- Two groups of planes are flying in the air and shoot an missile to a multitude of ground targets. +-- +-- # Test cases: +-- +-- 1. Observe the planes shooting the missile. +-- 2. Observe when the planes shoots the missile, and hit the group Tanks A, a dcs.log entry is written in the logging. +-- 3. Check the contents of the fields of the S_EVENT_HIT entry. +-- 4. The tanks of GROUP "Group Tanks A", should only send a message when they get hit. +-- 5. The tanks of GROUP "Group Tanks B", should NOT send a message when they get hit. + +TanksGroup = GROUP:FindByName( "Group Tanks A" ) + +TanksGroup:HandleEvent( EVENTS.Dead ) + +function TanksGroup:OnEventDead( EventData ) + + self:E( "I just got dead and I am part of " .. EventData.IniGroupName ) + EventData.IniUnit:MessageToAll( "I just got dead and I am part of " .. EventData.IniGroupName, 15, "Alert!" ) +end + + diff --git a/EVT - Event Handling/EVT-205 - GROUP OnEventDead Example/EVT-205 - GROUP OnEventDead Example.miz b/EVT - Event Handling/EVT-205 - GROUP OnEventDead Example/EVT-205 - GROUP OnEventDead Example.miz index 176c42c8c8..7e853c6ac2 100644 Binary files a/EVT - Event Handling/EVT-205 - GROUP OnEventDead Example/EVT-205 - GROUP OnEventDead Example.miz and b/EVT - Event Handling/EVT-205 - GROUP OnEventDead Example/EVT-205 - GROUP OnEventDead Example.miz differ diff --git a/EVT - Event Handling/EVT-401 - Generic OnEventHit Example/EVT-401 - Generic OnEventHit Example.lua b/EVT - Event Handling/EVT-401 - Generic OnEventHit Example/EVT-401 - Generic OnEventHit Example.lua index 9847ce5008..e6e04d9122 100644 --- a/EVT - Event Handling/EVT-401 - Generic OnEventHit Example/EVT-401 - Generic OnEventHit Example.lua +++ b/EVT - Event Handling/EVT-401 - Generic OnEventHit Example/EVT-401 - Generic OnEventHit Example.lua @@ -1,34 +1,34 @@ ---- --- Name: EVT-401 - Generic OnEventHit Example --- Author: FlightControl --- Date Created: 15 February 2017 --- --- # Situation: --- --- Ground targets are shooting each other. --- --- # Test cases: --- --- 1. Observe the ground forces shooting each other. --- 2. Observe when a tank receives a hit, a dcs.log entry is written in the logging. --- 3. The generic EventHandler objects should receive the hit events. - -CC = COMMANDCENTER:New( UNIT:FindByName( "HQ" ), "HQ" ) - -EventHandler1 = EVENTHANDLER:New() -EventHandler2 = EVENTHANDLER:New() - -EventHandler1:HandleEvent( EVENTS.Hit ) -EventHandler2:HandleEvent( EVENTS.Hit ) - -function EventHandler1:OnEventHit( EventData ) - self:E("hello 1") - CC:GetPositionable():MessageToAll( "I just got hit!", 15 , "Alert!" ) -end - -function EventHandler2:OnEventHit( EventData ) - self:E("hello 2") - CC:GetPositionable():MessageToAll( "I just got hit!", 15, "Alert!" ) -end - - +--- +-- Name: EVT-401 - Generic OnEventHit Example +-- Author: FlightControl +-- Date Created: 15 February 2017 +-- +-- # Situation: +-- +-- Ground targets are shooting each other. +-- +-- # Test cases: +-- +-- 1. Observe the ground forces shooting each other. +-- 2. Observe when a tank receives a hit, a dcs.log entry is written in the logging. +-- 3. The generic EventHandler objects should receive the hit events. + +CC = COMMANDCENTER:New( UNIT:FindByName( "HQ" ), "HQ" ) + +EventHandler1 = EVENTHANDLER:New() +EventHandler2 = EVENTHANDLER:New() + +EventHandler1:HandleEvent( EVENTS.Hit ) +EventHandler2:HandleEvent( EVENTS.Hit ) + +function EventHandler1:OnEventHit( EventData ) + self:E("hello 1") + CC:GetPositionable():MessageToAll( "I just got hit!", 15 , "Alert!" ) +end + +function EventHandler2:OnEventHit( EventData ) + self:E("hello 2") + CC:GetPositionable():MessageToAll( "I just got hit!", 15, "Alert!" ) +end + + diff --git a/EVT - Event Handling/EVT-401 - Generic OnEventHit Example/EVT-401 - Generic OnEventHit Example.miz b/EVT - Event Handling/EVT-401 - Generic OnEventHit Example/EVT-401 - Generic OnEventHit Example.miz index 20b40e0273..3fe742f11a 100644 Binary files a/EVT - Event Handling/EVT-401 - Generic OnEventHit Example/EVT-401 - Generic OnEventHit Example.miz and b/EVT - Event Handling/EVT-401 - Generic OnEventHit Example/EVT-401 - Generic OnEventHit Example.miz differ diff --git a/EVT - Event Handling/EVT-402 - Generic OnEventMissionEnd Example/EVT-402 - Generic OnEventMissionEnd Example.lua b/EVT - Event Handling/EVT-402 - Generic OnEventMissionEnd Example/EVT-402 - Generic OnEventMissionEnd Example.lua index f4e6d2519d..d5017b5a32 100644 --- a/EVT - Event Handling/EVT-402 - Generic OnEventMissionEnd Example/EVT-402 - Generic OnEventMissionEnd Example.lua +++ b/EVT - Event Handling/EVT-402 - Generic OnEventMissionEnd Example/EVT-402 - Generic OnEventMissionEnd Example.lua @@ -1,26 +1,26 @@ ---- --- Name: EVT-402 - Generic OnEventMissionEnd Example --- Author: FlightControl --- Date Created: 12 Apr 2017 --- --- # Situation: --- --- Test mission end event handler. --- --- # Test cases: --- --- 1. Observe when the mission ends, a dcs.log entry is written in the logging. --- 2. The generic EventHandler objects should be called, and a log entry in dcs.log should be written. - -CC = COMMANDCENTER:New( UNIT:FindByName( "HQ" ), "HQ" ) - -EventHandler = EVENTHANDLER:New() - -EventHandler:HandleEvent( EVENTS.MissionEnd ) - -function EventHandler:OnEventMissionEnd( EventData ) - self:E("Mission End") -end - - - +--- +-- Name: EVT-402 - Generic OnEventMissionEnd Example +-- Author: FlightControl +-- Date Created: 12 Apr 2017 +-- +-- # Situation: +-- +-- Test mission end event handler. +-- +-- # Test cases: +-- +-- 1. Observe when the mission ends, a dcs.log entry is written in the logging. +-- 2. The generic EventHandler objects should be called, and a log entry in dcs.log should be written. + +CC = COMMANDCENTER:New( UNIT:FindByName( "HQ" ), "HQ" ) + +EventHandler = EVENTHANDLER:New() + +EventHandler:HandleEvent( EVENTS.MissionEnd ) + +function EventHandler:OnEventMissionEnd( EventData ) + self:E("Mission End") +end + + + diff --git a/EVT - Event Handling/EVT-402 - Generic OnEventMissionEnd Example/EVT-402 - Generic OnEventMissionEnd Example.miz b/EVT - Event Handling/EVT-402 - Generic OnEventMissionEnd Example/EVT-402 - Generic OnEventMissionEnd Example.miz index 2d65ee8580..91b68f637a 100644 Binary files a/EVT - Event Handling/EVT-402 - Generic OnEventMissionEnd Example/EVT-402 - Generic OnEventMissionEnd Example.miz and b/EVT - Event Handling/EVT-402 - Generic OnEventMissionEnd Example/EVT-402 - Generic OnEventMissionEnd Example.miz differ diff --git a/EVT - Event Handling/EVT-403 - Generic OnEventBirth Example/EVT-403 - Generic OnEventBirth Example.lua b/EVT - Event Handling/EVT-403 - Generic OnEventBirth Example/EVT-403 - Generic OnEventBirth Example.lua index d7e7c10020..2cd1c45eac 100644 --- a/EVT - Event Handling/EVT-403 - Generic OnEventBirth Example/EVT-403 - Generic OnEventBirth Example.lua +++ b/EVT - Event Handling/EVT-403 - Generic OnEventBirth Example/EVT-403 - Generic OnEventBirth Example.lua @@ -1,32 +1,32 @@ ---- --- Name: EVT-401 - Generic OnEventHit Example --- Author: FlightControl --- Date Created: 15 February 2017 --- --- # Situation: --- --- Ground targets are shooting each other. --- --- # Test cases: --- --- 1. Observe the ground forces shooting each other. --- 2. Observe when a tank receives a hit, a dcs.log entry is written in the logging. --- 3. The generic EventHandler objects should receive the hit events. - -CC = COMMANDCENTER:New( GROUP:FindByName( "HQ" ), "HQ" ) - -EventHandler1 = EVENTHANDLER:New() - - -EventHandler1:HandleEvent( EVENTS.Birth ) - ---- @param Core.Event#EVENT self --- @param Core.Event#EVENTDATA EventData -function EventHandler1:OnEventBirth( EventData ) - self:E("hello 1") - self:E( EventData.IniUnit:GetName() ) - CC:GetPositionable():MessageToAll( "I just got born!", 15 , "Alert!" ) -end - - - +--- +-- Name: EVT-401 - Generic OnEventHit Example +-- Author: FlightControl +-- Date Created: 15 February 2017 +-- +-- # Situation: +-- +-- Ground targets are shooting each other. +-- +-- # Test cases: +-- +-- 1. Observe the ground forces shooting each other. +-- 2. Observe when a tank receives a hit, a dcs.log entry is written in the logging. +-- 3. The generic EventHandler objects should receive the hit events. + +CC = COMMANDCENTER:New( GROUP:FindByName( "HQ" ), "HQ" ) + +EventHandler1 = EVENTHANDLER:New() + + +EventHandler1:HandleEvent( EVENTS.Birth ) + +--- @param Core.Event#EVENT self +-- @param Core.Event#EVENTDATA EventData +function EventHandler1:OnEventBirth( EventData ) + self:E("hello 1") + self:E( EventData.IniUnit:GetName() ) + CC:GetPositionable():MessageToAll( "I just got born!", 15 , "Alert!" ) +end + + + diff --git a/EVT - Event Handling/EVT-403 - Generic OnEventBirth Example/EVT-403 - Generic OnEventBirth Example.miz b/EVT - Event Handling/EVT-403 - Generic OnEventBirth Example/EVT-403 - Generic OnEventBirth Example.miz index a3577f92b6..9536e7725a 100644 Binary files a/EVT - Event Handling/EVT-403 - Generic OnEventBirth Example/EVT-403 - Generic OnEventBirth Example.miz and b/EVT - Event Handling/EVT-403 - Generic OnEventBirth Example/EVT-403 - Generic OnEventBirth Example.miz differ diff --git a/EVT - Event Handling/EVT-500 - OnEventLand LandingChallenge/EVT-103 - OnEventLand Example LandingChallenge.lua b/EVT - Event Handling/EVT-500 - OnEventLand LandingChallenge/EVT-103 - OnEventLand Example LandingChallenge.lua new file mode 100644 index 0000000000..a8adb118f7 --- /dev/null +++ b/EVT - Event Handling/EVT-500 - OnEventLand LandingChallenge/EVT-103 - OnEventLand Example LandingChallenge.lua @@ -0,0 +1,63 @@ +--- +-- Name: EVT-103 - OnEventLand Example +-- Author: CraigOwen +-- Date Created: 12 February 2017 +-- +-- # Situation: +-- +-- A client plane is landing on an airfield, trying to pick a rope in the landing zones. +-- When the plane landed in one of the zones, a vehicle flares and a message ist printed out to the client. +-- +-- # Test cases: +-- +-- 1. Land the plane. +-- 2. When the plane landed, observe your message and the signal. +-- 3. Check the contents of the fields of the S_EVENT_LAND entry in the dcs.log file. + +-- Create a unit which signalizes if the client landed good. +signal = UNIT:FindByName("LandingZoneChallenge - Signal") + +-- Create the zones used for the landing check +-- Init Zone +InitZone = ZONE:New("LandingChallange - InitZone") + +-- Ropes +zonegroup1 = GROUP:FindByName("LandingZoneChallenge - RopeGroup 1" ) +zonegroup2 = GROUP:FindByName("LandingZoneChallenge - RopeGroup 2" ) +zonegroup3 = GROUP:FindByName("LandingZoneChallenge - RopeGroup 3" ) +LandZoneRope1 = ZONE_POLYGON:New( "Rope1", zonegroup1) +LandZoneRope2 = ZONE_POLYGON:New( "Rope2", zonegroup2) +LandZoneRope3 = ZONE_POLYGON:New( "Rope3", zonegroup3) + +-- Create a variable Plane that holds a reference to CLIENT object (created by moose at the beginning of the mission) with the name "Plane". +Plane = CLIENT:FindByName( "Plane" ) +-- Subscribe to the event Land. The Land event occurs when a plane lands at an airfield. +Plane:HandleEvent( EVENTS.Land ) + +-- This function will be called whenever the Plane-Object (client) lands! +function Plane:OnEventLand( EventData ) + + -- check wether the client landet at the right airport, where the challenge is located + if not Plane:IsInZone(InitZone) then + return + end + + -- check if the touchdown took place inside of one of the zones + if Plane:IsInZone(LandZoneRope1) then + MESSAGE:New("Great job! You picked the first rope.", 15, "Landing challenge" ):ToClient( Plane ) + signal:FlareGreen() + elseif Plane:IsInZone(LandZoneRope2) then + MESSAGE:New("Good job! You picked the second rope.", 15, "Landing challenge" ):ToClient( Plane ) + signal:FlareYellow() + elseif Plane:IsInZone(LandZoneRope3) then + MESSAGE:New("Close! You picked the last rope.", 15, "Landing challenge" ):ToClient( Plane ) + signal:FlareRed() + else + MESSAGE:New("Too bad, no rope picked! Thrust your engines and try again.", 15, "Landing challenge" ):ToClient( Plane ) + end + + +end + + +MESSAGE:New("Try to land on the runway in between the red trucks.", 15, "Landing challenge"):ToClient(Plane) \ No newline at end of file diff --git a/EVT - Event Handling/EVT-500 - OnEventLand LandingChallenge/EVT-500 - OnEventLand LandingChallenge.lua b/EVT - Event Handling/EVT-500 - OnEventLand LandingChallenge/EVT-500 - OnEventLand LandingChallenge.lua index 2d81929e26..a8adb118f7 100644 --- a/EVT - Event Handling/EVT-500 - OnEventLand LandingChallenge/EVT-500 - OnEventLand LandingChallenge.lua +++ b/EVT - Event Handling/EVT-500 - OnEventLand LandingChallenge/EVT-500 - OnEventLand LandingChallenge.lua @@ -1,63 +1,63 @@ ---- --- Name: EVT-103 - OnEventLand Example --- Author: CraigOwen --- Date Created: 12 February 2017 --- --- # Situation: --- --- A client plane is landing on an airfield, trying to pick a rope in the landing zones. --- When the plane landed in one of the zones, a vehicle flares and a message ist printed out to the client. --- --- # Test cases: --- --- 1. Land the plane. --- 2. When the plane landed, observe your message and the signal. --- 3. Check the contents of the fields of the S_EVENT_LAND entry in the dcs.log file. - --- Create a unit which signalizes if the client landed good. -signal = UNIT:FindByName("LandingZoneChallenge - Signal") - --- Create the zones used for the landing check --- Init Zone -InitZone = ZONE:New("LandingChallange - InitZone") - --- Ropes -zonegroup1 = GROUP:FindByName("LandingZoneChallenge - RopeGroup 1" ) -zonegroup2 = GROUP:FindByName("LandingZoneChallenge - RopeGroup 2" ) -zonegroup3 = GROUP:FindByName("LandingZoneChallenge - RopeGroup 3" ) -LandZoneRope1 = ZONE_POLYGON:New( "Rope1", zonegroup1) -LandZoneRope2 = ZONE_POLYGON:New( "Rope2", zonegroup2) -LandZoneRope3 = ZONE_POLYGON:New( "Rope3", zonegroup3) - --- Create a variable Plane that holds a reference to CLIENT object (created by moose at the beginning of the mission) with the name "Plane". -Plane = CLIENT:FindByName( "Plane" ) --- Subscribe to the event Land. The Land event occurs when a plane lands at an airfield. -Plane:HandleEvent( EVENTS.Land ) - --- This function will be called whenever the Plane-Object (client) lands! -function Plane:OnEventLand( EventData ) - - -- check wether the client landet at the right airport, where the challenge is located - if not Plane:IsInZone(InitZone) then - return - end - - -- check if the touchdown took place inside of one of the zones - if Plane:IsInZone(LandZoneRope1) then - MESSAGE:New("Great job! You picked the first rope.", 15, "Landing challenge" ):ToClient( Plane ) - signal:FlareGreen() - elseif Plane:IsInZone(LandZoneRope2) then - MESSAGE:New("Good job! You picked the second rope.", 15, "Landing challenge" ):ToClient( Plane ) - signal:FlareYellow() - elseif Plane:IsInZone(LandZoneRope3) then - MESSAGE:New("Close! You picked the last rope.", 15, "Landing challenge" ):ToClient( Plane ) - signal:FlareRed() - else - MESSAGE:New("Too bad, no rope picked! Thrust your engines and try again.", 15, "Landing challenge" ):ToClient( Plane ) - end - - -end - - +--- +-- Name: EVT-103 - OnEventLand Example +-- Author: CraigOwen +-- Date Created: 12 February 2017 +-- +-- # Situation: +-- +-- A client plane is landing on an airfield, trying to pick a rope in the landing zones. +-- When the plane landed in one of the zones, a vehicle flares and a message ist printed out to the client. +-- +-- # Test cases: +-- +-- 1. Land the plane. +-- 2. When the plane landed, observe your message and the signal. +-- 3. Check the contents of the fields of the S_EVENT_LAND entry in the dcs.log file. + +-- Create a unit which signalizes if the client landed good. +signal = UNIT:FindByName("LandingZoneChallenge - Signal") + +-- Create the zones used for the landing check +-- Init Zone +InitZone = ZONE:New("LandingChallange - InitZone") + +-- Ropes +zonegroup1 = GROUP:FindByName("LandingZoneChallenge - RopeGroup 1" ) +zonegroup2 = GROUP:FindByName("LandingZoneChallenge - RopeGroup 2" ) +zonegroup3 = GROUP:FindByName("LandingZoneChallenge - RopeGroup 3" ) +LandZoneRope1 = ZONE_POLYGON:New( "Rope1", zonegroup1) +LandZoneRope2 = ZONE_POLYGON:New( "Rope2", zonegroup2) +LandZoneRope3 = ZONE_POLYGON:New( "Rope3", zonegroup3) + +-- Create a variable Plane that holds a reference to CLIENT object (created by moose at the beginning of the mission) with the name "Plane". +Plane = CLIENT:FindByName( "Plane" ) +-- Subscribe to the event Land. The Land event occurs when a plane lands at an airfield. +Plane:HandleEvent( EVENTS.Land ) + +-- This function will be called whenever the Plane-Object (client) lands! +function Plane:OnEventLand( EventData ) + + -- check wether the client landet at the right airport, where the challenge is located + if not Plane:IsInZone(InitZone) then + return + end + + -- check if the touchdown took place inside of one of the zones + if Plane:IsInZone(LandZoneRope1) then + MESSAGE:New("Great job! You picked the first rope.", 15, "Landing challenge" ):ToClient( Plane ) + signal:FlareGreen() + elseif Plane:IsInZone(LandZoneRope2) then + MESSAGE:New("Good job! You picked the second rope.", 15, "Landing challenge" ):ToClient( Plane ) + signal:FlareYellow() + elseif Plane:IsInZone(LandZoneRope3) then + MESSAGE:New("Close! You picked the last rope.", 15, "Landing challenge" ):ToClient( Plane ) + signal:FlareRed() + else + MESSAGE:New("Too bad, no rope picked! Thrust your engines and try again.", 15, "Landing challenge" ):ToClient( Plane ) + end + + +end + + MESSAGE:New("Try to land on the runway in between the red trucks.", 15, "Landing challenge"):ToClient(Plane) \ No newline at end of file diff --git a/EVT - Event Handling/EVT-500 - OnEventLand LandingChallenge/EVT-500 - OnEventLand LandingChallenge.miz b/EVT - Event Handling/EVT-500 - OnEventLand LandingChallenge/EVT-500 - OnEventLand LandingChallenge.miz index 973a34990b..5ffb916b29 100644 Binary files a/EVT - Event Handling/EVT-500 - OnEventLand LandingChallenge/EVT-500 - OnEventLand LandingChallenge.miz and b/EVT - Event Handling/EVT-500 - OnEventLand LandingChallenge/EVT-500 - OnEventLand LandingChallenge.miz differ diff --git a/EVT - Event Handling/EVT-501 - OnEventLand LandingChallengeComplex/EVT-501 - OnEventLand LandingChallengeComplex.lua b/EVT - Event Handling/EVT-501 - OnEventLand LandingChallengeComplex/EVT-501 - OnEventLand LandingChallengeComplex.lua index 469122ac97..200c8083fc 100644 --- a/EVT - Event Handling/EVT-501 - OnEventLand LandingChallengeComplex/EVT-501 - OnEventLand LandingChallengeComplex.lua +++ b/EVT - Event Handling/EVT-501 - OnEventLand LandingChallengeComplex/EVT-501 - OnEventLand LandingChallengeComplex.lua @@ -1,151 +1,151 @@ ---- --- Name: EVT-103 - OnEventLand LandingChallengeComplex --- Author: CraigOwen --- Date Created: 12 February 2017 --- --- # Situation: --- --- Approaching the airfield the client gets a message and can try to land inside the landing zones. --- Here we want all clients to participate in the challenge, not only one. --- When the plane landed in one of the zones, a vehicle flares and a message ist printed out to the client. --- --- # Test cases: --- --- 1. Land one of the planes. --- 2. While landing the plane, observe your message and the signal (flare). --- 3. Check the contents of the fields of the S_EVENT_LAND entry in the dcs.log file. - --- In this advanced challenge we want to make sure all the following. --- 1. The challenge takes place at a certain airfield. --- 2. All clients can repeat the challange at any time, try after try. --- 3. All clients approaching the airport get a message indicating the challenge. --- 4. There is no useraction needet to participate in this, providing full focus on the task. - --- So lets go then... in five steps --- 1. Create a unit to signalize (flare) whenever a client landed correctly --- 2. Create Zones --- 3. Create a set of clients --- 4. Handle the EVENT.Land for all clients in the set using the signal unit --- 5. Create a scheduler checking for clients in zones - --- 1. Create a unit which signalizes if the client landed good. -signal = UNIT:FindByName("LandingZoneChallenge - Signal") - --- 2. Create Zones --- Init Zone - This is the global Zone for the LandingChallenge -InitZone = ZONE:New("LandingChallange - InitZone") - ---Ingress Zone - This Zone tries to asure the client approaches the runway from the right side -IngressZoneTemplate = GROUP:FindByName( "LandingZoneChallenge - IngressZone" ) -IngressZone = ZONE_POLYGON:New( "IngressZone", IngressZoneTemplate ) - --- Ropes - theese zones will simulate the ropes on a carrier. -zonegroup1 = GROUP:FindByName("LandingZoneChallenge - Rope 1" ) -zonegroup2 = GROUP:FindByName("LandingZoneChallenge - Rope 2" ) -zonegroup3 = GROUP:FindByName("LandingZoneChallenge - Rope 3" ) -LandZoneRope1 = ZONE_POLYGON:New( "Rope1", zonegroup1) -LandZoneRope2 = ZONE_POLYGON:New( "Rope2", zonegroup2) -LandZoneRope3 = ZONE_POLYGON:New( "Rope3", zonegroup3) - - --- 3. Create a set of clients --- In this example we do not want to handle the event for one specific client, but rather for all red plane clients. --- To achieve this, we start with filtering the clients and saving those into the "BlueClients" variable -RedClients = SET_CLIENT:New():FilterCoalitions("red"):FilterStart() - - --- 4. We want to let every client subscribe to the event EVENT.Land. This event occurs when a plane lands. Be aware that this could be any airfield at this point. --- To do so, we run the ForEachClient method on our set of clients and call a function taking the client as parameter -RedClients:ForEachClient( - --- This function will be called for every single client in the set - -- @param MooseClient#CLIENT ClientInSet - function( ClientInSet ) - - -- Inside here we want to do two things. - -- 1. Write down the local function doing all the magic. - -- 2. Call this function for each ClientInSet - - -- 1. The magic - local function ResetClientForZone( MooseClient ) - --At first we set this client to a state, in wich she/he is not participating in this event - MooseClient:SetState( MooseClient, "ZoneStep", "0" ) - - --Now we subscribe to the event just like we did in the first example. - MooseClient:HandleEvent(EVENTS.Land) - - - --- Finally we set up the so called handler FOR the event. This is a function wich will determine what happens, whenever a client lands. - -- Note here, that the function has the MooseClient in front. So this function will literaly get a part of the client itself. - -- Therefore we can refere to "self" inside the function whenever meaning the MooseClient - -- The param EventData is a parameter given to all event handlers and providing several data about this particular event. - -- @param Core.Event#EVENTDATA EventData - function MooseClient:OnEventLand( EventData ) - - -- Ok now the client "MooseClient" definetly has landed. And beeing here means being the client. MooseClient <-> self - -- So now i want to know 2 things, to verify that i have done everything right. - -- 1. I want to know if my(self) landed in the challengeZone, so landing in other places will not react to this challenge - -- 2. Furthermore i want to know if my(self) came from the right side. - -- In all other cases nothing shell happen, so we reset the client state here and return doin nothing else. - if not self:IsInZone(InitZone) or self:GetState( self, "ZoneStep" ) ~= "2" then - self:SetState( self, "ZoneStep", "0" ) - return - end - - -- Here we check wich rope was picked and set the signal and message according to it. - if self:IsInZone(LandZoneRope1) then - MESSAGE:New("Great job! You picked the first rope.", 15, "Landing challenge" ):ToClient( self ) - signal:FlareGreen() - elseif self:IsInZone(LandZoneRope2) then - MESSAGE:New("Good job! You picked the second rope.", 15, "Landing challenge" ):ToClient( self ) - signal:FlareYellow() - elseif self:IsInZone(LandZoneRope3) then - MESSAGE:New("Close! You picked the last rope.", 15, "Landing challenge" ):ToClient( self ) - signal:FlareRed() - else - MESSAGE:New("Too bad, no rope picked! Thrust your engines and try again.", 15, "Landing challenge" ):ToClient( self ) - end - - -- Finally we set the client back to step 1, allowing a new message for landing - self:SetState( self, "ZoneStep", "1" ) - - end - end - - -- 2. As we're now all set, we can finally call our function for every ClientInSet - ClientInSet:Alive( ResetClientForZone ) - - end - ) - --- 5. Finally we use a scheduler checking wether clients are inside or outside these zones. -LandingChallangeActionsScheduler, LandingChallangeActionsSchedulerID = SCHEDULER:New( nil, - function () - - -- Flying by the airport there will be a message showing that the landing challange is currently in place. - -- This will make the ClientState shift from 0 -> 1 - RedClients:ForEachClientInZone( InitZone, - function( MooseClient ) - BASE:E( { Client = MooseClient, State = MooseClient:GetState( MooseClient, "ZoneStep" ) } ) - if MooseClient:IsAlive() and MooseClient:GetState( MooseClient, "ZoneStep" ) == "0" then - MooseClient:SetState( MooseClient, "ZoneStep", "1" ) - MESSAGE:New("Welcome to the Landing challenge. If you want to participate, get yourself a landing clearance by ATC and navigate to the landing corridor.", 20, "Landing challenge" ):ToClient( MooseClient ) - end - end - ) - - -- The client is approaching the runway from the correct side? - -- If yes, then shift state from 1 to 2 - RedClients:ForEachClientInZone( IngressZone, - function( MooseClient ) - BASE:E( { Client = MooseClient, State = MooseClient:GetState( MooseClient, "ZoneStep" ) } ) - if MooseClient:IsAlive() and MooseClient:GetState( MooseClient, "ZoneStep" ) == "1" then - MooseClient:SetState( MooseClient, "ZoneStep", "2" ) - MESSAGE:New("Ok, now its your turn. Land your airframe and try to get one of the ropes. Good luck!", 15, "Landing challenge" ):ToClient( MooseClient ) - end - end - ) - - end, {}, 5, 5 - ) - +--- +-- Name: EVT-103 - OnEventLand LandingChallengeComplex +-- Author: CraigOwen +-- Date Created: 12 February 2017 +-- +-- # Situation: +-- +-- Approaching the airfield the client gets a message and can try to land inside the landing zones. +-- Here we want all clients to participate in the challenge, not only one. +-- When the plane landed in one of the zones, a vehicle flares and a message ist printed out to the client. +-- +-- # Test cases: +-- +-- 1. Land one of the planes. +-- 2. While landing the plane, observe your message and the signal (flare). +-- 3. Check the contents of the fields of the S_EVENT_LAND entry in the dcs.log file. + +-- In this advanced challenge we want to make sure all the following. +-- 1. The challenge takes place at a certain airfield. +-- 2. All clients can repeat the challange at any time, try after try. +-- 3. All clients approaching the airport get a message indicating the challenge. +-- 4. There is no useraction needet to participate in this, providing full focus on the task. + +-- So lets go then... in five steps +-- 1. Create a unit to signalize (flare) whenever a client landed correctly +-- 2. Create Zones +-- 3. Create a set of clients +-- 4. Handle the EVENT.Land for all clients in the set using the signal unit +-- 5. Create a scheduler checking for clients in zones + +-- 1. Create a unit which signalizes if the client landed good. +signal = UNIT:FindByName("LandingZoneChallenge - Signal") + +-- 2. Create Zones +-- Init Zone - This is the global Zone for the LandingChallenge +InitZone = ZONE:New("LandingChallange - InitZone") + +--Ingress Zone - This Zone tries to asure the client approaches the runway from the right side +IngressZoneTemplate = GROUP:FindByName( "LandingZoneChallenge - IngressZone" ) +IngressZone = ZONE_POLYGON:New( "IngressZone", IngressZoneTemplate ) + +-- Ropes - theese zones will simulate the ropes on a carrier. +zonegroup1 = GROUP:FindByName("LandingZoneChallenge - Rope 1" ) +zonegroup2 = GROUP:FindByName("LandingZoneChallenge - Rope 2" ) +zonegroup3 = GROUP:FindByName("LandingZoneChallenge - Rope 3" ) +LandZoneRope1 = ZONE_POLYGON:New( "Rope1", zonegroup1) +LandZoneRope2 = ZONE_POLYGON:New( "Rope2", zonegroup2) +LandZoneRope3 = ZONE_POLYGON:New( "Rope3", zonegroup3) + + +-- 3. Create a set of clients +-- In this example we do not want to handle the event for one specific client, but rather for all red plane clients. +-- To achieve this, we start with filtering the clients and saving those into the "BlueClients" variable +RedClients = SET_CLIENT:New():FilterCoalitions("red"):FilterStart() + + +-- 4. We want to let every client subscribe to the event EVENT.Land. This event occurs when a plane lands. Be aware that this could be any airfield at this point. +-- To do so, we run the ForEachClient method on our set of clients and call a function taking the client as parameter +RedClients:ForEachClient( + --- This function will be called for every single client in the set + -- @param MooseClient#CLIENT ClientInSet + function( ClientInSet ) + + -- Inside here we want to do two things. + -- 1. Write down the local function doing all the magic. + -- 2. Call this function for each ClientInSet + + -- 1. The magic + local function ResetClientForZone( MooseClient ) + --At first we set this client to a state, in wich she/he is not participating in this event + MooseClient:SetState( MooseClient, "ZoneStep", "0" ) + + --Now we subscribe to the event just like we did in the first example. + MooseClient:HandleEvent(EVENTS.Land) + + + --- Finally we set up the so called handler FOR the event. This is a function wich will determine what happens, whenever a client lands. + -- Note here, that the function has the MooseClient in front. So this function will literaly get a part of the client itself. + -- Therefore we can refere to "self" inside the function whenever meaning the MooseClient + -- The param EventData is a parameter given to all event handlers and providing several data about this particular event. + -- @param Core.Event#EVENTDATA EventData + function MooseClient:OnEventLand( EventData ) + + -- Ok now the client "MooseClient" definetly has landed. And beeing here means being the client. MooseClient <-> self + -- So now i want to know 2 things, to verify that i have done everything right. + -- 1. I want to know if my(self) landed in the challengeZone, so landing in other places will not react to this challenge + -- 2. Furthermore i want to know if my(self) came from the right side. + -- In all other cases nothing shell happen, so we reset the client state here and return doin nothing else. + if not self:IsInZone(InitZone) or self:GetState( self, "ZoneStep" ) ~= "2" then + self:SetState( self, "ZoneStep", "0" ) + return + end + + -- Here we check wich rope was picked and set the signal and message according to it. + if self:IsInZone(LandZoneRope1) then + MESSAGE:New("Great job! You picked the first rope.", 15, "Landing challenge" ):ToClient( self ) + signal:FlareGreen() + elseif self:IsInZone(LandZoneRope2) then + MESSAGE:New("Good job! You picked the second rope.", 15, "Landing challenge" ):ToClient( self ) + signal:FlareYellow() + elseif self:IsInZone(LandZoneRope3) then + MESSAGE:New("Close! You picked the last rope.", 15, "Landing challenge" ):ToClient( self ) + signal:FlareRed() + else + MESSAGE:New("Too bad, no rope picked! Thrust your engines and try again.", 15, "Landing challenge" ):ToClient( self ) + end + + -- Finally we set the client back to step 1, allowing a new message for landing + self:SetState( self, "ZoneStep", "1" ) + + end + end + + -- 2. As we're now all set, we can finally call our function for every ClientInSet + ClientInSet:Alive( ResetClientForZone ) + + end + ) + +-- 5. Finally we use a scheduler checking wether clients are inside or outside these zones. +LandingChallangeActionsScheduler, LandingChallangeActionsSchedulerID = SCHEDULER:New( nil, + function () + + -- Flying by the airport there will be a message showing that the landing challange is currently in place. + -- This will make the ClientState shift from 0 -> 1 + RedClients:ForEachClientInZone( InitZone, + function( MooseClient ) + BASE:E( { Client = MooseClient, State = MooseClient:GetState( MooseClient, "ZoneStep" ) } ) + if MooseClient:IsAlive() and MooseClient:GetState( MooseClient, "ZoneStep" ) == "0" then + MooseClient:SetState( MooseClient, "ZoneStep", "1" ) + MESSAGE:New("Welcome to the Landing challenge. If you want to participate, get yourself a landing clearance by ATC and navigate to the landing corridor.", 20, "Landing challenge" ):ToClient( MooseClient ) + end + end + ) + + -- The client is approaching the runway from the correct side? + -- If yes, then shift state from 1 to 2 + RedClients:ForEachClientInZone( IngressZone, + function( MooseClient ) + BASE:E( { Client = MooseClient, State = MooseClient:GetState( MooseClient, "ZoneStep" ) } ) + if MooseClient:IsAlive() and MooseClient:GetState( MooseClient, "ZoneStep" ) == "1" then + MooseClient:SetState( MooseClient, "ZoneStep", "2" ) + MESSAGE:New("Ok, now its your turn. Land your airframe and try to get one of the ropes. Good luck!", 15, "Landing challenge" ):ToClient( MooseClient ) + end + end + ) + + end, {}, 5, 5 + ) + MESSAGE:New("Try to land on the runway in between the red trucks located at the right side.", 15, "Landing challenge"):ToAll() \ No newline at end of file diff --git a/EVT - Event Handling/EVT-501 - OnEventLand LandingChallengeComplex/EVT-501 - OnEventLand LandingChallengeComplex.miz b/EVT - Event Handling/EVT-501 - OnEventLand LandingChallengeComplex/EVT-501 - OnEventLand LandingChallengeComplex.miz index 46a0b81e5a..50fa60503c 100644 Binary files a/EVT - Event Handling/EVT-501 - OnEventLand LandingChallengeComplex/EVT-501 - OnEventLand LandingChallengeComplex.miz and b/EVT - Event Handling/EVT-501 - OnEventLand LandingChallengeComplex/EVT-501 - OnEventLand LandingChallengeComplex.miz differ diff --git a/EVT - Event Handling/EVT-600 - OnEventHit Example with a Set of Units/EVT-600 - OnEventHit Example with a Set of Units.lua b/EVT - Event Handling/EVT-600 - OnEventHit Example with a Set of Units/EVT-600 - OnEventHit Example with a Set of Units.lua index e05d830818..a58e7fae54 100644 --- a/EVT - Event Handling/EVT-600 - OnEventHit Example with a Set of Units/EVT-600 - OnEventHit Example with a Set of Units.lua +++ b/EVT - Event Handling/EVT-600 - OnEventHit Example with a Set of Units/EVT-600 - OnEventHit Example with a Set of Units.lua @@ -1,29 +1,29 @@ ---- --- Name: EVT-600 - OnEventHit Example with a Set of Units --- Author: FlightControl --- Date Created: 6 Mar 2017 --- --- # Situation: --- --- A plane is flying in the air and shoots an missile to a ground target. --- It will shoot a couple of tanks units that are part of a Set. --- --- # Test cases: --- --- 1. Observe the plane shooting the missile. --- 2. Observe when the plane hits a tank, a dcs.log entry is written in the logging. --- 4. Observe the tanks hitting the targets and the messages appear. --- 3. Check the contents of the fields of the S_EVENT_HIT entries. - -Plane = UNIT:FindByName( "Plane" ) - -UnitSet = SET_UNIT:New():FilterPrefixes( "Tank" ):FilterStart() - -UnitSet:HandleEvent( EVENTS.Hit ) - -function UnitSet:OnEventHit( EventData ) - - Plane:MessageToAll( "I just hit a tank! " .. EventData.IniUnit:GetName(), 15, "Alert!" ) -end - - +--- +-- Name: EVT-600 - OnEventHit Example with a Set of Units +-- Author: FlightControl +-- Date Created: 6 Mar 2017 +-- +-- # Situation: +-- +-- A plane is flying in the air and shoots an missile to a ground target. +-- It will shoot a couple of tanks units that are part of a Set. +-- +-- # Test cases: +-- +-- 1. Observe the plane shooting the missile. +-- 2. Observe when the plane hits a tank, a dcs.log entry is written in the logging. +-- 4. Observe the tanks hitting the targets and the messages appear. +-- 3. Check the contents of the fields of the S_EVENT_HIT entries. + +Plane = UNIT:FindByName( "Plane" ) + +UnitSet = SET_UNIT:New():FilterPrefixes( "Tank" ):FilterStart() + +UnitSet:HandleEvent( EVENTS.Hit ) + +function UnitSet:OnEventHit( EventData ) + + Plane:MessageToAll( "I just hit a tank! " .. EventData.IniUnit:GetName(), 15, "Alert!" ) +end + + diff --git a/EVT - Event Handling/EVT-600 - OnEventHit Example with a Set of Units/EVT-600 - OnEventHit Example with a Set of Units.miz b/EVT - Event Handling/EVT-600 - OnEventHit Example with a Set of Units/EVT-600 - OnEventHit Example with a Set of Units.miz index 8b11b5b714..dabb816809 100644 Binary files a/EVT - Event Handling/EVT-600 - OnEventHit Example with a Set of Units/EVT-600 - OnEventHit Example with a Set of Units.miz and b/EVT - Event Handling/EVT-600 - OnEventHit Example with a Set of Units/EVT-600 - OnEventHit Example with a Set of Units.miz differ diff --git a/FOR - AI Group Formation/FOR-001 - Bomber Speed and Route Test/FOR-001 - Bomber Speed and Route Test.lua b/FOR - AI Group Formation/FOR-001 - Bomber Speed and Route Test/FOR-001 - Bomber Speed and Route Test.lua index 7bb1852a55..9a87b788e2 100644 --- a/FOR - AI Group Formation/FOR-001 - Bomber Speed and Route Test/FOR-001 - Bomber Speed and Route Test.lua +++ b/FOR - AI Group Formation/FOR-001 - Bomber Speed and Route Test/FOR-001 - Bomber Speed and Route Test.lua @@ -1,8 +1,8 @@ - -local FollowGroupSet = SET_GROUP:New():FilterCategories("plane"):FilterCoalitions("blue"):FilterPrefixes("Follow"):FilterStart() -FollowGroupSet:Flush() -local LeaderUnit = UNIT:FindByName( "Leader" ) -local LargeFormation = AI_FORMATION:New( LeaderUnit, FollowGroupSet, "Left Line Formation", "Briefing" ):TestSmokeDirectionVector(true) -LargeFormation:FormationLeftLine( 500, 0, 250, 0 ) -LargeFormation:__Start( 1 ) - + +local FollowGroupSet = SET_GROUP:New():FilterCategories("plane"):FilterCoalitions("blue"):FilterPrefixes("Follow"):FilterStart() +FollowGroupSet:Flush() +local LeaderUnit = UNIT:FindByName( "Leader" ) +local LargeFormation = AI_FORMATION:New( LeaderUnit, FollowGroupSet, "Left Line Formation", "Briefing" ):TestSmokeDirectionVector(true) +LargeFormation:FormationLeftLine( 500, 0, 250, 0 ) +LargeFormation:__Start( 1 ) + diff --git a/FOR - AI Group Formation/FOR-001 - Bomber Speed and Route Test/FOR-001 - Bomber Speed and Route Test.miz b/FOR - AI Group Formation/FOR-001 - Bomber Speed and Route Test/FOR-001 - Bomber Speed and Route Test.miz index 301d1436b5..40ac7a0adf 100644 Binary files a/FOR - AI Group Formation/FOR-001 - Bomber Speed and Route Test/FOR-001 - Bomber Speed and Route Test.miz and b/FOR - AI Group Formation/FOR-001 - Bomber Speed and Route Test/FOR-001 - Bomber Speed and Route Test.miz differ diff --git a/FOR - AI Group Formation/FOR-100 - Bomber Left Line Formation/FOR-100 - Bomber Left Line Formation.lua b/FOR - AI Group Formation/FOR-100 - Bomber Left Line Formation/FOR-100 - Bomber Left Line Formation.lua index b6c474add3..9fd2e661ee 100644 --- a/FOR - AI Group Formation/FOR-100 - Bomber Left Line Formation/FOR-100 - Bomber Left Line Formation.lua +++ b/FOR - AI Group Formation/FOR-100 - Bomber Left Line Formation/FOR-100 - Bomber Left Line Formation.lua @@ -1,8 +1,8 @@ - -local FollowGroupSet = SET_GROUP:New():FilterCategories("plane"):FilterCoalitions("blue"):FilterPrefixes("Follow"):FilterStart() -FollowGroupSet:Flush() -local LeaderUnit = UNIT:FindByName( "Leader" ) -local LargeFormation = AI_FORMATION:New( LeaderUnit, FollowGroupSet, "Left Line Formation", "Briefing" ) -LargeFormation:FormationLeftLine( 0, 0, 250, 250 ) -LargeFormation:__Start( 1 ) - + +local FollowGroupSet = SET_GROUP:New():FilterCategories("plane"):FilterCoalitions("blue"):FilterPrefixes("Follow"):FilterStart() +FollowGroupSet:Flush() +local LeaderUnit = UNIT:FindByName( "Leader" ) +local LargeFormation = AI_FORMATION:New( LeaderUnit, FollowGroupSet, "Left Line Formation", "Briefing" ) +LargeFormation:FormationLeftLine( 0, 0, 250, 250 ) +LargeFormation:__Start( 1 ) + diff --git a/FOR - AI Group Formation/FOR-100 - Bomber Left Line Formation/FOR-100 - Bomber Left Line Formation.miz b/FOR - AI Group Formation/FOR-100 - Bomber Left Line Formation/FOR-100 - Bomber Left Line Formation.miz index 929173068c..19da6917e9 100644 Binary files a/FOR - AI Group Formation/FOR-100 - Bomber Left Line Formation/FOR-100 - Bomber Left Line Formation.miz and b/FOR - AI Group Formation/FOR-100 - Bomber Left Line Formation/FOR-100 - Bomber Left Line Formation.miz differ diff --git a/FOR - AI Group Formation/FOR-101 - Bomber Right Line Formation/FOR-101 - Bomber Right Line Formation.lua b/FOR - AI Group Formation/FOR-101 - Bomber Right Line Formation/FOR-101 - Bomber Right Line Formation.lua index 1ae1013f78..4d8d532349 100644 --- a/FOR - AI Group Formation/FOR-101 - Bomber Right Line Formation/FOR-101 - Bomber Right Line Formation.lua +++ b/FOR - AI Group Formation/FOR-101 - Bomber Right Line Formation/FOR-101 - Bomber Right Line Formation.lua @@ -1,8 +1,8 @@ - -local FollowGroupSet = SET_GROUP:New():FilterCategories("plane"):FilterCoalitions("blue"):FilterPrefixes("Follow"):FilterStart() -FollowGroupSet:Flush() -local LeaderUnit = UNIT:FindByName( "Leader" ) -local LargeFormation = AI_FORMATION:New( LeaderUnit, FollowGroupSet, "Right Line Formation", "Briefing" ) -LargeFormation:FormationRightLine(500,0,250,250) -LargeFormation:__Start( 1 ) - + +local FollowGroupSet = SET_GROUP:New():FilterCategories("plane"):FilterCoalitions("blue"):FilterPrefixes("Follow"):FilterStart() +FollowGroupSet:Flush() +local LeaderUnit = UNIT:FindByName( "Leader" ) +local LargeFormation = AI_FORMATION:New( LeaderUnit, FollowGroupSet, "Right Line Formation", "Briefing" ) +LargeFormation:FormationRightLine(500,0,250,250) +LargeFormation:__Start( 1 ) + diff --git a/FOR - AI Group Formation/FOR-101 - Bomber Right Line Formation/FOR-101 - Bomber Right Line Formation.miz b/FOR - AI Group Formation/FOR-101 - Bomber Right Line Formation/FOR-101 - Bomber Right Line Formation.miz index 149e8fdf4a..49911b99f1 100644 Binary files a/FOR - AI Group Formation/FOR-101 - Bomber Right Line Formation/FOR-101 - Bomber Right Line Formation.miz and b/FOR - AI Group Formation/FOR-101 - Bomber Right Line Formation/FOR-101 - Bomber Right Line Formation.miz differ diff --git a/FOR - AI Group Formation/FOR-102 - Bomber Left Wing Formation/FOR-102 - Bomber Left Wing Formation.lua b/FOR - AI Group Formation/FOR-102 - Bomber Left Wing Formation/FOR-102 - Bomber Left Wing Formation.lua index d5971c2c81..8367fc8c98 100644 --- a/FOR - AI Group Formation/FOR-102 - Bomber Left Wing Formation/FOR-102 - Bomber Left Wing Formation.lua +++ b/FOR - AI Group Formation/FOR-102 - Bomber Left Wing Formation/FOR-102 - Bomber Left Wing Formation.lua @@ -1,8 +1,8 @@ - -local FollowGroupSet = SET_GROUP:New():FilterCategories("plane"):FilterCoalitions("blue"):FilterPrefixes("Follow"):FilterStart() -FollowGroupSet:Flush() -local LeaderUnit = UNIT:FindByName( "Leader" ) -local LargeFormation = AI_FORMATION:New( LeaderUnit, FollowGroupSet, "Left Wing Formation", "Briefing" ) -LargeFormation:FormationLeftWing( 500, 50, 0, 250, 250 ) -LargeFormation:__Start( 1 ) - + +local FollowGroupSet = SET_GROUP:New():FilterCategories("plane"):FilterCoalitions("blue"):FilterPrefixes("Follow"):FilterStart() +FollowGroupSet:Flush() +local LeaderUnit = UNIT:FindByName( "Leader" ) +local LargeFormation = AI_FORMATION:New( LeaderUnit, FollowGroupSet, "Left Wing Formation", "Briefing" ) +LargeFormation:FormationLeftWing( 500, 50, 0, 250, 250 ) +LargeFormation:__Start( 1 ) + diff --git a/FOR - AI Group Formation/FOR-102 - Bomber Left Wing Formation/FOR-102 - Bomber Left Wing Formation.miz b/FOR - AI Group Formation/FOR-102 - Bomber Left Wing Formation/FOR-102 - Bomber Left Wing Formation.miz index 7c5023fd13..4ad8f95f80 100644 Binary files a/FOR - AI Group Formation/FOR-102 - Bomber Left Wing Formation/FOR-102 - Bomber Left Wing Formation.miz and b/FOR - AI Group Formation/FOR-102 - Bomber Left Wing Formation/FOR-102 - Bomber Left Wing Formation.miz differ diff --git a/FOR - AI Group Formation/FOR-103 - Bomber Right Wing Formation/FOR-103 - Bomber Right Wing Formation.lua b/FOR - AI Group Formation/FOR-103 - Bomber Right Wing Formation/FOR-103 - Bomber Right Wing Formation.lua index 65f7663d9f..543fb90f63 100644 --- a/FOR - AI Group Formation/FOR-103 - Bomber Right Wing Formation/FOR-103 - Bomber Right Wing Formation.lua +++ b/FOR - AI Group Formation/FOR-103 - Bomber Right Wing Formation/FOR-103 - Bomber Right Wing Formation.lua @@ -1,8 +1,8 @@ - -local FollowGroupSet = SET_GROUP:New():FilterCategories("plane"):FilterCoalitions("blue"):FilterPrefixes("Follow"):FilterStart() -FollowGroupSet:Flush() -local LeaderUnit = UNIT:FindByName( "Leader" ) -local LargeFormation = AI_FORMATION:New( LeaderUnit, FollowGroupSet, "Right Wing Formation", "Briefing" ) -LargeFormation:FormationRightWing( 100, 50, 0, 500, 500 ) -LargeFormation:__Start( 1 ) - + +local FollowGroupSet = SET_GROUP:New():FilterCategories("plane"):FilterCoalitions("blue"):FilterPrefixes("Follow"):FilterStart() +FollowGroupSet:Flush() +local LeaderUnit = UNIT:FindByName( "Leader" ) +local LargeFormation = AI_FORMATION:New( LeaderUnit, FollowGroupSet, "Right Wing Formation", "Briefing" ) +LargeFormation:FormationRightWing( 100, 50, 0, 500, 500 ) +LargeFormation:__Start( 1 ) + diff --git a/FOR - AI Group Formation/FOR-103 - Bomber Right Wing Formation/FOR-103 - Bomber Right Wing Formation.miz b/FOR - AI Group Formation/FOR-103 - Bomber Right Wing Formation/FOR-103 - Bomber Right Wing Formation.miz index 43d38a21ca..456ea1cd76 100644 Binary files a/FOR - AI Group Formation/FOR-103 - Bomber Right Wing Formation/FOR-103 - Bomber Right Wing Formation.miz and b/FOR - AI Group Formation/FOR-103 - Bomber Right Wing Formation/FOR-103 - Bomber Right Wing Formation.miz differ diff --git a/FOR - AI Group Formation/FOR-104 - Bomber Center Wing Formation/FOR-104 - Bomber Center Wing Formation.lua b/FOR - AI Group Formation/FOR-104 - Bomber Center Wing Formation/FOR-104 - Bomber Center Wing Formation.lua index e9e81ce8df..55dc30c280 100644 --- a/FOR - AI Group Formation/FOR-104 - Bomber Center Wing Formation/FOR-104 - Bomber Center Wing Formation.lua +++ b/FOR - AI Group Formation/FOR-104 - Bomber Center Wing Formation/FOR-104 - Bomber Center Wing Formation.lua @@ -1,8 +1,8 @@ - -local FollowGroupSet = SET_GROUP:New():FilterCategories("plane"):FilterCoalitions("blue"):FilterPrefixes("Follow"):FilterStart() -FollowGroupSet:Flush() -local LeaderUnit = UNIT:FindByName( "Leader" ) -local LargeFormation = AI_FORMATION:New( LeaderUnit, FollowGroupSet, "Center Wing Formation", "Briefing" ) -LargeFormation:FormationCenterWing( 500, 50, 0, 0, 250, 250 ) -LargeFormation:__Start( 1 ) - + +local FollowGroupSet = SET_GROUP:New():FilterCategories("plane"):FilterCoalitions("blue"):FilterPrefixes("Follow"):FilterStart() +FollowGroupSet:Flush() +local LeaderUnit = UNIT:FindByName( "Leader" ) +local LargeFormation = AI_FORMATION:New( LeaderUnit, FollowGroupSet, "Center Wing Formation", "Briefing" ) +LargeFormation:FormationCenterWing( 500, 50, 0, 0, 250, 250 ) +LargeFormation:__Start( 1 ) + diff --git a/FOR - AI Group Formation/FOR-104 - Bomber Center Wing Formation/FOR-104 - Bomber Center Wing Formation.miz b/FOR - AI Group Formation/FOR-104 - Bomber Center Wing Formation/FOR-104 - Bomber Center Wing Formation.miz index a279de7227..9b425e4847 100644 Binary files a/FOR - AI Group Formation/FOR-104 - Bomber Center Wing Formation/FOR-104 - Bomber Center Wing Formation.miz and b/FOR - AI Group Formation/FOR-104 - Bomber Center Wing Formation/FOR-104 - Bomber Center Wing Formation.miz differ diff --git a/FOR - AI Group Formation/FOR-105 - Bomber Trail Formation/FOR-105 - Bomber Trail Formation.lua b/FOR - AI Group Formation/FOR-105 - Bomber Trail Formation/FOR-105 - Bomber Trail Formation.lua index c17743225d..7e42d02086 100644 --- a/FOR - AI Group Formation/FOR-105 - Bomber Trail Formation/FOR-105 - Bomber Trail Formation.lua +++ b/FOR - AI Group Formation/FOR-105 - Bomber Trail Formation/FOR-105 - Bomber Trail Formation.lua @@ -1,8 +1,8 @@ - -local FollowGroupSet = SET_GROUP:New():FilterCategories("plane"):FilterCoalitions("blue"):FilterPrefixes("Follow"):FilterStart() -FollowGroupSet:Flush() -local LeaderUnit = UNIT:FindByName( "Leader" ) -local LargeFormation = AI_FORMATION:New( LeaderUnit, FollowGroupSet, "Trail Formation", "Briefing" ) -LargeFormation:FormationTrail( 250, 750 , 0 ) -LargeFormation:__Start( 1 ) - + +local FollowGroupSet = SET_GROUP:New():FilterCategories("plane"):FilterCoalitions("blue"):FilterPrefixes("Follow"):FilterStart() +FollowGroupSet:Flush() +local LeaderUnit = UNIT:FindByName( "Leader" ) +local LargeFormation = AI_FORMATION:New( LeaderUnit, FollowGroupSet, "Trail Formation", "Briefing" ) +LargeFormation:FormationTrail( 250, 750 , 0 ) +LargeFormation:__Start( 1 ) + diff --git a/FOR - AI Group Formation/FOR-105 - Bomber Trail Formation/FOR-105 - Bomber Trail Formation.miz b/FOR - AI Group Formation/FOR-105 - Bomber Trail Formation/FOR-105 - Bomber Trail Formation.miz index 4170fc5d1e..8394f30c0b 100644 Binary files a/FOR - AI Group Formation/FOR-105 - Bomber Trail Formation/FOR-105 - Bomber Trail Formation.miz and b/FOR - AI Group Formation/FOR-105 - Bomber Trail Formation/FOR-105 - Bomber Trail Formation.miz differ diff --git a/FOR - AI Group Formation/FOR-106 - Bomber Box Formation/FOR-106 - Bomber Box Formation.lua b/FOR - AI Group Formation/FOR-106 - Bomber Box Formation/FOR-106 - Bomber Box Formation.lua index 83f3cfbd95..3b66832f05 100644 --- a/FOR - AI Group Formation/FOR-106 - Bomber Box Formation/FOR-106 - Bomber Box Formation.lua +++ b/FOR - AI Group Formation/FOR-106 - Bomber Box Formation/FOR-106 - Bomber Box Formation.lua @@ -1,10 +1,10 @@ - -local FollowGroupSet = SET_GROUP:New():FilterCategories("plane"):FilterCoalitions("blue"):FilterPrefixes("Follow"):FilterStart() -FollowGroupSet:Flush() -local LeaderUnit = UNIT:FindByName( "Leader" ) -local LargeFormation = AI_FORMATION:New( LeaderUnit, FollowGroupSet, "Trail Formation", "Briefing" ) -LargeFormation:FormationBox(150,120,0,-5,0,60,8) -LargeFormation:__Start( 1 ) - -collectgarbage() - + +local FollowGroupSet = SET_GROUP:New():FilterCategories("plane"):FilterCoalitions("blue"):FilterPrefixes("Follow"):FilterStart() +FollowGroupSet:Flush() +local LeaderUnit = UNIT:FindByName( "Leader" ) +local LargeFormation = AI_FORMATION:New( LeaderUnit, FollowGroupSet, "Trail Formation", "Briefing" ) +LargeFormation:FormationBox(150,120,0,-5,0,60,8) +LargeFormation:__Start( 1 ) + +collectgarbage() + diff --git a/FOR - AI Group Formation/FOR-106 - Bomber Box Formation/FOR-106 - Bomber Box Formation.miz b/FOR - AI Group Formation/FOR-106 - Bomber Box Formation/FOR-106 - Bomber Box Formation.miz index 5209d2e329..35e9518524 100644 Binary files a/FOR - AI Group Formation/FOR-106 - Bomber Box Formation/FOR-106 - Bomber Box Formation.miz and b/FOR - AI Group Formation/FOR-106 - Bomber Box Formation/FOR-106 - Bomber Box Formation.miz differ diff --git a/FSM - Finite State Machine/FSM-100 - Transition Explanation/FSM-100 - Transition Explanation.lua b/FSM - Finite State Machine/FSM-100 - Transition Explanation/FSM-100 - Transition Explanation.lua index 1ad43849b4..50d85c903b 100644 --- a/FSM - Finite State Machine/FSM-100 - Transition Explanation/FSM-100 - Transition Explanation.lua +++ b/FSM - Finite State Machine/FSM-100 - Transition Explanation/FSM-100 - Transition Explanation.lua @@ -1,122 +1,122 @@ ---- Transition Explanation --- --- === --- --- Name: Transition Explanation --- Author: FlightControl --- Date Created: 05 Jan 2017 --- --- # Situation: --- --- Create a simple FSM. --- Add 2 transitions that will switch state from "Green" to "Red" upon event "Switch". --- --- # Test cases: --- --- # Status: TESTED 05 Jan 2017 - -local FsmDemo = FSM:New() -- #FsmDemo -local FsmUnit = UNIT:FindByName( "FlareUnit" ) - -FsmDemo:SetStartState( "Green" ) - -do FsmDemo:AddTransition( "Green", "Switch", "Red" ) -- FSM Transition for type #FsmDemo. - - --- OnLeave State Transition for Green. - -- @function [parent=#FsmDemo] OnLeaveGreen - -- @param #FsmDemo self - -- @param #string From The From State string. - -- @param #string Event The Event string. - -- @param #string To The To State string. - -- @return #boolean Return false to cancel Transition. - - --- OnEnter State Transition for Red. - -- @function [parent=#FsmDemo] OnEnterRed - -- @param #FsmDemo self - -- @param #string From The From State string. - -- @param #string Event The Event string. - -- @param #string To The To State string. - - --- OnBefore State Transition for Switch. - -- @function [parent=#FsmDemo] OnBeforeSwitch - -- @param #FsmDemo self - -- @param #string From The From State string. - -- @param #string Event The Event string. - -- @param #string To The To State string. - -- @return #boolean Return false to cancel Transition. - - --- OnAfter State Transition for Switch. - -- @function [parent=#FsmDemo] OnAfterSwitch - -- @param #FsmDemo self - -- @param #string From The From State string. - -- @param #string Event The Event string. - -- @param #string To The To State string. - - --- Embedded Event Trigger for Switch. - -- @function [parent=#FsmDemo] Switch - -- @param #FsmDemo self - - --- Delayed Event Trigger for Switch - -- @function [parent=#FsmDemo] __Switch - -- @param #FsmDemo self - -- @param #number Delay The delay in seconds. - -end -- FsmDemo - -do FsmDemo:AddTransition( "Red", "Switch", "Green" ) -- FSM Transition for type #FsmDemo. - - --- OnLeave State Transition for Red. - -- @function [parent=#FsmDemo] OnLeaveRed - -- @param #FsmDemo self - -- @param #string From The From State string. - -- @param #string Event The Event string. - -- @param #string To The To State string. - -- @return #boolean Return false to cancel Transition. - - --- OnEnter State Transition for Green. - -- @function [parent=#FsmDemo] OnEnterGreen - -- @param #FsmDemo self - -- @param #string From The From State string. - -- @param #string Event The Event string. - -- @param #string To The To State string. - - --- OnBefore State Transition for Switch. - -- @function [parent=#FsmDemo] OnBeforeSwitch - -- @param #FsmDemo self - -- @param #string From The From State string. - -- @param #string Event The Event string. - -- @param #string To The To State string. - -- @return #boolean Return false to cancel Transition. - - --- OnAfter State Transition for Switch. - -- @function [parent=#FsmDemo] OnAfterSwitch - -- @param #FsmDemo self - -- @param #string From The From State string. - -- @param #string Event The Event string. - -- @param #string To The To State string. - - --- Embedded Event Trigger for Switch. - -- @function [parent=#FsmDemo] Switch - -- @param #FsmDemo self - - --- Delayed Event Trigger for Switch - -- @function [parent=#FsmDemo] __Switch - -- @param #FsmDemo self - -- @param #number Delay The delay in seconds. - -end -- FsmDemo - -function FsmDemo:OnAfterSwitch( From, Event, To, FsmUnit ) - self:E( { From, Event, To, FsmUnit } ) - if From == "Green" then - FsmUnit:Flare(FLARECOLOR.Green) - else - if From == "Red" then - FsmUnit:Flare(FLARECOLOR.Red) - end - end - FsmDemo:__Switch( 5, FsmUnit ) -end - -FsmDemo:__Switch( 5, FsmUnit ) - +--- Transition Explanation +-- +-- === +-- +-- Name: Transition Explanation +-- Author: FlightControl +-- Date Created: 05 Jan 2017 +-- +-- # Situation: +-- +-- Create a simple FSM. +-- Add 2 transitions that will switch state from "Green" to "Red" upon event "Switch". +-- +-- # Test cases: +-- +-- # Status: TESTED 05 Jan 2017 + +local FsmDemo = FSM:New() -- #FsmDemo +local FsmUnit = UNIT:FindByName( "FlareUnit" ) + +FsmDemo:SetStartState( "Green" ) + +do FsmDemo:AddTransition( "Green", "Switch", "Red" ) -- FSM Transition for type #FsmDemo. + + --- OnLeave State Transition for Green. + -- @function [parent=#FsmDemo] OnLeaveGreen + -- @param #FsmDemo self + -- @param #string From The From State string. + -- @param #string Event The Event string. + -- @param #string To The To State string. + -- @return #boolean Return false to cancel Transition. + + --- OnEnter State Transition for Red. + -- @function [parent=#FsmDemo] OnEnterRed + -- @param #FsmDemo self + -- @param #string From The From State string. + -- @param #string Event The Event string. + -- @param #string To The To State string. + + --- OnBefore State Transition for Switch. + -- @function [parent=#FsmDemo] OnBeforeSwitch + -- @param #FsmDemo self + -- @param #string From The From State string. + -- @param #string Event The Event string. + -- @param #string To The To State string. + -- @return #boolean Return false to cancel Transition. + + --- OnAfter State Transition for Switch. + -- @function [parent=#FsmDemo] OnAfterSwitch + -- @param #FsmDemo self + -- @param #string From The From State string. + -- @param #string Event The Event string. + -- @param #string To The To State string. + + --- Embedded Event Trigger for Switch. + -- @function [parent=#FsmDemo] Switch + -- @param #FsmDemo self + + --- Delayed Event Trigger for Switch + -- @function [parent=#FsmDemo] __Switch + -- @param #FsmDemo self + -- @param #number Delay The delay in seconds. + +end -- FsmDemo + +do FsmDemo:AddTransition( "Red", "Switch", "Green" ) -- FSM Transition for type #FsmDemo. + + --- OnLeave State Transition for Red. + -- @function [parent=#FsmDemo] OnLeaveRed + -- @param #FsmDemo self + -- @param #string From The From State string. + -- @param #string Event The Event string. + -- @param #string To The To State string. + -- @return #boolean Return false to cancel Transition. + + --- OnEnter State Transition for Green. + -- @function [parent=#FsmDemo] OnEnterGreen + -- @param #FsmDemo self + -- @param #string From The From State string. + -- @param #string Event The Event string. + -- @param #string To The To State string. + + --- OnBefore State Transition for Switch. + -- @function [parent=#FsmDemo] OnBeforeSwitch + -- @param #FsmDemo self + -- @param #string From The From State string. + -- @param #string Event The Event string. + -- @param #string To The To State string. + -- @return #boolean Return false to cancel Transition. + + --- OnAfter State Transition for Switch. + -- @function [parent=#FsmDemo] OnAfterSwitch + -- @param #FsmDemo self + -- @param #string From The From State string. + -- @param #string Event The Event string. + -- @param #string To The To State string. + + --- Embedded Event Trigger for Switch. + -- @function [parent=#FsmDemo] Switch + -- @param #FsmDemo self + + --- Delayed Event Trigger for Switch + -- @function [parent=#FsmDemo] __Switch + -- @param #FsmDemo self + -- @param #number Delay The delay in seconds. + +end -- FsmDemo + +function FsmDemo:OnAfterSwitch( From, Event, To, FsmUnit ) + self:E( { From, Event, To, FsmUnit } ) + if From == "Green" then + FsmUnit:Flare(FLARECOLOR.Green) + else + if From == "Red" then + FsmUnit:Flare(FLARECOLOR.Red) + end + end + FsmDemo:__Switch( 5, FsmUnit ) +end + +FsmDemo:__Switch( 5, FsmUnit ) + diff --git a/FSM - Finite State Machine/FSM-100 - Transition Explanation/FSM-100 - Transition Explanation.miz b/FSM - Finite State Machine/FSM-100 - Transition Explanation/FSM-100 - Transition Explanation.miz index 11575a6c0d..e08c4f560d 100644 Binary files a/FSM - Finite State Machine/FSM-100 - Transition Explanation/FSM-100 - Transition Explanation.miz and b/FSM - Finite State Machine/FSM-100 - Transition Explanation/FSM-100 - Transition Explanation.miz differ diff --git a/GRP - Group Commands/GRP-100 - IsAlive/GRP-100 - IsAlive.lua b/GRP - Group Commands/GRP-100 - IsAlive/GRP-100 - IsAlive.lua index 7f33d42f2d..27e3a00b97 100644 --- a/GRP - Group Commands/GRP-100 - IsAlive/GRP-100 - IsAlive.lua +++ b/GRP - Group Commands/GRP-100 - IsAlive/GRP-100 - IsAlive.lua @@ -1,32 +1,32 @@ ---- --- Name: GRP-100 - IsAlive --- Author: FlightControl --- Date Created: 23 Feb 2017 --- --- # Situation: --- --- This test is about checking if IsAlive on GROUP level is working correctly. --- Two ground forces GROUPS are shooting each other. --- Check the IsAlive status in the logging of the survivor and the defeat. --- --- # Test cases: --- --- 1. Observe the IsAlive statuses in the dcs.log file. - - - ---Create Spawn Groups -local GroupBlue = GROUP:FindByName( "Blue" ) -local GroupRed = GROUP:FindByName( "Red" ) - -local Schedule, ScheduleID = SCHEDULER:New( nil, - --- Variable Declarations - -- @param Wrapper.Group#GROUP GroupBlue - -- @param Wrapper.Group#GROUP GroupRed - function( GroupBlue, GroupRed ) - local IsAliveBlue = GroupBlue:IsAlive() - local IsAliveRed = GroupRed:IsAlive() - BASE:E( { IsAliveBlue = IsAliveBlue, IsAliveRed = IsAliveRed } ) - end, { GroupBlue, GroupRed }, 1, 1 -) - +--- +-- Name: GRP-100 - IsAlive +-- Author: FlightControl +-- Date Created: 23 Feb 2017 +-- +-- # Situation: +-- +-- This test is about checking if IsAlive on GROUP level is working correctly. +-- Two ground forces GROUPS are shooting each other. +-- Check the IsAlive status in the logging of the survivor and the defeat. +-- +-- # Test cases: +-- +-- 1. Observe the IsAlive statuses in the dcs.log file. + + + +--Create Spawn Groups +local GroupBlue = GROUP:FindByName( "Blue" ) +local GroupRed = GROUP:FindByName( "Red" ) + +local Schedule, ScheduleID = SCHEDULER:New( nil, + --- Variable Declarations + -- @param Wrapper.Group#GROUP GroupBlue + -- @param Wrapper.Group#GROUP GroupRed + function( GroupBlue, GroupRed ) + local IsAliveBlue = GroupBlue:IsAlive() + local IsAliveRed = GroupRed:IsAlive() + BASE:E( { IsAliveBlue = IsAliveBlue, IsAliveRed = IsAliveRed } ) + end, { GroupBlue, GroupRed }, 1, 1 +) + diff --git a/GRP - Group Commands/GRP-100 - IsAlive/GRP-100 - IsAlive.miz b/GRP - Group Commands/GRP-100 - IsAlive/GRP-100 - IsAlive.miz index 6b9120624b..adf7ec7e93 100644 Binary files a/GRP - Group Commands/GRP-100 - IsAlive/GRP-100 - IsAlive.miz and b/GRP - Group Commands/GRP-100 - IsAlive/GRP-100 - IsAlive.miz differ diff --git a/GRP - Group Commands/GRP-100 - TaskAttackUnit/GRP-100 - TaskAttackUnit.lua b/GRP - Group Commands/GRP-100 - TaskAttackUnit/GRP-100 - TaskAttackUnit.lua index 1a96f44e74..efd8040ab7 100644 --- a/GRP - Group Commands/GRP-100 - TaskAttackUnit/GRP-100 - TaskAttackUnit.lua +++ b/GRP - Group Commands/GRP-100 - TaskAttackUnit/GRP-100 - TaskAttackUnit.lua @@ -1,30 +1,30 @@ ---- This test demonstrates the use(s) of the SwitchWayPoint method of the GROUP class. - -local HeliGroup = GROUP:FindByName( "Helicopter" ) - -local AttackGroup = GROUP:FindByName( "AttackGroup" ) - -local AttackUnits = AttackGroup:GetUnits() - -local Tasks = {} - -for i = 1, #AttackUnits do - - local AttackUnit = AttackGroup:GetUnit( i ) - Tasks[#Tasks+1] = HeliGroup:TaskAttackUnit( AttackUnit ) -end - -Tasks[#Tasks+1] = HeliGroup:TaskFunction( "_Resume", { "''" } ) - ---- @param Wrapper.Group#GROUP HeliGroup -function _Resume( HeliGroup ) - env.info( '_Resume' ) - - HeliGroup:MessageToAll( "Resuming",10,"Info") -end - -HeliGroup:PushTask( - HeliGroup:TaskCombo( - Tasks - ), 30 +--- This test demonstrates the use(s) of the SwitchWayPoint method of the GROUP class. + +local HeliGroup = GROUP:FindByName( "Helicopter" ) + +local AttackGroup = GROUP:FindByName( "AttackGroup" ) + +local AttackUnits = AttackGroup:GetUnits() + +local Tasks = {} + +for i = 1, #AttackUnits do + + local AttackUnit = AttackGroup:GetUnit( i ) + Tasks[#Tasks+1] = HeliGroup:TaskAttackUnit( AttackUnit ) +end + +Tasks[#Tasks+1] = HeliGroup:TaskFunction( "_Resume", { "''" } ) + +--- @param Wrapper.Group#GROUP HeliGroup +function _Resume( HeliGroup ) + env.info( '_Resume' ) + + HeliGroup:MessageToAll( "Resuming",10,"Info") +end + +HeliGroup:PushTask( + HeliGroup:TaskCombo( + Tasks + ), 30 ) \ No newline at end of file diff --git a/GRP - Group Commands/GRP-100 - TaskAttackUnit/GRP-100 - TaskAttackUnit.miz b/GRP - Group Commands/GRP-100 - TaskAttackUnit/GRP-100 - TaskAttackUnit.miz index 36c81cf7b6..d48b4b93c8 100644 Binary files a/GRP - Group Commands/GRP-100 - TaskAttackUnit/GRP-100 - TaskAttackUnit.miz and b/GRP - Group Commands/GRP-100 - TaskAttackUnit/GRP-100 - TaskAttackUnit.miz differ diff --git a/GRP - Group Commands/GRP-200 - Follow Group/GRP-200 - Follow Group.lua b/GRP - Group Commands/GRP-200 - Follow Group/GRP-200 - Follow Group.lua index 176f507c99..3c414f54a6 100644 --- a/GRP - Group Commands/GRP-200 - Follow Group/GRP-200 - Follow Group.lua +++ b/GRP - Group Commands/GRP-200 - Follow Group/GRP-200 - Follow Group.lua @@ -1,24 +1,24 @@ - ---Create Spawn Groups -local SpawnPlane1 = SPAWN:New("Plane 1") -local SpawnPlane2 = SPAWN:New("Plane 2") - ---Spawn Groups into world -local GroupPlane1 = SpawnPlane1:Spawn() ---local GroupPlane1 = GROUP:FindByName( "Plane 1" ) -local GroupPlane2 = SpawnPlane2:Spawn() ---local GroupPlane2 = GROUP:FindByName( "Plane 2" ) - ---Create Task for plane2 (follow groupPlane1 at Vec3 offset) (Note: I think I need to be using controllers here) ---i.e. cntrlPlane1 = groupPlane1.getController(groupPlane1) - -local PointVec3 = POINT_VEC3:New( 100, 0, -100 ) -- This is a Vec3 class. - -local FollowDCSTask = GroupPlane2:TaskFollow( GroupPlane1, PointVec3:GetVec3() ) - ---Activate Task (Either PushTask/SetTask?) --- PushTask will push a task on the execution queue of the group. --- SetTask will delete all tasks from the current group queue, and executes this task. - -GroupPlane2:SetTask( FollowDCSTask, 1 ) - + +--Create Spawn Groups +local SpawnPlane1 = SPAWN:New("Plane 1") +local SpawnPlane2 = SPAWN:New("Plane 2") + +--Spawn Groups into world +local GroupPlane1 = SpawnPlane1:Spawn() +--local GroupPlane1 = GROUP:FindByName( "Plane 1" ) +local GroupPlane2 = SpawnPlane2:Spawn() +--local GroupPlane2 = GROUP:FindByName( "Plane 2" ) + +--Create Task for plane2 (follow groupPlane1 at Vec3 offset) (Note: I think I need to be using controllers here) +--i.e. cntrlPlane1 = groupPlane1.getController(groupPlane1) + +local PointVec3 = POINT_VEC3:New( 100, 0, -100 ) -- This is a Vec3 class. + +local FollowDCSTask = GroupPlane2:TaskFollow( GroupPlane1, PointVec3:GetVec3() ) + +--Activate Task (Either PushTask/SetTask?) +-- PushTask will push a task on the execution queue of the group. +-- SetTask will delete all tasks from the current group queue, and executes this task. + +GroupPlane2:SetTask( FollowDCSTask, 1 ) + diff --git a/GRP - Group Commands/GRP-200 - Follow Group/GRP-200 - Follow Group.miz b/GRP - Group Commands/GRP-200 - Follow Group/GRP-200 - Follow Group.miz index cbae297549..5986686fbf 100644 Binary files a/GRP - Group Commands/GRP-200 - Follow Group/GRP-200 - Follow Group.miz and b/GRP - Group Commands/GRP-200 - Follow Group/GRP-200 - Follow Group.miz differ diff --git a/GRP - Group Commands/GRP-300 - Switch WayPoints/GRP-300 - Switch WayPoints.lua b/GRP - Group Commands/GRP-300 - Switch WayPoints/GRP-300 - Switch WayPoints.lua index 03258b2cfb..8355b95e10 100644 --- a/GRP - Group Commands/GRP-300 - Switch WayPoints/GRP-300 - Switch WayPoints.lua +++ b/GRP - Group Commands/GRP-300 - Switch WayPoints/GRP-300 - Switch WayPoints.lua @@ -1,12 +1,12 @@ ---- This test demonstrates the use(s) of the SwitchWayPoint method of the GROUP class. - -HeliGroup = GROUP:FindByName( "Helicopter" ) - ---- Route the helicopter back to the FARP after 60 seconds. --- We use the SCHEDULER class to do this. -SCHEDULER:New( nil, - function( HeliGroup ) - local CommandRTB = HeliGroup:CommandSwitchWayPoint( 2, 8 ) - HeliGroup:SetCommand( CommandRTB ) - end, { HeliGroup }, 90 -) +--- This test demonstrates the use(s) of the SwitchWayPoint method of the GROUP class. + +HeliGroup = GROUP:FindByName( "Helicopter" ) + +--- Route the helicopter back to the FARP after 60 seconds. +-- We use the SCHEDULER class to do this. +SCHEDULER:New( nil, + function( HeliGroup ) + local CommandRTB = HeliGroup:CommandSwitchWayPoint( 2, 8 ) + HeliGroup:SetCommand( CommandRTB ) + end, { HeliGroup }, 90 +) diff --git a/GRP - Group Commands/GRP-300 - Switch WayPoints/GRP-300 - Switch WayPoints.miz b/GRP - Group Commands/GRP-300 - Switch WayPoints/GRP-300 - Switch WayPoints.miz index 71e1d11fad..e75a952f29 100644 Binary files a/GRP - Group Commands/GRP-300 - Switch WayPoints/GRP-300 - Switch WayPoints.miz and b/GRP - Group Commands/GRP-300 - Switch WayPoints/GRP-300 - Switch WayPoints.miz differ diff --git a/GRP - Group Commands/GRP-310 - Command StopRoute/GRP-310 - Command StopRoute.lua b/GRP - Group Commands/GRP-310 - Command StopRoute/GRP-310 - Command StopRoute.lua index 1f7710d18c..47012d3de2 100644 --- a/GRP - Group Commands/GRP-310 - Command StopRoute/GRP-310 - Command StopRoute.lua +++ b/GRP - Group Commands/GRP-310 - Command StopRoute/GRP-310 - Command StopRoute.lua @@ -1,39 +1,39 @@ ---- --- Name: GRP-310 - Command StopRoute --- Author: FlightControl --- Date Created: 25 Mar 2017 --- --- # Situation: --- A ground unit is moving. --- Using the command CommandStopMove it will stop moving after 10 seconds. --- --- # Test cases: --- --- 1. Observe the ground group stopping to move. --- - ---- @param Wrapper.Group#GROUP GroundGroup -function StopMove( GroundGroup ) - - BASE:E("Stop") - local Command = GroundGroup:CommandStopRoute( true ) - GroundGroup:SetCommand(Command) - -end - ---- @param Wrapper.Group#GROUP GroundGroup -function StartMove( GroundGroup ) - - BASE:E("Start") - local Command = GroundGroup:CommandStopRoute( false ) - GroundGroup:SetCommand(Command) - -end - -GroundGroup = GROUP:FindByName( "Ground" ) - -Scheduler = SCHEDULER:New( nil ) -ScheduleIDStop = Scheduler:Schedule(nil, StopMove, { GroundGroup }, 10, 20 ) -ScheduleIDStart = Scheduler:Schedule(nil, StartMove, { GroundGroup }, 20, 20 ) - - +--- +-- Name: GRP-310 - Command StopRoute +-- Author: FlightControl +-- Date Created: 25 Mar 2017 +-- +-- # Situation: +-- A ground unit is moving. +-- Using the command CommandStopMove it will stop moving after 10 seconds. +-- +-- # Test cases: +-- +-- 1. Observe the ground group stopping to move. +-- + +--- @param Wrapper.Group#GROUP GroundGroup +function StopMove( GroundGroup ) + + BASE:E("Stop") + local Command = GroundGroup:CommandStopRoute( true ) + GroundGroup:SetCommand(Command) + +end + +--- @param Wrapper.Group#GROUP GroundGroup +function StartMove( GroundGroup ) + + BASE:E("Start") + local Command = GroundGroup:CommandStopRoute( false ) + GroundGroup:SetCommand(Command) + +end + +GroundGroup = GROUP:FindByName( "Ground" ) + +Scheduler = SCHEDULER:New( nil ) +ScheduleIDStop = Scheduler:Schedule(nil, StopMove, { GroundGroup }, 10, 20 ) +ScheduleIDStart = Scheduler:Schedule(nil, StartMove, { GroundGroup }, 20, 20 ) + + diff --git a/GRP - Group Commands/GRP-310 - Command StopRoute/GRP-310 - Command StopRoute.miz b/GRP - Group Commands/GRP-310 - Command StopRoute/GRP-310 - Command StopRoute.miz index c60565d4ab..72635948e5 100644 Binary files a/GRP - Group Commands/GRP-310 - Command StopRoute/GRP-310 - Command StopRoute.miz and b/GRP - Group Commands/GRP-310 - Command StopRoute/GRP-310 - Command StopRoute.miz differ diff --git a/GRP - Group Commands/GRP-400 - RouteReturnToAirbase/GRP-400 - RouteReturnToAirbase.lua b/GRP - Group Commands/GRP-400 - RouteReturnToAirbase/GRP-400 - RouteReturnToAirbase.lua index 47ff792f44..879bf9cd33 100644 --- a/GRP - Group Commands/GRP-400 - RouteReturnToAirbase/GRP-400 - RouteReturnToAirbase.lua +++ b/GRP - Group Commands/GRP-400 - RouteReturnToAirbase/GRP-400 - RouteReturnToAirbase.lua @@ -1,45 +1,45 @@ ---- --- Name: GRP-400 - RouteReturnToAirbase --- Author: FlightControl --- Date Created: 25 Mar 2017 --- --- # Situation: --- Three air units are flying and are commanded to return a specific airbase. --- --- # Test cases: --- --- 1. Observe the Air1 group return to Batumi after 10 seconds. --- 2. Observe the Air2 group returning to Kobuleti after 300 seconds. (It was planned to land at Kutaisi). --- 3. Observe the Air3 group returning to the home (landing) airbase after 300 seconds. (It was planned to land at Kutaisi). --- - ---- @param Wrapper.Group#GROUP AirGroup -function ReturnToBatumi( AirGroup ) - BASE:E("ReturnToBatumi") - AirGroup:RouteRTB( AIRBASE:FindByName("Batumi") ) -end - ---- @param Wrapper.Group#GROUP AirGroup -function ReturnToKobuleti( AirGroup ) - BASE:E("ReturnToKobuleti") - AirGroup:RouteRTB( AIRBASE:FindByName("Kobuleti") ) -end - ---- @param Wrapper.Group#GROUP AirGroup -function ReturnToHome( AirGroup ) - BASE:E("ReturnToHome") - AirGroup:RouteRTB() -end - -Air1Group = GROUP:FindByName( "Air1" ) -Air2Group = GROUP:FindByName( "Air2" ) -Air3Group = GROUP:FindByName( "Air3" ) - -Scheduler = SCHEDULER:New( nil ) -ScheduleIDAir1 = Scheduler:Schedule(nil, ReturnToBatumi, { Air1Group }, 10 ) -ScheduleIDAir2 = Scheduler:Schedule(nil, ReturnToKobuleti, { Air2Group }, 300 ) -ScheduleIDAir3 = Scheduler:Schedule(nil, ReturnToHome, { Air3Group }, 300 ) - - - - +--- +-- Name: GRP-400 - RouteReturnToAirbase +-- Author: FlightControl +-- Date Created: 25 Mar 2017 +-- +-- # Situation: +-- Three air units are flying and are commanded to return a specific airbase. +-- +-- # Test cases: +-- +-- 1. Observe the Air1 group return to Batumi after 10 seconds. +-- 2. Observe the Air2 group returning to Kobuleti after 300 seconds. (It was planned to land at Kutaisi). +-- 3. Observe the Air3 group returning to the home (landing) airbase after 300 seconds. (It was planned to land at Kutaisi). +-- + +--- @param Wrapper.Group#GROUP AirGroup +function ReturnToBatumi( AirGroup ) + BASE:E("ReturnToBatumi") + AirGroup:RouteRTB( AIRBASE:FindByName("Batumi") ) +end + +--- @param Wrapper.Group#GROUP AirGroup +function ReturnToKobuleti( AirGroup ) + BASE:E("ReturnToKobuleti") + AirGroup:RouteRTB( AIRBASE:FindByName("Kobuleti") ) +end + +--- @param Wrapper.Group#GROUP AirGroup +function ReturnToHome( AirGroup ) + BASE:E("ReturnToHome") + AirGroup:RouteRTB() +end + +Air1Group = GROUP:FindByName( "Air1" ) +Air2Group = GROUP:FindByName( "Air2" ) +Air3Group = GROUP:FindByName( "Air3" ) + +Scheduler = SCHEDULER:New( nil ) +ScheduleIDAir1 = Scheduler:Schedule(nil, ReturnToBatumi, { Air1Group }, 10 ) +ScheduleIDAir2 = Scheduler:Schedule(nil, ReturnToKobuleti, { Air2Group }, 300 ) +ScheduleIDAir3 = Scheduler:Schedule(nil, ReturnToHome, { Air3Group }, 300 ) + + + + diff --git a/GRP - Group Commands/GRP-400 - RouteReturnToAirbase/GRP-400 - RouteReturnToAirbase.miz b/GRP - Group Commands/GRP-400 - RouteReturnToAirbase/GRP-400 - RouteReturnToAirbase.miz index 5500e6d085..b13f7354ce 100644 Binary files a/GRP - Group Commands/GRP-400 - RouteReturnToAirbase/GRP-400 - RouteReturnToAirbase.miz and b/GRP - Group Commands/GRP-400 - RouteReturnToAirbase/GRP-400 - RouteReturnToAirbase.miz differ diff --git a/GRP - Group Commands/GRP-500 - Ground TaskRoute/GRP-500 - Ground TaskRoute.lua b/GRP - Group Commands/GRP-500 - Ground TaskRoute/GRP-500 - Ground TaskRoute.lua index b8948304bb..6de4df765b 100644 --- a/GRP - Group Commands/GRP-500 - Ground TaskRoute/GRP-500 - Ground TaskRoute.lua +++ b/GRP - Group Commands/GRP-500 - Ground TaskRoute/GRP-500 - Ground TaskRoute.lua @@ -1,21 +1,21 @@ --- This routes a GroundGroup 1km further with an angle of 180 degrees. - -local GroundGroup = GROUP:FindByName( "Vehicle" ) - --- Get the current coordinate of GroundGroup -FromCoord = GroundGroup:GetCoordinate() - --- From the current coordinate, calculate 1km away with an angle of 180 degrees. -ToCoord = FromCoord:Translate( 1000, 180 ) - -RoutePoints = {} - --- Create a "grount route point", which is a "point" structure that can be given as a parameter to a Task -RoutePoints[#RoutePoints+1] = FromCoord:RoutePointGround( 0 ) -RoutePoints[#RoutePoints+1] = ToCoord:RoutePointGround( 60, "Cone" ) - --- Create a combo task, that creates a route task to the RoutePoint -RouteTask = GroundGroup:TaskRoute( RoutePoints ) - --- Set the task to be executed by the GroundGroup +-- This routes a GroundGroup 1km further with an angle of 180 degrees. + +local GroundGroup = GROUP:FindByName( "Vehicle" ) + +-- Get the current coordinate of GroundGroup +FromCoord = GroundGroup:GetCoordinate() + +-- From the current coordinate, calculate 1km away with an angle of 180 degrees. +ToCoord = FromCoord:Translate( 1000, 180 ) + +RoutePoints = {} + +-- Create a "grount route point", which is a "point" structure that can be given as a parameter to a Task +RoutePoints[#RoutePoints+1] = FromCoord:RoutePointGround( 0 ) +RoutePoints[#RoutePoints+1] = ToCoord:RoutePointGround( 60, "Cone" ) + +-- Create a combo task, that creates a route task to the RoutePoint +RouteTask = GroundGroup:TaskRoute( RoutePoints ) + +-- Set the task to be executed by the GroundGroup GroundGroup:SetTask( RouteTask, 1 ) \ No newline at end of file diff --git a/GRP - Group Commands/GRP-500 - Ground TaskRoute/GRP-500 - Ground TaskRoute.miz b/GRP - Group Commands/GRP-500 - Ground TaskRoute/GRP-500 - Ground TaskRoute.miz index 854339a924..29aa05cf7d 100644 Binary files a/GRP - Group Commands/GRP-500 - Ground TaskRoute/GRP-500 - Ground TaskRoute.miz and b/GRP - Group Commands/GRP-500 - Ground TaskRoute/GRP-500 - Ground TaskRoute.miz differ diff --git a/GRP - Group Commands/GRP-501 - Ground TaskRouteToVec2/GRP-501 - Ground TaskRouteToVec2.lua b/GRP - Group Commands/GRP-501 - Ground TaskRouteToVec2/GRP-501 - Ground TaskRouteToVec2.lua index 3c27fa34c7..44530328be 100644 --- a/GRP - Group Commands/GRP-501 - Ground TaskRouteToVec2/GRP-501 - Ground TaskRouteToVec2.lua +++ b/GRP - Group Commands/GRP-501 - Ground TaskRouteToVec2/GRP-501 - Ground TaskRouteToVec2.lua @@ -1,16 +1,16 @@ --- This routes a GroundGroup 1km further with an angle of 180 degrees. - -local GroundGroup = GROUP:FindByName( "Vehicle" ) - --- Get the current coordinate of GroundGroup -FromCoord = GroundGroup:GetCoordinate() - --- From the current coordinate, calculate 1km away with an angle of 180 degrees. -ToCoord = FromCoord:Translate( 1000, 180 ) - - --- Create a combo task, that creates a route task to the RoutePoint -RouteTask = GroundGroup:TaskRouteToVec2( ToCoord:GetVec2() ) - --- Set the task to be executed by the GroundGroup +-- This routes a GroundGroup 1km further with an angle of 180 degrees. + +local GroundGroup = GROUP:FindByName( "Vehicle" ) + +-- Get the current coordinate of GroundGroup +FromCoord = GroundGroup:GetCoordinate() + +-- From the current coordinate, calculate 1km away with an angle of 180 degrees. +ToCoord = FromCoord:Translate( 1000, 180 ) + + +-- Create a combo task, that creates a route task to the RoutePoint +RouteTask = GroundGroup:TaskRouteToVec2( ToCoord:GetVec2() ) + +-- Set the task to be executed by the GroundGroup GroundGroup:SetTask( RouteTask, 1 ) \ No newline at end of file diff --git a/GRP - Group Commands/GRP-501 - Ground TaskRouteToVec2/GRP-501 - Ground TaskRouteToVec2.miz b/GRP - Group Commands/GRP-501 - Ground TaskRouteToVec2/GRP-501 - Ground TaskRouteToVec2.miz index c057b61452..8d6ee1bea7 100644 Binary files a/GRP - Group Commands/GRP-501 - Ground TaskRouteToVec2/GRP-501 - Ground TaskRouteToVec2.miz and b/GRP - Group Commands/GRP-501 - Ground TaskRouteToVec2/GRP-501 - Ground TaskRouteToVec2.miz differ diff --git a/GRP - Group Commands/GRP-502 - Route at waypoint to random point/GRP-502 - Route at waypoint to random point.lua b/GRP - Group Commands/GRP-502 - Route at waypoint to random point/GRP-502 - Route at waypoint to random point.lua index 2718cafa9f..51979c7f34 100644 --- a/GRP - Group Commands/GRP-502 - Route at waypoint to random point/GRP-502 - Route at waypoint to random point.lua +++ b/GRP - Group Commands/GRP-502 - Route at waypoint to random point/GRP-502 - Route at waypoint to random point.lua @@ -1,46 +1,46 @@ ---- This makes a vehicle fly to random zones when a waypoint has been reached. --- Name: GRP - Group Commands/GRP-502 - Route at waypoint to random point --- Author: FlightControl --- Date Created: 08 Aug 2017 - - -local ZoneList = { - ZONE:New( "ZONE1" ), - ZONE:New( "ZONE2" ), - ZONE:New( "ZONE3" ), - ZONE:New( "ZONE4" ), - ZONE:New( "ZONE5" ) -} - -GroundGroup = GROUP:FindByName( "Vehicle" ) - ---- @param Wrapper.Group#GROUP GroundGroup -function RouteToZone( Vehicle, ZoneRoute ) - - local Route = {} - - Vehicle:E( { ZoneRoute = ZoneRoute } ) - - Vehicle:MessageToAll( "Moving to zone " .. ZoneRoute:GetName(), 10 ) - - -- Get the current coordinate of the Vehicle - local FromCoord = Vehicle:GetCoordinate() - - -- Select a random Zone and get the Coordinate of the new Zone. - local RandomZone = ZoneList[ math.random( 1, #ZoneList ) ] -- Core.Zone#ZONE - local ToCoord = RandomZone:GetCoordinate() - - -- Create a "ground route point", which is a "point" structure that can be given as a parameter to a Task - Route[#Route+1] = FromCoord:RoutePointGround( 72 ) - Route[#Route+1] = ToCoord:RoutePointGround( 60, "Vee" ) - - local TaskRouteToZone = Vehicle:TaskFunction( "RouteToZone", RandomZone ) - - Vehicle:SetTaskAtWaypoint( Route, #Route, TaskRouteToZone ) -- Set for the given Route at Waypoint 2 the TaskRouteToZone. - - Vehicle:Route( Route, math.random( 10, 20 ) ) -- Move after a random seconds to the Route. See the Route method for details. - -end - -RouteToZone( GroundGroup, ZoneList[1] ) - +--- This makes a vehicle fly to random zones when a waypoint has been reached. +-- Name: GRP - Group Commands/GRP-502 - Route at waypoint to random point +-- Author: FlightControl +-- Date Created: 08 Aug 2017 + + +local ZoneList = { + ZONE:New( "ZONE1" ), + ZONE:New( "ZONE2" ), + ZONE:New( "ZONE3" ), + ZONE:New( "ZONE4" ), + ZONE:New( "ZONE5" ) +} + +GroundGroup = GROUP:FindByName( "Vehicle" ) + +--- @param Wrapper.Group#GROUP GroundGroup +function RouteToZone( Vehicle, ZoneRoute ) + + local Route = {} + + Vehicle:E( { ZoneRoute = ZoneRoute } ) + + Vehicle:MessageToAll( "Moving to zone " .. ZoneRoute:GetName(), 10 ) + + -- Get the current coordinate of the Vehicle + local FromCoord = Vehicle:GetCoordinate() + + -- Select a random Zone and get the Coordinate of the new Zone. + local RandomZone = ZoneList[ math.random( 1, #ZoneList ) ] -- Core.Zone#ZONE + local ToCoord = RandomZone:GetCoordinate() + + -- Create a "ground route point", which is a "point" structure that can be given as a parameter to a Task + Route[#Route+1] = FromCoord:RoutePointGround( 72 ) + Route[#Route+1] = ToCoord:RoutePointGround( 60, "Vee" ) + + local TaskRouteToZone = Vehicle:TaskFunction( "RouteToZone", RandomZone ) + + Vehicle:SetTaskAtWaypoint( Route, #Route, TaskRouteToZone ) -- Set for the given Route at Waypoint 2 the TaskRouteToZone. + + Vehicle:Route( Route, math.random( 10, 20 ) ) -- Move after a random seconds to the Route. See the Route method for details. + +end + +RouteToZone( GroundGroup, ZoneList[1] ) + diff --git a/GRP - Group Commands/GRP-502 - Route at waypoint to random point/GRP-502 - Route at waypoint to random point.miz b/GRP - Group Commands/GRP-502 - Route at waypoint to random point/GRP-502 - Route at waypoint to random point.miz index b62816cc7b..49617e2984 100644 Binary files a/GRP - Group Commands/GRP-502 - Route at waypoint to random point/GRP-502 - Route at waypoint to random point.miz and b/GRP - Group Commands/GRP-502 - Route at waypoint to random point/GRP-502 - Route at waypoint to random point.miz differ diff --git a/GRP - Group Commands/GRP-503 - NTTR Route at waypoint to random point/GRP-503 - NTTR Route at waypoint to random point.lua b/GRP - Group Commands/GRP-503 - NTTR Route at waypoint to random point/GRP-503 - NTTR Route at waypoint to random point.lua index 021dc73518..330e3fbc26 100644 --- a/GRP - Group Commands/GRP-503 - NTTR Route at waypoint to random point/GRP-503 - NTTR Route at waypoint to random point.lua +++ b/GRP - Group Commands/GRP-503 - NTTR Route at waypoint to random point/GRP-503 - NTTR Route at waypoint to random point.lua @@ -1,45 +1,45 @@ ---- This makes a vehicle drive to random zones when a waypoint has been reached. --- Name: GRP - Group Commands/GRP-503 - NTTR Route at waypoint to random point --- Author: FlightControl --- Date Created: 08 Aug 2017 - - -local ZoneList = { - ZONE:New( "ZONE1" ), - ZONE:New( "ZONE2" ), - ZONE:New( "ZONE3" ), - ZONE:New( "ZONE4" ), - ZONE:New( "ZONE5" ), -} - -VehicleGroup = GROUP:FindByName( "Vehicle #001" ) - ---- @param Wrapper.Group#GROUP RoutedGroup -function ReRoute( VehicleGroup ) - - VehicleGroup:E( "Routing" ) - - local ZoneNumber = math.random( 1, #ZoneList ) - VehicleGroup:E( ZoneNumber ) - - local FromCoord = VehicleGroup:GetCoordinate() -- Core.Point#COORDINATE - local FromWP = FromCoord:WaypointGround() - - local ZoneTo = ZoneList[ ZoneNumber ] -- Core.Zone#ZONE - local ToCoord = ZoneTo:GetCoordinate() - local ToWP = ToCoord:WaypointGround( 72, "Vee" ) - - local TaskReRoute = VehicleGroup:TaskFunction( "ReRoute" ) - VehicleGroup:SetTaskWaypoint( ToWP, TaskReRoute ) - - VehicleGroup:Route( { FromWP, ToWP }, 1 ) - -end - -ReRoute( VehicleGroup ) - - - - - - +--- This makes a vehicle drive to random zones when a waypoint has been reached. +-- Name: GRP - Group Commands/GRP-503 - NTTR Route at waypoint to random point +-- Author: FlightControl +-- Date Created: 08 Aug 2017 + + +local ZoneList = { + ZONE:New( "ZONE1" ), + ZONE:New( "ZONE2" ), + ZONE:New( "ZONE3" ), + ZONE:New( "ZONE4" ), + ZONE:New( "ZONE5" ), +} + +VehicleGroup = GROUP:FindByName( "Vehicle #001" ) + +--- @param Wrapper.Group#GROUP RoutedGroup +function ReRoute( VehicleGroup ) + + VehicleGroup:E( "Routing" ) + + local ZoneNumber = math.random( 1, #ZoneList ) + VehicleGroup:E( ZoneNumber ) + + local FromCoord = VehicleGroup:GetCoordinate() -- Core.Point#COORDINATE + local FromWP = FromCoord:WaypointGround() + + local ZoneTo = ZoneList[ ZoneNumber ] -- Core.Zone#ZONE + local ToCoord = ZoneTo:GetCoordinate() + local ToWP = ToCoord:WaypointGround( 72, "Vee" ) + + local TaskReRoute = VehicleGroup:TaskFunction( "ReRoute" ) + VehicleGroup:SetTaskWaypoint( ToWP, TaskReRoute ) + + VehicleGroup:Route( { FromWP, ToWP }, 1 ) + +end + +ReRoute( VehicleGroup ) + + + + + + diff --git a/GRP - Group Commands/GRP-503 - NTTR Route at waypoint to random point/GRP-503 - NTTR Route at waypoint to random point.miz b/GRP - Group Commands/GRP-503 - NTTR Route at waypoint to random point/GRP-503 - NTTR Route at waypoint to random point.miz index d6430996be..87c8b5e544 100644 Binary files a/GRP - Group Commands/GRP-503 - NTTR Route at waypoint to random point/GRP-503 - NTTR Route at waypoint to random point.miz and b/GRP - Group Commands/GRP-503 - NTTR Route at waypoint to random point/GRP-503 - NTTR Route at waypoint to random point.miz differ diff --git a/GRP - Group Commands/GRP-550 - Patrol a route/GRP-550 - Patrol a route.lua b/GRP - Group Commands/GRP-550 - Patrol a route/GRP-550 - Patrol a route.lua index 909d0f11c8..685a5826d5 100644 --- a/GRP - Group Commands/GRP-550 - Patrol a route/GRP-550 - Patrol a route.lua +++ b/GRP - Group Commands/GRP-550 - Patrol a route/GRP-550 - Patrol a route.lua @@ -1,17 +1,17 @@ ---- This makes a vehicle drive its route in a repetitive way. --- Name: GRP-550 - Patrol a route --- Author: FlightControl --- Date Created: 24 Sep 2017 - - --- Find the Vehicle and create a GROUP object. -Vehicle = GROUP:FindByName( "Vehicle" ) - --- Patrol the route of the Vehicle. -Vehicle:PatrolRoute() - --- Find the Ship and create a GROUP object. -Ship = GROUP:FindByName( "Ship" ) - --- Patrol the route of the Ship. -Ship:PatrolRoute() +--- This makes a vehicle drive its route in a repetitive way. +-- Name: GRP-550 - Patrol a route +-- Author: FlightControl +-- Date Created: 24 Sep 2017 + + +-- Find the Vehicle and create a GROUP object. +Vehicle = GROUP:FindByName( "Vehicle" ) + +-- Patrol the route of the Vehicle. +Vehicle:PatrolRoute() + +-- Find the Ship and create a GROUP object. +Ship = GROUP:FindByName( "Ship" ) + +-- Patrol the route of the Ship. +Ship:PatrolRoute() diff --git a/GRP - Group Commands/GRP-550 - Patrol a route/GRP-550 - Patrol a route.miz b/GRP - Group Commands/GRP-550 - Patrol a route/GRP-550 - Patrol a route.miz index 7be5130427..e765b29cba 100644 Binary files a/GRP - Group Commands/GRP-550 - Patrol a route/GRP-550 - Patrol a route.miz and b/GRP - Group Commands/GRP-550 - Patrol a route/GRP-550 - Patrol a route.miz differ diff --git a/GRP - Group Commands/GRP-551 - Patrol to random points of a route/GRP-551 - Patrol to random points of a route.lua b/GRP - Group Commands/GRP-551 - Patrol to random points of a route/GRP-551 - Patrol to random points of a route.lua index d934f1018f..17949556e8 100644 --- a/GRP - Group Commands/GRP-551 - Patrol to random points of a route/GRP-551 - Patrol to random points of a route.lua +++ b/GRP - Group Commands/GRP-551 - Patrol to random points of a route/GRP-551 - Patrol to random points of a route.lua @@ -1,17 +1,17 @@ ---- This makes a vehicle drive its route using the waypoints of the route and selecing random points on the route. --- Name: GRP-551 - Patrol to random points of a route --- Author: FlightControl --- Date Created: 24 Sep 2017 - - --- Find the Vehicle and create a GROUP object. -Vehicle = GROUP:FindByName( "Vehicle" ) - --- Patrol to random points of the route at 120 km/h in "Vee" formation. -Vehicle:PatrolRouteRandom( 120, "Vee" ) - --- Find the Ship and create a GROUP object. -Ship = GROUP:FindByName( "Ship" ) - --- Patrol to random points of the route at 120 km/h in "Vee" formation. -Ship:PatrolRouteRandom( 120, "Vee" ) +--- This makes a vehicle drive its route using the waypoints of the route and selecing random points on the route. +-- Name: GRP-551 - Patrol to random points of a route +-- Author: FlightControl +-- Date Created: 24 Sep 2017 + + +-- Find the Vehicle and create a GROUP object. +Vehicle = GROUP:FindByName( "Vehicle" ) + +-- Patrol to random points of the route at 120 km/h in "Vee" formation. +Vehicle:PatrolRouteRandom( 120, "Vee" ) + +-- Find the Ship and create a GROUP object. +Ship = GROUP:FindByName( "Ship" ) + +-- Patrol to random points of the route at 120 km/h in "Vee" formation. +Ship:PatrolRouteRandom( 120, "Vee" ) diff --git a/GRP - Group Commands/GRP-551 - Patrol to random points of a route/GRP-551 - Patrol to random points of a route.miz b/GRP - Group Commands/GRP-551 - Patrol to random points of a route/GRP-551 - Patrol to random points of a route.miz index acc78980f9..02647bf0bf 100644 Binary files a/GRP - Group Commands/GRP-551 - Patrol to random points of a route/GRP-551 - Patrol to random points of a route.miz and b/GRP - Group Commands/GRP-551 - Patrol to random points of a route/GRP-551 - Patrol to random points of a route.miz differ diff --git a/GRP - Group Commands/GRP-552 - Patrol in a zone/GRP-552 - Patrol in a zone.lua b/GRP - Group Commands/GRP-552 - Patrol in a zone/GRP-552 - Patrol in a zone.lua index c3dbcc73d6..926a790e9b 100644 --- a/GRP - Group Commands/GRP-552 - Patrol in a zone/GRP-552 - Patrol in a zone.lua +++ b/GRP - Group Commands/GRP-552 - Patrol in a zone/GRP-552 - Patrol in a zone.lua @@ -1,16 +1,16 @@ ---- This makes a vehicle drive its route selecting random points in a zone. --- Name: GRP-552 - Patrol in a zone --- Author: FlightControl --- Date Created: 24 Sep 2017 - - -- Find the Vehicle and create a GROUP object. - Vehicle = GROUP:FindByName( "Vehicle" ) - - -- Patrol to random points in the trigger zone ZONE, at 120 km/h in Vee format. - Vehicle:PatrolZones( { ZONE:New( "ZONEVEHICLE" ) }, 120, "Vee" ) - - -- Find the Vehicle and create a GROUP object. - Ship = GROUP:FindByName( "Ship" ) - - -- Patrol to random points in the trigger zone ZONE, at 120 km/h in Vee format. - Ship:PatrolZones( { ZONE:New( "ZONESHIP" ) }, 120, "Vee" ) +--- This makes a vehicle drive its route selecting random points in a zone. +-- Name: GRP-552 - Patrol in a zone +-- Author: FlightControl +-- Date Created: 24 Sep 2017 + + -- Find the Vehicle and create a GROUP object. + Vehicle = GROUP:FindByName( "Vehicle" ) + + -- Patrol to random points in the trigger zone ZONE, at 120 km/h in Vee format. + Vehicle:PatrolZones( { ZONE:New( "ZONEVEHICLE" ) }, 120, "Vee" ) + + -- Find the Vehicle and create a GROUP object. + Ship = GROUP:FindByName( "Ship" ) + + -- Patrol to random points in the trigger zone ZONE, at 120 km/h in Vee format. + Ship:PatrolZones( { ZONE:New( "ZONESHIP" ) }, 120, "Vee" ) diff --git a/GRP - Group Commands/GRP-552 - Patrol in a zone/GRP-552 - Patrol in a zone.miz b/GRP - Group Commands/GRP-552 - Patrol in a zone/GRP-552 - Patrol in a zone.miz index 731e42ba05..b21687a42a 100644 Binary files a/GRP - Group Commands/GRP-552 - Patrol in a zone/GRP-552 - Patrol in a zone.miz and b/GRP - Group Commands/GRP-552 - Patrol in a zone/GRP-552 - Patrol in a zone.miz differ diff --git a/GRP - Group Commands/GRP-553 - Patrol in a list of zones/GRP-553 - Patrol in a list of zones.lua b/GRP - Group Commands/GRP-553 - Patrol in a list of zones/GRP-553 - Patrol in a list of zones.lua index db2f18d112..d7f821d839 100644 --- a/GRP - Group Commands/GRP-553 - Patrol in a list of zones/GRP-553 - Patrol in a list of zones.lua +++ b/GRP - Group Commands/GRP-553 - Patrol in a list of zones/GRP-553 - Patrol in a list of zones.lua @@ -1,16 +1,16 @@ ---- This makes a vehicle drive its route selecting random points in a zone. --- Name: GRP-553 - Patrol in a list of zones --- Author: FlightControl --- Date Created: 24 Sep 2017 - --- Find the Vehicle and create a GROUP object. -Vehicle = GROUP:FindByName( "Vehicle" ) - --- Patrol to random points in the trigger zones ZONEVEHICLE1, ZONEVEHICLE2, ZONEVEHICLE3, at 120 km/h in Vee format. -Vehicle:PatrolZones( { ZONE:New( "ZONEVEHICLE1" ), ZONE:New( "ZONEVEHICLE2" ), ZONE:New( "ZONEVEHICLE3" ) }, 120, "Vee" ) - --- Find the Ship and create a GROUP object. -Ship = GROUP:FindByName( "Ship" ) - --- Patrol to random points in the trigger zones ZONESHIP1, ZONESHIP2, ZONESHIP3, at 120 km/h in Vee format. -Ship:PatrolZones( { ZONE:New( "ZONESHIP1" ), ZONE:New( "ZONESHIP2" ), ZONE:New( "ZONESHIP3" ) }, 120, "Vee" ) +--- This makes a vehicle drive its route selecting random points in a zone. +-- Name: GRP-553 - Patrol in a list of zones +-- Author: FlightControl +-- Date Created: 24 Sep 2017 + +-- Find the Vehicle and create a GROUP object. +Vehicle = GROUP:FindByName( "Vehicle" ) + +-- Patrol to random points in the trigger zones ZONEVEHICLE1, ZONEVEHICLE2, ZONEVEHICLE3, at 120 km/h in Vee format. +Vehicle:PatrolZones( { ZONE:New( "ZONEVEHICLE1" ), ZONE:New( "ZONEVEHICLE2" ), ZONE:New( "ZONEVEHICLE3" ) }, 120, "Vee" ) + +-- Find the Ship and create a GROUP object. +Ship = GROUP:FindByName( "Ship" ) + +-- Patrol to random points in the trigger zones ZONESHIP1, ZONESHIP2, ZONESHIP3, at 120 km/h in Vee format. +Ship:PatrolZones( { ZONE:New( "ZONESHIP1" ), ZONE:New( "ZONESHIP2" ), ZONE:New( "ZONESHIP3" ) }, 120, "Vee" ) diff --git a/GRP - Group Commands/GRP-553 - Patrol in a list of zones/GRP-553 - Patrol in a list of zones.miz b/GRP - Group Commands/GRP-553 - Patrol in a list of zones/GRP-553 - Patrol in a list of zones.miz index 5419682fcd..ff89b1b705 100644 Binary files a/GRP - Group Commands/GRP-553 - Patrol in a list of zones/GRP-553 - Patrol in a list of zones.miz and b/GRP - Group Commands/GRP-553 - Patrol in a list of zones/GRP-553 - Patrol in a list of zones.miz differ diff --git a/GRP - Group Commands/GRP-601 - Respawn hidden/GRP-601 - Respawn hidden.lua b/GRP - Group Commands/GRP-601 - Respawn hidden/GRP-601 - Respawn hidden.lua index 2fb61d50b1..e44d649a56 100644 --- a/GRP - Group Commands/GRP-601 - Respawn hidden/GRP-601 - Respawn hidden.lua +++ b/GRP - Group Commands/GRP-601 - Respawn hidden/GRP-601 - Respawn hidden.lua @@ -1,11 +1,11 @@ ---- This makes a vehicle respawn itself when the mission starts. --- The vehicle is hidden, so you need to observe from the watch tower! --- Name: GRP-601 - Respawn hidden --- Author: FlightControl --- Date Created: 01 Mar 2018 - --- Find the Vehicle and create a GROUP object. -Vehicle = GROUP:FindByName( "Vehicle" ) - --- Respawn the vehicle. +--- This makes a vehicle respawn itself when the mission starts. +-- The vehicle is hidden, so you need to observe from the watch tower! +-- Name: GRP-601 - Respawn hidden +-- Author: FlightControl +-- Date Created: 01 Mar 2018 + +-- Find the Vehicle and create a GROUP object. +Vehicle = GROUP:FindByName( "Vehicle" ) + +-- Respawn the vehicle. Vehicle:Respawn() \ No newline at end of file diff --git a/GRP - Group Commands/GRP-601 - Respawn hidden/GRP-601 - Respawn hidden.miz b/GRP - Group Commands/GRP-601 - Respawn hidden/GRP-601 - Respawn hidden.miz index 2c0f7d0a97..e5096ad432 100644 Binary files a/GRP - Group Commands/GRP-601 - Respawn hidden/GRP-601 - Respawn hidden.miz and b/GRP - Group Commands/GRP-601 - Respawn hidden/GRP-601 - Respawn hidden.miz differ diff --git a/GRP - Group Commands/GRP-610 - Respawn in Zone/GRP-610 - Respawn in Zone.lua b/GRP - Group Commands/GRP-610 - Respawn in Zone/GRP-610 - Respawn in Zone.lua index e5fb8c0ab8..40b26485f2 100644 --- a/GRP - Group Commands/GRP-610 - Respawn in Zone/GRP-610 - Respawn in Zone.lua +++ b/GRP - Group Commands/GRP-610 - Respawn in Zone/GRP-610 - Respawn in Zone.lua @@ -1,16 +1,16 @@ ---- This makes a vehicle respawn itself in zone ZONEVEHICLE1. --- Name: GRP-610 - Respawn in Zone --- Author: FlightControl --- Date Created: 01 Mar 2018 - --- Find the Vehicle and create a GROUP object. -Vehicle = GROUP:FindByName( "Vehicle" ) - --- Setup RespawnZone1 linking to the trigger zone ZONEVEHICLE1. -RespawnZone1 = ZONE:New( "ZONEVEHICLE1") - --- Prepare the spawning to be done in RespawnZone1. -Vehicle:InitZone( RespawnZone1 ) - --- Respawn the vehicle in RespawnZone1. +--- This makes a vehicle respawn itself when the mission starts. +-- Name: GRP-600 - Respawn +-- Author: FlightControl +-- Date Created: 01 Mar 2018 + +-- Find the Vehicle and create a GROUP object. +Vehicle = GROUP:FindByName( "Vehicle" ) + +-- Setup RespawnZone1 linking to the trigger zone ZONEVEHICLE1. +RespawnZone1 = ZONE:New( "ZONEVEHICLE1") + +-- Prepare the spawning to be done in RespawnZone1. +Vehicle:InitZone( RespawnZone1 ) + +-- Respawn the vehicle in RespawnZone1. Vehicle:Respawn() \ No newline at end of file diff --git a/GRP - Group Commands/GRP-610 - Respawn in Zone/GRP-610 - Respawn in Zone.miz b/GRP - Group Commands/GRP-610 - Respawn in Zone/GRP-610 - Respawn in Zone.miz index 8260c5b671..1ead86882b 100644 Binary files a/GRP - Group Commands/GRP-610 - Respawn in Zone/GRP-610 - Respawn in Zone.miz and b/GRP - Group Commands/GRP-610 - Respawn in Zone/GRP-610 - Respawn in Zone.miz differ diff --git a/GRP - Group Commands/GRP-611 - Respawn multiple units in Zone/GRP-611 - Respawn multiple units in Zone.lua b/GRP - Group Commands/GRP-611 - Respawn multiple units in Zone/GRP-611 - Respawn multiple units in Zone.lua index e88b31fb7a..447a9fd440 100644 --- a/GRP - Group Commands/GRP-611 - Respawn multiple units in Zone/GRP-611 - Respawn multiple units in Zone.lua +++ b/GRP - Group Commands/GRP-611 - Respawn multiple units in Zone/GRP-611 - Respawn multiple units in Zone.lua @@ -1,18 +1,18 @@ ---- This makes a vehicle respawn itself within ZONEVEHICLE1. --- The vehicle group consists of multiple units and are spawned in relation to the original template position. --- --- Name: GRP-611 - Respawn multiple units in Zone --- Author: FlightControl --- Date Created: 01 Mar 2018 - --- Find the Vehicle and create a GROUP object. -Vehicle = GROUP:FindByName( "Vehicle" ) - --- Setup RespawnZone1 linking to the trigger zone ZONEVEHICLE1. -RespawnZone1 = ZONE:New( "ZONEVEHICLE1") - --- Prepare the spawning to be done in RespawnZone1. -Vehicle:InitZone( RespawnZone1 ) - --- Respawn the vehicle in RespawnZone1. +--- This makes a vehicle respawn itself within ZONEVEHICLE1. +-- The vehicle group consists of multiple units and are spawned in relation to the original template position. +-- +-- Name: GRP-611 - Respawn multiple units in Zone +-- Author: FlightControl +-- Date Created: 01 Mar 2018 + +-- Find the Vehicle and create a GROUP object. +Vehicle = GROUP:FindByName( "Vehicle" ) + +-- Setup RespawnZone1 linking to the trigger zone ZONEVEHICLE1. +RespawnZone1 = ZONE:New( "ZONEVEHICLE1") + +-- Prepare the spawning to be done in RespawnZone1. +Vehicle:InitZone( RespawnZone1 ) + +-- Respawn the vehicle in RespawnZone1. Vehicle:Respawn() \ No newline at end of file diff --git a/GRP - Group Commands/GRP-611 - Respawn multiple units in Zone/GRP-611 - Respawn multiple units in Zone.miz b/GRP - Group Commands/GRP-611 - Respawn multiple units in Zone/GRP-611 - Respawn multiple units in Zone.miz index dacd7cac20..d8d0ac567e 100644 Binary files a/GRP - Group Commands/GRP-611 - Respawn multiple units in Zone/GRP-611 - Respawn multiple units in Zone.miz and b/GRP - Group Commands/GRP-611 - Respawn multiple units in Zone/GRP-611 - Respawn multiple units in Zone.miz differ diff --git a/GRP - Group Commands/GRP-612 - Respawn multiple units in Zone randomized/GRP-612 - Respawn multiple units in Zone randomized.lua b/GRP - Group Commands/GRP-612 - Respawn multiple units in Zone randomized/GRP-612 - Respawn multiple units in Zone randomized.lua index 9eacddea4d..acd0ef570a 100644 --- a/GRP - Group Commands/GRP-612 - Respawn multiple units in Zone randomized/GRP-612 - Respawn multiple units in Zone randomized.lua +++ b/GRP - Group Commands/GRP-612 - Respawn multiple units in Zone randomized/GRP-612 - Respawn multiple units in Zone randomized.lua @@ -1,19 +1,19 @@ ---- This makes a vehicle respawn itself within ZONEVEHICLE1. --- The vehicle group consists of multiple units and are spawned in randomized within the new zone. --- --- Name: GRP-612 - Respawn multiple units in Zone randomized. --- Author: FlightControl --- Date Created: 01 Mar 2018 - --- Find the Vehicle and create a GROUP object. -Vehicle = GROUP:FindByName( "Vehicle" ) - --- Setup RespawnZone1 linking to the trigger zone ZONEVEHICLE1. -RespawnZone1 = ZONE:New( "ZONEVEHICLE1") - --- Prepare the spawning to be done in RespawnZone1. -Vehicle:InitZone( RespawnZone1 ) -Vehicle:InitRandomizePositionZone( true ) - --- Respawn the vehicle in RespawnZone1. +--- This makes a vehicle respawn itself within ZONEVEHICLE1. +-- The vehicle group consists of multiple units and are spawned in randomized within the new zone. +-- +-- Name: GRP-612 - Respawn multiple units in Zone randomized. +-- Author: FlightControl +-- Date Created: 01 Mar 2018 + +-- Find the Vehicle and create a GROUP object. +Vehicle = GROUP:FindByName( "Vehicle" ) + +-- Setup RespawnZone1 linking to the trigger zone ZONEVEHICLE1. +RespawnZone1 = ZONE:New( "ZONEVEHICLE1") + +-- Prepare the spawning to be done in RespawnZone1. +Vehicle:InitZone( RespawnZone1 ) +Vehicle:InitRandomizePositionZone( true ) + +-- Respawn the vehicle in RespawnZone1. Vehicle:Respawn() \ No newline at end of file diff --git a/GRP - Group Commands/GRP-612 - Respawn multiple units in Zone randomized/GRP-612 - Respawn multiple units in Zone randomized.miz b/GRP - Group Commands/GRP-612 - Respawn multiple units in Zone randomized/GRP-612 - Respawn multiple units in Zone randomized.miz index dfb4f4455c..a616ed5b55 100644 Binary files a/GRP - Group Commands/GRP-612 - Respawn multiple units in Zone randomized/GRP-612 - Respawn multiple units in Zone randomized.miz and b/GRP - Group Commands/GRP-612 - Respawn multiple units in Zone randomized/GRP-612 - Respawn multiple units in Zone randomized.miz differ diff --git a/GRP - Group Commands/GRP-615 - Respawn in Zone hidden/GRP-615 - Respawn in Zone hidden.lua b/GRP - Group Commands/GRP-615 - Respawn in Zone hidden/GRP-615 - Respawn in Zone hidden.lua index 15bd8837ea..1ea21c9e2e 100644 --- a/GRP - Group Commands/GRP-615 - Respawn in Zone hidden/GRP-615 - Respawn in Zone hidden.lua +++ b/GRP - Group Commands/GRP-615 - Respawn in Zone hidden/GRP-615 - Respawn in Zone hidden.lua @@ -1,17 +1,17 @@ ---- This makes a vehicle respawn within ZONEVEHICLE1. --- The vehicle is hidden, so you need to observe at the watch tower through external view. --- Name: GRP-615 - Respawn in Zone hidden --- Author: FlightControl --- Date Created: 01 Mar 2018 - --- Find the Vehicle and create a GROUP object. -Vehicle = GROUP:FindByName( "Vehicle" ) - --- Setup RespawnZone1 linking to the trigger zone ZONEVEHICLE1. -RespawnZone1 = ZONE:New( "ZONEVEHICLE1") - --- Prepare the spawning to be done in RespawnZone1. -Vehicle:InitZone( RespawnZone1 ) - --- Respawn the vehicle in RespawnZone1. +--- This makes a vehicle respawn within ZONEVEHICLE1. +-- The vehicle is hidden, so you need to observe at the watch tower through external view. +-- Name: GRP-615 - Respawn in Zone hidden +-- Author: FlightControl +-- Date Created: 01 Mar 2018 + +-- Find the Vehicle and create a GROUP object. +Vehicle = GROUP:FindByName( "Vehicle" ) + +-- Setup RespawnZone1 linking to the trigger zone ZONEVEHICLE1. +RespawnZone1 = ZONE:New( "ZONEVEHICLE1") + +-- Prepare the spawning to be done in RespawnZone1. +Vehicle:InitZone( RespawnZone1 ) + +-- Respawn the vehicle in RespawnZone1. Vehicle:Respawn() \ No newline at end of file diff --git a/GRP - Group Commands/GRP-615 - Respawn in Zone hidden/GRP-615 - Respawn in Zone hidden.miz b/GRP - Group Commands/GRP-615 - Respawn in Zone hidden/GRP-615 - Respawn in Zone hidden.miz index d5d065959d..d916fe96a5 100644 Binary files a/GRP - Group Commands/GRP-615 - Respawn in Zone hidden/GRP-615 - Respawn in Zone hidden.miz and b/GRP - Group Commands/GRP-615 - Respawn in Zone hidden/GRP-615 - Respawn in Zone hidden.miz differ diff --git a/GRP - Group Commands/GRP-616 - Respawn multiple units in Zone hidden/GRP-616 - Respawn multiple units in Zone hidden.lua b/GRP - Group Commands/GRP-616 - Respawn multiple units in Zone hidden/GRP-616 - Respawn multiple units in Zone hidden.lua index bc2268a4c6..af7d29b1d8 100644 --- a/GRP - Group Commands/GRP-616 - Respawn multiple units in Zone hidden/GRP-616 - Respawn multiple units in Zone hidden.lua +++ b/GRP - Group Commands/GRP-616 - Respawn multiple units in Zone hidden/GRP-616 - Respawn multiple units in Zone hidden.lua @@ -1,19 +1,19 @@ ---- This makes a vehicle respawn itself within ZONEVEHICLE1. --- The vehicle group consists of multiple units and are spawned in relation to the original template position. --- The vehicle is hidden, so you need to observe from the watch tower (external view). --- --- Name: GRP-616 - Respawn multiple units in Zone hidden --- Author: FlightControl --- Date Created: 01 Mar 2018 - --- Find the Vehicle and create a GROUP object. -Vehicle = GROUP:FindByName( "Vehicle" ) - --- Setup RespawnZone1 linking to the trigger zone ZONEVEHICLE1. -RespawnZone1 = ZONE:New( "ZONEVEHICLE1") - --- Prepare the spawning to be done in RespawnZone1. -Vehicle:InitZone( RespawnZone1 ) - --- Respawn the vehicle in RespawnZone1. +--- This makes a vehicle respawn itself within ZONEVEHICLE1. +-- The vehicle group consists of multiple units and are spawned in relation to the original template position. +-- The vehicle is hidden, so you need to observe from the watch tower (external view). +-- +-- Name: GRP-616 - Respawn multiple units in Zone hidden +-- Author: FlightControl +-- Date Created: 01 Mar 2018 + +-- Find the Vehicle and create a GROUP object. +Vehicle = GROUP:FindByName( "Vehicle" ) + +-- Setup RespawnZone1 linking to the trigger zone ZONEVEHICLE1. +RespawnZone1 = ZONE:New( "ZONEVEHICLE1") + +-- Prepare the spawning to be done in RespawnZone1. +Vehicle:InitZone( RespawnZone1 ) + +-- Respawn the vehicle in RespawnZone1. Vehicle:Respawn() \ No newline at end of file diff --git a/GRP - Group Commands/GRP-616 - Respawn multiple units in Zone hidden/GRP-616 - Respawn multiple units in Zone hidden.miz b/GRP - Group Commands/GRP-616 - Respawn multiple units in Zone hidden/GRP-616 - Respawn multiple units in Zone hidden.miz index c61a536271..e2c2e1a69b 100644 Binary files a/GRP - Group Commands/GRP-616 - Respawn multiple units in Zone hidden/GRP-616 - Respawn multiple units in Zone hidden.miz and b/GRP - Group Commands/GRP-616 - Respawn multiple units in Zone hidden/GRP-616 - Respawn multiple units in Zone hidden.miz differ diff --git a/GRP - Group Commands/GRP-617 - Respawn multiple units in Zone randomized hidden/GRP-617 - Respawn multiple units in Zone randomized hidden.lua b/GRP - Group Commands/GRP-617 - Respawn multiple units in Zone randomized hidden/GRP-617 - Respawn multiple units in Zone randomized hidden.lua index 8df3b2487a..005a9c99f6 100644 --- a/GRP - Group Commands/GRP-617 - Respawn multiple units in Zone randomized hidden/GRP-617 - Respawn multiple units in Zone randomized hidden.lua +++ b/GRP - Group Commands/GRP-617 - Respawn multiple units in Zone randomized hidden/GRP-617 - Respawn multiple units in Zone randomized hidden.lua @@ -1,20 +1,20 @@ ---- This makes a vehicle respawn itself within ZONEVEHICLE1 hidden. --- The vehicle group consists of multiple units and are spawned in randomized within the new zone. --- The vehicle is hidden, so you need to observe from the watch tower (external view). --- --- Name: GRP-617 - Respawn multiple units in Zone randomized hidden --- Author: FlightControl --- Date Created: 01 Mar 2018 - --- Find the Vehicle and create a GROUP object. -Vehicle = GROUP:FindByName( "Vehicle" ) - --- Setup RespawnZone1 linking to the trigger zone ZONEVEHICLE1. -RespawnZone1 = ZONE:New( "ZONEVEHICLE1") - --- Prepare the spawning to be done in RespawnZone1. -Vehicle:InitZone( RespawnZone1 ) -Vehicle:InitRandomizePositionZone( true ) - --- Respawn the vehicle in RespawnZone1. +--- This makes a vehicle respawn itself within ZONEVEHICLE1 hidden. +-- The vehicle group consists of multiple units and are spawned in randomized within the new zone. +-- The vehicle is hidden, so you need to observe from the watch tower (external view). +-- +-- Name: GRP-617 - Respawn multiple units in Zone randomized hidden +-- Author: FlightControl +-- Date Created: 01 Mar 2018 + +-- Find the Vehicle and create a GROUP object. +Vehicle = GROUP:FindByName( "Vehicle" ) + +-- Setup RespawnZone1 linking to the trigger zone ZONEVEHICLE1. +RespawnZone1 = ZONE:New( "ZONEVEHICLE1") + +-- Prepare the spawning to be done in RespawnZone1. +Vehicle:InitZone( RespawnZone1 ) +Vehicle:InitRandomizePositionZone( true ) + +-- Respawn the vehicle in RespawnZone1. Vehicle:Respawn() \ No newline at end of file diff --git a/GRP - Group Commands/GRP-617 - Respawn multiple units in Zone randomized hidden/GRP-617 - Respawn multiple units in Zone randomized hidden.miz b/GRP - Group Commands/GRP-617 - Respawn multiple units in Zone randomized hidden/GRP-617 - Respawn multiple units in Zone randomized hidden.miz index 2602bacd8a..d51c519ad6 100644 Binary files a/GRP - Group Commands/GRP-617 - Respawn multiple units in Zone randomized hidden/GRP-617 - Respawn multiple units in Zone randomized hidden.miz and b/GRP - Group Commands/GRP-617 - Respawn multiple units in Zone randomized hidden/GRP-617 - Respawn multiple units in Zone randomized hidden.miz differ diff --git a/GRP - Group Commands/GRP-620 - Respawn multiple units when destroyed/GRP-620 - Respawn multiple units when destroyed.lua b/GRP - Group Commands/GRP-620 - Respawn multiple units when destroyed/GRP-620 - Respawn multiple units when destroyed.lua index 16fc27ddd4..a654277c0b 100644 --- a/GRP - Group Commands/GRP-620 - Respawn multiple units when destroyed/GRP-620 - Respawn multiple units when destroyed.lua +++ b/GRP - Group Commands/GRP-620 - Respawn multiple units when destroyed/GRP-620 - Respawn multiple units when destroyed.lua @@ -1,29 +1,29 @@ ---- This makes a vehicle respawn itself within ZONEVEHICLE1. --- The vehicle group consists of multiple units and are spawned in randomized within the new zone. --- When the last vehicle of the group is destroyed, the group will respawn. --- --- Name: GRP-620 - Respawn multiple units when destroyed --- Author: FlightControl --- Date Created: 01 Mar 2018 - --- Find the Vehicle and create a GROUP object. -Vehicle = GROUP:FindByName( "Vehicle" ) - --- Setup RespawnZone1 linking to the trigger zone ZONEVEHICLE1. -RespawnZone1 = ZONE:New( "ZONEVEHICLE1") - --- Prepare the spawning to be done in RespawnZone1. -Vehicle:InitZone( RespawnZone1 ) -Vehicle:InitRandomizePositionZone( true ) - -Vehicle:HandleEvent( EVENTS.Dead ) -function Vehicle:OnEventDead( EventData ) - - self:E( { "Size ", Size = Vehicle:GetSize() } ) - - -- When the last vehicle of the group is declared dead, respawn the group. - if Vehicle:GetSize() == 1 then - -- Respawn the vehicle in RespawnZone1. - Vehicle:Respawn() - end +--- This makes a vehicle respawn itself within ZONEVEHICLE1. +-- The vehicle group consists of multiple units and are spawned in randomized within the new zone. +-- When the last vehicle of the group is destroyed, the group will respawn. +-- +-- Name: GRP-620 - Respawn multiple units when destroyed +-- Author: FlightControl +-- Date Created: 01 Mar 2018 + +-- Find the Vehicle and create a GROUP object. +Vehicle = GROUP:FindByName( "Vehicle" ) + +-- Setup RespawnZone1 linking to the trigger zone ZONEVEHICLE1. +RespawnZone1 = ZONE:New( "ZONEVEHICLE1") + +-- Prepare the spawning to be done in RespawnZone1. +Vehicle:InitZone( RespawnZone1 ) +Vehicle:InitRandomizePositionZone( true ) + +Vehicle:HandleEvent( EVENTS.Dead ) +function Vehicle:OnEventDead( EventData ) + + self:E( { "Size ", Size = Vehicle:GetSize() } ) + + -- When the last vehicle of the group is declared dead, respawn the group. + if Vehicle:GetSize() == 1 then + -- Respawn the vehicle in RespawnZone1. + Vehicle:Respawn() + end end \ No newline at end of file diff --git a/GRP - Group Commands/GRP-620 - Respawn multiple units when destroyed/GRP-620 - Respawn multiple units when destroyed.miz b/GRP - Group Commands/GRP-620 - Respawn multiple units when destroyed/GRP-620 - Respawn multiple units when destroyed.miz index 63519f5beb..ff2c2fb8ac 100644 Binary files a/GRP - Group Commands/GRP-620 - Respawn multiple units when destroyed/GRP-620 - Respawn multiple units when destroyed.miz and b/GRP - Group Commands/GRP-620 - Respawn multiple units when destroyed/GRP-620 - Respawn multiple units when destroyed.miz differ diff --git a/GRP - Group Commands/GRP-900 - Option Green and Red State/GRP-900 - Option Green and Red State.lua b/GRP - Group Commands/GRP-900 - Option Green and Red State/GRP-900 - Option Green and Red State.lua index c5ae02e822..6083e5218c 100644 --- a/GRP - Group Commands/GRP-900 - Option Green and Red State/GRP-900 - Option Green and Red State.lua +++ b/GRP - Group Commands/GRP-900 - Option Green and Red State/GRP-900 - Option Green and Red State.lua @@ -1,27 +1,27 @@ ---- --- Name: GRP-900 - Option Green and Red State --- Author: FlightControl --- Date Created: 10 Dec 2017 --- --- This tests the option to set the alarm state of a group to RED or GREEN. --- Both options are tested with two groups. --- Please check the dcs.log in case of errors, and the time the group reacts to the approaching target. --- The Red State Group should react much faster than the Green State Group. --- --- Join the Game Master to observe the reaction of the ground units. --- --- Blue is attacking. --- Green is defending. --- - - -RedStateGroup = GROUP:FindByName( "Red State" ) -GreenStateGroup = GROUP:FindByName( "Green State" ) - - -RedStateGroup:OptionAlarmStateRed() -GreenStateGroup:OptionAlarmStateGreen() - - - - +--- +-- Name: GRP-900 - Option Green and Red State +-- Author: FlightControl +-- Date Created: 10 Dec 2017 +-- +-- This tests the option to set the alarm state of a group to RED or GREEN. +-- Both options are tested with two groups. +-- Please check the dcs.log in case of errors, and the time the group reacts to the approaching target. +-- The Red State Group should react much faster than the Green State Group. +-- +-- Join the Game Master to observe the reaction of the ground units. +-- +-- Blue is attacking. +-- Green is defending. +-- + + +RedStateGroup = GROUP:FindByName( "Red State" ) +GreenStateGroup = GROUP:FindByName( "Green State" ) + + +RedStateGroup:OptionAlarmStateRed() +GreenStateGroup:OptionAlarmStateGreen() + + + + diff --git a/GRP - Group Commands/GRP-900 - Option Green and Red State/GRP-900 - Option Green and Red State.miz b/GRP - Group Commands/GRP-900 - Option Green and Red State/GRP-900 - Option Green and Red State.miz index 6a47d8357b..487eba2289 100644 Binary files a/GRP - Group Commands/GRP-900 - Option Green and Red State/GRP-900 - Option Green and Red State.miz and b/GRP - Group Commands/GRP-900 - Option Green and Red State/GRP-900 - Option Green and Red State.miz differ diff --git a/MEN - Menu Options/Nevada/MEN-102 - Menu Coalition Multi Player/MEN-102 - Menu Coalition Multi Player.lua b/MEN - Menu Options/Nevada/MEN-102 - Menu Coalition Multi Player/MEN-102 - Menu Coalition Multi Player.lua index 11c0bbb028..088ec2bd1b 100644 --- a/MEN - Menu Options/Nevada/MEN-102 - Menu Coalition Multi Player/MEN-102 - Menu Coalition Multi Player.lua +++ b/MEN - Menu Options/Nevada/MEN-102 - Menu Coalition Multi Player/MEN-102 - Menu Coalition Multi Player.lua @@ -1,43 +1,43 @@ - -do - -- This demo creates a menu structure for the planes within the red coalition. - -- To test, join the planes, then look at the other radio menus (Option F10). - -- Then switch planes and check if the menu is still there. - - local Plane1 = GROUP:FindByName( "Red Plane 1" ) - local Plane2 = GROUP:FindByName( "Red Plane 2" ) - local Plane3 = GROUP:FindByName( "Red Plane 3" ) - local Plane4 = GROUP:FindByName( "Red Plane 4" ) - - -- This would create a menu for the red coalition under the main DCS "Others" menu. - local MenuCoalitionRed = MENU_COALITION:New( coalition.side.RED, "Manage Menus" ) - - - local function ShowStatus( StatusText, Coalition ) - - Plane1:MessageToRed( StatusText, 15 ) - Plane2:MessageToRed( StatusText, 15 ) - end - - local MenuStatus -- Menu#MENU_COALITION - local MenuStatusShow -- Menu#MENU_COALITION_COMMAND - - local function RemoveStatusMenu() - MenuStatus:Remove() - end - - local function AddStatusMenu() - - -- This would create a menu for the red coalition under the MenuCoalitionRed menu object. - MenuStatus = MENU_COALITION:New( coalition.side.RED, "Status for Planes" ) - MenuStatusShow = MENU_COALITION_COMMAND:New( coalition.side.RED, "Show Status", MenuStatus, ShowStatus, "Status of planes is ok!", "Message to Red Coalition" ) - end - - local MenuAdd = MENU_COALITION_COMMAND:New( coalition.side.RED, "Add Status Menu", MenuCoalitionRed, AddStatusMenu ) - local MenuRemove = MENU_COALITION_COMMAND:New( coalition.side.RED, "Remove Status Menu", MenuCoalitionRed, RemoveStatusMenu ) - -end - - - - + +do + -- This demo creates a menu structure for the planes within the red coalition. + -- To test, join the planes, then look at the other radio menus (Option F10). + -- Then switch planes and check if the menu is still there. + + local Plane1 = GROUP:FindByName( "Red Plane 1" ) + local Plane2 = GROUP:FindByName( "Red Plane 2" ) + local Plane3 = GROUP:FindByName( "Red Plane 3" ) + local Plane4 = GROUP:FindByName( "Red Plane 4" ) + + -- This would create a menu for the red coalition under the main DCS "Others" menu. + local MenuCoalitionRed = MENU_COALITION:New( coalition.side.RED, "Manage Menus" ) + + + local function ShowStatus( StatusText, Coalition ) + + Plane1:MessageToRed( StatusText, 15 ) + Plane2:MessageToRed( StatusText, 15 ) + end + + local MenuStatus -- Menu#MENU_COALITION + local MenuStatusShow -- Menu#MENU_COALITION_COMMAND + + local function RemoveStatusMenu() + MenuStatus:Remove() + end + + local function AddStatusMenu() + + -- This would create a menu for the red coalition under the MenuCoalitionRed menu object. + MenuStatus = MENU_COALITION:New( coalition.side.RED, "Status for Planes" ) + MenuStatusShow = MENU_COALITION_COMMAND:New( coalition.side.RED, "Show Status", MenuStatus, ShowStatus, "Status of planes is ok!", "Message to Red Coalition" ) + end + + local MenuAdd = MENU_COALITION_COMMAND:New( coalition.side.RED, "Add Status Menu", MenuCoalitionRed, AddStatusMenu ) + local MenuRemove = MENU_COALITION_COMMAND:New( coalition.side.RED, "Remove Status Menu", MenuCoalitionRed, RemoveStatusMenu ) + +end + + + + diff --git a/MEN - Menu Options/Nevada/MEN-102 - Menu Coalition Multi Player/MEN-102 - Menu Coalition Multi Player.miz b/MEN - Menu Options/Nevada/MEN-102 - Menu Coalition Multi Player/MEN-102 - Menu Coalition Multi Player.miz index 03953b65c3..92fc0f0033 100644 Binary files a/MEN - Menu Options/Nevada/MEN-102 - Menu Coalition Multi Player/MEN-102 - Menu Coalition Multi Player.miz and b/MEN - Menu Options/Nevada/MEN-102 - Menu Coalition Multi Player/MEN-102 - Menu Coalition Multi Player.miz differ diff --git a/MEN - Menu Options/Normandy/MEN-001 - Menu Client/MEN-001 - Menu Client.lua b/MEN - Menu Options/Normandy/MEN-001 - Menu Client/MEN-001 - Menu Client.lua index fa483f1037..170029283e 100644 --- a/MEN - Menu Options/Normandy/MEN-001 - Menu Client/MEN-001 - Menu Client.lua +++ b/MEN - Menu Options/Normandy/MEN-001 - Menu Client/MEN-001 - Menu Client.lua @@ -1,56 +1,56 @@ - -do - -- This demo creates a menu structure for the two clients of planes. - -- Each client will receive a different menu structure. - -- To test, join the planes, then look at the other radio menus (Option F10). - -- Then switch planes and check if the menu is still there. - -- And play with the Add and Remove menu options. - - -- Note that in multi player, this will only work after the DCS clients bug is solved. - - local function ShowStatus( PlaneClient, StatusText, Coalition ) - - MESSAGE:New( Coalition, 15 ):ToRed() - PlaneClient:Message( StatusText, 15 ) - end - - local MenuStatus = {} - - local function RemoveStatusMenu( MenuClient ) - local MenuClientName = MenuClient:GetName() - MenuStatus[MenuClientName]:Remove() - end - - --- @param Wrapper.Client#CLIENT MenuClient - local function AddStatusMenu( MenuClient ) - local MenuClientName = MenuClient:GetName() - -- This would create a menu for the red coalition under the MenuCoalitionRed menu object. - MenuStatus[MenuClientName] = MENU_CLIENT:New( MenuClient, "Status for Planes" ) - MENU_CLIENT_COMMAND:New( MenuClient, "Show Status", MenuStatus[MenuClientName], ShowStatus, MenuClient, "Status of planes is ok!", "Message to Red Coalition" ) - end - - SCHEDULER:New( nil, - function() - local PlaneClient = CLIENT:FindByName( "Plane 1" ) - if PlaneClient and PlaneClient:IsAlive() then - local MenuManage = MENU_CLIENT:New( PlaneClient, "Manage Menus" ) - MENU_CLIENT_COMMAND:New( PlaneClient, "Add Status Menu Plane 1", MenuManage, AddStatusMenu, PlaneClient ) - MENU_CLIENT_COMMAND:New( PlaneClient, "Remove Status Menu Plane 1", MenuManage, RemoveStatusMenu, PlaneClient ) - end - end, {}, 10, 10 ) - - SCHEDULER:New( nil, - function() - local PlaneClient = CLIENT:FindByName( "Plane 2" ) - if PlaneClient and PlaneClient:IsAlive() then - local MenuManage = MENU_CLIENT:New( PlaneClient, "Manage Menus" ) - MENU_CLIENT_COMMAND:New( PlaneClient, "Add Status Menu Plane 2", MenuManage, AddStatusMenu, PlaneClient ) - MENU_CLIENT_COMMAND:New( PlaneClient, "Remove Status Menu Plane 2", MenuManage, RemoveStatusMenu, PlaneClient ) - end - end, {}, 10, 10 ) - -end - - - - + +do + -- This demo creates a menu structure for the two clients of planes. + -- Each client will receive a different menu structure. + -- To test, join the planes, then look at the other radio menus (Option F10). + -- Then switch planes and check if the menu is still there. + -- And play with the Add and Remove menu options. + + -- Note that in multi player, this will only work after the DCS clients bug is solved. + + local function ShowStatus( PlaneClient, StatusText, Coalition ) + + MESSAGE:New( Coalition, 15 ):ToRed() + PlaneClient:Message( StatusText, 15 ) + end + + local MenuStatus = {} + + local function RemoveStatusMenu( MenuClient ) + local MenuClientName = MenuClient:GetName() + MenuStatus[MenuClientName]:Remove() + end + + --- @param Wrapper.Client#CLIENT MenuClient + local function AddStatusMenu( MenuClient ) + local MenuClientName = MenuClient:GetName() + -- This would create a menu for the red coalition under the MenuCoalitionRed menu object. + MenuStatus[MenuClientName] = MENU_CLIENT:New( MenuClient, "Status for Planes" ) + MENU_CLIENT_COMMAND:New( MenuClient, "Show Status", MenuStatus[MenuClientName], ShowStatus, MenuClient, "Status of planes is ok!", "Message to Red Coalition" ) + end + + SCHEDULER:New( nil, + function() + local PlaneClient = CLIENT:FindByName( "Plane 1" ) + if PlaneClient and PlaneClient:IsAlive() then + local MenuManage = MENU_CLIENT:New( PlaneClient, "Manage Menus" ) + MENU_CLIENT_COMMAND:New( PlaneClient, "Add Status Menu Plane 1", MenuManage, AddStatusMenu, PlaneClient ) + MENU_CLIENT_COMMAND:New( PlaneClient, "Remove Status Menu Plane 1", MenuManage, RemoveStatusMenu, PlaneClient ) + end + end, {}, 10, 10 ) + + SCHEDULER:New( nil, + function() + local PlaneClient = CLIENT:FindByName( "Plane 2" ) + if PlaneClient and PlaneClient:IsAlive() then + local MenuManage = MENU_CLIENT:New( PlaneClient, "Manage Menus" ) + MENU_CLIENT_COMMAND:New( PlaneClient, "Add Status Menu Plane 2", MenuManage, AddStatusMenu, PlaneClient ) + MENU_CLIENT_COMMAND:New( PlaneClient, "Remove Status Menu Plane 2", MenuManage, RemoveStatusMenu, PlaneClient ) + end + end, {}, 10, 10 ) + +end + + + + diff --git a/MEN - Menu Options/Normandy/MEN-001 - Menu Client/MEN-001 - Menu Client.miz b/MEN - Menu Options/Normandy/MEN-001 - Menu Client/MEN-001 - Menu Client.miz index bf6ac81fe5..358e84ef6b 100644 Binary files a/MEN - Menu Options/Normandy/MEN-001 - Menu Client/MEN-001 - Menu Client.miz and b/MEN - Menu Options/Normandy/MEN-001 - Menu Client/MEN-001 - Menu Client.miz differ diff --git a/MEN - Menu Options/Normandy/MEN-002 - Menu Coalition/MEN-002 - Menu Coalition.lua b/MEN - Menu Options/Normandy/MEN-002 - Menu Coalition/MEN-002 - Menu Coalition.lua index f7ffaccefa..86ae033e59 100644 --- a/MEN - Menu Options/Normandy/MEN-002 - Menu Coalition/MEN-002 - Menu Coalition.lua +++ b/MEN - Menu Options/Normandy/MEN-002 - Menu Coalition/MEN-002 - Menu Coalition.lua @@ -1,43 +1,43 @@ - -do - -- This demo creates a menu structure for the planes within the red coalition. - -- To test, join the planes, then look at the other radio menus (Option F10). - -- Then switch planes and check if the menu is still there. - - local Plane1 = CLIENT:FindByName( "Plane 1" ) - local Plane2 = CLIENT:FindByName( "Plane 2" ) - - - -- This would create a menu for the red coalition under the main DCS "Others" menu. - local MenuCoalitionRed = MENU_COALITION:New( coalition.side.RED, "Manage Menus" ) - - - local function ShowStatus( StatusText, Coalition ) - - MESSAGE:New( Coalition, 15 ):ToRed() - Plane1:Message( StatusText, 15 ) - Plane2:Message( StatusText, 15 ) - end - - local MenuStatus -- Menu#MENU_COALITION - local MenuStatusShow -- Menu#MENU_COALITION_COMMAND - - local function RemoveStatusMenu() - MenuStatus:Remove() - end - - local function AddStatusMenu() - - -- This would create a menu for the red coalition under the MenuCoalitionRed menu object. - MenuStatus = MENU_COALITION:New( coalition.side.RED, "Status for Planes" ) - MenuStatusShow = MENU_COALITION_COMMAND:New( coalition.side.RED, "Show Status", MenuStatus, ShowStatus, "Status of planes is ok!", "Message to Red Coalition" ) - end - - local MenuAdd = MENU_COALITION_COMMAND:New( coalition.side.RED, "Add Status Menu", MenuCoalitionRed, AddStatusMenu ) - local MenuRemove = MENU_COALITION_COMMAND:New( coalition.side.RED, "Remove Status Menu", MenuCoalitionRed, RemoveStatusMenu ) - -end - - - - + +do + -- This demo creates a menu structure for the planes within the red coalition. + -- To test, join the planes, then look at the other radio menus (Option F10). + -- Then switch planes and check if the menu is still there. + + local Plane1 = CLIENT:FindByName( "Plane 1" ) + local Plane2 = CLIENT:FindByName( "Plane 2" ) + + + -- This would create a menu for the red coalition under the main DCS "Others" menu. + local MenuCoalitionRed = MENU_COALITION:New( coalition.side.RED, "Manage Menus" ) + + + local function ShowStatus( StatusText, Coalition ) + + MESSAGE:New( Coalition, 15 ):ToRed() + Plane1:Message( StatusText, 15 ) + Plane2:Message( StatusText, 15 ) + end + + local MenuStatus -- Menu#MENU_COALITION + local MenuStatusShow -- Menu#MENU_COALITION_COMMAND + + local function RemoveStatusMenu() + MenuStatus:Remove() + end + + local function AddStatusMenu() + + -- This would create a menu for the red coalition under the MenuCoalitionRed menu object. + MenuStatus = MENU_COALITION:New( coalition.side.RED, "Status for Planes" ) + MenuStatusShow = MENU_COALITION_COMMAND:New( coalition.side.RED, "Show Status", MenuStatus, ShowStatus, "Status of planes is ok!", "Message to Red Coalition" ) + end + + local MenuAdd = MENU_COALITION_COMMAND:New( coalition.side.RED, "Add Status Menu", MenuCoalitionRed, AddStatusMenu ) + local MenuRemove = MENU_COALITION_COMMAND:New( coalition.side.RED, "Remove Status Menu", MenuCoalitionRed, RemoveStatusMenu ) + +end + + + + diff --git a/MEN - Menu Options/Normandy/MEN-002 - Menu Coalition/MEN-002 - Menu Coalition.miz b/MEN - Menu Options/Normandy/MEN-002 - Menu Coalition/MEN-002 - Menu Coalition.miz index 6fcf3cf114..47b7190205 100644 Binary files a/MEN - Menu Options/Normandy/MEN-002 - Menu Coalition/MEN-002 - Menu Coalition.miz and b/MEN - Menu Options/Normandy/MEN-002 - Menu Coalition/MEN-002 - Menu Coalition.miz differ diff --git a/MEN - Menu Options/Normandy/MEN-003 - Menu Group/MEN-003 - Menu Group.lua b/MEN - Menu Options/Normandy/MEN-003 - Menu Group/MEN-003 - Menu Group.lua index 94d602abf0..ee0b1722bc 100644 --- a/MEN - Menu Options/Normandy/MEN-003 - Menu Group/MEN-003 - Menu Group.lua +++ b/MEN - Menu Options/Normandy/MEN-003 - Menu Group/MEN-003 - Menu Group.lua @@ -1,56 +1,56 @@ - -do - -- This demo creates a menu structure for the two groups of planes. - -- Each group will receive a different menu structure. - -- To test, join the planes, then look at the other radio menus (Option F10). - -- Then switch planes and check if the menu is still there. - -- And play with the Add and Remove menu options. - - -- Note that in multi player, this will only work after the DCS groups bug is solved. - - local function ShowStatus( PlaneGroup, StatusText, Coalition ) - - MESSAGE:New( Coalition, 15 ):ToRed() - PlaneGroup:Message( StatusText, 15 ) - end - - local MenuStatus = {} - - local function RemoveStatusMenu( MenuGroup ) - local MenuGroupName = MenuGroup:GetName() - MenuStatus[MenuGroupName]:Remove() - end - - --- @param Wrapper.Group#GROUP MenuGroup - local function AddStatusMenu( MenuGroup ) - local MenuGroupName = MenuGroup:GetName() - -- This would create a menu for the red coalition under the MenuCoalitionRed menu object. - MenuStatus[MenuGroupName] = MENU_GROUP:New( MenuGroup, "Status for Planes" ) - MENU_GROUP_COMMAND:New( MenuGroup, "Show Status", MenuStatus[MenuGroupName], ShowStatus, MenuGroup, "Status of planes is ok!", "Message to Red Coalition" ) - end - - SCHEDULER:New( nil, - function() - local PlaneGroup = GROUP:FindByName( "Plane 1" ) - if PlaneGroup and PlaneGroup:IsAlive() then - local MenuManage = MENU_GROUP:New( PlaneGroup, "Manage Menus" ) - MENU_GROUP_COMMAND:New( PlaneGroup, "Add Status Menu Plane 1", MenuManage, AddStatusMenu, PlaneGroup ) - MENU_GROUP_COMMAND:New( PlaneGroup, "Remove Status Menu Plane 1", MenuManage, RemoveStatusMenu, PlaneGroup ) - end - end, {}, 10, 10 ) - - SCHEDULER:New( nil, - function() - local PlaneGroup = GROUP:FindByName( "Plane 2" ) - if PlaneGroup and PlaneGroup:IsAlive() then - local MenuManage = MENU_GROUP:New( PlaneGroup, "Manage Menus" ) - MENU_GROUP_COMMAND:New( PlaneGroup, "Add Status Menu Plane 2", MenuManage, AddStatusMenu, PlaneGroup ) - MENU_GROUP_COMMAND:New( PlaneGroup, "Remove Status Menu Plane 2", MenuManage, RemoveStatusMenu, PlaneGroup ) - end - end, {}, 10, 10 ) - -end - - - - + +do + -- This demo creates a menu structure for the two groups of planes. + -- Each group will receive a different menu structure. + -- To test, join the planes, then look at the other radio menus (Option F10). + -- Then switch planes and check if the menu is still there. + -- And play with the Add and Remove menu options. + + -- Note that in multi player, this will only work after the DCS groups bug is solved. + + local function ShowStatus( PlaneGroup, StatusText, Coalition ) + + MESSAGE:New( Coalition, 15 ):ToRed() + PlaneGroup:Message( StatusText, 15 ) + end + + local MenuStatus = {} + + local function RemoveStatusMenu( MenuGroup ) + local MenuGroupName = MenuGroup:GetName() + MenuStatus[MenuGroupName]:Remove() + end + + --- @param Wrapper.Group#GROUP MenuGroup + local function AddStatusMenu( MenuGroup ) + local MenuGroupName = MenuGroup:GetName() + -- This would create a menu for the red coalition under the MenuCoalitionRed menu object. + MenuStatus[MenuGroupName] = MENU_GROUP:New( MenuGroup, "Status for Planes" ) + MENU_GROUP_COMMAND:New( MenuGroup, "Show Status", MenuStatus[MenuGroupName], ShowStatus, MenuGroup, "Status of planes is ok!", "Message to Red Coalition" ) + end + + SCHEDULER:New( nil, + function() + local PlaneGroup = GROUP:FindByName( "Plane 1" ) + if PlaneGroup and PlaneGroup:IsAlive() then + local MenuManage = MENU_GROUP:New( PlaneGroup, "Manage Menus" ) + MENU_GROUP_COMMAND:New( PlaneGroup, "Add Status Menu Plane 1", MenuManage, AddStatusMenu, PlaneGroup ) + MENU_GROUP_COMMAND:New( PlaneGroup, "Remove Status Menu Plane 1", MenuManage, RemoveStatusMenu, PlaneGroup ) + end + end, {}, 10, 10 ) + + SCHEDULER:New( nil, + function() + local PlaneGroup = GROUP:FindByName( "Plane 2" ) + if PlaneGroup and PlaneGroup:IsAlive() then + local MenuManage = MENU_GROUP:New( PlaneGroup, "Manage Menus" ) + MENU_GROUP_COMMAND:New( PlaneGroup, "Add Status Menu Plane 2", MenuManage, AddStatusMenu, PlaneGroup ) + MENU_GROUP_COMMAND:New( PlaneGroup, "Remove Status Menu Plane 2", MenuManage, RemoveStatusMenu, PlaneGroup ) + end + end, {}, 10, 10 ) + +end + + + + diff --git a/MEN - Menu Options/Normandy/MEN-003 - Menu Group/MEN-003 - Menu Group.miz b/MEN - Menu Options/Normandy/MEN-003 - Menu Group/MEN-003 - Menu Group.miz index 4bc5550e6e..e8ab3a8945 100644 Binary files a/MEN - Menu Options/Normandy/MEN-003 - Menu Group/MEN-003 - Menu Group.miz and b/MEN - Menu Options/Normandy/MEN-003 - Menu Group/MEN-003 - Menu Group.miz differ diff --git a/MEN - Menu Options/Normandy/MEN-102 - Menu Coalition Multi Player/MEN-102 - Menu Coalition Multi Player.lua b/MEN - Menu Options/Normandy/MEN-102 - Menu Coalition Multi Player/MEN-102 - Menu Coalition Multi Player.lua index 11c0bbb028..088ec2bd1b 100644 --- a/MEN - Menu Options/Normandy/MEN-102 - Menu Coalition Multi Player/MEN-102 - Menu Coalition Multi Player.lua +++ b/MEN - Menu Options/Normandy/MEN-102 - Menu Coalition Multi Player/MEN-102 - Menu Coalition Multi Player.lua @@ -1,43 +1,43 @@ - -do - -- This demo creates a menu structure for the planes within the red coalition. - -- To test, join the planes, then look at the other radio menus (Option F10). - -- Then switch planes and check if the menu is still there. - - local Plane1 = GROUP:FindByName( "Red Plane 1" ) - local Plane2 = GROUP:FindByName( "Red Plane 2" ) - local Plane3 = GROUP:FindByName( "Red Plane 3" ) - local Plane4 = GROUP:FindByName( "Red Plane 4" ) - - -- This would create a menu for the red coalition under the main DCS "Others" menu. - local MenuCoalitionRed = MENU_COALITION:New( coalition.side.RED, "Manage Menus" ) - - - local function ShowStatus( StatusText, Coalition ) - - Plane1:MessageToRed( StatusText, 15 ) - Plane2:MessageToRed( StatusText, 15 ) - end - - local MenuStatus -- Menu#MENU_COALITION - local MenuStatusShow -- Menu#MENU_COALITION_COMMAND - - local function RemoveStatusMenu() - MenuStatus:Remove() - end - - local function AddStatusMenu() - - -- This would create a menu for the red coalition under the MenuCoalitionRed menu object. - MenuStatus = MENU_COALITION:New( coalition.side.RED, "Status for Planes" ) - MenuStatusShow = MENU_COALITION_COMMAND:New( coalition.side.RED, "Show Status", MenuStatus, ShowStatus, "Status of planes is ok!", "Message to Red Coalition" ) - end - - local MenuAdd = MENU_COALITION_COMMAND:New( coalition.side.RED, "Add Status Menu", MenuCoalitionRed, AddStatusMenu ) - local MenuRemove = MENU_COALITION_COMMAND:New( coalition.side.RED, "Remove Status Menu", MenuCoalitionRed, RemoveStatusMenu ) - -end - - - - + +do + -- This demo creates a menu structure for the planes within the red coalition. + -- To test, join the planes, then look at the other radio menus (Option F10). + -- Then switch planes and check if the menu is still there. + + local Plane1 = GROUP:FindByName( "Red Plane 1" ) + local Plane2 = GROUP:FindByName( "Red Plane 2" ) + local Plane3 = GROUP:FindByName( "Red Plane 3" ) + local Plane4 = GROUP:FindByName( "Red Plane 4" ) + + -- This would create a menu for the red coalition under the main DCS "Others" menu. + local MenuCoalitionRed = MENU_COALITION:New( coalition.side.RED, "Manage Menus" ) + + + local function ShowStatus( StatusText, Coalition ) + + Plane1:MessageToRed( StatusText, 15 ) + Plane2:MessageToRed( StatusText, 15 ) + end + + local MenuStatus -- Menu#MENU_COALITION + local MenuStatusShow -- Menu#MENU_COALITION_COMMAND + + local function RemoveStatusMenu() + MenuStatus:Remove() + end + + local function AddStatusMenu() + + -- This would create a menu for the red coalition under the MenuCoalitionRed menu object. + MenuStatus = MENU_COALITION:New( coalition.side.RED, "Status for Planes" ) + MenuStatusShow = MENU_COALITION_COMMAND:New( coalition.side.RED, "Show Status", MenuStatus, ShowStatus, "Status of planes is ok!", "Message to Red Coalition" ) + end + + local MenuAdd = MENU_COALITION_COMMAND:New( coalition.side.RED, "Add Status Menu", MenuCoalitionRed, AddStatusMenu ) + local MenuRemove = MENU_COALITION_COMMAND:New( coalition.side.RED, "Remove Status Menu", MenuCoalitionRed, RemoveStatusMenu ) + +end + + + + diff --git a/MEN - Menu Options/Normandy/MEN-102 - Menu Coalition Multi Player/MEN-102 - Menu Coalition Multi Player.miz b/MEN - Menu Options/Normandy/MEN-102 - Menu Coalition Multi Player/MEN-102 - Menu Coalition Multi Player.miz index b2960e4975..92fc0f0033 100644 Binary files a/MEN - Menu Options/Normandy/MEN-102 - Menu Coalition Multi Player/MEN-102 - Menu Coalition Multi Player.miz and b/MEN - Menu Options/Normandy/MEN-102 - Menu Coalition Multi Player/MEN-102 - Menu Coalition Multi Player.miz differ diff --git a/MEN - Menu Options/Normandy/MEN-200 - Menu Stress Test 1/MEN-200 - Menu Stress Test 1.lua b/MEN - Menu Options/Normandy/MEN-200 - Menu Stress Test 1/MEN-200 - Menu Stress Test 1.lua index ab24d82d08..ee2b5bca07 100644 --- a/MEN - Menu Options/Normandy/MEN-200 - Menu Stress Test 1/MEN-200 - Menu Stress Test 1.lua +++ b/MEN - Menu Options/Normandy/MEN-200 - Menu Stress Test 1/MEN-200 - Menu Stress Test 1.lua @@ -1,56 +1,56 @@ - -TestMenus = {} - -Menu = MENU_MISSION:New( "Generate Menus" ) - -do - -- This demo creates a menu structure for the planes within the red coalition. - -- To test, join the planes, then look at the other radio menus (Option F10). - -- Then switch planes and check if the menu is still there. - - local Plane1 = GROUP:FindByName( "Red Plane 1" ) - local Plane2 = GROUP:FindByName( "Red Plane 2" ) - local Plane3 = GROUP:FindByName( "Red Plane 3" ) - local Plane4 = GROUP:FindByName( "Red Plane 4" ) - - local CoalitionText = { - [coalition.side.BLUE] = "BLUE", - [coalition.side.RED] = "RED", - } - - local function MenuMessage( Text, Parameter ) - MESSAGE:NewType( Text .. Parameter, MESSAGE.Type.Information ):ToAll() - end - - local function MenuRemove(m) - TestMenus[m]:Remove() - end - - local function GenerateMissionMenu() - local m = #TestMenus+1 - TestMenus[m] = MENU_MISSION:New( "Menu Mission "..m ) - for n = 1, 8 do - local MenuMissionCommand = MENU_MISSION_COMMAND:New( "Show Mission "..m.."."..n, TestMenus[m], MenuMessage, "Mission ", m.."."..n) - end - local MenuMissionRemoveCommand = MENU_MISSION_COMMAND:New( "Remove Mission "..m, TestMenus[m], MenuRemove, m) - end - - local function GenerateCoalitionMenu( Coalition ) - local m = #TestMenus+1 - TestMenus[m] = MENU_COALITION:New( Coalition, "Menu Coalition "..CoalitionText[Coalition].." ".. m ) - for n = 1, 8 do - local MenuMissionCommand = MENU_COALITION_COMMAND:New( Coalition, "Show Coalition "..CoalitionText[Coalition].." "..m.."."..n, TestMenus[m], MenuMessage, "Coalition ", CoalitionText[Coalition].." "..m.."."..n) - end - local MenuMissionRemoveCommand = MENU_COALITION_COMMAND:New( Coalition, "Remove Coalition "..CoalitionText[Coalition].." "..m, TestMenus[m], MenuRemove, m) - end - - -- Create a mission menu to generate the menus. - local MenuMission = MENU_MISSION_COMMAND:New( "Generate Mission Menus", Menu, GenerateMissionMenu ) - local MenuCoalitionBlue = MENU_MISSION_COMMAND:New( "Generate Blue Coalition Menus", Menu, GenerateCoalitionMenu, coalition.side.BLUE ) - local MenucoalitionRed = MENU_MISSION_COMMAND:New( "Generate Red Coalition Menus", Menu, GenerateCoalitionMenu, coalition.side.RED ) - -end - - - - + +TestMenus = {} + +Menu = MENU_MISSION:New( "Generate Menus" ) + +do + -- This demo creates a menu structure for the planes within the red coalition. + -- To test, join the planes, then look at the other radio menus (Option F10). + -- Then switch planes and check if the menu is still there. + + local Plane1 = GROUP:FindByName( "Red Plane 1" ) + local Plane2 = GROUP:FindByName( "Red Plane 2" ) + local Plane3 = GROUP:FindByName( "Red Plane 3" ) + local Plane4 = GROUP:FindByName( "Red Plane 4" ) + + local CoalitionText = { + [coalition.side.BLUE] = "BLUE", + [coalition.side.RED] = "RED", + } + + local function MenuMessage( Text, Parameter ) + MESSAGE:NewType( Text .. Parameter, MESSAGE.Type.Information ):ToAll() + end + + local function MenuRemove(m) + TestMenus[m]:Remove() + end + + local function GenerateMissionMenu() + local m = #TestMenus+1 + TestMenus[m] = MENU_MISSION:New( "Menu Mission "..m ) + for n = 1, 8 do + local MenuMissionCommand = MENU_MISSION_COMMAND:New( "Show Mission "..m.."."..n, TestMenus[m], MenuMessage, "Mission ", m.."."..n) + end + local MenuMissionRemoveCommand = MENU_MISSION_COMMAND:New( "Remove Mission "..m, TestMenus[m], MenuRemove, m) + end + + local function GenerateCoalitionMenu( Coalition ) + local m = #TestMenus+1 + TestMenus[m] = MENU_COALITION:New( Coalition, "Menu Coalition "..CoalitionText[Coalition].." ".. m ) + for n = 1, 8 do + local MenuMissionCommand = MENU_COALITION_COMMAND:New( Coalition, "Show Coalition "..CoalitionText[Coalition].." "..m.."."..n, TestMenus[m], MenuMessage, "Coalition ", CoalitionText[Coalition].." "..m.."."..n) + end + local MenuMissionRemoveCommand = MENU_COALITION_COMMAND:New( Coalition, "Remove Coalition "..CoalitionText[Coalition].." "..m, TestMenus[m], MenuRemove, m) + end + + -- Create a mission menu to generate the menus. + local MenuMission = MENU_MISSION_COMMAND:New( "Generate Mission Menus", Menu, GenerateMissionMenu ) + local MenuCoalitionBlue = MENU_MISSION_COMMAND:New( "Generate Blue Coalition Menus", Menu, GenerateCoalitionMenu, coalition.side.BLUE ) + local MenucoalitionRed = MENU_MISSION_COMMAND:New( "Generate Red Coalition Menus", Menu, GenerateCoalitionMenu, coalition.side.RED ) + +end + + + + diff --git a/MEN - Menu Options/Normandy/MEN-200 - Menu Stress Test 1/MEN-200 - Menu Stress Test 1.miz b/MEN - Menu Options/Normandy/MEN-200 - Menu Stress Test 1/MEN-200 - Menu Stress Test 1.miz index 0f2254e289..4dd24310ea 100644 Binary files a/MEN - Menu Options/Normandy/MEN-200 - Menu Stress Test 1/MEN-200 - Menu Stress Test 1.miz and b/MEN - Menu Options/Normandy/MEN-200 - Menu Stress Test 1/MEN-200 - Menu Stress Test 1.miz differ diff --git a/MIT - Missile Trainer/MIT-001 - Missile Trainer/MIT-001 - Missile Trainer.lua b/MIT - Missile Trainer/MIT-001 - Missile Trainer/MIT-001 - Missile Trainer.lua index b28f6644d7..388e1127f6 100644 --- a/MIT - Missile Trainer/MIT-001 - Missile Trainer/MIT-001 - Missile Trainer.lua +++ b/MIT - Missile Trainer/MIT-001 - Missile Trainer/MIT-001 - Missile Trainer.lua @@ -1,20 +1,20 @@ - --- Only use Include.File when developing new MOOSE classes. --- When using Moose.lua in the DO SCIPTS FILE initialization box, --- these Include.File statements are not needed, because all classes within Moose will be loaded. - - --- This is an example of a global -local Trainer = MISSILETRAINER - :New( 200, "Trainer: Welcome to the missile training, trainee! Missiles will be fired at you. Try to evade them. Good luck!" ) - :InitMessagesOnOff(true) - :InitAlertsToAll(true) - :InitAlertsHitsOnOff(true) - :InitAlertsLaunchesOnOff(false) -- I'll put it on below ... - :InitBearingOnOff(true) - :InitRangeOnOff(true) - :InitTrackingOnOff(true) - :InitTrackingToAll(true) - :InitMenusOnOff(false) - -Trainer:InitAlertsToAll(true) -- Now alerts are also on + +-- Only use Include.File when developing new MOOSE classes. +-- When using Moose.lua in the DO SCIPTS FILE initialization box, +-- these Include.File statements are not needed, because all classes within Moose will be loaded. + + +-- This is an example of a global +local Trainer = MISSILETRAINER + :New( 200, "Trainer: Welcome to the missile training, trainee! Missiles will be fired at you. Try to evade them. Good luck!" ) + :InitMessagesOnOff(true) + :InitAlertsToAll(true) + :InitAlertsHitsOnOff(true) + :InitAlertsLaunchesOnOff(false) -- I'll put it on below ... + :InitBearingOnOff(true) + :InitRangeOnOff(true) + :InitTrackingOnOff(true) + :InitTrackingToAll(true) + :InitMenusOnOff(false) + +Trainer:InitAlertsToAll(true) -- Now alerts are also on diff --git a/MIT - Missile Trainer/MIT-001 - Missile Trainer/MIT-001 - Missile Trainer.miz b/MIT - Missile Trainer/MIT-001 - Missile Trainer/MIT-001 - Missile Trainer.miz index 6d4cd9aa35..62837bd291 100644 Binary files a/MIT - Missile Trainer/MIT-001 - Missile Trainer/MIT-001 - Missile Trainer.miz and b/MIT - Missile Trainer/MIT-001 - Missile Trainer/MIT-001 - Missile Trainer.miz differ diff --git a/MOP-100 - MARKEROPS_BASE/MOP-100 - MARKEROPS_BASE.miz b/MOP-100 - MARKEROPS_BASE/MOP-100 - MARKEROPS_BASE.miz index 3893a10530..8c23eea1f9 100644 Binary files a/MOP-100 - MARKEROPS_BASE/MOP-100 - MARKEROPS_BASE.miz and b/MOP-100 - MARKEROPS_BASE/MOP-100 - MARKEROPS_BASE.miz differ diff --git a/MOP-100 - MARKEROPS_BASE/MarkerOps_Base_Demo.lua b/MOP-100 - MARKEROPS_BASE/MarkerOps_Base_Demo.lua new file mode 100644 index 0000000000..bda9ed35b9 --- /dev/null +++ b/MOP-100 - MARKEROPS_BASE/MarkerOps_Base_Demo.lua @@ -0,0 +1,86 @@ +------------------------------------------------------------------------- +-- MOP-100 - MARKEROPS_BASE - Basic Demo +------------------------------------------------------------------------- +-- Documentation +-- +-- MARKEROPS_BASE: https://flightcontrol-master.github.io/MOOSE_DOCS_DEVELOP/Documentation/Core.MarkerOps_Base.html +-- +------------------------------------------------------------------------- +-- On the F10, call a tanker to start from the carrier. It will fly to +-- an initial zone. Set a marker on the F10 map with keyword "TankerDemo". +-- The Tanker will fly there. Set a marker on the F10 map with keywords +-- "TankerDemo RTB". The tanke will RTB to the carrier. +------------------------------------------------------------------------- +-- Date: May 2021 +------------------------------------------------------------------------- + +-- globals +mytanker = nil +tankergroup = nil +TankerAuftrag = nil + +function menucalltanker() + + if not mytanker then + -- new MARKEROPS_BASE object + mytanker = MARKEROPS_BASE:New("TankerDemo",{"RTB"}) -- Core.MarkerOps_Base#MARKEROPS_BASE + -- start FlightGroup + tankergroup = FLIGHTGROUP:New("Tanker") + tankergroup:SetHomebase(AIRBASE:FindByName("Truman")) + tankergroup:SetDefaultRadio(245,"AM",false) + tankergroup:SetDespawnAfterLanding() + tankergroup:SwitchTACAN(45, "TKR", 1, "X") + tankergroup:SetDefaultCallsign(CALLSIGN.Tanker.Texaco,1) + -- Mission + local InitialHold = ZONE:New("Initial Hold"):GetCoordinate() + TankerAuftrag = AUFTRAG:NewTANKER(InitialHold,18000,UTILS.KnotsToAltKIAS(220,18000),90,20,0) + TankerAuftrag:SetMissionRange(500) + tankergroup:AddMission(TankerAuftrag) + else + local status = tankergroup:GetState() + local m = MESSAGE:New(string.format("Tanker %s ops in status: %s", mytanker.Tag, status),10,"Info",true):ToAll() + end + + -- Handler function + local function Handler(Keywords,Coord) + + local MustRTB = false + for _,_word in pairs (Keywords) do + if string.lower(_word) == "rtb" then + MustRTB = true + end + end + + -- cancel current Auftrag + TankerAuftrag:Cancel() + + -- check if we need to RTB + if MustRTB then + tankergroup:RTB(AIRBASE:FindByName("Truman")) + else + -- no, fly to coordinate of marker + local auftrag = AUFTRAG:NewTANKER(Coord,18000,UTILS.KnotsToAltKIAS(220,18000),90,20,0) + auftrag:SetMissionRange(500) + tankergroup:AddMission(auftrag) + TankerAuftrag = auftrag + end + end + + -- Event functions + function mytanker:OnAfterMarkAdded(From,Event,To,Text,Keywords,Coord) + local m = MESSAGE:New(string.format("Tanker %s Mark Added.", self.Tag),10,"Info",true):ToAll() + Handler(Keywords,Coord) + end + + function mytanker:OnAfterMarkChanged(From,Event,To,Text,Keywords,Coord) + local m = MESSAGE:New(string.format("Tanker %s Mark Changed.", self.Tag),10,"Info",true):ToAll() + Handler(Keywords,Coord) + end + + function mytanker:OnAfterMarkDeleted(From,Event,To) + local m = MESSAGE:New(string.format("Tanker %s Mark Deleted.", self.Tag),10,"Info",true):ToAll() + end +end + +MenuTop = MENU_COALITION:New( coalition.side.BLUE,"Call Tanker") +MenuTanker = MENU_COALITION_COMMAND:New(coalition.side.BLUE,"Start Tanker",MenuTop,menucalltanker) diff --git a/MTS - Mantis/MTS-010 - Basic Mantis Demo/MTS-010 - Basic Mantis Demo.miz b/MTS - Mantis/MTS-010 - Basic Mantis Demo/MTS-010 - Basic Mantis Demo.miz index c17f9bdc93..fbc2a9f0c1 100644 Binary files a/MTS - Mantis/MTS-010 - Basic Mantis Demo/MTS-010 - Basic Mantis Demo.miz and b/MTS - Mantis/MTS-010 - Basic Mantis Demo/MTS-010 - Basic Mantis Demo.miz differ diff --git a/MTS - Mantis/MTS-100 - Autorelocate HQ and EWR/MTS-100 - Autorelocate HQ and EWR.lua b/MTS - Mantis/MTS-100 - Autorelocate HQ and EWR/MTS-100 - Autorelocate HQ and EWR.lua index cdf7f3efbe..3522ba2568 100644 --- a/MTS - Mantis/MTS-100 - Autorelocate HQ and EWR/MTS-100 - Autorelocate HQ and EWR.lua +++ b/MTS - Mantis/MTS-100 - Autorelocate HQ and EWR/MTS-100 - Autorelocate HQ and EWR.lua @@ -1,23 +1,23 @@ -------------------------------------------------------------------------- --- MTS-100 - MANTIS - Autorelocate HQ and EWR -------------------------------------------------------------------------- --- Documentation --- --- MANTIS: https://flightcontrol-master.github.io/MOOSE_DOCS/Documentation/Functional.Mantis.html --- --- Note: As of Dec/20, MANTIS is WIP. Needs a recent build of Moose.lua > 16 Dec 20 --- for CONTROLLABLE:RelocateGroundRandomInRadius() to be available --- https://flightcontrol-master.github.io/MOOSE_DOCS/Documentation/CONTROLLABLE.RelocateGroundRandomInRadius.html -------------------------------------------------------------------------- --- Observe a set of SAM sites being attacked by F18 SEAD, A10 and Helicopters. --- HQ and EWR will randomly relocate between 30 and 60 mins --- The SA 11 Radar will only relocate if not detected units are in range -------------------------------------------------------------------------- --- Date: 17 Dec 2020 -------------------------------------------------------------------------- - -myredmantis = MANTIS:New("myredmantis","Red SAM","Red EWR","Red HQ","red",false) -myredmantis:SetAutoRelocate(true, true) -- make HQ and EWR relocatable, if they are actually mobile in DCS! -myredmantis:Debug(false) -myredmantis.verbose = true +------------------------------------------------------------------------- +-- MTS-100 - MANTIS - Autorelocate HQ and EWR +------------------------------------------------------------------------- +-- Documentation +-- +-- MANTIS: https://flightcontrol-master.github.io/MOOSE_DOCS/Documentation/Functional.Mantis.html +-- +-- Note: As of Dec/20, MANTIS is WIP. Needs a recent build of Moose.lua > 16 Dec 20 +-- for CONTROLLABLE:RelocateGroundRandomInRadius() to be available +-- https://flightcontrol-master.github.io/MOOSE_DOCS/Documentation/CONTROLLABLE.RelocateGroundRandomInRadius.html +------------------------------------------------------------------------- +-- Observe a set of SAM sites being attacked by F18 SEAD, A10 and Helicopters. +-- HQ and EWR will randomly relocate between 30 and 60 mins +-- The SA 11 Radar will only relocate if not detected units are in range +------------------------------------------------------------------------- +-- Date: 17 Dec 2020 +------------------------------------------------------------------------- + +myredmantis = MANTIS:New("myredmantis","Red SAM","Red EWR","Red HQ","red",false) +myredmantis:SetAutoRelocate(true, true) -- make HQ and EWR relocatable, if they are actually mobile in DCS! +myredmantis:Debug(true) +myredmantis.verbose = true myredmantis:Start() \ No newline at end of file diff --git a/MTS - Mantis/MTS-100 - Autorelocate HQ and EWR/MTS-100 - Autorelocate HQ and EWR.miz b/MTS - Mantis/MTS-100 - Autorelocate HQ and EWR/MTS-100 - Autorelocate HQ and EWR.miz index 3c367a234d..2e163d8647 100644 Binary files a/MTS - Mantis/MTS-100 - Autorelocate HQ and EWR/MTS-100 - Autorelocate HQ and EWR.miz and b/MTS - Mantis/MTS-100 - Autorelocate HQ and EWR/MTS-100 - Autorelocate HQ and EWR.miz differ diff --git a/MTS - Mantis/MTS-100 - Blue Autorelocate HQ and EWR/MTS-100 - Blue Autorelocate HQ and EWR.lua b/MTS - Mantis/MTS-100 - Blue Autorelocate HQ and EWR/MTS-100 - Blue Autorelocate HQ and EWR.lua index baf38d3047..fe480710a4 100644 --- a/MTS - Mantis/MTS-100 - Blue Autorelocate HQ and EWR/MTS-100 - Blue Autorelocate HQ and EWR.lua +++ b/MTS - Mantis/MTS-100 - Blue Autorelocate HQ and EWR/MTS-100 - Blue Autorelocate HQ and EWR.lua @@ -1,23 +1,23 @@ -------------------------------------------------------------------------- --- MTS-100 - MANTIS - Autorelocate HQ and EWR -------------------------------------------------------------------------- --- Documentation --- --- MANTIS: https://flightcontrol-master.github.io/MOOSE_DOCS/Documentation/Functional.Mantis.html --- --- Note: As of Dec/20, MANTIS is WIP. Needs a recent build of Moose.lua > 16 Dec 20 --- for CONTROLLABLE:RelocateGroundRandomInRadius() to be available --- https://flightcontrol-master.github.io/MOOSE_DOCS/Documentation/CONTROLLABLE.RelocateGroundRandomInRadius.html -------------------------------------------------------------------------- --- Observe a set of Blue SAM sites being attacked by Red SEAD and Helicopters --- HQ and EWR will randomly relocate between 30 and 60 mins --- The Radar will only relocate if not detected units are in range -------------------------------------------------------------------------- --- Date: 26 Dec 2020 -------------------------------------------------------------------------- - -myredmantis = MANTIS:New("mybluemantis","Blue SAM","Blue EWR","Blue HQ","blue",false) -myredmantis:SetAutoRelocate(true, true) -- make HQ and EWR relocatable, if they are actually mobile in DCS! -myredmantis:Debug(false) -myredmantis.verbose = true +------------------------------------------------------------------------- +-- MTS-100 - MANTIS - Autorelocate HQ and EWR +------------------------------------------------------------------------- +-- Documentation +-- +-- MANTIS: https://flightcontrol-master.github.io/MOOSE_DOCS/Documentation/Functional.Mantis.html +-- +-- Note: As of Dec/20, MANTIS is WIP. Needs a recent build of Moose.lua > 16 Dec 20 +-- for CONTROLLABLE:RelocateGroundRandomInRadius() to be available +-- https://flightcontrol-master.github.io/MOOSE_DOCS/Documentation/CONTROLLABLE.RelocateGroundRandomInRadius.html +------------------------------------------------------------------------- +-- Observe a set of Blue SAM sites being attacked by Red SEAD and Helicopters +-- HQ and EWR will randomly relocate between 30 and 60 mins +-- The Radar will only relocate if not detected units are in range +------------------------------------------------------------------------- +-- Date: 26 Dec 2020 +------------------------------------------------------------------------- + +myredmantis = MANTIS:New("mybluemantis","Blue SAM","Blue EWR","Blue HQ","blue",false) +myredmantis:SetAutoRelocate(true, true) -- make HQ and EWR relocatable, if they are actually mobile in DCS! +myredmantis:Debug(false) +myredmantis.verbose = true myredmantis:Start() \ No newline at end of file diff --git a/MTS - Mantis/MTS-100 - Blue Autorelocate HQ and EWR/MTS-100 - Blue Autorelocate HQ and EWR.miz b/MTS - Mantis/MTS-100 - Blue Autorelocate HQ and EWR/MTS-100 - Blue Autorelocate HQ and EWR.miz index 1979a1da8b..4c97afdc56 100644 Binary files a/MTS - Mantis/MTS-100 - Blue Autorelocate HQ and EWR/MTS-100 - Blue Autorelocate HQ and EWR.miz and b/MTS - Mantis/MTS-100 - Blue Autorelocate HQ and EWR/MTS-100 - Blue Autorelocate HQ and EWR.miz differ diff --git a/MTS - Mantis/MTS-110 - Mantis Link to A2A-Dispatcher/MTS-110 - Mantis Link to A2A-Dispatcher.lua b/MTS - Mantis/MTS-110 - Mantis Link to A2A-Dispatcher/MTS-110 - Mantis Link to A2A-Dispatcher.lua index 89fcae1eb0..055f0cd500 100644 --- a/MTS - Mantis/MTS-110 - Mantis Link to A2A-Dispatcher/MTS-110 - Mantis Link to A2A-Dispatcher.lua +++ b/MTS - Mantis/MTS-110 - Mantis Link to A2A-Dispatcher/MTS-110 - Mantis Link to A2A-Dispatcher.lua @@ -1,38 +1,38 @@ -------------------------------------------------------------------------- --- MTS-110 - Mantis Link to A2A-Dispatcher -------------------------------------------------------------------------- --- Documentation --- --- MANTIS: https://flightcontrol-master.github.io/MOOSE_DOCS/Documentation/Functional.Mantis.html --- --- Note: As of Dec/20, MANTIS is WIP. Needs a recent build of Moose.lua > 16 Dec 20 --- for CONTROLLABLE:RelocateGroundRandomInRadius() to be available --- https://flightcontrol-master.github.io/MOOSE_DOCS/Documentation/CONTROLLABLE.RelocateGroundRandomInRadius.html -------------------------------------------------------------------------- --- Observe a set of SAM sites being attacked by F18 SEAD, A10 and Helicopters. --- HQ and EWR will randomly relocate between 30 and 60 mins --- SU-27 GCICAP Flights will start from Pashkovsky to help the SAMs -------------------------------------------------------------------------- --- Date: 17 Dec 2020 -------------------------------------------------------------------------- - -myredmantis = MANTIS:New("myredmantis","Red SAM","Red EWR","Red HQ","red",false) ---myredmantis:SetAutoRelocate(true, true) -- make HQ and EWR relocatable, if they are actually mobile in DCS! -myredmantis:Debug(false) ---myredmantis.verbose = false -myredmantis:Start() - --- link in AI_A2A_Dispatcher - -Red_GCI = AI_A2A_DISPATCHER:New(myredmantis.Detection) -- use existing detection object - -Red_GCI:SetTacticalDisplay(true) -Red_GCI:SetDefaultLandingAtRunway() -Red_GCI:SetDefaultTakeoffInAir() -Red_GCI:SetDisengageRadius(125000) -Red_GCI:SetDefaultOverhead(0.4) -Red_GCI:SetDefaultGrouping(2) -Red_GCI:SetGciRadius(125000) -Red_GCI:SetSquadron("Russian Tigers Sq1",AIRBASE.Caucasus.Krasnodar_Pashkovsky,"Red Interceptor",10) -Red_GCI:SetSquadronGci("Russian Tigers Sq1",900,1800) -Red_GCI:Start() -- never forget to use Start()!! +------------------------------------------------------------------------- +-- MTS-110 - Mantis Link to A2A-Dispatcher +------------------------------------------------------------------------- +-- Documentation +-- +-- MANTIS: https://flightcontrol-master.github.io/MOOSE_DOCS/Documentation/Functional.Mantis.html +-- +-- Note: As of Dec/20, MANTIS is WIP. Needs a recent build of Moose.lua > 16 Dec 20 +-- for CONTROLLABLE:RelocateGroundRandomInRadius() to be available +-- https://flightcontrol-master.github.io/MOOSE_DOCS/Documentation/CONTROLLABLE.RelocateGroundRandomInRadius.html +------------------------------------------------------------------------- +-- Observe a set of SAM sites being attacked by F18 SEAD, A10 and Helicopters. +-- HQ and EWR will randomly relocate between 30 and 60 mins +-- SU-27 GCICAP Flights will start from Pashkovsky to help the SAMs +------------------------------------------------------------------------- +-- Date: 17 Dec 2020 +------------------------------------------------------------------------- + +myredmantis = MANTIS:New("myredmantis","Red SAM","Red EWR","Red HQ","red",false) +--myredmantis:SetAutoRelocate(true, true) -- make HQ and EWR relocatable, if they are actually mobile in DCS! +myredmantis:Debug(false) +--myredmantis.verbose = false +myredmantis:Start() + +-- link in AI_A2A_Dispatcher + +Red_GCI = AI_A2A_DISPATCHER:New(myredmantis.Detection) -- use existing detection object + +Red_GCI:SetTacticalDisplay(true) +Red_GCI:SetDefaultLandingAtRunway() +Red_GCI:SetDefaultTakeoffInAir() +Red_GCI:SetDisengageRadius(125000) +Red_GCI:SetDefaultOverhead(0.4) +Red_GCI:SetDefaultGrouping(2) +Red_GCI:SetGciRadius(125000) +Red_GCI:SetSquadron("Russian Tigers Sq1",AIRBASE.Caucasus.Krasnodar_Pashkovsky,"Red Interceptor",10) +Red_GCI:SetSquadronGci("Russian Tigers Sq1",900,1800) +Red_GCI:Start() -- never forget to use Start()!! diff --git a/MTS - Mantis/MTS-110 - Mantis Link to A2A-Dispatcher/MTS-110 - Mantis Link to A2A-Dispatcher.miz b/MTS - Mantis/MTS-110 - Mantis Link to A2A-Dispatcher/MTS-110 - Mantis Link to A2A-Dispatcher.miz index 4ebef775d7..c78239bf86 100644 Binary files a/MTS - Mantis/MTS-110 - Mantis Link to A2A-Dispatcher/MTS-110 - Mantis Link to A2A-Dispatcher.miz and b/MTS - Mantis/MTS-110 - Mantis Link to A2A-Dispatcher/MTS-110 - Mantis Link to A2A-Dispatcher.miz differ diff --git a/MTS - Mantis/MTS-200 - MANTIS - Advanced Mode/MTS-200 - MANTIS - Advanced Mode.lua b/MTS - Mantis/MTS-200 - MANTIS - Advanced Mode/MTS-200 - MANTIS - Advanced Mode.lua index af72dad47d..030ece1c00 100644 --- a/MTS - Mantis/MTS-200 - MANTIS - Advanced Mode/MTS-200 - MANTIS - Advanced Mode.lua +++ b/MTS - Mantis/MTS-200 - MANTIS - Advanced Mode/MTS-200 - MANTIS - Advanced Mode.lua @@ -1,71 +1,71 @@ -------------------------------------------------------------------------- --- MTS-200 - MANTIS - Advanced Mode -------------------------------------------------------------------------- --- Documentation --- --- MANTIS: https://flightcontrol-master.github.io/MOOSE_DOCS/Documentation/Functional.Mantis.html --- --- Note: As of Dec/20, MANTIS is WIP. Needs a recent build of Moose.lua > 17 Dec 20 --- for CONTROLLABLE:RelocateGroundRandomInRadius() to be available --- https://flightcontrol-master.github.io/MOOSE_DOCS/Documentation/CONTROLLABLE.RelocateGroundRandomInRadius.html -------------------------------------------------------------------------- --- Observe a set of SAM sites being attacked by F18 SEAD, A10 and Helicopters. --- HQ and EWR will be destroyed after 10 and 15 mins, respectively --- Detection will slow down accordingly, if both units are dead, all SAM sites go to RED state --- Set up of a new HQ and EWR will recover MANTIS -------------------------------------------------------------------------- --- Date: 21 Dec 2020 -------------------------------------------------------------------------- - -myredmantis = MANTIS:New("myredmantis","Red SAM","Red EWR","Red HQ","red",true) ---myredmantis:SetAutoRelocate(true, true) -- make HQ and EWR relocatable, if they are actually mobile in DCS! -myredmantis:SetAdvancedMode(true, 100) -- switch on advanced mode - detection will slow down or die if HQ and EWR die -myredmantis:Debug(false) -myredmantis.verbose = true -- watch DCS.log -myredmantis:Start() - -function destroy(objectname) - local text = "Destroying "..objectname - m=MESSAGE:New(text,30,"Info"):ToAll() - local grp = GROUP:FindByName(objectname) - grp:Destroy() -end - -function createhq() - newhq = SPAWN - :New("Red HQ-1") - :InitDelayOff() - :OnSpawnGroup( - function (group) - myredmantis:SetCommandCenter(group) - end - ) - :Spawn() - local text = "Creating new HQ!" - m=MESSAGE:New(text,30,"Info"):ToAll() -end - -function createewr() - newewr = SPAWN - :New("Red EWR-1") - :InitDelayOff() - :Spawn() - local text = "Creating new EWR!" - m=MESSAGE:New(text,30,"Info"):ToAll() -end - -hqtimer = TIMER:New(destroy,"Red HQ") -ewrtimer = TIMER:New(destroy,"Red EWR") -awacstimer = TIMER:New(destroy,"Red EWR Awacs") - -nhqtimer = TIMER:New(createhq) -newrtimer = TIMER:New(createewr) - --- slow down -hqtimer:Start(300) -- 5 min -ewrtimer:Start(360) -- 6 min -awacstimer:Start(420) -- 7 min - ---speed up -nhqtimer:Start(600) -- 10 min -newrtimer:Start(660) -- 11 min +------------------------------------------------------------------------- +-- MTS-200 - MANTIS - Advanced Mode +------------------------------------------------------------------------- +-- Documentation +-- +-- MANTIS: https://flightcontrol-master.github.io/MOOSE_DOCS/Documentation/Functional.Mantis.html +-- +-- Note: As of Dec/20, MANTIS is WIP. Needs a recent build of Moose.lua > 17 Dec 20 +-- for CONTROLLABLE:RelocateGroundRandomInRadius() to be available +-- https://flightcontrol-master.github.io/MOOSE_DOCS/Documentation/CONTROLLABLE.RelocateGroundRandomInRadius.html +------------------------------------------------------------------------- +-- Observe a set of SAM sites being attacked by F18 SEAD, A10 and Helicopters. +-- HQ and EWR will be destroyed after 10 and 15 mins, respectively +-- Detection will slow down accordingly, if both units are dead, all SAM sites go to RED state +-- Set up of a new HQ and EWR will recover MANTIS +------------------------------------------------------------------------- +-- Date: 21 Dec 2020 +------------------------------------------------------------------------- + +myredmantis = MANTIS:New("myredmantis","Red SAM","Red EWR","Red HQ","red",true) +--myredmantis:SetAutoRelocate(true, true) -- make HQ and EWR relocatable, if they are actually mobile in DCS! +myredmantis:SetAdvancedMode(true, 100) -- switch on advanced mode - detection will slow down or die if HQ and EWR die +myredmantis:Debug(false) +myredmantis.verbose = true -- watch DCS.log +myredmantis:Start() + +function destroy(objectname) + local text = "Destroying "..objectname + m=MESSAGE:New(text,30,"Info"):ToAll() + local grp = GROUP:FindByName(objectname) + grp:Destroy() +end + +function createhq() + newhq = SPAWN + :New("Red HQ-1") + :InitDelayOff() + :OnSpawnGroup( + function (group) + myredmantis:SetCommandCenter(group) + end + ) + :Spawn() + local text = "Creating new HQ!" + m=MESSAGE:New(text,30,"Info"):ToAll() +end + +function createewr() + newewr = SPAWN + :New("Red EWR-1") + :InitDelayOff() + :Spawn() + local text = "Creating new EWR!" + m=MESSAGE:New(text,30,"Info"):ToAll() +end + +hqtimer = TIMER:New(destroy,"Red HQ") +ewrtimer = TIMER:New(destroy,"Red EWR") +awacstimer = TIMER:New(destroy,"Red EWR Awacs") + +nhqtimer = TIMER:New(createhq) +newrtimer = TIMER:New(createewr) + +-- slow down +hqtimer:Start(300) -- 5 min +ewrtimer:Start(360) -- 6 min +awacstimer:Start(420) -- 7 min + +--speed up +nhqtimer:Start(600) -- 10 min +newrtimer:Start(660) -- 11 min diff --git a/MTS - Mantis/MTS-200 - MANTIS - Advanced Mode/MTS-200 - MANTIS - Advanced Mode.miz b/MTS - Mantis/MTS-200 - MANTIS - Advanced Mode/MTS-200 - MANTIS - Advanced Mode.miz index 9f973ae4ec..c7405a525d 100644 Binary files a/MTS - Mantis/MTS-200 - MANTIS - Advanced Mode/MTS-200 - MANTIS - Advanced Mode.miz and b/MTS - Mantis/MTS-200 - MANTIS - Advanced Mode/MTS-200 - MANTIS - Advanced Mode.miz differ diff --git a/MTS - Mantis/MTS-210 - MANTIS - Advanced Mode plus AWACS/MTS-210 - MANTIS - Advanced Mode plus AWACS.lua b/MTS - Mantis/MTS-210 - MANTIS - Advanced Mode plus AWACS/MTS-210 - MANTIS - Advanced Mode plus AWACS.lua index 2398a52cfa..8952fee017 100644 --- a/MTS - Mantis/MTS-210 - MANTIS - Advanced Mode plus AWACS/MTS-210 - MANTIS - Advanced Mode plus AWACS.lua +++ b/MTS - Mantis/MTS-210 - MANTIS - Advanced Mode plus AWACS/MTS-210 - MANTIS - Advanced Mode plus AWACS.lua @@ -1,90 +1,90 @@ -------------------------------------------------------------------------- --- MTS-210 - MANTIS - Advanced Mode plus AWACS -------------------------------------------------------------------------- --- Documentation --- --- MANTIS: https://flightcontrol-master.github.io/MOOSE_DOCS/Documentation/Functional.Mantis.html --- --- Note: As of Dec/20, MANTIS is WIP. Needs a recent build of Moose.lua > 20 Dec 20 --- for CONTROLLABLE:RelocateGroundRandomInRadius() to be available --- https://flightcontrol-master.github.io/MOOSE_DOCS/Documentation/CONTROLLABLE.RelocateGroundRandomInRadius.html -------------------------------------------------------------------------- --- Observe a set of SAM sites being attacked by F18 SEAD, A10 and Helicopters. --- HQ, Awacs and EWR will be destroyed after 5, 6, 7 mins, respectively --- Detection will slow down accordingly, if both units are dead, all SAM sites go to RED state --- Set up of a new HQ and EWR will recover MANTIS from min 10 onwards -------------------------------------------------------------------------- --- Date: 27 Dec 2020 -------------------------------------------------------------------------- - -myredmantis = MANTIS:New("myredmantis","Red SAM","Red EWR","Red HQ","red",true,"Red Awacs") -myredmantis:SetAutoRelocate(true, true) -- make HQ and EWR relocatable, if they are actually mobile in DCS! -myredmantis:SetAdvancedMode(true, 100) -- switch on advanced mode - detection will slow down or die if HQ and EWR die -myredmantis:SetSAMRange(85) -myredmantis:SetSAMRadius(30000) -myredmantis:Debug(false) -myredmantis.verbose = true -- watch DCS.log -myredmantis:Start() - - -function destroy(objectname) - local text = "Destroying "..objectname - m=MESSAGE:New(text,30,"Info"):ToAll() - local grp = GROUP:FindByName(objectname) - grp:Destroy() -end - -function createhq() - newhq = SPAWN - :New("Red HQ-1") - :InitDelayOff() - :OnSpawnGroup( - function (group) - myredmantis:SetCommandCenter(group) - end - ) - :Spawn() - local text = "Creating new HQ!" - m=MESSAGE:New(text,30,"Info"):ToAll() -end - -function createewr() - newewr = SPAWN - :New("Red EWR-1") - :InitDelayOff() - :Spawn() - local text = "Creating new EWR!" - m=MESSAGE:New(text,30,"Info"):ToAll() -end - -function createawacs() - newewr = SPAWN - :New("Red Awacs 1") - :InitDelayOff() - :OnSpawnGroup( - function (grp) - local name = grp:GetName() - myredmantis:SetAwacs(name) - end - ) - :Spawn() - local text = "Creating new AWACS!" - m=MESSAGE:New(text,30,"Info"):ToAll() -end - -hqtimer = TIMER:New(destroy,"Red HQ") -ewrtimer = TIMER:New(destroy,"Red EWR") -awacstimer = TIMER:New(destroy,"Red Awacs") - -nhqtimer = TIMER:New(createhq) -newrtimer = TIMER:New(createewr) -newAtimer = TIMER:New(createawacs) --- slow down -hqtimer:Start(300) -- 5 min -ewrtimer:Start(360) -- 6 min -awacstimer:Start(420) -- 7 min - ---speed up -nhqtimer:Start(600) -- 10 min -newrtimer:Start(660) -- 11 min +------------------------------------------------------------------------- +-- MTS-210 - MANTIS - Advanced Mode plus AWACS +------------------------------------------------------------------------- +-- Documentation +-- +-- MANTIS: https://flightcontrol-master.github.io/MOOSE_DOCS/Documentation/Functional.Mantis.html +-- +-- Note: As of Dec/20, MANTIS is WIP. Needs a recent build of Moose.lua > 20 Dec 20 +-- for CONTROLLABLE:RelocateGroundRandomInRadius() to be available +-- https://flightcontrol-master.github.io/MOOSE_DOCS/Documentation/CONTROLLABLE.RelocateGroundRandomInRadius.html +------------------------------------------------------------------------- +-- Observe a set of SAM sites being attacked by F18 SEAD, A10 and Helicopters. +-- HQ, Awacs and EWR will be destroyed after 5, 6, 7 mins, respectively +-- Detection will slow down accordingly, if both units are dead, all SAM sites go to RED state +-- Set up of a new HQ and EWR will recover MANTIS from min 10 onwards +------------------------------------------------------------------------- +-- Date: 27 Dec 2020 +------------------------------------------------------------------------- + +myredmantis = MANTIS:New("myredmantis","Red SAM","Red EWR","Red HQ","red",true,"Red Awacs") +myredmantis:SetAutoRelocate(true, true) -- make HQ and EWR relocatable, if they are actually mobile in DCS! +myredmantis:SetAdvancedMode(true, 100) -- switch on advanced mode - detection will slow down or die if HQ and EWR die +myredmantis:SetSAMRange(85) +myredmantis:SetSAMRadius(30000) +myredmantis:Debug(false) +myredmantis.verbose = true -- watch DCS.log +myredmantis:Start() + + +function destroy(objectname) + local text = "Destroying "..objectname + m=MESSAGE:New(text,30,"Info"):ToAll() + local grp = GROUP:FindByName(objectname) + grp:Destroy() +end + +function createhq() + newhq = SPAWN + :New("Red HQ-1") + :InitDelayOff() + :OnSpawnGroup( + function (group) + myredmantis:SetCommandCenter(group) + end + ) + :Spawn() + local text = "Creating new HQ!" + m=MESSAGE:New(text,30,"Info"):ToAll() +end + +function createewr() + newewr = SPAWN + :New("Red EWR-1") + :InitDelayOff() + :Spawn() + local text = "Creating new EWR!" + m=MESSAGE:New(text,30,"Info"):ToAll() +end + +function createawacs() + newewr = SPAWN + :New("Red Awacs 1") + :InitDelayOff() + :OnSpawnGroup( + function (grp) + local name = grp:GetName() + myredmantis:SetAwacs(name) + end + ) + :Spawn() + local text = "Creating new AWACS!" + m=MESSAGE:New(text,30,"Info"):ToAll() +end + +hqtimer = TIMER:New(destroy,"Red HQ") +ewrtimer = TIMER:New(destroy,"Red EWR") +awacstimer = TIMER:New(destroy,"Red Awacs") + +nhqtimer = TIMER:New(createhq) +newrtimer = TIMER:New(createewr) +newAtimer = TIMER:New(createawacs) +-- slow down +hqtimer:Start(300) -- 5 min +ewrtimer:Start(360) -- 6 min +awacstimer:Start(420) -- 7 min + +--speed up +nhqtimer:Start(600) -- 10 min +newrtimer:Start(660) -- 11 min newAtimer:Start(720) -- 12 min \ No newline at end of file diff --git a/MTS - Mantis/MTS-210 - MANTIS - Advanced Mode plus AWACS/MTS-210 - MANTIS - Advanced Mode plus AWACS.miz b/MTS - Mantis/MTS-210 - MANTIS - Advanced Mode plus AWACS/MTS-210 - MANTIS - Advanced Mode plus AWACS.miz index 8b58fb064e..4be945f515 100644 Binary files a/MTS - Mantis/MTS-210 - MANTIS - Advanced Mode plus AWACS/MTS-210 - MANTIS - Advanced Mode plus AWACS.miz and b/MTS - Mantis/MTS-210 - MANTIS - Advanced Mode plus AWACS/MTS-210 - MANTIS - Advanced Mode plus AWACS.miz differ diff --git a/MTS - Mantis/MTS-300 - MANTIS - Advanced Mode Complex Example/MTS-300 - MANTIS - Advanced Mode Complex Example.miz b/MTS - Mantis/MTS-300 - MANTIS - Advanced Mode Complex Example/MTS-300 - MANTIS - Advanced Mode Complex Example.miz index 43e7bc5288..a811339abb 100644 Binary files a/MTS - Mantis/MTS-300 - MANTIS - Advanced Mode Complex Example/MTS-300 - MANTIS - Advanced Mode Complex Example.miz and b/MTS - Mantis/MTS-300 - MANTIS - Advanced Mode Complex Example/MTS-300 - MANTIS - Advanced Mode Complex Example.miz differ diff --git a/OPS - ATIS/ATIS - 100 - Caucasus Batumi/ATIS - 100 - Caucasus Batumi.lua b/OPS - ATIS/ATIS - 100 - Caucasus Batumi/ATIS - 100 - Caucasus Batumi.lua index 4bbcf789ab..5bfd11f1b4 100644 --- a/OPS - ATIS/ATIS - 100 - Caucasus Batumi/ATIS - 100 - Caucasus Batumi.lua +++ b/OPS - ATIS/ATIS - 100 - Caucasus Batumi/ATIS - 100 - Caucasus Batumi.lua @@ -1,19 +1,18 @@ - --- ATIS Batumi Airport on 143.00 MHz AM. -atisBatumi=ATIS:New(AIRBASE.Caucasus.Batumi, 143.00) -atisBatumi:SetRadioRelayUnitName("Radio Relay Batumi") -atisBatumi:SetTowerFrequencies({260, 131}) -atisBatumi:Start() - --- ATIS Vaziani Airport on 144.00 MHz AM. -atisVaziani=ATIS:New(AIRBASE.Caucasus.Vaziani, 144.00) -atisVaziani:SetRadioRelayUnitName("Radio Relay Vaziani") -atisVaziani:SetTowerFrequencies({269, 140}) -atisVaziani:Start() - --- Only for debugging/info. -local airbases=AIRBASE.GetAllAirbases() -for _,_airbase in pairs(airbases) do - local airbase=_airbase --Wrapper.Airbase#AIRBASE - airbase:GetRunwayData(nil, true) -end + +-- ATIS Batumi Airport on 143.00 MHz AM. +atisBatumi=ATIS:New(AIRBASE.Caucasus.Batumi, 143.00) +atisBatumi:SetRadioRelayUnitName("Radio Relay Batumi") +atisBatumi:SetTowerFrequencies({260, 131}) +atisBatumi:Start() + +-- ATIS Vaziani Airport on 144.00 MHz AM. +atisVaziani=ATIS:New(AIRBASE.Caucasus.Vaziani, 144.00) +atisVaziani:SetRadioRelayUnitName("Radio Relay Vaziani") +atisVaziani:SetTowerFrequencies({269, 140}) +atisVaziani:Start() + +local airbases=AIRBASE.GetAllAirbases() +for _,_airbase in pairs(airbases) do + local airbase=_airbase --Wrapper.Airbase#AIRBASE + airbase:GetRunwayData(nil, true) +end diff --git a/OPS - ATIS/ATIS - 100 - Caucasus Batumi/ATIS - 100 - Caucasus Batumi.miz b/OPS - ATIS/ATIS - 100 - Caucasus Batumi/ATIS - 100 - Caucasus Batumi.miz index 90b4a9ae13..63d8165492 100644 Binary files a/OPS - ATIS/ATIS - 100 - Caucasus Batumi/ATIS - 100 - Caucasus Batumi.miz and b/OPS - ATIS/ATIS - 100 - Caucasus Batumi/ATIS - 100 - Caucasus Batumi.miz differ diff --git a/OPS - ATIS/ATIS - 200 - Nevada Nellis/ATIS - 200 - Nevada Nellis.lua b/OPS - ATIS/ATIS - 200 - Nevada Nellis/ATIS - 200 - Nevada Nellis.lua index 9f054116a9..c100a29be2 100644 --- a/OPS - ATIS/ATIS - 200 - Nevada Nellis/ATIS - 200 - Nevada Nellis.lua +++ b/OPS - ATIS/ATIS - 200 - Nevada Nellis/ATIS - 200 - Nevada Nellis.lua @@ -1,30 +1,37 @@ --- ATIS Nellis AFB on 270.10 MHz AM. -atisNellis=ATIS:New(AIRBASE.Nevada.Nellis_AFB, 270.1) -atisNellis:SetRadioRelayUnitName("Radio Relay Nellis") -atisNellis:SetActiveRunway("21L") -atisNellis:SetTowerFrequencies({327.000, 132.550}) -atisNellis:SetTACAN(12) -atisNellis:AddILS(109.1, "21") -atisNellis:Start() - --- ATIS Creech AFB on 290.45 MHz -atisCreech=ATIS:New(AIRBASE.Nevada.Creech_AFB, 290.45) -atisCreech:SetRadioRelayUnitName("Radio Relay Creech") -atisCreech:SetTowerFrequencies({360.6, 118.3}) -atisCreech:AddILS(108.7, "08") -atisCreech:SetTACAN(87) -atisCreech:Start() - --- ATIS McCarran International on 132.4 MHz -atisMcCarran=ATIS:New(AIRBASE.Nevada.McCarran_International_Airport, 132.4) -atisMcCarran:SetRadioRelayUnitName("Radio Relay McCarran") -atisMcCarran:SetTowerFrequencies({257.8, 119.9}) -atisMcCarran:SetRunwayHeadingsMagnetic({"25L", "25R"}) -atisMcCarran:SetActiveRunway("R") -atisMcCarran:AddILS(110.3, "25R") -atisMcCarran:AddILS(111.75, "25L") -atisMcCarran:SetVOR(116.9) -atisMcCarran:SetTACAN(116) -atisMcCarran:SetElevation() -atisMcCarran:SetRunwayLength() -atisMcCarran:Start() + + +-- ATIS Nellis AFB on 270.10 MHz AM. +atisNellis=ATIS:New(AIRBASE.Nevada.Nellis_AFB, 270.1) +atisNellis:SetRadioRelayUnitName("Radio Relay Nellis") +atisNellis:SetActiveRunway("21L") +atisNellis:SetTowerFrequencies({327.000, 132.550}) +atisNellis:SetTACAN(12) +atisNellis:AddILS(109.1, "21") +atisNellis:Start() + +-- For debugging: Mark runway info on F10 map. +--atisNellis:MarkRunways(true) + + +-- ATIS Creech AFB on 290.45 MHz AM +atisCreech=ATIS:New(AIRBASE.Nevada.Creech_AFB, 290.45) +atisCreech:SetRadioRelayUnitName("Radio Relay Creech") +atisCreech:SetTowerFrequencies({360.6, 118.3}) +atisCreech:AddILS(108.7, "08") +atisCreech:SetTACAN(87) +atisCreech:Start() + + +-- ATIS Creech AFB on 290.45 MHz AM. +atisMcCarran=ATIS:New(AIRBASE.Nevada.McCarran_International_Airport, 132.4) +atisMcCarran:SetRadioRelayUnitName("Radio Relay McCarran") +atisMcCarran:SetTowerFrequencies({257.8, 119.9}) +atisMcCarran:SetRunwayHeadingsMagnetic({"25L", "25R"}) +atisMcCarran:SetActiveRunway("R") +atisMcCarran:AddILS(110.3, "25R") +atisMcCarran:AddILS(111.75, "25L") +atisMcCarran:SetVOR(116.9) +atisMcCarran:SetTACAN(116) +atisMcCarran:SetElevation() +atisMcCarran:SetRunwayLength() +atisMcCarran:Start() diff --git a/OPS - ATIS/ATIS - 200 - Nevada Nellis/ATIS - 200 - Nevada Nellis.miz b/OPS - ATIS/ATIS - 200 - Nevada Nellis/ATIS - 200 - Nevada Nellis.miz index 8cb5a06ed6..4b3edcc22b 100644 Binary files a/OPS - ATIS/ATIS - 200 - Nevada Nellis/ATIS - 200 - Nevada Nellis.miz and b/OPS - ATIS/ATIS - 200 - Nevada Nellis/ATIS - 200 - Nevada Nellis.miz differ diff --git a/OPS - ATIS/ATIS - 300 - Persian Gulf Dubai/ATIS - 300 - Persian Gulf Dubai.lua b/OPS - ATIS/ATIS - 300 - Persian Gulf Dubai/ATIS - 300 - Persian Gulf Dubai.lua index 89824a2690..be713b1907 100644 --- a/OPS - ATIS/ATIS - 300 - Persian Gulf Dubai/ATIS - 300 - Persian Gulf Dubai.lua +++ b/OPS - ATIS/ATIS - 300 - Persian Gulf Dubai/ATIS - 300 - Persian Gulf Dubai.lua @@ -1,26 +1,26 @@ - -atisDubai=ATIS:New(AIRBASE.PersianGulf.Dubai_Intl, 131.7) -atisDubai:SetRadioRelayUnitName("Radio Relay Dubai Intl") -atisDubai:SetMetricUnits() -atisDubai:SetActiveRunway("R") -atisDubai:SetTowerFrequencies({251.05, 118.75}) -atisDubai:AddILS(110.9, "30") -atisDubai:AddILS(110.1, "12") -atisDubai:Start() - -atisAbuDhabi=ATIS:New(AIRBASE.PersianGulf.Abu_Dhabi_International_Airport, 125.1) -atisAbuDhabi:SetRadioRelayUnitName("Radio Relay Abu Dhabi International Airport") -atisAbuDhabi:SetMetricUnits() -atisAbuDhabi:SetActiveRunway("L") -atisAbuDhabi:SetTowerFrequencies({250.5, 119.2}) -atisAbuDhabi:SetVOR(114.25) -atisAbuDhabi:Start() - --- For debug only! Mark Runway info on F10 map. ---atisAbuDhabi:MarkRunways(true) - --- Jiroft Airport. No radio relay unit ==> No subtitles. -atisJiroft=ATIS:New(AIRBASE.PersianGulf.Jiroft_Airport, 130) -atisJiroft:SetMetricUnits() -atisJiroft:SetTowerFrequencies({250.75, 136}) + +atisDubai=ATIS:New(AIRBASE.PersianGulf.Dubai_Intl, 131.7) +atisDubai:SetRadioRelayUnitName("Radio Relay Dubai Intl") +atisDubai:SetMetricUnits() +atisDubai:SetActiveRunway("R") +atisDubai:SetTowerFrequencies({251.05, 118.75}) +atisDubai:AddILS(110.9, "30") +atisDubai:AddILS(110.1, "12") +atisDubai:Start() + +atisAbuDhabi=ATIS:New(AIRBASE.PersianGulf.Abu_Dhabi_International_Airport, 125.1) +atisAbuDhabi:SetRadioRelayUnitName("Radio Relay Abu Dhabi International Airport") +atisAbuDhabi:SetMetricUnits() +atisAbuDhabi:SetActiveRunway("L") +atisAbuDhabi:SetTowerFrequencies({250.5, 119.2}) +atisAbuDhabi:SetVOR(114.25) +atisAbuDhabi:Start() + +-- For debug only! Mark Runway info on F10 map. +--atisAbuDhabi:MarkRunways(true) + +-- Jiroft Airport. No radio relay unit ==> No subtitles. +atisJiroft=ATIS:New(AIRBASE.PersianGulf.Jiroft_Airport, 130) +atisJiroft:SetMetricUnits() +atisJiroft:SetTowerFrequencies({250.75, 136}) atisJiroft:Start() \ No newline at end of file diff --git a/OPS - ATIS/ATIS - 300 - Persian Gulf Dubai/ATIS - 300 - Persian Gulf Dubai.miz b/OPS - ATIS/ATIS - 300 - Persian Gulf Dubai/ATIS - 300 - Persian Gulf Dubai.miz index d2fd5b1aa9..bf03c2e8e3 100644 Binary files a/OPS - ATIS/ATIS - 300 - Persian Gulf Dubai/ATIS - 300 - Persian Gulf Dubai.miz and b/OPS - ATIS/ATIS - 300 - Persian Gulf Dubai/ATIS - 300 - Persian Gulf Dubai.miz differ diff --git a/OPS - ATIS/ATIS - 500 - Syria/ATIS - 500 - Syria.lua b/OPS - ATIS/ATIS - 500 - Syria/ATIS - 500 - Syria.lua index 54b1a58964..021ab7155c 100644 --- a/OPS - ATIS/ATIS - 500 - Syria/ATIS - 500 - Syria.lua +++ b/OPS - ATIS/ATIS - 500 - Syria/ATIS - 500 - Syria.lua @@ -1,37 +1,44 @@ --- Beirut Rafic Hariri Airport -atisBeirut=ATIS:New(AIRBASE.Syria.Beirut_Rafic_Hariri, 130.0) -atisBeirut:SetRadioRelayUnitName("Radio Relay "..AIRBASE.Syria.Beirut_Rafic_Hariri) -atisBeirut:SetTowerFrequencies({251.450, 118.900, 39.850, 4.475}) -atisBeirut:SetVOR(112.60) -atisBeirut:AddILS(109.5, "17") -atisBeirut:SetMapMarks() -atisBeirut:Start() - --- Damascus Airport -atisDamascus=ATIS:New(AIRBASE.Syria.Damascus, 131.0) -atisDamascus:SetRadioRelayUnitName("Radio Relay "..AIRBASE.Syria.Damascus) -atisDamascus:SetTowerFrequencies({251.500, 118.500, 39.900, 4.500}) -atisDamascus:SetActiveRunway("R") -atisDamascus:SetVOR(116.00) -atisDamascus:AddILS(109.9, "23") -atisDamascus:SetMapMarks() -atisDamascus:Start() - --- Ramat David Airport -atisRamatDavid=ATIS:New(AIRBASE.Syria.Ramat_David, 132.0) -atisRamatDavid:SetRadioRelayUnitName("Radio Relay "..AIRBASE.Syria.Ramat_David) -atisRamatDavid:SetTowerFrequencies({251.000, 118.600, 39.400, 4.250}) -atisRamatDavid:ReportQNHOnly() -- More realitic as only QNH not QFE is reported. -atisRamatDavid:ReportZuluTimeOnly() -- More realistic as -atisRamatDavid:SetMapMarks() -atisRamatDavid:Start() - --- Incirlik -atisIncirlik=ATIS:New(AIRBASE.Syria.Incirlik, 250.40) -atisIncirlik:SetRadioRelayUnitName("Radio Relay "..AIRBASE.Syria.Incirlik) -atisIncirlik:SetImperialUnits() -atisIncirlik:SetTACAN(21) -atisIncirlik:SetTowerFrequencies({250.350}) -atisIncirlik:AddILS(109.30, "5") -atisIncirlik:AddILS(111.70, "23") + +--[[ + +-- Beirut Rafic Hariri Airport +atisBeirut=ATIS:New(AIRBASE.Syria.Beirut_Rafic_Hariri, 130.0) +atisBeirut:SetRadioRelayUnitName("Radio Relay "..AIRBASE.Syria.Beirut_Rafic_Hariri) +atisBeirut:SetTowerFrequencies({251.450, 118.900, 39.850, 4.475}) +atisBeirut:SetVOR(112.60) +atisBeirut:AddILS(109.5, "17") +atisBeirut:SetMapMarks() +atisBeirut:Start() + +-- Damascus Airport +atisDamascus=ATIS:New(AIRBASE.Syria.Damascus, 131.0) +atisDamascus:SetRadioRelayUnitName("Radio Relay "..AIRBASE.Syria.Damascus) +atisDamascus:SetTowerFrequencies({251.500, 118.500, 39.900, 4.500}) +atisDamascus:SetActiveRunway("R") +atisDamascus:SetVOR(116.00) +atisDamascus:AddILS(109.9, "23") +atisDamascus:SetMapMarks() +atisDamascus:Start() + +-- Ramat David Airport +atisRamatDavid=ATIS:New(AIRBASE.Syria.Ramat_David, 132.0) +atisRamatDavid:SetRadioRelayUnitName("Radio Relay "..AIRBASE.Syria.Ramat_David) +atisRamatDavid:SetTowerFrequencies({251.000, 118.600, 39.400, 4.250}) +atisRamatDavid:ReportQNHOnly() -- More realitic as only QNH not QFE is reported. +atisRamatDavid:ReportZuluTimeOnly() -- More realistic as +atisRamatDavid:SetMapMarks() +atisRamatDavid:Start() + +]] + +PROFILER.Start() + +-- Incirlik +atisIncirlik=ATIS:New(AIRBASE.Syria.Incirlik, 250.40) +atisIncirlik:SetRadioRelayUnitName("Radio Relay "..AIRBASE.Syria.Incirlik) +atisIncirlik:SetImperialUnits() +atisIncirlik:SetTACAN(21) +atisIncirlik:SetTowerFrequencies({250.350}) +atisIncirlik:AddILS(109.30, "5") +atisIncirlik:AddILS(111.70, "23") atisIncirlik:Start() \ No newline at end of file diff --git a/OPS - ATIS/ATIS - 500 - Syria/ATIS - 500 - Syria.miz b/OPS - ATIS/ATIS - 500 - Syria/ATIS - 500 - Syria.miz index ce00fbcb26..cbe77ba6bb 100644 Binary files a/OPS - ATIS/ATIS - 500 - Syria/ATIS - 500 - Syria.miz and b/OPS - ATIS/ATIS - 500 - Syria/ATIS - 500 - Syria.miz differ diff --git a/OPS - ATIS/ATIS - 510 - Syria SRS/ATIS - 510 - Syria SRS.lua b/OPS - ATIS/ATIS - 510 - Syria SRS/ATIS - 510 - Syria SRS.lua index a0a5ed358c..1ca1a2f4c3 100644 --- a/OPS - ATIS/ATIS - 510 - Syria SRS/ATIS - 510 - Syria SRS.lua +++ b/OPS - ATIS/ATIS - 510 - Syria SRS/ATIS - 510 - Syria SRS.lua @@ -1,29 +1,29 @@ ---- --- SRS: --- SRS version 1.9.6.0+ required. See https://github.com/ciribob/DCS-SimpleRadioStandalone --- SRS is installed in the D:\DCS\_SRS directory. NOTE that backslashes need to be escaped and you have to adjust the directory for you personal install path. ---- - - --- Damascus Airport: Use male voice with en-US culture (accent) -atisDamascus=ATIS:New(AIRBASE.Syria.Damascus, 250.00) -atisDamascus:SetSRS("D:\\DCS\\_SRS", "male", "en-US") -atisDamascus:SetTowerFrequencies({251.500, 118.500, 39.900, 4.500}) -atisDamascus:SetActiveRunway("R") -atisDamascus:SetVOR(116.00) -atisDamascus:AddILS(109.9, "23") -atisDamascus:SetMapMarks() -atisDamascus:Start() - - --- Incirlik: Use specific voice named "Microsoft Hedda Desktop", which is a female German adult. Hope you don't mind the accent too much ;) -atisIncirlik=ATIS:New(AIRBASE.Syria.Incirlik, 251.50) -atisIncirlik:SetSRS("D:\\DCS\\_SRS", nil, nil, "Microsoft Hedda Desktop") -atisIncirlik:SetImperialUnits() -atisIncirlik:SetTACAN(21) -atisIncirlik:SetTowerFrequencies({250.350}) -atisIncirlik:AddILS(109.30, "5") -atisIncirlik:AddILS(111.70, "23") -atisIncirlik:Start() - - +--- +-- SRS: +-- SRS version 1.9.6.0+ required. See https://github.com/ciribob/DCS-SimpleRadioStandalone +-- SRS is installed in the D:\DCS\_SRS directory. NOTE that backslashes need to be escaped and you have to adjust the directory for you personal install path. +--- + + +-- Damascus Airport: Use male voice with en-US culture (accent) +atisDamascus=ATIS:New(AIRBASE.Syria.Damascus, 250.00) +atisDamascus:SetSRS("D:\\DCS\\_SRS", "male", "en-US") +atisDamascus:SetTowerFrequencies({251.500, 118.500, 39.900, 4.500}) +atisDamascus:SetActiveRunway("R") +atisDamascus:SetVOR(116.00) +atisDamascus:AddILS(109.9, "23") +atisDamascus:SetMapMarks() +atisDamascus:Start() + + +-- Incirlik: Use specific voice named "Microsoft Hedda Desktop", which is a female German adult. Hope you don't mind the accent too much ;) +atisIncirlik=ATIS:New(AIRBASE.Syria.Incirlik, 251.50) +atisIncirlik:SetSRS("D:\\DCS\\_SRS", nil, nil, "Microsoft Hedda Desktop") +atisIncirlik:SetImperialUnits() +atisIncirlik:SetTACAN(21) +atisIncirlik:SetTowerFrequencies({250.350}) +atisIncirlik:AddILS(109.30, "5") +atisIncirlik:AddILS(111.70, "23") +atisIncirlik:Start() + + diff --git a/OPS - ATIS/ATIS - 510 - Syria SRS/ATIS - 510 - Syria SRS.miz b/OPS - ATIS/ATIS - 510 - Syria SRS/ATIS - 510 - Syria SRS.miz index 57975ba9ff..57a4a39621 100644 Binary files a/OPS - ATIS/ATIS - 510 - Syria SRS/ATIS - 510 - Syria SRS.miz and b/OPS - ATIS/ATIS - 510 - Syria SRS/ATIS - 510 - Syria SRS.miz differ diff --git a/OPS - Airboss/Caucasus/BOS-100 - Stennis Hornet and Tomcat/BOS-100 - Stennis Hornet and Tomcat.lua b/OPS - Airboss/Caucasus/BOS-100 - Stennis Hornet and Tomcat/BOS-100 - Stennis Hornet and Tomcat.lua index ccca4459ae..53b14f2795 100644 --- a/OPS - Airboss/Caucasus/BOS-100 - Stennis Hornet and Tomcat/BOS-100 - Stennis Hornet and Tomcat.lua +++ b/OPS - Airboss/Caucasus/BOS-100 - Stennis Hornet and Tomcat/BOS-100 - Stennis Hornet and Tomcat.lua @@ -1,149 +1,150 @@ ----------------------------------------------------------------------------------------- ---- --- Name: BOS-100 - Stennis Hornet and Tomcat --- Author: funkyfranky --- Date Created: 17 August 2019 --- --- # Situation: --- --- Practice Case I/II/III recovery using the F/A-18C Hornet or F-14B Tomcat. --- --- See mission briefing for further details. --- --- *** IMPORTANT *** --- If you run the mission in single player, hit ESC twice before entering a slot! --- Otherwise the script will not load due to a long standing DCS bug. --- ----------------------------------------------------------------------------------------- - --- No MOOSE settings menu. Comment out this line if required. -_SETTINGS:SetPlayerMenuOff() - --- S-3B Recovery Tanker spawning in air. -local tanker=RECOVERYTANKER:New("USS Stennis", "Texaco Group") -tanker:SetTakeoffAir() -tanker:SetRadio(250) -tanker:SetModex(511) -tanker:SetTACAN(1, "TKR") -tanker:__Start(1) - --- E-2D AWACS spawning on Stennis. -local awacs=RECOVERYTANKER:New("USS Stennis", "E-2D Wizard Group") -awacs:SetAWACS() -awacs:SetRadio(260) -awacs:SetAltitude(20000) -awacs:SetCallsign(CALLSIGN.AWACS.Wizard) -awacs:SetRacetrackDistances(30, 15) -awacs:SetModex(611) -awacs:SetTACAN(2, "WIZ") -awacs:__Start(1) - --- Rescue Helo with home base Lake Erie. Has to be a global object! -rescuehelo=RESCUEHELO:New("USS Stennis", "Rescue Helo") -rescuehelo:SetHomeBase(AIRBASE:FindByName("Lake Erie")) -rescuehelo:SetModex(42) -rescuehelo:__Start(1) - --- Create AIRBOSS object. -local AirbossStennis=AIRBOSS:New("USS Stennis") - --- Add recovery windows: --- Case I from 9 to 10 am. -local window1=AirbossStennis:AddRecoveryWindow( "9:00", "10:00", 1, nil, true, 25) --- Case II with +15 degrees holding offset from 15:00 for 60 min. -local window2=AirbossStennis:AddRecoveryWindow("15:00", "16:00", 2, 15, true, 23) --- Case III with +30 degrees holding offset from 2100 to 2200. -local window3=AirbossStennis:AddRecoveryWindow("21:00", "22:00", 3, 30, true, 21) - --- Set folder of airboss sound files within miz file. -AirbossStennis:SetSoundfilesFolder("Airboss Soundfiles/") - --- Single carrier menu optimization. -AirbossStennis:SetMenuSingleCarrier() - --- Skipper menu. -AirbossStennis:SetMenuRecovery(30, 20, false) - --- Remove landed AI planes from flight deck. -AirbossStennis:SetDespawnOnEngineShutdown() - --- Load all saved player grades from your "Saved Games\DCS" folder (if lfs was desanitized). -AirbossStennis:Load() - --- Automatically save player results to your "Saved Games\DCS" folder each time a player get a final grade from the LSO. -AirbossStennis:SetAutoSave() - --- Enable trap sheet. -AirbossStennis:SetTrapSheet() - --- Start airboss class. -AirbossStennis:Start() - - ---- Function called when recovery tanker is started. -function tanker:OnAfterStart(From,Event,To) - - -- Set recovery tanker. - AirbossStennis:SetRecoveryTanker(tanker) - - -- Use tanker as radio relay unit for LSO transmissions. - AirbossStennis:SetRadioRelayLSO(self:GetUnitName()) - -end - ---- Function called when AWACS is started. -function awacs:OnAfterStart(From,Event,To) - -- Set AWACS. - AirbossStennis:SetAWACS(awacs) -end - - ---- Function called when rescue helo is started. -function rescuehelo:OnAfterStart(From,Event,To) - -- Use rescue helo as radio relay for Marshal. - AirbossStennis:SetRadioRelayMarshal(self:GetUnitName()) -end - ---- Function called when a player gets graded by the LSO. -function AirbossStennis:OnAfterLSOGrade(From, Event, To, playerData, grade) - local PlayerData=playerData --Ops.Airboss#AIRBOSS.PlayerData - local Grade=grade --Ops.Airboss#AIRBOSS.LSOgrade - - ---------------------------------------- - --- Interface your Discord bot here! --- - ---------------------------------------- - - local score=tonumber(Grade.points) - local name=tostring(PlayerData.name) - - -- Report LSO grade to dcs.log file. - env.info(string.format("Player %s scored %.1f", name, score)) -end - - ---------------------------- ---- Generate AI Traffic --- ---------------------------- - --- Spawn some AI flights as additional traffic. -local F181=SPAWN:New("FA-18C Group 1"):InitModex(111) -- Coming in from NW after ~ 6 min -local F182=SPAWN:New("FA-18C Group 2"):InitModex(112) -- Coming in from NW after ~20 min -local F183=SPAWN:New("FA-18C Group 3"):InitModex(113) -- Coming in from W after ~18 min -local F14=SPAWN:New("F-14B 2ship"):InitModex(211) -- Coming in from SW after ~ 4 min -local E2D=SPAWN:New("E-2D Group"):InitModex(311) -- Coming in from NE after ~10 min -local S3B=SPAWN:New("S-3B Group"):InitModex(411) -- Coming in from S after ~16 min - --- Spawn always 9 min before the recovery window opens. -local spawntimes={"8:51", "14:51", "20:51"} -for _,spawntime in pairs(spawntimes) do - local _time=UTILS.ClockToSeconds(spawntime)-timer.getAbsTime() - if _time>0 then - SCHEDULER:New(nil, F181.Spawn, {F181}, _time) - SCHEDULER:New(nil, F182.Spawn, {F182}, _time) - SCHEDULER:New(nil, F183.Spawn, {F183}, _time) - SCHEDULER:New(nil, F14.Spawn, {F14}, _time) - SCHEDULER:New(nil, E2D.Spawn, {E2D}, _time) - SCHEDULER:New(nil, S3B.Spawn, {S3B}, _time) - end -end - +---------------------------------------------------------------------------------------- +--- +-- Name: BOS-100 - Stennis Hornet and Tomcat +-- Author: funkyfranky +-- Date Created: 17 August 2019 +-- +-- # Situation: +-- +-- Practice Case I/II/III recovery using the F/A-18C Hornet or F-14B Tomcat. +-- +-- See mission briefing for further details. +-- +-- *** IMPORTANT *** +-- If you run the mission in single player, hit ESC twice before entering a slot! +-- Otherwise the script will not load due to a long standing DCS bug. +-- +---------------------------------------------------------------------------------------- + +-- No MOOSE settings menu. Comment out this line if required. +_SETTINGS:SetPlayerMenuOff() + +-- S-3B Recovery Tanker spawning in air. +local tanker=RECOVERYTANKER:New("USS Stennis", "Texaco Group") +tanker:SetTakeoffAir() +tanker:SetRadio(250) +tanker:SetModex(511) +tanker:SetTACAN(1, "TKR") +tanker:__Start(1) + +-- E-2D AWACS spawning on Stennis. +local awacs=RECOVERYTANKER:New("USS Stennis", "E-2D Wizard Group") +awacs:SetAWACS() +awacs:SetRadio(260) +awacs:SetAltitude(20000) +awacs:SetCallsign(CALLSIGN.AWACS.Wizard) +awacs:SetRacetrackDistances(30, 15) +awacs:SetModex(611) +awacs:SetTACAN(2, "WIZ") +awacs:__Start(1) + +-- Rescue Helo with home base Lake Erie. Has to be a global object! +rescuehelo=RESCUEHELO:New("USS Stennis", "Rescue Helo") +rescuehelo:SetHomeBase(AIRBASE:FindByName("Lake Erie")) +rescuehelo:SetModex(42) +rescuehelo:__Start(1) + +-- Create AIRBOSS object. +local AirbossStennis=AIRBOSS:New("USS Stennis") + +-- Add recovery windows: +-- Case I from 9 to 10 am. +local window1=AirbossStennis:AddRecoveryWindow( "9:00", "10:00", 1, nil, true, 25) +-- Case II with +15 degrees holding offset from 15:00 for 60 min. +local window2=AirbossStennis:AddRecoveryWindow("15:00", "16:00", 2, 15, true, 23) +-- Case III with +30 degrees holding offset from 2100 to 2200. +local window3=AirbossStennis:AddRecoveryWindow("21:00", "22:00", 3, 30, true, 21) + +-- Set folder of airboss sound files within miz file. +AirbossStennis:SetSoundfilesFolder("Airboss Soundfiles/") + +-- Single carrier menu optimization. +AirbossStennis:SetMenuSingleCarrier() + +-- Skipper menu. +AirbossStennis:SetMenuRecovery(30, 20, false) + +-- Remove landed AI planes from flight deck. +AirbossStennis:SetDespawnOnEngineShutdown() + +-- Load all saved player grades from your "Saved Games\DCS" folder (if lfs was desanitized). +AirbossStennis:Load() + +-- Automatically save player results to your "Saved Games\DCS" folder each time a player get a final grade from the LSO. +AirbossStennis:SetAutoSave() + +-- Enable trap sheet. +AirbossStennis:SetTrapSheet() + +-- Start airboss class. +AirbossStennis:Start() + + +--- Function called when recovery tanker is started. +function tanker:OnAfterStart(From,Event,To) + + -- Set recovery tanker. + AirbossStennis:SetRecoveryTanker(tanker) + + + -- Use tanker as radio relay unit for LSO transmissions. + AirbossStennis:SetRadioRelayLSO(self:GetUnitName()) + +end + +--- Function called when AWACS is started. +function awacs:OnAfterStart(From,Event,To) + -- Set AWACS. + AirbossStennis:SetRecoveryTanker(tanker) +end + + +--- Function called when rescue helo is started. +function rescuehelo:OnAfterStart(From,Event,To) + -- Use rescue helo as radio relay for Marshal. + AirbossStennis:SetRadioRelayMarshal(self:GetUnitName()) +end + +--- Function called when a player gets graded by the LSO. +function AirbossStennis:OnAfterLSOGrade(From, Event, To, playerData, grade) + local PlayerData=playerData --Ops.Airboss#AIRBOSS.PlayerData + local Grade=grade --Ops.Airboss#AIRBOSS.LSOgrade + + ---------------------------------------- + --- Interface your Discord bot here! --- + ---------------------------------------- + + local score=tonumber(Grade.points) + local name=tostring(PlayerData.name) + + -- Report LSO grade to dcs.log file. + env.info(string.format("Player %s scored %.1f", name, score)) +end + + +--------------------------- +--- Generate AI Traffic --- +--------------------------- + +-- Spawn some AI flights as additional traffic. +local F181=SPAWN:New("FA-18C Group 1"):InitModex(111) -- Coming in from NW after ~ 6 min +local F182=SPAWN:New("FA-18C Group 2"):InitModex(112) -- Coming in from NW after ~20 min +local F183=SPAWN:New("FA-18C Group 3"):InitModex(113) -- Coming in from W after ~18 min +local F14=SPAWN:New("F-14B 2ship"):InitModex(211) -- Coming in from SW after ~ 4 min +local E2D=SPAWN:New("E-2D Group"):InitModex(311) -- Coming in from NE after ~10 min +local S3B=SPAWN:New("S-3B Group"):InitModex(411) -- Coming in from S after ~16 min + +-- Spawn always 9 min before the recovery window opens. +local spawntimes={"8:51", "14:51", "20:51"} +for _,spawntime in pairs(spawntimes) do + local _time=UTILS.ClockToSeconds(spawntime)-timer.getAbsTime() + if _time>0 then + SCHEDULER:New(nil, F181.Spawn, {F181}, _time) + SCHEDULER:New(nil, F182.Spawn, {F182}, _time) + SCHEDULER:New(nil, F183.Spawn, {F183}, _time) + SCHEDULER:New(nil, F14.Spawn, {F14}, _time) + SCHEDULER:New(nil, E2D.Spawn, {E2D}, _time) + SCHEDULER:New(nil, S3B.Spawn, {S3B}, _time) + end +end + diff --git a/OPS - Airboss/Caucasus/BOS-100 - Stennis Hornet and Tomcat/BOS-100 - Stennis Hornet and Tomcat.miz b/OPS - Airboss/Caucasus/BOS-100 - Stennis Hornet and Tomcat/BOS-100 - Stennis Hornet and Tomcat.miz index 901ff7008e..c440e7addf 100644 Binary files a/OPS - Airboss/Caucasus/BOS-100 - Stennis Hornet and Tomcat/BOS-100 - Stennis Hornet and Tomcat.miz and b/OPS - Airboss/Caucasus/BOS-100 - Stennis Hornet and Tomcat/BOS-100 - Stennis Hornet and Tomcat.miz differ diff --git a/OPS - Airboss/Caucasus/BOS-110 - Airboss launch tanker from ramp/BOS-110 - Airboss launch tanker from ramp.miz b/OPS - Airboss/Caucasus/BOS-110 - Airboss launch tanker from ramp/BOS-110 - Airboss launch tanker from ramp.miz index a71472f2bf..fcbf630e8f 100644 Binary files a/OPS - Airboss/Caucasus/BOS-110 - Airboss launch tanker from ramp/BOS-110 - Airboss launch tanker from ramp.miz and b/OPS - Airboss/Caucasus/BOS-110 - Airboss launch tanker from ramp/BOS-110 - Airboss launch tanker from ramp.miz differ diff --git a/OPS - Airboss/Caucasus/BOS-110 - Airboss launch tanker from ramp/RecoveryTanker - 030 - Uncontrolled_AI.lua b/OPS - Airboss/Caucasus/BOS-110 - Airboss launch tanker from ramp/RecoveryTanker - 030 - Uncontrolled_AI.lua new file mode 100644 index 0000000000..145a50171d --- /dev/null +++ b/OPS - Airboss/Caucasus/BOS-110 - Airboss launch tanker from ramp/RecoveryTanker - 030 - Uncontrolled_AI.lua @@ -0,0 +1,52 @@ +--- +-- RECOVERYTANKER: Uncontrolled_AI +-- +-- Created by Azza276. +-- +-- DateTime: 29/12/2020 20:47 +-- +-- Simple Recovery tanker script demonstrating the use of the RECOVERYTANKER.uncontrolledac method. +-- or RECOVERYTANKER:SetUseUncontrolledAircraft(). Both are shown below. +-- You will require an AI skill S-3B tanker group placed in the mission editor, +-- Set to "Takeoff from Ramp" and ensure "Uncontrolled" is ticked. +-- Ensure "Late activation" is not ticked. +-- +-- 2 S-3B Tankers will be spawned on the USS Stennis as a visible objects (not late activation) but without crew. +-- After 30 seconds, the first S-3B will start up go on station overhead at angels 6 with 274 knots TAS (~250 KIAS). +-- After 1 minute, the second S-3B will start up and go on station overhead at angels 12 with 300 knots TAS (~250 KIAS) +-- Radio frequencies, callsign are set below and overrule the settings of the AI group. +--- + +-- S-3B at USS Stennis spawning on deck, Start with Delay in Moose. +local tankerStennis=RECOVERYTANKER:New("USS Stennis", "Texaco Group") + +-- Custom settings for radio frequency, TACAN and callsign. +tankerStennis:SetRadio(261) +tankerStennis:SetTACAN(37, "SHL") +tankerStennis:SetCallsign(CALLSIGN.Tanker.Shell, 3) + +--tankerStennis:SetTakeoffCold() --This is not required as they will always start cold from uncontrolled state. + +--RECOVERYTANKER.uncontrolledac if true, use an uncontrolled tanker group already present in the mission. +tankerStennis.uncontrolledac = true + +-- Start recovery tanker. +-- NOTE: Delay to show Aircraft visible on deck then starts later (30 seconds after mission start). +tankerStennis:__Start(30) + + + +-- S-3B at USS Stennis spawning on deck, Start with Delay in Mission Editor Trigger. +tankerStennis2=RECOVERYTANKER:New( "USS Stennis", "Texaco Group-1") +tankerStennis2:SetRadio(271) +tankerStennis2:SetTACAN(38, "SHE") +tankerStennis2:SetCallsign(3, 2) --First parameter is Callsign name (1=Texaco, 2=Arco, 3=Shell) +tankerStennis2:SetAltitude(12000) --Sets Orbit Altitude +tankerStennis2:SetSpeed(300) --Sets speed to 300 knots TAS (~250 KIAS at 12000ft) + +--RECOVERYTANKER:SetUseUncontrolledAircraft() to use an uncontrolled tanker group already present in the mission. +tankerStennis2:SetUseUncontrolledAircraft() + +-- tankerStennis2:Start() +-- The above without "--" is loaded to the Mission editor trigger "Do Script" action after 60 seconds condition. +-- NOTE: Delay to show Aircraft visible on deck then starts later (60 seconds after mission start).. diff --git a/OPS - Airboss/Caucasus/BOS-200 - Tarawa Harrier/BOS-200 - Tarawa Harrier.lua b/OPS - Airboss/Caucasus/BOS-200 - Tarawa Harrier/BOS-200 - Tarawa Harrier.lua index b8a12422d9..173cfd9440 100644 --- a/OPS - Airboss/Caucasus/BOS-200 - Tarawa Harrier/BOS-200 - Tarawa Harrier.lua +++ b/OPS - Airboss/Caucasus/BOS-200 - Tarawa Harrier/BOS-200 - Tarawa Harrier.lua @@ -1,124 +1,124 @@ ----------------------------------------------------------------------------------------- ---- --- Name: BOS-200 - Tarawa Harrier --- Author: funkyfranky --- Date Created: 18 August 2019 --- --- # Situation: --- --- Practice Case I/II/III recovery using the AV-8B Harrier on the USS Tarawa. --- --- See mission briefing for further details. --- --- *** IMPORTANT *** --- If you run the mission in single player, hit ESC twice before entering a slot! --- Otherwise the script will not load due to a long standing DCS bug. --- ----------------------------------------------------------------------------------------- - --- No MOOSE settings menu. Comment out this line if required. -_SETTINGS:SetPlayerMenuOff() - --- Rescue Helo with home base USS Viksburg. Has to be a global object! -rescuehelo=RESCUEHELO:New("USS Tarawa", "Rescue Helo") -rescuehelo:SetHomeBase(AIRBASE:FindByName("USS Viksburg")) -rescuehelo:SetModex(42) - --- Create AIRBOSS object. -local AirbossTarawa=AIRBOSS:New("USS Tarawa") - --- Add recovery windows: --- Case I from 9:00 to 10:00 am. -local window1=AirbossTarawa:AddRecoveryWindow( "9:00", "10:00", 1, nil, true, 25) --- Case II with +15 degrees holding offset from 15:00 for 60 min. -local window2=AirbossTarawa:AddRecoveryWindow("15:00", "16:00", 2, 15, true, 20) --- Case III with +30 degrees holding offset from 2100 to 2200. -local window3=AirbossTarawa:AddRecoveryWindow("21:00", "22:00", 3, 30, true, 20) - --- Set TACAN. -AirbossTarawa:SetTACAN(73, "X", "LHA") - --- Not sure if Tarawa has ICLS? ---AirbossTarawa:SetICLSoff() - --- Load all saved player grades from your "Saved Games\DCS" folder (if lfs was desanitized). -AirbossTarawa:Load() - --- Automatically save player results to your "Saved Games\DCS" folder each time a player get a final grade from the LSO. -AirbossTarawa:SetAutoSave() - --- Set radio relay units in order to properly send transmissions with subtitles only visible if correct frequency is tuned in. -AirbossTarawa:SetRadioRelayLSO("CH-53E Radio Relay") -AirbossTarawa:SetRadioRelayMarshal("SH-60B Radio Relay") - --- Radios. -AirbossTarawa:SetMarshalRadio(243) -AirbossTarawa:SetLSORadio(265) - ---Set folder of airboss sound files within miz file. -AirbossTarawa:SetSoundfilesFolder("Airboss Soundfiles/") - --- Remove landed AI planes from flight deck. -AirbossTarawa:SetDespawnOnEngineShutdown() - --- Single carrier menu optimization. -AirbossTarawa:SetMenuSingleCarrier() - --- Add Skipper menu to start recovery via F10 radio menu. -AirbossTarawa:SetMenuRecovery(30, 20, true) - --- Start Airboss. -AirbossTarawa:Start() - - ---- Function called when a recovery starts. -function AirbossTarawa:OnAfterRecoveryStart(From, Event, To, Case, Offset) - -- Start helo. - rescuehelo:Start() -end - ---- Function called when a recovery ends. -function AirbossTarawa:OnAfterRecoveryStop(From,Event,To) - -- Send helo RTB. - rescuehelo:RTB() -end - ---- Function called when the rescue helo has returned to base. -function rescuehelo:OnAfterReturned(From, Event, To, airbase) - -- Stop helo. - self:__Stop(3) -end - ---- Function called when a player gets graded by the LSO. -function AirbossTarawa:OnAfterLSOGrade(From, Event, To, playerData, grade) - local PlayerData=playerData --Ops.Airboss#AIRBOSS.PlayerData - local Grade=grade --Ops.Airboss#AIRBOSS.LSOgrade - - ---------------------------------------- - --- Interface your Discord bot here! --- - ---------------------------------------- - - local score=tonumber(Grade.points) - local name=tostring(PlayerData.name) - - -- Report LSO grade to dcs.log file. - env.info(self.lid..string.format("Player %s scored %.1f", name, score)) -end - - ---------------------------- ---- Generate AI Traffic --- ---------------------------- - -local AV8B1=SPAWN:New("Harrier Group 1"):InitModex(70) -local AV8B2=SPAWN:New("Harrier Group 2"):InitModex(80) - --- Spawn always 9 min before the recovery window opens. -local spawntimes={"9:06", "14:51", "20:51"} -for _,spawntime in pairs(spawntimes) do - local _time=UTILS.ClockToSeconds(spawntime)-timer.getAbsTime() - if _time>0 then - SCHEDULER:New(nil, AV8B1.Spawn, {AV8B1}, _time) - SCHEDULER:New(nil, AV8B2.Spawn, {AV8B2}, _time) - end -end +---------------------------------------------------------------------------------------- +--- +-- Name: BOS-200 - Tarawa Harrier +-- Author: funkyfranky +-- Date Created: 18 August 2019 +-- +-- # Situation: +-- +-- Practice Case I/II/III recovery using the AV-8B Harrier on the USS Tarawa. +-- +-- See mission briefing for further details. +-- +-- *** IMPORTANT *** +-- If you run the mission in single player, hit ESC twice before entering a slot! +-- Otherwise the script will not load due to a long standing DCS bug. +-- +---------------------------------------------------------------------------------------- + +-- No MOOSE settings menu. Comment out this line if required. +_SETTINGS:SetPlayerMenuOff() + +-- Rescue Helo with home base USS Viksburg. Has to be a global object! +rescuehelo=RESCUEHELO:New("USS Tarawa", "Rescue Helo") +rescuehelo:SetHomeBase(AIRBASE:FindByName("USS Viksburg")) +rescuehelo:SetModex(42) + +-- Create AIRBOSS object. +local AirbossTarawa=AIRBOSS:New("USS Tarawa") + +-- Add recovery windows: +-- Case I from 9:00 to 10:00 am. +local window1=AirbossTarawa:AddRecoveryWindow( "9:00", "10:00", 1, nil, true, 25) +-- Case II with +15 degrees holding offset from 15:00 for 60 min. +local window2=AirbossTarawa:AddRecoveryWindow("15:00", "16:00", 2, 15, true, 20) +-- Case III with +30 degrees holding offset from 2100 to 2200. +local window3=AirbossTarawa:AddRecoveryWindow("21:00", "22:00", 3, 30, true, 20) + +-- Set TACAN. +AirbossTarawa:SetTACAN(73, "X", "LHA") + +-- Not sure if Tarawa has ICLS? +--AirbossTarawa:SetICLSoff() + +-- Load all saved player grades from your "Saved Games\DCS" folder (if lfs was desanitized). +AirbossTarawa:Load() + +-- Automatically save player results to your "Saved Games\DCS" folder each time a player get a final grade from the LSO. +AirbossTarawa:SetAutoSave() + +-- Set radio relay units in order to properly send transmissions with subtitles only visible if correct frequency is tuned in. +AirbossTarawa:SetRadioRelayLSO("CH-53E Radio Relay") +AirbossTarawa:SetRadioRelayMarshal("SH-60B Radio Relay") + +-- Radios. +AirbossTarawa:SetMarshalRadio(243) +AirbossTarawa:SetLSORadio(265) + +--Set folder of airboss sound files within miz file. +AirbossTarawa:SetSoundfilesFolder("Airboss Soundfiles/") + +-- Remove landed AI planes from flight deck. +AirbossTarawa:SetDespawnOnEngineShutdown() + +-- Single carrier menu optimization. +AirbossTarawa:SetMenuSingleCarrier() + +-- Add Skipper menu to start recovery via F10 radio menu. +AirbossTarawa:SetMenuRecovery(30, 20, true) + +-- Start Airboss. +AirbossTarawa:Start() + + +--- Function called when a recovery starts. +function AirbossTarawa:OnAfterRecoveryStart(From, Event, To, Case, Offset) + -- Start helo. + rescuehelo:Start() +end + +--- Function called when a recovery ends. +function AirbossTarawa:OnAfterRecoveryStop(From,Event,To) + -- Send helo RTB. + rescuehelo:RTB() +end + +--- Function called when the rescue helo has returned to base. +function rescuehelo:OnAfterReturned(From, Event, To, airbase) + -- Stop helo. + self:__Stop(3) +end + +--- Function called when a player gets graded by the LSO. +function AirbossTarawa:OnAfterLSOGrade(From, Event, To, playerData, grade) + local PlayerData=playerData --Ops.Airboss#AIRBOSS.PlayerData + local Grade=grade --Ops.Airboss#AIRBOSS.LSOgrade + + ---------------------------------------- + --- Interface your Discord bot here! --- + ---------------------------------------- + + local score=tonumber(Grade.points) + local name=tostring(PlayerData.name) + + -- Report LSO grade to dcs.log file. + env.info(self.lid..string.format("Player %s scored %.1f", name, score)) +end + + +--------------------------- +--- Generate AI Traffic --- +--------------------------- + +local AV8B1=SPAWN:New("Harrier Group 1"):InitModex(70) +local AV8B2=SPAWN:New("Harrier Group 2"):InitModex(80) + +-- Spawn always 9 min before the recovery window opens. +local spawntimes={"9:06", "14:51", "20:51"} +for _,spawntime in pairs(spawntimes) do + local _time=UTILS.ClockToSeconds(spawntime)-timer.getAbsTime() + if _time>0 then + SCHEDULER:New(nil, AV8B1.Spawn, {AV8B1}, _time) + SCHEDULER:New(nil, AV8B2.Spawn, {AV8B2}, _time) + end +end diff --git a/OPS - Airboss/Caucasus/BOS-200 - Tarawa Harrier/BOS-200 - Tarawa Harrier.miz b/OPS - Airboss/Caucasus/BOS-200 - Tarawa Harrier/BOS-200 - Tarawa Harrier.miz index 3d0c2b8eda..3ff4914bea 100644 Binary files a/OPS - Airboss/Caucasus/BOS-200 - Tarawa Harrier/BOS-200 - Tarawa Harrier.miz and b/OPS - Airboss/Caucasus/BOS-200 - Tarawa Harrier/BOS-200 - Tarawa Harrier.miz differ diff --git a/OPS - Airboss/Normandy/BOS-200 - Fortress Cherbourg/BOS-200 - FA-18C Fortress Cherbourg.lua b/OPS - Airboss/Normandy/BOS-200 - Fortress Cherbourg/BOS-200 - FA-18C Fortress Cherbourg.lua new file mode 100644 index 0000000000..ac13e56cbe --- /dev/null +++ b/OPS - Airboss/Normandy/BOS-200 - Fortress Cherbourg/BOS-200 - FA-18C Fortress Cherbourg.lua @@ -0,0 +1,83 @@ +------------------------- +-- AIRBOSS Test Script -- +------------------------- + +-- Set mission menu. +AIRBOSS.MenuF10Root=MENU_MISSION:New("Airboss").MenuPath + +-- No MOOSE settings menu. +_SETTINGS:SetPlayerMenuOff() + +-- S-3B Recovery Tanker spawning in air. +local tanker=RECOVERYTANKER:New("CVN-74", "- Texaco Tanker") +tanker:SetTakeoffAir() +tanker:SetRadio(256) +tanker:SetModex(511) +tanker:SetTACAN(1, "TKR") +tanker:Start() + +-- E-2D AWACS spawning in air +local awacs=RECOVERYTANKER:New("CVN-74", "AWACS") +awacs:SetAWACS() +awacs:SetTakeoffAir() +awacs:SetRadio(264) +awacs:SetAltitude(20000) +awacs:SetCallsign(CALLSIGN.AWACS.Overloard) +awacs:SetRacetrackDistances(20, 8) +awacs:SetModex(611) +awacs:SetTACAN(2, "OLV") +awacs:Start() + +-- Rescue Helo spawned in air with home base USS Perry. Has to be a global object! +rescuehelo=RESCUEHELO:New("CVN-74", "CV Helo") +rescuehelo:SetHomeBase(AIRBASE:FindByName("CG-67")) +rescuehelo:SetTakeoffAir() +rescuehelo:SetModex(42) +rescuehelo:Start() + +-- Create AIRBOSS object. +local AirbossStennis=AIRBOSS:New("CVN-74") + +-- Add recovery windows: +local window1=AirbossStennis:AddRecoveryWindow("18:30", "21:00", 1, nil, true, 20) + +-- Radio freqs. +AirbossStennis:SetMarshalRadio(305) +AirbossStennis:SetLSORadio(265) + +-- Radio relay units. +AirbossStennis:SetRadioRelayLSO(rescuehelo:GetUnitName()) +AirbossStennis:SetRadioRelayMarshal(tanker:GetUnitName()) + +-- Set folder of airboss sound files within miz file. +AirbossStennis:SetSoundfilesFolder("Airboss Soundfiles/") + +-- Single carrier menu optimization. +AirbossStennis:SetMenuSingleCarrier() + +-- Enable skipper menu. +AirbossStennis:SetMenuRecovery(15, 30, true) + +-- AI groups explicitly excluded from handling by the Airboss +AirbossStennis:SetHandleAIOFF() + +-- Remove landed AI planes from flight deck. +AirbossStennis:SetDespawnOnEngineShutdown() + +-- Load all saved player grades from your "Saved Games\DCS" folder (if lfs was desanitized). +AirbossStennis:Load() + +-- Automatically save player results to your "Saved Games\DCS" folder each time a player get a final grade from the LSO. +AirbossStennis:SetAutoSave() + +-- Enable trap sheet. +AirbossStennis:SetTrapSheet() + +-- Set recovery tanker +AirbossStennis:SetRecoveryTanker(tanker) + +-- Set AWACS. +AirbossStennis:SetAWACS(awacs) + +-- Start airboss class. +AirbossStennis:Start() diff --git a/OPS - Airboss/Normandy/BOS-200 - Fortress Cherbourg/BOS-200 - Fortress Cherbourg.miz b/OPS - Airboss/Normandy/BOS-200 - Fortress Cherbourg/BOS-200 - Fortress Cherbourg.miz index b694d87fcf..2283f557dc 100644 Binary files a/OPS - Airboss/Normandy/BOS-200 - Fortress Cherbourg/BOS-200 - Fortress Cherbourg.miz and b/OPS - Airboss/Normandy/BOS-200 - Fortress Cherbourg/BOS-200 - Fortress Cherbourg.miz differ diff --git a/OPS - Recovery Tanker/RecoveryTanker - 010 - Simple/RecoveryTanker - 010 - Simple.lua b/OPS - Recovery Tanker/RecoveryTanker - 010 - Simple/RecoveryTanker - 010 - Simple.lua index 1c57bd1432..457e68695c 100644 --- a/OPS - Recovery Tanker/RecoveryTanker - 010 - Simple/RecoveryTanker - 010 - Simple.lua +++ b/OPS - Recovery Tanker/RecoveryTanker - 010 - Simple/RecoveryTanker - 010 - Simple.lua @@ -1,16 +1,16 @@ ---- --- RECOVERYTANKER: Simple --- --- Simple Recovery tanker script using default settings. --- --- Tanker will be spawned on the USS Stennis and go on station overhead at angels 6 with 274 knots TAS (~250 KIAS). --- --- Radio frequencies, callsign are taken from the settings of the late activated template group in the mission editor. ---- - --- S-3B at USS Stennis spawning on deck. First Parameter is the UNIT name of the Carrier, second the GROUP name of the tanker template. -local tankerStennis=RECOVERYTANKER:New("USS Stennis", "Texaco Group") - --- Start recovery tanker. --- NOTE: If you spawn on deck, it seems prudent to delay the spawn a bit after the mission starts. -tankerStennis:__Start(1) +--- +-- RECOVERYTANKER: Simple +-- +-- Simple Recovery tanker script using default settings. +-- +-- Tanker will be spawned on the USS Stennis and go on station overhead at angels 6 with 274 knots TAS (~250 KIAS). +-- +-- Radio frequencies, callsign are taken from the settings of the late activated template group in the mission editor. +--- + +-- S-3B at USS Stennis spawning on deck. First Parameter is the UNIT name of the Carrier, second the GROUP name of the tanker template. +local tankerStennis=RECOVERYTANKER:New("USS Stennis", "Texaco Group") + +-- Start recovery tanker. +-- NOTE: If you spawn on deck, it seems prudent to delay the spawn a bit after the mission starts. +tankerStennis:__Start(1) diff --git a/OPS - Recovery Tanker/RecoveryTanker - 010 - Simple/RecoveryTanker - 010 - Simple.miz b/OPS - Recovery Tanker/RecoveryTanker - 010 - Simple/RecoveryTanker - 010 - Simple.miz index acaa271f50..db8a2bd104 100644 Binary files a/OPS - Recovery Tanker/RecoveryTanker - 010 - Simple/RecoveryTanker - 010 - Simple.miz and b/OPS - Recovery Tanker/RecoveryTanker - 010 - Simple/RecoveryTanker - 010 - Simple.miz differ diff --git a/OPS - Recovery Tanker/RecoveryTanker - 020 - Custom/RecoveryTanker - 020 - Custom.lua b/OPS - Recovery Tanker/RecoveryTanker - 020 - Custom/RecoveryTanker - 020 - Custom.lua index 7c1bcf6bc4..954b984ffb 100644 --- a/OPS - Recovery Tanker/RecoveryTanker - 020 - Custom/RecoveryTanker - 020 - Custom.lua +++ b/OPS - Recovery Tanker/RecoveryTanker - 020 - Custom/RecoveryTanker - 020 - Custom.lua @@ -1,22 +1,22 @@ ---- --- RECOVERYTANKER: Custom --- --- Simple Recovery tanker script using some customized settings. --- --- Tanker will be spawned on the USS Stennis and go on station overhead at angels 6 with 274 knots TAS (~250 KIAS). --- --- Radio frequencies, callsign are set below and overrule the settings of the late activated template group. ---- - --- S-3B at USS Stennis spawning on deck. -local tankerStennis=RECOVERYTANKER:New("USS Stennis", "Texaco Group") - --- Custom settings for radio frequency, TACAN, callsign and modex. -tankerStennis:SetRadio(261) -tankerStennis:SetTACAN(37, "SHL") -tankerStennis:SetCallsign(CALLSIGN.Tanker.Arco, 3) -tankerStennis:SetModex(0) -- "Triple nuts" - --- Start recovery tanker. --- NOTE: If you spawn on deck, it seems prudent to delay the spawn a bit after the mission starts. -tankerStennis:__Start(1) +--- +-- RECOVERYTANKER: Custom +-- +-- Simple Recovery tanker script using some customized settings. +-- +-- Tanker will be spawned on the USS Stennis and go on station overhead at angels 6 with 274 knots TAS (~250 KIAS). +-- +-- Radio frequencies, callsign are set below and overrule the settings of the late activated template group. +--- + +-- S-3B at USS Stennis spawning on deck. +local tankerStennis=RECOVERYTANKER:New("USS Stennis", "Texaco Group") + +-- Custom settings for radio frequency, TACAN, callsign and modex. +tankerStennis:SetRadio(261) +tankerStennis:SetTACAN(37, "SHL") +tankerStennis:SetCallsign(CALLSIGN.Tanker.Arco, 3) +tankerStennis:SetModex(0) -- "Triple nuts" + +-- Start recovery tanker. +-- NOTE: If you spawn on deck, it seems prudent to delay the spawn a bit after the mission starts. +tankerStennis:__Start(1) diff --git a/OPS - Recovery Tanker/RecoveryTanker - 020 - Custom/RecoveryTanker - 020 - Custom.miz b/OPS - Recovery Tanker/RecoveryTanker - 020 - Custom/RecoveryTanker - 020 - Custom.miz index 409711c17b..0023e12e0e 100644 Binary files a/OPS - Recovery Tanker/RecoveryTanker - 020 - Custom/RecoveryTanker - 020 - Custom.miz and b/OPS - Recovery Tanker/RecoveryTanker - 020 - Custom/RecoveryTanker - 020 - Custom.miz differ diff --git a/PAT - Patrolling/PAT-001 - Switching Patrol Zones/PAT-001 - Switching Patrol Zones.lua b/PAT - Patrolling/PAT-001 - Switching Patrol Zones/PAT-001 - Switching Patrol Zones.lua index cd25ae5576..e460ba8d40 100644 --- a/PAT - Patrolling/PAT-001 - Switching Patrol Zones/PAT-001 - Switching Patrol Zones.lua +++ b/PAT - Patrolling/PAT-001 - Switching Patrol Zones/PAT-001 - Switching Patrol Zones.lua @@ -1,80 +1,80 @@ --- This test mission models the behaviour of the AI_PATROL_ZONE class. --- --- It creates a 2 AI_PATROL_ZONE objects with the name Patrol1 and Patrol2. --- Patrol1 will govern a GROUP object to patrol the zone defined by PatrolZone1, within 3000 meters and 6000 meters, within a speed of 400 and 600 km/h. --- When the GROUP object that is assigned to Patrol has fuel below 20%, the GROUP object will orbit for 60 secondes, before returning to base. --- --- Patrol2 will goven a GROUP object to patrol the zone defined by PatrolZone2, within 600 meters and 1000 meters, within a speed of 300 and 400 km/h. --- When the GROUP object that is assigned to Patrol has fuel below 20%, the GROUP object will orbit for 0 secondes, before returning to base. --- --- The Patrol1 and Patrol2 object have 2 state transition functions defined, which customize the default behaviour of the RTB state. --- When Patrol1 goes RTB, it will create a new GROUP object, that will be assigned to Patrol2. --- When Patrol2 goes RTB, it will create a new GROUP object, that will be assgined to Patrol1. --- --- In this way, the Patrol1 and Patrol2 objects are fluctuating the patrol pattern from PatrolZone1 and PatrolZone2 :-) - - -PatrolZoneGroup1 = GROUP:FindByName( "Patrol Zone 1" ) -PatrolZone1 = ZONE_POLYGON:New( "Patrol Zone 1", PatrolZoneGroup1 ) - -PatrolZoneGroup2 = GROUP:FindByName( "Patrol Zone 2" ) -PatrolZone2 = ZONE_POLYGON:New( "Patrol Zone 2", PatrolZoneGroup2 ) - -PatrolSpawn = SPAWN:New( "Patrol Group" ) -PatrolGroup = PatrolSpawn:Spawn() - -Patrol1 = AI_PATROL_ZONE:New( PatrolZone1, 3000, 6000, 400, 600 ) -Patrol1:ManageFuel( 0.2, 60 ) -Patrol1:SetControllable( PatrolGroup ) -Patrol1:__Start( 5 ) - -Patrol2 = AI_PATROL_ZONE:New( PatrolZone2, 600, 1000, 300, 400 ) -Patrol2:ManageFuel( 0.2, 0 ) - ---- State transition function for the PROCESS\_PATROLZONE **Patrol1** object --- @param #AI_PATROL_ZONE self --- @param Wrapper.Group#GROUP AIGroup --- @return #boolean If false is returned, then the OnAfter state transition function will not be called. -function Patrol1:OnLeaveRTB( AIGroup ) - AIGroup:MessageToRed( "Returning to base", 20 ) -end - ---- State transition function for the PROCESS\_PATROLZONE **Patrol1** object --- @param Process_PatrolCore.Zone#AI_PATROL_ZONE self --- @param Wrapper.Group#GROUP AIGroup -function Patrol1:OnAfterRTB( AIGroup ) - local NewGroup = PatrolSpawn:Spawn() - Patrol2:SetControllable( NewGroup ) - Patrol2:__Start( 1 ) -end - ---- State transition function for the PROCESS\_PATROLZONE **Patrol1** object --- @param Process_PatrolCore.Zone#AI_PATROL_ZONE self --- @param Wrapper.Group#GROUP AIGroup -function Patrol1:OnEnterPatrol( AIGroup ) - AIGroup:MessageToRed( "Patrolling in zone " .. PatrolZone1:GetName() , 20 ) -end - ---- State transition function for the PROCESS\_PATROLZONE **Patrol2** object --- @param #AI_PATROL_ZONE self --- @param Wrapper.Group#GROUP AIGroup --- @return #boolean If false is returned, then the OnEnter state transition function will not be called. -function Patrol2:OnBeforeRTB( AIGroup ) - AIGroup:MessageToRed( "Returning to base", 20 ) -end - ---- State transition function for the PROCESS\_PATROLZONE **Patrol2** object --- @param Process_PatrolCore.Zone#AI_PATROL_ZONE self --- @param Wrapper.Group#GROUP AIGroup -function Patrol2:OnEnterRTB( AIGroup ) - local NewGroup = PatrolSpawn:Spawn() - Patrol1:SetControllable( NewGroup ) - Patrol1:__Start( 1 ) -end - ---- State transition function for the PROCESS\_PATROLZONE **Patrol2** object --- @param Process_PatrolCore.Zone#AI_PATROL_ZONE self --- @param Wrapper.Group#GROUP AIGroup -function Patrol2:OnEnterPatrol( AIGroup ) - AIGroup:MessageToRed( "Patrolling in zone " .. PatrolZone2:GetName() , 20 ) -end +-- This test mission models the behaviour of the AI_PATROL_ZONE class. +-- +-- It creates a 2 AI_PATROL_ZONE objects with the name Patrol1 and Patrol2. +-- Patrol1 will govern a GROUP object to patrol the zone defined by PatrolZone1, within 3000 meters and 6000 meters, within a speed of 400 and 600 km/h. +-- When the GROUP object that is assigned to Patrol has fuel below 20%, the GROUP object will orbit for 60 secondes, before returning to base. +-- +-- Patrol2 will goven a GROUP object to patrol the zone defined by PatrolZone2, within 600 meters and 1000 meters, within a speed of 300 and 400 km/h. +-- When the GROUP object that is assigned to Patrol has fuel below 20%, the GROUP object will orbit for 0 secondes, before returning to base. +-- +-- The Patrol1 and Patrol2 object have 2 state transition functions defined, which customize the default behaviour of the RTB state. +-- When Patrol1 goes RTB, it will create a new GROUP object, that will be assigned to Patrol2. +-- When Patrol2 goes RTB, it will create a new GROUP object, that will be assgined to Patrol1. +-- +-- In this way, the Patrol1 and Patrol2 objects are fluctuating the patrol pattern from PatrolZone1 and PatrolZone2 :-) + + +PatrolZoneGroup1 = GROUP:FindByName( "Patrol Zone 1" ) +PatrolZone1 = ZONE_POLYGON:New( "Patrol Zone 1", PatrolZoneGroup1 ) + +PatrolZoneGroup2 = GROUP:FindByName( "Patrol Zone 2" ) +PatrolZone2 = ZONE_POLYGON:New( "Patrol Zone 2", PatrolZoneGroup2 ) + +PatrolSpawn = SPAWN:New( "Patrol Group" ) +PatrolGroup = PatrolSpawn:Spawn() + +Patrol1 = AI_PATROL_ZONE:New( PatrolZone1, 3000, 6000, 400, 600 ) +Patrol1:ManageFuel( 0.2, 60 ) +Patrol1:SetControllable( PatrolGroup ) +Patrol1:__Start( 5 ) + +Patrol2 = AI_PATROL_ZONE:New( PatrolZone2, 600, 1000, 300, 400 ) +Patrol2:ManageFuel( 0.2, 0 ) + +--- State transition function for the PROCESS\_PATROLZONE **Patrol1** object +-- @param #AI_PATROL_ZONE self +-- @param Wrapper.Group#GROUP AIGroup +-- @return #boolean If false is returned, then the OnAfter state transition function will not be called. +function Patrol1:OnLeaveRTB( AIGroup ) + AIGroup:MessageToRed( "Returning to base", 20 ) +end + +--- State transition function for the PROCESS\_PATROLZONE **Patrol1** object +-- @param Process_PatrolCore.Zone#AI_PATROL_ZONE self +-- @param Wrapper.Group#GROUP AIGroup +function Patrol1:OnAfterRTB( AIGroup ) + local NewGroup = PatrolSpawn:Spawn() + Patrol2:SetControllable( NewGroup ) + Patrol2:__Start( 1 ) +end + +--- State transition function for the PROCESS\_PATROLZONE **Patrol1** object +-- @param Process_PatrolCore.Zone#AI_PATROL_ZONE self +-- @param Wrapper.Group#GROUP AIGroup +function Patrol1:OnEnterPatrol( AIGroup ) + AIGroup:MessageToRed( "Patrolling in zone " .. PatrolZone1:GetName() , 20 ) +end + +--- State transition function for the PROCESS\_PATROLZONE **Patrol2** object +-- @param #AI_PATROL_ZONE self +-- @param Wrapper.Group#GROUP AIGroup +-- @return #boolean If false is returned, then the OnEnter state transition function will not be called. +function Patrol2:OnBeforeRTB( AIGroup ) + AIGroup:MessageToRed( "Returning to base", 20 ) +end + +--- State transition function for the PROCESS\_PATROLZONE **Patrol2** object +-- @param Process_PatrolCore.Zone#AI_PATROL_ZONE self +-- @param Wrapper.Group#GROUP AIGroup +function Patrol2:OnEnterRTB( AIGroup ) + local NewGroup = PatrolSpawn:Spawn() + Patrol1:SetControllable( NewGroup ) + Patrol1:__Start( 1 ) +end + +--- State transition function for the PROCESS\_PATROLZONE **Patrol2** object +-- @param Process_PatrolCore.Zone#AI_PATROL_ZONE self +-- @param Wrapper.Group#GROUP AIGroup +function Patrol2:OnEnterPatrol( AIGroup ) + AIGroup:MessageToRed( "Patrolling in zone " .. PatrolZone2:GetName() , 20 ) +end diff --git a/PAT - Patrolling/PAT-001 - Switching Patrol Zones/PAT-001 - Switching Patrol Zones.miz b/PAT - Patrolling/PAT-001 - Switching Patrol Zones/PAT-001 - Switching Patrol Zones.miz index d28be6728f..611d0691c8 100644 Binary files a/PAT - Patrolling/PAT-001 - Switching Patrol Zones/PAT-001 - Switching Patrol Zones.miz and b/PAT - Patrolling/PAT-001 - Switching Patrol Zones/PAT-001 - Switching Patrol Zones.miz differ diff --git a/RAD - Radio/RAD-000 - Transmission from Static/RAD-000 - Transmission from Static.lua b/RAD - Radio/RAD-000 - Transmission from Static/RAD-000 - Transmission from Static.lua index 296604a1dc..63c03e94ca 100644 --- a/RAD - Radio/RAD-000 - Transmission from Static/RAD-000 - Transmission from Static.lua +++ b/RAD - Radio/RAD-000 - Transmission from Static/RAD-000 - Transmission from Static.lua @@ -1,19 +1,19 @@ --- This test mission demonstrates the RADIO class, particularily when the transmiter is anything but a UNIT or a GROUP (a STATIC in this case) --- The Player is in a Su25T parked on Batumi, and a Russian command center named "Russian Command Center" is placed 12km east of Batumi. - --- Note that if you are not using an ASM aircraft (a clickable cockpit aircraft), then the frequency and the modulation is not important. --- If you want to test the mission fully, replance the SU25T by an ASM aircraft you own and tune to the right frequency (108AM here) - -CommandCenter = STATIC:FindByName("Russian Command Center") - --- Let's get a reference to the Command Center's RADIO -CommandCenterRadio = CommandCenter:GetRadio() - --- Now, we'll set up the next transmission -CommandCenterRadio:SetFileName("Noise.ogg") -- We first need the file name of a sound, -CommandCenterRadio:SetFrequency(108) -- then a frequency in MHz, -CommandCenterRadio:SetModulation(radio.modulation.AM) -- a modulation (we use DCS' enumartion, this way we don't have to type numbers)... -CommandCenterRadio:SetPower(100) -- and finally a power in Watts. A "normal" ground TACAN station has a power of 120W. - --- We have finished tinkering with our transmission, now is the time to broadcast it ! +-- This test mission demonstrates the RADIO class, particularily when the transmiter is anything but a UNIT or a GROUP (a STATIC in this case) +-- The Player is in a Su25T parked on Batumi, and a Russian command center named "Russian Command Center" is placed 12km east of Batumi. + +-- Note that if you are not using an ASM aircraft (a clickable cockpit aircraft), then the frequency and the modulation is not important. +-- If you want to test the mission fully, replance the SU25T by an ASM aircraft you own and tune to the right frequency (108AM here) + +CommandCenter = STATIC:FindByName("Russian Command Center") + +-- Let's get a reference to the Command Center's RADIO +CommandCenterRadio = CommandCenter:GetRadio() + +-- Now, we'll set up the next transmission +CommandCenterRadio:SetFileName("Noise.ogg") -- We first need the file name of a sound, +CommandCenterRadio:SetFrequency(108) -- then a frequency in MHz, +CommandCenterRadio:SetModulation(radio.modulation.AM) -- a modulation (we use DCS' enumartion, this way we don't have to type numbers)... +CommandCenterRadio:SetPower(100) -- and finally a power in Watts. A "normal" ground TACAN station has a power of 120W. + +-- We have finished tinkering with our transmission, now is the time to broadcast it ! CommandCenterRadio:Broadcast() \ No newline at end of file diff --git a/RAD - Radio/RAD-000 - Transmission from Static/RAD-000 - Transmission from Static.miz b/RAD - Radio/RAD-000 - Transmission from Static/RAD-000 - Transmission from Static.miz index 1a8d8d0fa9..ce4ae44d89 100644 Binary files a/RAD - Radio/RAD-000 - Transmission from Static/RAD-000 - Transmission from Static.miz and b/RAD - Radio/RAD-000 - Transmission from Static/RAD-000 - Transmission from Static.miz differ diff --git a/RAD - Radio/RAD-001 - Transmission from UNIT or GROUP/RAD-001 - Transmission from UNIT or GROUP.lua b/RAD - Radio/RAD-001 - Transmission from UNIT or GROUP/RAD-001 - Transmission from UNIT or GROUP.lua index 53b86eccbb..daf3208968 100644 --- a/RAD - Radio/RAD-001 - Transmission from UNIT or GROUP/RAD-001 - Transmission from UNIT or GROUP.lua +++ b/RAD - Radio/RAD-001 - Transmission from UNIT or GROUP/RAD-001 - Transmission from UNIT or GROUP.lua @@ -1,25 +1,25 @@ --- This test mission demonstrates the RADIO class, particularily when the transmiter is a UNIT or a GROUP --- The Player is in a Su25T parked on Batumi, and a Russian MiG-29 creatively named "Sergey" is placed above Kobuleti and is --- inbound for a landing on Batumi - --- Note that if you are not using an ASM aircraft (a clickable cockpit aircraft), then the frequency and the modulation is not important. --- If you want to test the mission fully, replance the SU25T by an ASM aircraft you own and tune to the right frequency (108AM here) - -Sergey = UNIT:FindByName("Sergey") - --- Let's get a reference to Sergey's RADIO -SergeyRadio = Sergey:GetRadio() - --- Now, we'll set up the next transmission -SergeyRadio:SetFileName("Noise.ogg") -- We first need the file name of a sound, -SergeyRadio:SetFrequency(108) -- then a frequency in MHz, -SergeyRadio:SetModulation(radio.modulation.AM) -- and a modulation (we use DCS' enumartion, this way we don't have to type numbers). - --- Since Sergey is a UNIT, we can add a subtitle (displayed on the top left) to the transmission, and loop the transmission -SergeyRadio:SetSubtitle("Hey, hear that noise ?", 5) -- The subtitle "Noise" will be displayed for 5 secs -SergeyRadio:SetLoop(false) - --- Notice that we didn't have to imput a power ? If the broadcater is a UNIT or a GROUP, DCS automatically guesses the power to use depending on the type of UNIT or GROUP - --- We have finished tinkering with our transmission, now is the time to broadcast it ! +-- This test mission demonstrates the RADIO class, particularily when the transmiter is a UNIT or a GROUP +-- The Player is in a Su25T parked on Batumi, and a Russian MiG-29 creatively named "Sergey" is placed above Kobuleti and is +-- inbound for a landing on Batumi + +-- Note that if you are not using an ASM aircraft (a clickable cockpit aircraft), then the frequency and the modulation is not important. +-- If you want to test the mission fully, replance the SU25T by an ASM aircraft you own and tune to the right frequency (108AM here) + +Sergey = UNIT:FindByName("Sergey") + +-- Let's get a reference to Sergey's RADIO +SergeyRadio = Sergey:GetRadio() + +-- Now, we'll set up the next transmission +SergeyRadio:SetFileName("Noise.ogg") -- We first need the file name of a sound, +SergeyRadio:SetFrequency(108) -- then a frequency in MHz, +SergeyRadio:SetModulation(radio.modulation.AM) -- and a modulation (we use DCS' enumartion, this way we don't have to type numbers). + +-- Since Sergey is a UNIT, we can add a subtitle (displayed on the top left) to the transmission, and loop the transmission +SergeyRadio:SetSubtitle("Hey, hear that noise ?", 5) -- The subtitle "Noise" will be displayed for 5 secs +SergeyRadio:SetLoop(false) + +-- Notice that we didn't have to imput a power ? If the broadcater is a UNIT or a GROUP, DCS automatically guesses the power to use depending on the type of UNIT or GROUP + +-- We have finished tinkering with our transmission, now is the time to broadcast it ! SergeyRadio:Broadcast() \ No newline at end of file diff --git a/RAD - Radio/RAD-001 - Transmission from UNIT or GROUP/RAD-001 - Transmission from UNIT or GROUP.miz b/RAD - Radio/RAD-001 - Transmission from UNIT or GROUP/RAD-001 - Transmission from UNIT or GROUP.miz index bd0d28bc34..40a1701050 100644 Binary files a/RAD - Radio/RAD-001 - Transmission from UNIT or GROUP/RAD-001 - Transmission from UNIT or GROUP.miz and b/RAD - Radio/RAD-001 - Transmission from UNIT or GROUP/RAD-001 - Transmission from UNIT or GROUP.miz differ diff --git a/RAD - Radio/RAD-002 - Transmission Tips and Tricks/RAD-002 - Transmission Tips and Tricks.lua b/RAD - Radio/RAD-002 - Transmission Tips and Tricks/RAD-002 - Transmission Tips and Tricks.lua index 0d7a473f1b..e39c5224e7 100644 --- a/RAD - Radio/RAD-002 - Transmission Tips and Tricks/RAD-002 - Transmission Tips and Tricks.lua +++ b/RAD - Radio/RAD-002 - Transmission Tips and Tricks/RAD-002 - Transmission Tips and Tricks.lua @@ -1,91 +1,91 @@ --- This test mission demonstrates the RADIO class in a practical scenario. --- It also focuses on how to create transmissions faster and more efficiently --- Please Read both RAD-000 and RAD-001, as well as SCH-000 code first. - --- Note that if you are not using an ASM aircraft (a clickable cockpit aircraft), then the frequency and the modulation is not important. --- If you want to test the mission fully, replance the SU25T by an ASM aircraft you own and tune to the right frequency (115AM here) - --- The Player is in a Su25T parked on Batumi, and a Russian command center named "Batumi Tower" placed near Batumi will act as Batumi's Radio Tower. --- This mission also features the "Viktor" flight, a Russian Su25, who is inbound for landing on Batumi. --- The goal of this script is to manage the dialog between Viktor and Batumi Tower. - --- The (short) conversation between Viktor and Batumi Tower will happen on 115 AM --- Time 0 : Batumi Tower "Viktor flight, this is Batumi Tower, enter left base runway one two five, report 5 kilometers final. Over." --- Time 10 : Viktor "Report 5 kilometers final, one two five, viktor" --- Time 145 : Viktor "Batumi Tower, Viktor is 5 kilomters final, request landing clearance. Over?" --- Time 154 : Batumi Tower "Viktor flight, you are claer to land, runway one two five. Check gear down." --- Time 160 : Viktor "Clear to land, One two five, Viktor" --- Time 210 : Viktor "Viktor, touchdown" --- Time 215 : Batumi Tower "Viktor, confirmed touchdown, taxi to parking area, Batumi Tower out." - - -BatumiRadio = STATIC:FindByName("Batumi Tower"):GetRadio() -ViktorRadio = UNIT:FindByName("Viktor"):GetRadio() - --- Let's first explore different shortcuts to setup a transmission before broadcastiong it ------------------------------------------------------------------------------------------------------------------------------------------------------- --- First, the long way. -BatumiRadio:SetFileName("Batumi Tower - Enter left base.ogg") -BatumiRadio:SetFrequency(115) -BatumiRadio:SetModulation(radio.modulation.AM) -BatumiRadio:SetPower(100) - --- Every RADIO.SetXXX() function returns the radio, so we can rewrite the code above this way : -BatumiRadio:SetFileName("Batumi Tower - Enter left base.ogg"):SetFrequency(115):SetModulation(radio.modulation.AM):SetPower(100) - --- We can also use the shortcut RADIO:NewGenericTransmission() to set multiple parameters in one function call --- If our broadcaster was a UNIT or a GROUP, the more appropriate shortcut to use would have been NewUnitTransmission() --- it works for both UNIT and GROUP, despite its name ! -BatumiRadio:NewGenericTransmission("Batumi Tower - Enter left base.ogg", 115, radio.modulation.AM, 100) - --- If you already set some parameters previously, you don't have to redo it ! --- NewGenericTransmission's paramter have to be set in order -BatumiRadio:NewGenericTransmission("Batumi Tower - Enter left base.ogg", 115) -- Modulation is still AM and power is still 100 (set previously) - ---If you want to change only the sound file, the frequency and the power for exemple, you can still use the appropriate Set function -BatumiRadio:NewGenericTransmission("Batumi Tower - Enter left base.ogg", 115):SetPower(100) - --- We have finished tinkering with our transmission, now is the time to broadcast it ! -BatumiRadio:Broadcast() - --- Now, if Viktor answered imedately, the two radio broadcasts would overlap. We need to delay Viktor's answer. ------------------------------------------------------------------------------------------------------------------------------------------------------- -CommunitcationScheduler = SCHEDULER:New( nil, - function() - ViktorRadio:SetFileName("Viktor - Enter left base ack.ogg"):SetFrequency(115):SetModulation(radio.modulation.AM):Broadcast() -- We don't specify a subtitle since we don't want one - end, {}, 10 -- 10s delay - ) - --- Viktor takes 145s to be 5km final, and need to contact Batumi Tower. ------------------------------------------------------------------------------------------------------------------------------------------------------- -CommunitcationScheduler:Schedule( nil, - function() - ViktorRadio:SetFileName("Viktor - Request landing clearance.ogg"):Broadcast() --We only specify the new file name, since frequency and modulation didn't change - end, {}, 145 - ) - --- Now that you understand everything about the RADIO class, the rest is pretty trivial -------------------------------------------------------------------------------------------------------------------------------------------------------- -CommunitcationScheduler:Schedule( nil, - function() - BatumiRadio:SetFileName("Batumi Tower - Clear to land.ogg"):Broadcast() - end, {}, 154 - ) - -CommunitcationScheduler:Schedule( nil, - function() - ViktorRadio:SetFileName("Viktor - Clear to land ack.ogg"):Broadcast() - end, {}, 160 - ) - -CommunitcationScheduler:Schedule( nil, - function() - ViktorRadio:SetFileName("Viktor - Touchdown.ogg"):Broadcast() - end, {}, 210 - ) - -CommunitcationScheduler:Schedule( nil, - function() - BatumiRadio:SetFileName("Batumi Tower - Taxi to parking.ogg"):Broadcast() - end, {}, 215 +-- This test mission demonstrates the RADIO class in a practical scenario. +-- It also focuses on how to create transmissions faster and more efficiently +-- Please Read both RAD-000 and RAD-001, as well as SCH-000 code first. + +-- Note that if you are not using an ASM aircraft (a clickable cockpit aircraft), then the frequency and the modulation is not important. +-- If you want to test the mission fully, replance the SU25T by an ASM aircraft you own and tune to the right frequency (115AM here) + +-- The Player is in a Su25T parked on Batumi, and a Russian command center named "Batumi Tower" placed near Batumi will act as Batumi's Radio Tower. +-- This mission also features the "Viktor" flight, a Russian Su25, who is inbound for landing on Batumi. +-- The goal of this script is to manage the dialog between Viktor and Batumi Tower. + +-- The (short) conversation between Viktor and Batumi Tower will happen on 115 AM +-- Time 0 : Batumi Tower "Viktor flight, this is Batumi Tower, enter left base runway one two five, report 5 kilometers final. Over." +-- Time 10 : Viktor "Report 5 kilometers final, one two five, viktor" +-- Time 145 : Viktor "Batumi Tower, Viktor is 5 kilomters final, request landing clearance. Over?" +-- Time 154 : Batumi Tower "Viktor flight, you are claer to land, runway one two five. Check gear down." +-- Time 160 : Viktor "Clear to land, One two five, Viktor" +-- Time 210 : Viktor "Viktor, touchdown" +-- Time 215 : Batumi Tower "Viktor, confirmed touchdown, taxi to parking area, Batumi Tower out." + + +BatumiRadio = STATIC:FindByName("Batumi Tower"):GetRadio() +ViktorRadio = UNIT:FindByName("Viktor"):GetRadio() + +-- Let's first explore different shortcuts to setup a transmission before broadcastiong it +------------------------------------------------------------------------------------------------------------------------------------------------------ +-- First, the long way. +BatumiRadio:SetFileName("Batumi Tower - Enter left base.ogg") +BatumiRadio:SetFrequency(115) +BatumiRadio:SetModulation(radio.modulation.AM) +BatumiRadio:SetPower(100) + +-- Every RADIO.SetXXX() function returns the radio, so we can rewrite the code above this way : +BatumiRadio:SetFileName("Batumi Tower - Enter left base.ogg"):SetFrequency(115):SetModulation(radio.modulation.AM):SetPower(100) + +-- We can also use the shortcut RADIO:NewGenericTransmission() to set multiple parameters in one function call +-- If our broadcaster was a UNIT or a GROUP, the more appropriate shortcut to use would have been NewUnitTransmission() +-- it works for both UNIT and GROUP, despite its name ! +BatumiRadio:NewGenericTransmission("Batumi Tower - Enter left base.ogg", 115, radio.modulation.AM, 100) + +-- If you already set some parameters previously, you don't have to redo it ! +-- NewGenericTransmission's paramter have to be set in order +BatumiRadio:NewGenericTransmission("Batumi Tower - Enter left base.ogg", 115) -- Modulation is still AM and power is still 100 (set previously) + +--If you want to change only the sound file, the frequency and the power for exemple, you can still use the appropriate Set function +BatumiRadio:NewGenericTransmission("Batumi Tower - Enter left base.ogg", 115):SetPower(100) + +-- We have finished tinkering with our transmission, now is the time to broadcast it ! +BatumiRadio:Broadcast() + +-- Now, if Viktor answered imedately, the two radio broadcasts would overlap. We need to delay Viktor's answer. +------------------------------------------------------------------------------------------------------------------------------------------------------ +CommunitcationScheduler = SCHEDULER:New( nil, + function() + ViktorRadio:SetFileName("Viktor - Enter left base ack.ogg"):SetFrequency(115):SetModulation(radio.modulation.AM):Broadcast() -- We don't specify a subtitle since we don't want one + end, {}, 10 -- 10s delay + ) + +-- Viktor takes 145s to be 5km final, and need to contact Batumi Tower. +------------------------------------------------------------------------------------------------------------------------------------------------------ +CommunitcationScheduler:Schedule( nil, + function() + ViktorRadio:SetFileName("Viktor - Request landing clearance.ogg"):Broadcast() --We only specify the new file name, since frequency and modulation didn't change + end, {}, 145 + ) + +-- Now that you understand everything about the RADIO class, the rest is pretty trivial +------------------------------------------------------------------------------------------------------------------------------------------------------- +CommunitcationScheduler:Schedule( nil, + function() + BatumiRadio:SetFileName("Batumi Tower - Clear to land.ogg"):Broadcast() + end, {}, 154 + ) + +CommunitcationScheduler:Schedule( nil, + function() + ViktorRadio:SetFileName("Viktor - Clear to land ack.ogg"):Broadcast() + end, {}, 160 + ) + +CommunitcationScheduler:Schedule( nil, + function() + ViktorRadio:SetFileName("Viktor - Touchdown.ogg"):Broadcast() + end, {}, 210 + ) + +CommunitcationScheduler:Schedule( nil, + function() + BatumiRadio:SetFileName("Batumi Tower - Taxi to parking.ogg"):Broadcast() + end, {}, 215 ) \ No newline at end of file diff --git a/RAD - Radio/RAD-002 - Transmission Tips and Tricks/RAD-002 - Transmission Tips and Tricks.miz b/RAD - Radio/RAD-002 - Transmission Tips and Tricks/RAD-002 - Transmission Tips and Tricks.miz index 4fc6039789..61f4d6e344 100644 Binary files a/RAD - Radio/RAD-002 - Transmission Tips and Tricks/RAD-002 - Transmission Tips and Tricks.miz and b/RAD - Radio/RAD-002 - Transmission Tips and Tricks/RAD-002 - Transmission Tips and Tricks.miz differ diff --git a/RAD - Radio/RAD-010 - Beacons/RAD-010 - Beacons.lua b/RAD - Radio/RAD-010 - Beacons/RAD-010 - Beacons.lua index f34f4c1132..d5c9820495 100644 --- a/RAD - Radio/RAD-010 - Beacons/RAD-010 - Beacons.lua +++ b/RAD - Radio/RAD-010 - Beacons/RAD-010 - Beacons.lua @@ -1,22 +1,22 @@ --- This test mission demonstrates the BEACON class. --- The goal is to activate 2 types of beacons : 1 TACAN beacon attach to an aircraft, and 1 generic radio beacon attach to a ground UNIT - --- The player aircraft needs to be ASM and TACAN compatible. Please replace the M2000C by an aircraft you own and can receive TACAN signals - --- Activates the trace to see what BEACON does in the log ---BASE:TraceClass("BEACON") -BASE:TraceLevel(3) - --- Create our UNITs on which we'll attach a BEACON -local Aircraft = UNIT:FindByName("Unit1") -local LandUnit = UNIT:FindByName("Unit2") - --- Now, let's start with the TACAN Beacon. --- Note that they are limited to Y band. Notice also that this particular TACAN can be homed on. -local BeaconAircraft = Aircraft:GetBeacon() -BeaconAircraft:AATACAN(6, "UNIT1", true) - --- And let's setup the ground based radio beacon ! --- Notice how this beacon will stop in 20 sec (last parameter). -local BeaconLand = LandUnit:GetBeacon() +-- This test mission demonstrates the BEACON class. +-- The goal is to activate 2 types of beacons : 1 TACAN beacon attach to an aircraft, and 1 generic radio beacon attach to a ground UNIT + +-- The player aircraft needs to be ASM and TACAN compatible. Please replace the M2000C by an aircraft you own and can receive TACAN signals + +-- Activates the trace to see what BEACON does in the log +--BASE:TraceClass("BEACON") +BASE:TraceLevel(3) + +-- Create our UNITs on which we'll attach a BEACON +local Aircraft = UNIT:FindByName("Unit1") +local LandUnit = UNIT:FindByName("Unit2") + +-- Now, let's start with the TACAN Beacon. +-- Note that they are limited to Y band. Notice also that this particular TACAN can be homed on. +local BeaconAircraft = Aircraft:GetBeacon() +BeaconAircraft:AATACAN(6, "UNIT1", true) + +-- And let's setup the ground based radio beacon ! +-- Notice how this beacon will stop in 20 sec (last parameter). +local BeaconLand = LandUnit:GetBeacon() BeaconLand:RadioBeacon("Morse.ogg", 129, radio.modulation.AM, 100, 20) \ No newline at end of file diff --git a/RAD - Radio/RAD-010 - Beacons/RAD-010 - Beacons.miz b/RAD - Radio/RAD-010 - Beacons/RAD-010 - Beacons.miz index 42ccc67ec4..024df4d635 100644 Binary files a/RAD - Radio/RAD-010 - Beacons/RAD-010 - Beacons.miz and b/RAD - Radio/RAD-010 - Beacons/RAD-010 - Beacons.miz differ diff --git a/RAD - Radio/RAD-100 - Speech/RAD-100 - Speech.lua b/RAD - Radio/RAD-100 - Speech/RAD-100 - Speech.lua index e4b50bf6ed..5016e6b44d 100644 --- a/RAD - Radio/RAD-100 - Speech/RAD-100 - Speech.lua +++ b/RAD - Radio/RAD-100 - Speech/RAD-100 - Speech.lua @@ -1,19 +1,19 @@ --- This test mission demonstrates the BEACON class. --- The goal is to activate 2 types of beacons : 1 TACAN beacon attach to an aircraft, and 1 generic radio beacon attach to a ground UNIT - --- The player aircraft needs to be ASM and TACAN compatible. Please replace the M2000C by an aircraft you own and can receive TACAN signals - --- Activates the trace to see what BEACON does in the log ---BASE:TraceClass("BEACON") -BASE:TraceLevel(3) - --- Create our UNITs on which we'll attach a BEACON -local Aircraft = UNIT:FindByName("Unit1") -local LandUnit = UNIT:FindByName("Unit2") - -RadioSpeech = RADIOSPEECH:New( 124 ) -RadioSpeech:SetSenderUnitName( "Unit2" ) - -RadioSpeech:Start(2) - +-- This test mission demonstrates the BEACON class. +-- The goal is to activate 2 types of beacons : 1 TACAN beacon attach to an aircraft, and 1 generic radio beacon attach to a ground UNIT + +-- The player aircraft needs to be ASM and TACAN compatible. Please replace the M2000C by an aircraft you own and can receive TACAN signals + +-- Activates the trace to see what BEACON does in the log +--BASE:TraceClass("BEACON") +BASE:TraceLevel(3) + +-- Create our UNITs on which we'll attach a BEACON +local Aircraft = UNIT:FindByName("Unit1") +local LandUnit = UNIT:FindByName("Unit2") + +RadioSpeech = RADIOSPEECH:New( 124 ) +RadioSpeech:SetSenderUnitName( "Unit2" ) + +RadioSpeech:Start(2) + RadioSpeech:ScheduleRepeat( 5, 30, 0, nil, RadioSpeech.Speak, "springfield11, patrolling" ) \ No newline at end of file diff --git a/RAD - Radio/RAD-100 - Speech/RAD-100 - Speech.miz b/RAD - Radio/RAD-100 - Speech/RAD-100 - Speech.miz index 4c1f3d5da9..447bb82571 100644 Binary files a/RAD - Radio/RAD-100 - Speech/RAD-100 - Speech.miz and b/RAD - Radio/RAD-100 - Speech/RAD-100 - Speech.miz differ diff --git a/RAT - Random Air Traffic/Caucasus/RAT-001 - Basic/RAT-001 - Basic.lua b/RAT - Random Air Traffic/Caucasus/RAT-001 - Basic/RAT-001 - Basic.lua index cdec7034ca..613f3114ad 100644 --- a/RAT - Random Air Traffic/Caucasus/RAT-001 - Basic/RAT-001 - Basic.lua +++ b/RAT - Random Air Traffic/Caucasus/RAT-001 - Basic/RAT-001 - Basic.lua @@ -1,18 +1,18 @@ --- Name: RAT-001 - Basic --- Author: funkyfranky --- Date Created: 24 Sep 2017 --- --- # Situation: --- --- Spawn several aircraft at random airports on the map. --- --- # Test cases: --- --- 1. Observe five Yak-40 aircraft being spawned at random airports of the map and fly to random destination airports. --- After the aircraft arrive at their destination they get despawned and then respawned at a new random airport with new random destination. - --- Create RAT object. The only required parameter is the name of the template group in the mission editor. -local yak=RAT:New("RAT_Yak") - --- Spawn five aircraft. +-- Name: RAT-001 - Basic +-- Author: funkyfranky +-- Date Created: 24 Sep 2017 +-- +-- # Situation: +-- +-- Spawn several aircraft at random airports on the map. +-- +-- # Test cases: +-- +-- 1. Observe five Yak-40 aircraft being spawned at random airports of the map and fly to random destination airports. +-- After the aircraft arrive at their destination they get despawned and then respawned at a new random airport with new random destination. + +-- Create RAT object. The only required parameter is the name of the template group in the mission editor. +local yak=RAT:New("RAT_Yak") + +-- Spawn five aircraft. yak:Spawn(5) \ No newline at end of file diff --git a/RAT - Random Air Traffic/Caucasus/RAT-001 - Basic/RAT-001 - Basic.miz b/RAT - Random Air Traffic/Caucasus/RAT-001 - Basic/RAT-001 - Basic.miz index e2bc14f61c..f646846717 100644 Binary files a/RAT - Random Air Traffic/Caucasus/RAT-001 - Basic/RAT-001 - Basic.miz and b/RAT - Random Air Traffic/Caucasus/RAT-001 - Basic/RAT-001 - Basic.miz differ diff --git a/RAT - Random Air Traffic/Caucasus/RAT-002 - Fixed Departure/RAT-002 - Fixed Departure.lua b/RAT - Random Air Traffic/Caucasus/RAT-002 - Fixed Departure/RAT-002 - Fixed Departure.lua index e6929993df..7febe99134 100644 --- a/RAT - Random Air Traffic/Caucasus/RAT-002 - Fixed Departure/RAT-002 - Fixed Departure.lua +++ b/RAT - Random Air Traffic/Caucasus/RAT-002 - Fixed Departure/RAT-002 - Fixed Departure.lua @@ -1,22 +1,22 @@ --- Name: RAT-002 - Fixed Departure --- Author: funkyfranky --- Date Created: 24 Sep 2017 --- --- # Situation: --- --- Spawn several aircraft of the same type at Gudauta and let them travel to random airports on the map. --- --- # Test cases: --- --- 1. Observe five Yak-40 aircraft being spawned at Gudauta. Destination airport for each aircraft is random. --- After the aircraft arrive at their destination they get despawned and then respawned again at Gudauta. But the next destination is random again. - --- Create RAT object. The only required parameter is the name of the template group in the mission editor. -local yak=RAT:New("RAT_Yak") - --- Set destination airport. -yak:SetDeparture("Gudauta") - --- Spawn five aircraft. -yak:Spawn(5) - +-- Name: RAT-002 - Fixed Departure +-- Author: funkyfranky +-- Date Created: 24 Sep 2017 +-- +-- # Situation: +-- +-- Spawn several aircraft of the same type at Gudauta and let them travel to random airports on the map. +-- +-- # Test cases: +-- +-- 1. Observe five Yak-40 aircraft being spawned at Gudauta. Destination airport for each aircraft is random. +-- After the aircraft arrive at their destination they get despawned and then respawned again at Gudauta. But the next destination is random again. + +-- Create RAT object. The only required parameter is the name of the template group in the mission editor. +local yak=RAT:New("RAT_Yak") + +-- Set destination airport. +yak:SetDeparture("Gudauta") + +-- Spawn five aircraft. +yak:Spawn(5) + diff --git a/RAT - Random Air Traffic/Caucasus/RAT-002 - Fixed Departure/RAT-002 - Fixed Departure.miz b/RAT - Random Air Traffic/Caucasus/RAT-002 - Fixed Departure/RAT-002 - Fixed Departure.miz index bd984212b7..eeddce0f7b 100644 Binary files a/RAT - Random Air Traffic/Caucasus/RAT-002 - Fixed Departure/RAT-002 - Fixed Departure.miz and b/RAT - Random Air Traffic/Caucasus/RAT-002 - Fixed Departure/RAT-002 - Fixed Departure.miz differ diff --git a/RAT - Random Air Traffic/Caucasus/RAT-003 - Fixed Destination/RAT-003 - Fixed Destination.lua b/RAT - Random Air Traffic/Caucasus/RAT-003 - Fixed Destination/RAT-003 - Fixed Destination.lua index 7664e1da24..5d9eadfd28 100644 --- a/RAT - Random Air Traffic/Caucasus/RAT-003 - Fixed Destination/RAT-003 - Fixed Destination.lua +++ b/RAT - Random Air Traffic/Caucasus/RAT-003 - Fixed Destination/RAT-003 - Fixed Destination.lua @@ -1,22 +1,22 @@ --- Name: RAT-003 - Fixed Destination --- Author: funkyfranky --- Date Created: 24 Sep 2017 --- --- # Situation: --- --- Spawn several aircraft of the same type at random airports and let them all travel to Sochi-Adler. --- --- # Test cases: --- --- 1. Observe five Yak-40 aircraft being spawned at random airports. They will all fly to Sochi-Adler. --- After the aircraft arrive at their destination they get despawned and then respawned at a random aiport with destination Sochi-Adler. - --- Create RAT object. The only required parameter is the name of the template group in the mission editor. -local yak=RAT:New("RAT_Yak") - --- Set destination airport. -yak:SetDestination("Sochi-Adler") - --- Spawn five aircraft. -yak:Spawn(5) - +-- Name: RAT-003 - Fixed Destination +-- Author: funkyfranky +-- Date Created: 24 Sep 2017 +-- +-- # Situation: +-- +-- Spawn several aircraft of the same type at random airports and let them all travel to Sochi-Adler. +-- +-- # Test cases: +-- +-- 1. Observe five Yak-40 aircraft being spawned at random airports. They will all fly to Sochi-Adler. +-- After the aircraft arrive at their destination they get despawned and then respawned at a random aiport with destination Sochi-Adler. + +-- Create RAT object. The only required parameter is the name of the template group in the mission editor. +local yak=RAT:New("RAT_Yak") + +-- Set destination airport. +yak:SetDestination("Sochi-Adler") + +-- Spawn five aircraft. +yak:Spawn(5) + diff --git a/RAT - Random Air Traffic/Caucasus/RAT-003 - Fixed Destination/RAT-003 - Fixed Destination.miz b/RAT - Random Air Traffic/Caucasus/RAT-003 - Fixed Destination/RAT-003 - Fixed Destination.miz index c57f21c1b4..2092351855 100644 Binary files a/RAT - Random Air Traffic/Caucasus/RAT-003 - Fixed Destination/RAT-003 - Fixed Destination.miz and b/RAT - Random Air Traffic/Caucasus/RAT-003 - Fixed Destination/RAT-003 - Fixed Destination.miz differ diff --git a/RAT - Random Air Traffic/Caucasus/RAT-004 - Fixed Departure and Destination/RAT-004 - Fixed Departure and Destination.lua b/RAT - Random Air Traffic/Caucasus/RAT-004 - Fixed Departure and Destination/RAT-004 - Fixed Departure and Destination.lua index 7a7e2bdd09..b3dc95e4ae 100644 --- a/RAT - Random Air Traffic/Caucasus/RAT-004 - Fixed Departure and Destination/RAT-004 - Fixed Departure and Destination.lua +++ b/RAT - Random Air Traffic/Caucasus/RAT-004 - Fixed Departure and Destination/RAT-004 - Fixed Departure and Destination.lua @@ -1,25 +1,25 @@ --- Name: RAT-004 - Fixed Departure and Destination --- Author: funkyfranky --- Date Created: 24 Sep 2017 --- --- # Situation: --- --- Spawn several aircraft of the same type at Guadauta or Batumi and make them fly to Gelendzhik or Beslan. --- --- # Test cases: --- --- 1. Observe five Yak-40 aircraft being spawned at Gudauta or Batumi. Their destination will be either Gelendzhik or Beslan. --- After the aircraft arrive at their destination they get despawned and then respawned again at one of the defined departure airports. --- Then they will travel to one of the defined destinations again. - --- Create RAT object. The only required parameter is the name of the template group in the mission editor. -local yak=RAT:New("RAT_Yak") - --- Set destination airports. If multiple destinations are specified, they have to be given as a table, i.e. in curly brackets {}. -yak:SetDeparture({"Gudauta", "Batumi"}) - --- Set destination airports. One of these is chosen randomly as destination. -yak:SetDestination({"Gelendzhik", "Beslan"}) - --- Spawn five aircraft. +-- Name: RAT-004 - Fixed Departure and Destination +-- Author: funkyfranky +-- Date Created: 24 Sep 2017 +-- +-- # Situation: +-- +-- Spawn several aircraft of the same type at Guadauta or Batumi and make them fly to Gelendzhik or Beslan. +-- +-- # Test cases: +-- +-- 1. Observe five Yak-40 aircraft being spawned at Gudauta or Batumi. Their destination will be either Gelendzhik or Beslan. +-- After the aircraft arrive at their destination they get despawned and then respawned again at one of the defined departure airports. +-- Then they will travel to one of the defined destinations again. + +-- Create RAT object. The only required parameter is the name of the template group in the mission editor. +local yak=RAT:New("RAT_Yak") + +-- Set destination airports. If multiple destinations are specified, they have to be given as a table, i.e. in curly brackets {}. +yak:SetDeparture({"Gudauta", "Batumi"}) + +-- Set destination airports. One of these is chosen randomly as destination. +yak:SetDestination({"Gelendzhik", "Beslan"}) + +-- Spawn five aircraft. yak:Spawn(5) \ No newline at end of file diff --git a/RAT - Random Air Traffic/Caucasus/RAT-004 - Fixed Departure and Destination/RAT-004 - Fixed Departure and Destination.miz b/RAT - Random Air Traffic/Caucasus/RAT-004 - Fixed Departure and Destination/RAT-004 - Fixed Departure and Destination.miz index 4295bf0380..c5e4c19fee 100644 Binary files a/RAT - Random Air Traffic/Caucasus/RAT-004 - Fixed Departure and Destination/RAT-004 - Fixed Departure and Destination.miz and b/RAT - Random Air Traffic/Caucasus/RAT-004 - Fixed Departure and Destination/RAT-004 - Fixed Departure and Destination.miz differ diff --git a/RAT - Random Air Traffic/Caucasus/RAT-005 - Resticted Coalition/RAT-005 - Resticted Coalition.miz b/RAT - Random Air Traffic/Caucasus/RAT-005 - Resticted Coalition/RAT-005 - Resticted Coalition.miz index ef7306c355..f2648d8081 100644 Binary files a/RAT - Random Air Traffic/Caucasus/RAT-005 - Resticted Coalition/RAT-005 - Resticted Coalition.miz and b/RAT - Random Air Traffic/Caucasus/RAT-005 - Resticted Coalition/RAT-005 - Resticted Coalition.miz differ diff --git a/RAT - Random Air Traffic/Caucasus/RAT-005 - Resticted Coalition/RAT-005 - Restricted Coalition.lua b/RAT - Random Air Traffic/Caucasus/RAT-005 - Resticted Coalition/RAT-005 - Restricted Coalition.lua index 29d5bede63..f79dc761a6 100644 --- a/RAT - Random Air Traffic/Caucasus/RAT-005 - Resticted Coalition/RAT-005 - Restricted Coalition.lua +++ b/RAT - Random Air Traffic/Caucasus/RAT-005 - Resticted Coalition/RAT-005 - Restricted Coalition.lua @@ -1,47 +1,47 @@ --- Name: RAT-005 - Restricted Coalition --- Author: funkyfranky --- Date Created: 24 Sep 2017 --- --- # Situation: --- --- Spawn several aircraft of the same type at airports belonging to a certain coalition. --- In the mission editor, we have set Sochi-Adler, Gelendzhik, Batumi, Senaki-Kolkhi and Kutaisi to red. --- Likewise, Tbilisi-Lochini, Beslan, Nalchik, Mozdok and Mineralnye-Vody were set to blue. --- --- # Test cases: --- --- 1. Observe three Yak-40 aircraft being spawned at red airports only. The will also only get destination airports belonging to that coalition. --- 2. Observe three Yak-40 being spawned at blue airports only. The coalition of the aircraft is changed manually. - --- Create RAT object. Additionally, to the template group name we give the group an alias to be able to distinguish to another group created from this template. -local yak=RAT:New("RAT_Yak", "Yak Red") - --- This restricts the possible departure and destination airports the airports belonging to the red coalition. --- Here it is important that in the mission editor enough (>2) airports have been set to red! Otherwise there will be no possible departure and/or destination airports. -yak:SetCoalition("sameonly") - --- Explicitly exclude Senaki from possible departures and destinations. -yak:ExcludedAirports("Senaki-Kolkhi") - --- Spawn three aircraft. -yak:Spawn(3) - - - --- Create RAT object. Alias is "Yak Blue". If the same template is used multiple times, it is important to give each RAT object an indiviual name! -local yakblue=RAT:New("RAT_Yak", "Yak Blue") - --- Change coalition of Yak to blue. -yakblue:SetCoalitionAircraft("blue") - --- This restricts the possible departure and destination airports the airports belonging to the blue coalition since the coalition is changed manually. -yakblue:SetCoalition("sameonly") - --- We also change the livery of these groups. If a table of liveries is given, each spawned group gets a random livery. -yakblue:Livery({"Georgian Airlines"}) - --- Explicitly exclude Nalchik from possible departures and destinations. -yakblue:ExcludedAirports({"Nalchik", "Mozdok"}) - --- Spawn three aircraft. +-- Name: RAT-005 - Restricted Coalition +-- Author: funkyfranky +-- Date Created: 24 Sep 2017 +-- +-- # Situation: +-- +-- Spawn several aircraft of the same type at airports belonging to a certain coalition. +-- In the mission editor, we have set Sochi-Adler, Gelendzhik, Batumi, Senaki-Kolkhi and Kutaisi to red. +-- Likewise, Tbilisi-Lochini, Beslan, Nalchik, Mozdok and Mineralnye-Vody were set to blue. +-- +-- # Test cases: +-- +-- 1. Observe three Yak-40 aircraft being spawned at red airports only. The will also only get destination airports belonging to that coalition. +-- 2. Observe three Yak-40 being spawned at blue airports only. The coalition of the aircraft is changed manually. + +-- Create RAT object. Additionally, to the template group name we give the group an alias to be able to distinguish to another group created from this template. +local yak=RAT:New("RAT_Yak", "Yak Red") + +-- This restricts the possible departure and destination airports the airports belonging to the red coalition. +-- Here it is important that in the mission editor enough (>2) airports have been set to red! Otherwise there will be no possible departure and/or destination airports. +yak:SetCoalition("sameonly") + +-- Explicitly exclude Senaki from possible departures and destinations. +yak:ExcludedAirports("Senaki-Kolkhi") + +-- Spawn three aircraft. +yak:Spawn(3) + + + +-- Create RAT object. Alias is "Yak Blue". If the same template is used multiple times, it is important to give each RAT object an indiviual name! +local yakblue=RAT:New("RAT_Yak", "Yak Blue") + +-- Change coalition of Yak to blue. +yakblue:SetCoalitionAircraft("blue") + +-- This restricts the possible departure and destination airports the airports belonging to the blue coalition since the coalition is changed manually. +yakblue:SetCoalition("sameonly") + +-- We also change the livery of these groups. If a table of liveries is given, each spawned group gets a random livery. +yakblue:Livery({"Georgian Airlines"}) + +-- Explicitly exclude Nalchik from possible departures and destinations. +yakblue:ExcludedAirports({"Nalchik", "Mozdok"}) + +-- Spawn three aircraft. yakblue:Spawn(3) \ No newline at end of file diff --git a/RAT - Random Air Traffic/Caucasus/RAT-006 - Continue Journey/RAT-006 - Continue Journey.lua b/RAT - Random Air Traffic/Caucasus/RAT-006 - Continue Journey/RAT-006 - Continue Journey.lua index 087629ca4f..d7b40b4fa0 100644 --- a/RAT - Random Air Traffic/Caucasus/RAT-006 - Continue Journey/RAT-006 - Continue Journey.lua +++ b/RAT - Random Air Traffic/Caucasus/RAT-006 - Continue Journey/RAT-006 - Continue Journey.lua @@ -1,25 +1,25 @@ --- Name: RAT-006 - Continue Journey --- Author: funkyfranky --- Date Created: 24 Sep 2017 --- --- # Situation: --- --- Spawn several aircraft of the same type at Gudauta. Each will get a random destination. --- Once the aircraft arrives at its destination, it will be respawned there and continue its journey to another random airport. --- Note that we do NOT have to set a departure airport. --- --- # Test cases: --- --- 1. Observe five Yak-40 aircraft being spawned at Gudauta. From there they will hop from airport to airport on the map. - --- Create RAT object. The only required parameter is the name of the template group in the mission editor. -local yak=RAT:New("RAT_Yak") - --- Set Gudauta as departure airport for all spawned aircraft. (Not required for ContinueJourney() to work.) -yak:SetDeparture("Gudauta") - --- This makes aircraft respawn at their destination airport instead of another random airport. -yak:ContinueJourney() - --- Spawn five aircraft. +-- Name: RAT-006 - Continue Journey +-- Author: funkyfranky +-- Date Created: 24 Sep 2017 +-- +-- # Situation: +-- +-- Spawn several aircraft of the same type at Gudauta. Each will get a random destination. +-- Once the aircraft arrives at its destination, it will be respawned there and continue its journey to another random airport. +-- Note that we do NOT have to set a departure airport. +-- +-- # Test cases: +-- +-- 1. Observe five Yak-40 aircraft being spawned at Gudauta. From there they will hop from airport to airport on the map. + +-- Create RAT object. The only required parameter is the name of the template group in the mission editor. +local yak=RAT:New("RAT_Yak") + +-- Set Gudauta as departure airport for all spawned aircraft. (Not required for ContinueJourney() to work.) +yak:SetDeparture("Gudauta") + +-- This makes aircraft respawn at their destination airport instead of another random airport. +yak:ContinueJourney() + +-- Spawn five aircraft. yak:Spawn(5) \ No newline at end of file diff --git a/RAT - Random Air Traffic/Caucasus/RAT-006 - Continue Journey/RAT-006 - Continue Journey.miz b/RAT - Random Air Traffic/Caucasus/RAT-006 - Continue Journey/RAT-006 - Continue Journey.miz index 74e860c1be..b35294f5b8 100644 Binary files a/RAT - Random Air Traffic/Caucasus/RAT-006 - Continue Journey/RAT-006 - Continue Journey.miz and b/RAT - Random Air Traffic/Caucasus/RAT-006 - Continue Journey/RAT-006 - Continue Journey.miz differ diff --git a/RAT - Random Air Traffic/Caucasus/RAT-007 - Commute/RAT-007 - Commute.lua b/RAT - Random Air Traffic/Caucasus/RAT-007 - Commute/RAT-007 - Commute.lua index 51d2584af3..b6ee513f42 100644 --- a/RAT - Random Air Traffic/Caucasus/RAT-007 - Commute/RAT-007 - Commute.lua +++ b/RAT - Random Air Traffic/Caucasus/RAT-007 - Commute/RAT-007 - Commute.lua @@ -1,31 +1,31 @@ --- Name: RAT-007 - Commute --- Author: funkyfranky --- Date Created: 24 Sep 2017 --- --- # Situation: --- --- Spawn several aircraft of the same type at Mozdok and let them fly to Mineralnye Vody. --- Once the aircraft arrives at its destination, it will be respawned there and fly back to Mozdok. --- Note that: --- We do NOT have to set a departure or destination airports. If we don't, the first departure and destination are random. --- Commute() also works for random destination and departure airports. But once they are chosen, aircraft will only commute between those. --- Also note that Commute() does NOT work with spawn in air since the departure airport is not defined then. --- --- # Test cases: --- --- 1. Observe two C-17A being spawned at Mozdok and fly back and forth between Mozdok and Mineralnye Vody until the end of time. - --- Create RAT object. The only required parameter is the name of the template group in the mission editor. -local c17=RAT:New("RAT_C17") - --- Set Gudauta as departure airport. -c17:SetDeparture("Mozdok") - --- Set Mineralnye Vody as destination. -c17:SetDestination("Mineralnye Vody") - --- This makes aircraft respawn at their destination airport and fly back to its departure. Hence, departure cannot be in air. -c17:Commute() - --- Spawn two aircraft. +-- Name: RAT-007 - Commute +-- Author: funkyfranky +-- Date Created: 24 Sep 2017 +-- +-- # Situation: +-- +-- Spawn several aircraft of the same type at Mozdok and let them fly to Mineralnye Vody. +-- Once the aircraft arrives at its destination, it will be respawned there and fly back to Mozdok. +-- Note that: +-- We do NOT have to set a departure or destination airports. If we don't, the first departure and destination are random. +-- Commute() also works for random destination and departure airports. But once they are chosen, aircraft will only commute between those. +-- Also note that Commute() does NOT work with spawn in air since the departure airport is not defined then. +-- +-- # Test cases: +-- +-- 1. Observe two C-17A being spawned at Mozdok and fly back and forth between Mozdok and Mineralnye Vody until the end of time. + +-- Create RAT object. The only required parameter is the name of the template group in the mission editor. +local c17=RAT:New("RAT_C17") + +-- Set Gudauta as departure airport. +c17:SetDeparture("Mozdok") + +-- Set Mineralnye Vody as destination. +c17:SetDestination("Mineralnye Vody") + +-- This makes aircraft respawn at their destination airport and fly back to its departure. Hence, departure cannot be in air. +c17:Commute() + +-- Spawn two aircraft. c17:Spawn(2) \ No newline at end of file diff --git a/RAT - Random Air Traffic/Caucasus/RAT-007 - Commute/RAT-007 - Commute.miz b/RAT - Random Air Traffic/Caucasus/RAT-007 - Commute/RAT-007 - Commute.miz index 1340354fd7..6fce5819b3 100644 Binary files a/RAT - Random Air Traffic/Caucasus/RAT-007 - Commute/RAT-007 - Commute.miz and b/RAT - Random Air Traffic/Caucasus/RAT-007 - Commute/RAT-007 - Commute.miz differ diff --git a/RAT - Random Air Traffic/Caucasus/RAT-008 - Spawn in Air/RAT-008 - Spawn in Air.lua b/RAT - Random Air Traffic/Caucasus/RAT-008 - Spawn in Air/RAT-008 - Spawn in Air.lua index e50b6f1663..d716df6b68 100644 --- a/RAT - Random Air Traffic/Caucasus/RAT-008 - Spawn in Air/RAT-008 - Spawn in Air.lua +++ b/RAT - Random Air Traffic/Caucasus/RAT-008 - Spawn in Air/RAT-008 - Spawn in Air.lua @@ -1,53 +1,53 @@ --- Name: RAT-008 - Spawn in Air --- Author: funkyfranky --- Date Created: 24 Sep 2017 --- --- # Situation: --- --- Spawn several aircraft above airports or at zones pre-defined in the mission editor. --- Note that if takeoff is set to air: --- Airports are treated like zones with a certain radius. --- Spawn happens at a random point anywhere within the zone. --- --- --- # Test cases: --- --- 1. Obsever ten Yak-40 being spawned in air near random airports of the map. --- 2. Observe five C-17A being spawned within Zones "RAT Zone West", and "RAT Zone North". --- 3. Observe eight IL76 being spawned within RAT Zone North or somewhere near Anapa Vityazevo airport. - - --- Create RAT object from Yak-40 template. -local yak=RAT:New("RAT_YAK") - --- Set takeoff type to air. -yak:SetTakeoff("air") - --- Spawn ten Yak-40s. -yak:Spawn(10) - - --- Create RAT object from C-17A template. -local c17=RAT:New("RAT_C17") - --- Set takeoff type to air. -c17:SetTakeoff("air") - --- Set departure zones for C-17. -c17:SetDeparture({"RAT Zone West", "RAT Zone South"}) - --- Spawn five C-17s. -c17:Spawn(5) - - --- Create RAT object from IL76 template. -local il76=RAT:New("RAT_IL76") - --- Set takeoff type to air. -il76:SetTakeoff("air") - --- Set departure zones for C-17. You can mix zone names and airport names. -il76:SetDeparture({"RAT Zone North", "Anapa-Vityazevo"}) - --- Spawn eight C-17s. +-- Name: RAT-008 - Spawn in Air +-- Author: funkyfranky +-- Date Created: 24 Sep 2017 +-- +-- # Situation: +-- +-- Spawn several aircraft above airports or at zones pre-defined in the mission editor. +-- Note that if takeoff is set to air: +-- Airports are treated like zones with a certain radius. +-- Spawn happens at a random point anywhere within the zone. +-- +-- +-- # Test cases: +-- +-- 1. Obsever ten Yak-40 being spawned in air near random airports of the map. +-- 2. Observe five C-17A being spawned within Zones "RAT Zone West", and "RAT Zone North". +-- 3. Observe eight IL76 being spawned within RAT Zone North or somewhere near Anapa Vityazevo airport. + + +-- Create RAT object from Yak-40 template. +local yak=RAT:New("RAT_YAK") + +-- Set takeoff type to air. +yak:SetTakeoff("air") + +-- Spawn ten Yak-40s. +yak:Spawn(10) + + +-- Create RAT object from C-17A template. +local c17=RAT:New("RAT_C17") + +-- Set takeoff type to air. +c17:SetTakeoff("air") + +-- Set departure zones for C-17. +c17:SetDeparture({"RAT Zone West", "RAT Zone South"}) + +-- Spawn five C-17s. +c17:Spawn(5) + + +-- Create RAT object from IL76 template. +local il76=RAT:New("RAT_IL76") + +-- Set takeoff type to air. +il76:SetTakeoff("air") + +-- Set departure zones for C-17. You can mix zone names and airport names. +il76:SetDeparture({"RAT Zone North", "Anapa-Vityazevo"}) + +-- Spawn eight C-17s. il76:Spawn(8) \ No newline at end of file diff --git a/RAT - Random Air Traffic/Caucasus/RAT-008 - Spawn in Air/RAT-008 - Spawn in Air.miz b/RAT - Random Air Traffic/Caucasus/RAT-008 - Spawn in Air/RAT-008 - Spawn in Air.miz index 949203ff94..ebeae0433f 100644 Binary files a/RAT - Random Air Traffic/Caucasus/RAT-008 - Spawn in Air/RAT-008 - Spawn in Air.miz and b/RAT - Random Air Traffic/Caucasus/RAT-008 - Spawn in Air/RAT-008 - Spawn in Air.miz differ diff --git a/RAT - Random Air Traffic/Caucasus/RAT-009 - Set Cruise Altitude/RAT-009 - Set Cruise Altitude.lua b/RAT - Random Air Traffic/Caucasus/RAT-009 - Set Cruise Altitude/RAT-009 - Set Cruise Altitude.lua index ab5a020ec7..454de48c4b 100644 --- a/RAT - Random Air Traffic/Caucasus/RAT-009 - Set Cruise Altitude/RAT-009 - Set Cruise Altitude.lua +++ b/RAT - Random Air Traffic/Caucasus/RAT-009 - Set Cruise Altitude/RAT-009 - Set Cruise Altitude.lua @@ -1,46 +1,46 @@ --- Name: RAT-009 - Set Cruise Altitude --- Author: funkyfranky --- Date Created: 24 Sep 2017 --- --- # Situation: --- --- Spawn several aircraft randomly but make them fly at certain cruise altitudes. --- In the first example we specify the flight level, i.e. the altitude above sea level in hundreds of meters. --- There are also methods to set the cruise altitude in meters. These are used in the second example. --- --- Note that when setting a lower bound for the cruise altitude, this automatically adjusts the minimum distance to possible destinations, since the aircraft must have enough time to climb to that alt and descent again to the destination. --- --- # Test cases: --- --- 1. Obsever five Yak-40 being spawned at random airports. They will travel to a random destination but the cruising altitude will not be below 5,000 feet and not be above 20,000 feet. --- Most aircraft will travel at or near 10,000 ft. --- 2. Observe two C-17 being spawned at Tbilisi-Lochini. They will travel to a random destination but the cruise alt is set to be > 5 km. - - --- Create RAT object from Yak-40 template. -local yak=RAT:New("RAT_YAK") - --- Set the minimum flight level. No aircaft will travel below this altitude. -yak:SetFLmin(50) - --- Set maximum flight level to 20,000 ft ASL. No aircraft will be assigned a cruise flight level above this altitude. -yak:SetFLmax(200) - --- Set cruise flight level to 10,000 ft. The final choise is random between FLmin and FLmax, but morst aircraft will travel at his or near this altitude. -yak:SetFLcruise(100) - --- Spawn five Yak-40s. -yak:Spawn(5) - - --- Create RAT object from C-17A template. -local c17=RAT:New("RAT_C17") - --- Set departure zones for C-17. -c17:SetDeparture("Tbilisi-Lochini") - --- All aircraft will fly at least at a height of 5 km ASL. -c17:SetMinCruiseAltitude(5000) - --- Spawn two C-17s. -c17:Spawn(2) +-- Name: RAT-009 - Set Cruise Altitude +-- Author: funkyfranky +-- Date Created: 24 Sep 2017 +-- +-- # Situation: +-- +-- Spawn several aircraft randomly but make them fly at certain cruise altitudes. +-- In the first example we specify the flight level, i.e. the altitude above sea level in hundreds of meters. +-- There are also methods to set the cruise altitude in meters. These are used in the second example. +-- +-- Note that when setting a lower bound for the cruise altitude, this automatically adjusts the minimum distance to possible destinations, since the aircraft must have enough time to climb to that alt and descent again to the destination. +-- +-- # Test cases: +-- +-- 1. Obsever five Yak-40 being spawned at random airports. They will travel to a random destination but the cruising altitude will not be below 5,000 feet and not be above 20,000 feet. +-- Most aircraft will travel at or near 10,000 ft. +-- 2. Observe two C-17 being spawned at Tbilisi-Lochini. They will travel to a random destination but the cruise alt is set to be > 5 km. + + +-- Create RAT object from Yak-40 template. +local yak=RAT:New("RAT_YAK") + +-- Set the minimum flight level. No aircaft will travel below this altitude. +yak:SetFLmin(50) + +-- Set maximum flight level to 20,000 ft ASL. No aircraft will be assigned a cruise flight level above this altitude. +yak:SetFLmax(200) + +-- Set cruise flight level to 10,000 ft. The final choise is random between FLmin and FLmax, but morst aircraft will travel at his or near this altitude. +yak:SetFLcruise(100) + +-- Spawn five Yak-40s. +yak:Spawn(5) + + +-- Create RAT object from C-17A template. +local c17=RAT:New("RAT_C17") + +-- Set departure zones for C-17. +c17:SetDeparture("Tbilisi-Lochini") + +-- All aircraft will fly at least at a height of 5 km ASL. +c17:SetMinCruiseAltitude(5000) + +-- Spawn two C-17s. +c17:Spawn(2) diff --git a/RAT - Random Air Traffic/Caucasus/RAT-009 - Set Cruise Altitude/RAT-009 - Set Cruise Altitude.miz b/RAT - Random Air Traffic/Caucasus/RAT-009 - Set Cruise Altitude/RAT-009 - Set Cruise Altitude.miz index b00cfedf68..ae0d1b0faa 100644 Binary files a/RAT - Random Air Traffic/Caucasus/RAT-009 - Set Cruise Altitude/RAT-009 - Set Cruise Altitude.miz and b/RAT - Random Air Traffic/Caucasus/RAT-009 - Set Cruise Altitude/RAT-009 - Set Cruise Altitude.miz differ diff --git a/RAT - Random Air Traffic/Caucasus/RAT-010 - Helo FARP and Ship/RAT-010 - Helo FARP and Ship.lua b/RAT - Random Air Traffic/Caucasus/RAT-010 - Helo FARP and Ship/RAT-010 - Helo FARP and Ship.lua index 844caabe27..561e2c431f 100644 --- a/RAT - Random Air Traffic/Caucasus/RAT-010 - Helo FARP and Ship/RAT-010 - Helo FARP and Ship.lua +++ b/RAT - Random Air Traffic/Caucasus/RAT-010 - Helo FARP and Ship/RAT-010 - Helo FARP and Ship.lua @@ -1,67 +1,67 @@ --- Name: RAT-010 - Helo FARP and Ship --- Author: funkyfranky --- Date Created: 23 Sep 2017 --- --- # Situation: --- --- Spawn helos at FARPS or ships. --- --- # Test cases: --- --- 1. Obsever five Yak-40 being spawned at random airports. They will travel to a random destination but the cruising altitude will not be below 5,000 feet and not be above 20,000 feet. - --- Create RAT object from Huey template. -local huey1=RAT:New("RAT_HUEY", "Huey Berlin") - --- Huey departing from FARP Berlin. -huey1:SetDeparture({"FARP Berlin"}) - --- Flying to Normandy. -huey1:SetDestination({"Normandy"}) - --- Take-off with engines on. -huey1:SetTakeoff("hot") - --- Huey will respawn at Normandy and fly back to FARP Berlin. -huey1:Commute() - --- Huey will be spawned. -huey1:Spawn() - - --- Create RAT object from Huey template. -local huey2=RAT:New("RAT_HUEY", "Huey London") - --- Huey departing from FARP London. -huey2:SetDeparture({"FARP London"}) - --- Flying to Normandy. -huey2:SetDestination({"Normandy"}) - --- Take-off with engines on. -huey2:SetTakeoff("hot") - --- Huey will respawn at Normandy and fly back to FARP London. -huey2:Commute() - --- Huey will be spawned. -huey2:Spawn() - - --- Create RAT object from Huey template. -local huey3=RAT:New("RAT_HUEY", "Huey Anapa") - --- Huey departing from FARP London. -huey3:SetDeparture({"FARP London", "FARP Berlin", "Anapa-Vityazevo"}) - --- Flying to Normandy. -huey3:SetDestination({"FARP London", "FARP Berlin", "Anapa-Vityazevo"}) - --- Take-off with engines on. -huey3:SetTakeoff("hot") - --- Huey will continue its journey. -huey3:ContinueJourney() - --- Huey will be spawned. +-- Name: RAT-010 - Helo FARP and Ship +-- Author: funkyfranky +-- Date Created: 23 Sep 2017 +-- +-- # Situation: +-- +-- Spawn helos at FARPS or ships. +-- +-- # Test cases: +-- +-- 1. Obsever five Yak-40 being spawned at random airports. They will travel to a random destination but the cruising altitude will not be below 5,000 feet and not be above 20,000 feet. + +-- Create RAT object from Huey template. +local huey1=RAT:New("RAT_HUEY", "Huey Berlin") + +-- Huey departing from FARP Berlin. +huey1:SetDeparture({"FARP Berlin"}) + +-- Flying to Normandy. +huey1:SetDestination({"Normandy"}) + +-- Take-off with engines on. +huey1:SetTakeoff("hot") + +-- Huey will respawn at Normandy and fly back to FARP Berlin. +huey1:Commute() + +-- Huey will be spawned. +huey1:Spawn() + + +-- Create RAT object from Huey template. +local huey2=RAT:New("RAT_HUEY", "Huey London") + +-- Huey departing from FARP London. +huey2:SetDeparture({"FARP London"}) + +-- Flying to Normandy. +huey2:SetDestination({"Normandy"}) + +-- Take-off with engines on. +huey2:SetTakeoff("hot") + +-- Huey will respawn at Normandy and fly back to FARP London. +huey2:Commute() + +-- Huey will be spawned. +huey2:Spawn() + + +-- Create RAT object from Huey template. +local huey3=RAT:New("RAT_HUEY", "Huey Anapa") + +-- Huey departing from FARP London. +huey3:SetDeparture({"FARP London", "FARP Berlin", "Anapa-Vityazevo"}) + +-- Flying to Normandy. +huey3:SetDestination({"FARP London", "FARP Berlin", "Anapa-Vityazevo"}) + +-- Take-off with engines on. +huey3:SetTakeoff("hot") + +-- Huey will continue its journey. +huey3:ContinueJourney() + +-- Huey will be spawned. huey3:Spawn() \ No newline at end of file diff --git a/RAT - Random Air Traffic/Caucasus/RAT-010 - Helo FARP and Ship/RAT-010 - Helo FARP and Ship.miz b/RAT - Random Air Traffic/Caucasus/RAT-010 - Helo FARP and Ship/RAT-010 - Helo FARP and Ship.miz index 8a15452b6e..36f1cd2661 100644 Binary files a/RAT - Random Air Traffic/Caucasus/RAT-010 - Helo FARP and Ship/RAT-010 - Helo FARP and Ship.miz and b/RAT - Random Air Traffic/Caucasus/RAT-010 - Helo FARP and Ship/RAT-010 - Helo FARP and Ship.miz differ diff --git a/RAT - Random Air Traffic/Caucasus/RAT-011 - Carrier Ops/RAT-011 - Carrier Ops.lua b/RAT - Random Air Traffic/Caucasus/RAT-011 - Carrier Ops/RAT-011 - Carrier Ops.lua index d6b1684b24..677a37ccb4 100644 --- a/RAT - Random Air Traffic/Caucasus/RAT-011 - Carrier Ops/RAT-011 - Carrier Ops.lua +++ b/RAT - Random Air Traffic/Caucasus/RAT-011 - Carrier Ops/RAT-011 - Carrier Ops.lua @@ -1,43 +1,43 @@ --- Name: RAT-011 - Carrier Ops --- Author: funkyfranky --- Date Created: 24 Sep 2017 --- --- # Situation: --- --- Spawn aircraft flying to and from aircraft carriers --- --- # Test cases: --- --- 1. Observe two SU-33 taking of from Novorossiysk and fly to the Kuznetsov. --- 2. Observe two F-14A taking of from the Carl Vinson flying into Batumi. - --- Create RAT object from Su-33 template. -local su33=RAT:New("RAT_SU33") - --- Huey departing from FARP Berlin. -su33:SetDeparture({"Novorossiysk"}) - --- Flying to Normandy. -su33:SetDestination({"Kuznetsov"}) - --- Take-off with engines on. -su33:SetTakeoff("hot") - --- Spawn two aircraft. -su33:Spawn(2) - - --- Create RAT object from Su-33 template. -local f14=RAT:New("RAT_F14") - --- Huey departing from FARP Berlin. -f14:SetDeparture({"Carl Vinson"}) - --- Flying to Normandy. -f14:SetDestination({"Batumi"}) - --- Take-off with engines on. -f14:SetTakeoff("hot") - --- Spawn two aircraft. +-- Name: RAT-011 - Carrier Ops +-- Author: funkyfranky +-- Date Created: 24 Sep 2017 +-- +-- # Situation: +-- +-- Spawn aircraft flying to and from aircraft carriers +-- +-- # Test cases: +-- +-- 1. Observe two SU-33 taking of from Novorossiysk and fly to the Kuznetsov. +-- 2. Observe two F-14A taking of from the Carl Vinson flying into Batumi. + +-- Create RAT object from Su-33 template. +local su33=RAT:New("RAT_SU33") + +-- Huey departing from FARP Berlin. +su33:SetDeparture({"Novorossiysk"}) + +-- Flying to Normandy. +su33:SetDestination({"Kuznetsov"}) + +-- Take-off with engines on. +su33:SetTakeoff("hot") + +-- Spawn two aircraft. +su33:Spawn(2) + + +-- Create RAT object from Su-33 template. +local f14=RAT:New("RAT_F14") + +-- Huey departing from FARP Berlin. +f14:SetDeparture({"Carl Vinson"}) + +-- Flying to Normandy. +f14:SetDestination({"Batumi"}) + +-- Take-off with engines on. +f14:SetTakeoff("hot") + +-- Spawn two aircraft. f14:Spawn(2) \ No newline at end of file diff --git a/RAT - Random Air Traffic/Caucasus/RAT-011 - Carrier Ops/RAT-011 - Carrier Ops.miz b/RAT - Random Air Traffic/Caucasus/RAT-011 - Carrier Ops/RAT-011 - Carrier Ops.miz index ad8391f8f6..a91562326e 100644 Binary files a/RAT - Random Air Traffic/Caucasus/RAT-011 - Carrier Ops/RAT-011 - Carrier Ops.miz and b/RAT - Random Air Traffic/Caucasus/RAT-011 - Carrier Ops/RAT-011 - Carrier Ops.miz differ diff --git a/RAT - Random Air Traffic/Nevada/RAT-010 - Traffic at McCarran International/RAT-010 - Traffic at McCarran International.lua b/RAT - Random Air Traffic/Nevada/RAT-010 - Traffic at McCarran International/RAT-010 - Traffic at McCarran International.lua index 8f7bf39dc7..329735119f 100644 --- a/RAT - Random Air Traffic/Nevada/RAT-010 - Traffic at McCarran International/RAT-010 - Traffic at McCarran International.lua +++ b/RAT - Random Air Traffic/Nevada/RAT-010 - Traffic at McCarran International/RAT-010 - Traffic at McCarran International.lua @@ -1,68 +1,68 @@ --- Name: RAT-010 - Traffic at McCarran International --- Author: funkyfranky --- Date Created: 24 Sep 2017 --- --- # Situation: --- --- We want to generate some random air traffic at McCarran International Airport. --- --- # Test cases: --- --- 1. KC-135 aircraft are spawned at zones north and east heading to McCarran. --- 2. E-3A aircraft are spawned at McCarran with random destinations. --- 3. Yak-40 aircraft are spawned at random airports heading for McCarran. --- 3. TF-51D aircraft are spawned at Henderson, Boulder City or Echo Bay heading for McCarran. - --- Create RAT object from KC-135 template. -local kc135=RAT:New("RAT_KC135") - --- Set departure zones. We need takeoff "air" for that. -kc135:SetDeparture({"RAT Zone North", "RAT Zone East"}) - --- Set spawn in air. -kc135:SetTakeoff("air") - --- Aircraft will fly to McCarran -kc135:SetDestination("McCarran International Airport") - --- Spawn two aircraft. -kc135:Spawn(2) - - --- Create RAT object from E-3A template. -local e3=RAT:New("RAT_E3") - --- Aircraft are spawned at McCarran. Destinations are random. -e3:SetDeparture("McCarran International Airport") - --- Enable respawn after landing with a delay of six minutes. -e3:RespawnAfterLanding(360) - --- Spawn two aircraft. -e3:Spawn(2) - - --- Create RAT object from Yak-40 template. -local yak=RAT:New("RAT_YAK") - --- These are the airports a Yak-40 gets a parking slot. -yak:SetDeparture({"Tonopah Airport", "Tonopah Test Range Airfield", "Henderson Executive Airport", "Nellis AFB", "Groom Lake", "Laughlin Airport"}) - --- Destination McCarran. -yak:SetDestination("McCarran International Airport") - --- Spawn eight Yak-40. -yak:Spawn(8) - - --- Create RAT object from E-3A template. -local tf51=RAT:New("RAT_TF51") - --- Departure airport will be chosen from this list. -tf51:SetDeparture({"Henderson Executive Airport", "Boulder City Airport", "Echo Bay"}) - --- All will fly to McCarran. -tf51:SetDestination("McCarran International Airport") - --- Spawn four TF-51D -tf51:Spawn(4) +-- Name: RAT-010 - Traffic at McCarran International +-- Author: funkyfranky +-- Date Created: 24 Sep 2017 +-- +-- # Situation: +-- +-- We want to generate some random air traffic at McCarran International Airport. +-- +-- # Test cases: +-- +-- 1. KC-135 aircraft are spawned at zones north and east heading to McCarran. +-- 2. E-3A aircraft are spawned at McCarran with random destinations. +-- 3. Yak-40 aircraft are spawned at random airports heading for McCarran. +-- 3. TF-51D aircraft are spawned at Henderson, Boulder City or Echo Bay heading for McCarran. + +-- Create RAT object from KC-135 template. +local kc135=RAT:New("RAT_KC135") + +-- Set departure zones. We need takeoff "air" for that. +kc135:SetDeparture({"RAT Zone North", "RAT Zone East"}) + +-- Set spawn in air. +kc135:SetTakeoff("air") + +-- Aircraft will fly to McCarran +kc135:SetDestination("McCarran International Airport") + +-- Spawn two aircraft. +kc135:Spawn(2) + + +-- Create RAT object from E-3A template. +local e3=RAT:New("RAT_E3") + +-- Aircraft are spawned at McCarran. Destinations are random. +e3:SetDeparture("McCarran International Airport") + +-- Enable respawn after landing with a delay of six minutes. +e3:RespawnAfterLanding(360) + +-- Spawn two aircraft. +e3:Spawn(2) + + +-- Create RAT object from Yak-40 template. +local yak=RAT:New("RAT_YAK") + +-- These are the airports a Yak-40 gets a parking slot. +yak:SetDeparture({"Tonopah Airport", "Tonopah Test Range Airfield", "Henderson Executive Airport", "Nellis AFB", "Groom Lake", "Laughlin Airport"}) + +-- Destination McCarran. +yak:SetDestination("McCarran International Airport") + +-- Spawn eight Yak-40. +yak:Spawn(8) + + +-- Create RAT object from E-3A template. +local tf51=RAT:New("RAT_TF51") + +-- Departure airport will be chosen from this list. +tf51:SetDeparture({"Henderson Executive Airport", "Boulder City Airport", "Echo Bay"}) + +-- All will fly to McCarran. +tf51:SetDestination("McCarran International Airport") + +-- Spawn four TF-51D +tf51:Spawn(4) diff --git a/RAT - Random Air Traffic/Nevada/RAT-010 - Traffic at McCarran International/RAT-010 - Traffic at McCarran International.miz b/RAT - Random Air Traffic/Nevada/RAT-010 - Traffic at McCarran International/RAT-010 - Traffic at McCarran International.miz index 4dd625910e..a164f0d509 100644 Binary files a/RAT - Random Air Traffic/Nevada/RAT-010 - Traffic at McCarran International/RAT-010 - Traffic at McCarran International.miz and b/RAT - Random Air Traffic/Nevada/RAT-010 - Traffic at McCarran International/RAT-010 - Traffic at McCarran International.miz differ diff --git a/RAT - Random Air Traffic/Nevada/RAT-011 - Traffic at Nellis AFB/RAT-011 - Traffic at Nellis AFB.lua b/RAT - Random Air Traffic/Nevada/RAT-011 - Traffic at Nellis AFB/RAT-011 - Traffic at Nellis AFB.lua index 67f5caa604..e737d0bba0 100644 --- a/RAT - Random Air Traffic/Nevada/RAT-011 - Traffic at Nellis AFB/RAT-011 - Traffic at Nellis AFB.lua +++ b/RAT - Random Air Traffic/Nevada/RAT-011 - Traffic at Nellis AFB/RAT-011 - Traffic at Nellis AFB.lua @@ -1,96 +1,96 @@ --- Name: RAT-011 - Traffic at Nellis AFB --- Author: funkyfranky --- Date Created: 24 Sep 2017 --- --- # Situation: --- --- We want to generate some random air traffic at Nellis AFB. --- --- # Test cases: --- --- 1. F-15C are spawned at Nellis with desitation Tonopah, Groom Lake or Creech. --- 2. A-10C are spawned at Nellis with desitation Tonopah, Groom Lake or Creech. --- 3. F/A-18C are spawned at Tonopah, Groom Lake or Creech and fly to Nellis. --- 4. KC-135 are spawned in air at two zones heading for Nellis. - --- ----------------------------------------------------------------------------------------------------------------------------------------------------------------- - --- Create RAT object from F-15C template. -local f15=RAT:New("RAT_F15C") - --- Departure Nellis. -f15:SetDeparture("Nellis AFB") - --- Destination Tonopah, Groom Lake or Creech. -f15:SetDestination({"Tonopah Test Range Airfield", "Groom Lake AFB", "Creech AFB"}) - --- Spawn three flights. -f15:Spawn(3) - --- ----------------------------------------------------------------------------------------------------------------------------------------------------------------- - -local a10=RAT:New("RAT_A10C") - --- Departure Nellis. -a10:SetDeparture("Nellis AFB") - --- Destination Tonopa, Groom Lake or Creech. -a10:SetDestination({"Tonopah Test Range Airfield", "Groom Lake AFB", "Creech AFB"}) - --- Spawning will happen 60 seconds after mission start. -a10:SetSpawnDelay(60) - --- Spawn three flights. -a10:Spawn(3) - --- ----------------------------------------------------------------------------------------------------------------------------------------------------------------- - --- Creat RAT object from F/A-18C template. -local f18=RAT:New("RAT_F18C") - --- Departure airports. -f18:SetDeparture({"Tonopah Test Range Airfield", "Groom Lake AFB", "Creech AFB"}) - --- Destination Nellis. -f18:SetDestination("Nellis AFB") - --- Spawn three flights. -f18:Spawn(3) - --- ----------------------------------------------------------------------------------------------------------------------------------------------------------------- - --- Create RAT object from KC-135 template. -local kc135=RAT:New("RAT_KC135") - --- Set departure zones. We need takeoff "air" for that. -kc135:SetDeparture({"RAT Zone North", "RAT Zone East"}) - --- Set spawn in air. -kc135:SetTakeoff("air") - --- Aircraft will fly to McCarran -kc135:SetDestination("Nellis AFB") - --- Spawning of aircraft will happen in 2 minute intervalls. -kc135:SetSpawnInterval(120) - --- Spawn two aircraft. -kc135:Spawn(2) - --- ----------------------------------------------------------------------------------------------------------------------------------------------------------------- - --- Store time at mission start -local T0=timer.getTime() - --- Send message with current misson time to all coalisions -local function print_mission_time() - local Tnow=timer.getTime() - local mission_time=Tnow-T0 - local mission_time_minutes=mission_time/60 - local mission_time_seconds=mission_time%60 - local text=string.format("Mission Time: %i:%02d", mission_time_minutes,mission_time_seconds) - MESSAGE:New(text, 5):ToAll() -end - --- Start scheduler to report mission time. +-- Name: RAT-011 - Traffic at Nellis AFB +-- Author: funkyfranky +-- Date Created: 24 Sep 2017 +-- +-- # Situation: +-- +-- We want to generate some random air traffic at Nellis AFB. +-- +-- # Test cases: +-- +-- 1. F-15C are spawned at Nellis with desitation Tonopah, Groom Lake or Creech. +-- 2. A-10C are spawned at Nellis with desitation Tonopah, Groom Lake or Creech. +-- 3. F/A-18C are spawned at Tonopah, Groom Lake or Creech and fly to Nellis. +-- 4. KC-135 are spawned in air at two zones heading for Nellis. + +-- ----------------------------------------------------------------------------------------------------------------------------------------------------------------- + +-- Create RAT object from F-15C template. +local f15=RAT:New("RAT_F15C") + +-- Departure Nellis. +f15:SetDeparture("Nellis AFB") + +-- Destination Tonopah, Groom Lake or Creech. +f15:SetDestination({"Tonopah Test Range Airfield", "Groom Lake AFB", "Creech AFB"}) + +-- Spawn three flights. +f15:Spawn(3) + +-- ----------------------------------------------------------------------------------------------------------------------------------------------------------------- + +local a10=RAT:New("RAT_A10C") + +-- Departure Nellis. +a10:SetDeparture("Nellis AFB") + +-- Destination Tonopa, Groom Lake or Creech. +a10:SetDestination({"Tonopah Test Range Airfield", "Groom Lake AFB", "Creech AFB"}) + +-- Spawning will happen 60 seconds after mission start. +a10:SetSpawnDelay(60) + +-- Spawn three flights. +a10:Spawn(3) + +-- ----------------------------------------------------------------------------------------------------------------------------------------------------------------- + +-- Creat RAT object from F/A-18C template. +local f18=RAT:New("RAT_F18C") + +-- Departure airports. +f18:SetDeparture({"Tonopah Test Range Airfield", "Groom Lake AFB", "Creech AFB"}) + +-- Destination Nellis. +f18:SetDestination("Nellis AFB") + +-- Spawn three flights. +f18:Spawn(3) + +-- ----------------------------------------------------------------------------------------------------------------------------------------------------------------- + +-- Create RAT object from KC-135 template. +local kc135=RAT:New("RAT_KC135") + +-- Set departure zones. We need takeoff "air" for that. +kc135:SetDeparture({"RAT Zone North", "RAT Zone East"}) + +-- Set spawn in air. +kc135:SetTakeoff("air") + +-- Aircraft will fly to McCarran +kc135:SetDestination("Nellis AFB") + +-- Spawning of aircraft will happen in 2 minute intervalls. +kc135:SetSpawnInterval(120) + +-- Spawn two aircraft. +kc135:Spawn(2) + +-- ----------------------------------------------------------------------------------------------------------------------------------------------------------------- + +-- Store time at mission start +local T0=timer.getTime() + +-- Send message with current misson time to all coalisions +local function print_mission_time() + local Tnow=timer.getTime() + local mission_time=Tnow-T0 + local mission_time_minutes=mission_time/60 + local mission_time_seconds=mission_time%60 + local text=string.format("Mission Time: %i:%02d", mission_time_minutes,mission_time_seconds) + MESSAGE:New(text, 5):ToAll() +end + +-- Start scheduler to report mission time. local Scheduler_Mission_Time = SCHEDULER:New(nil, print_mission_time, {}, 0, 10) \ No newline at end of file diff --git a/RAT - Random Air Traffic/Nevada/RAT-011 - Traffic at Nellis AFB/RAT-011 - Traffic at Nellis AFB.miz b/RAT - Random Air Traffic/Nevada/RAT-011 - Traffic at Nellis AFB/RAT-011 - Traffic at Nellis AFB.miz index 843944cf79..d11169ddb6 100644 Binary files a/RAT - Random Air Traffic/Nevada/RAT-011 - Traffic at Nellis AFB/RAT-011 - Traffic at Nellis AFB.miz and b/RAT - Random Air Traffic/Nevada/RAT-011 - Traffic at Nellis AFB/RAT-011 - Traffic at Nellis AFB.miz differ diff --git a/RAT - Random Air Traffic/Normandy/RAT-020 - WWII Scenario/RAT-020 - WWII Scenario.lua b/RAT - Random Air Traffic/Normandy/RAT-020 - WWII Scenario/RAT-020 - WWII Scenario.lua index e2b905c049..f774d55136 100644 --- a/RAT - Random Air Traffic/Normandy/RAT-020 - WWII Scenario/RAT-020 - WWII Scenario.lua +++ b/RAT - Random Air Traffic/Normandy/RAT-020 - WWII Scenario/RAT-020 - WWII Scenario.lua @@ -1,85 +1,85 @@ --- Name: RAT-020 - WWII Scenario --- Author: funkyfranky --- Date Created: 16 Sep 2017 --- --- # Situation: --- --- We want to generate some random air traffic of WWII units in 1944 Normandy. --- In the mission editor we have defined a couple of red and blue airfields. --- Germans are located to the east while the allies hold the western airfiels and those of southern England. --- Note that the default setting of the RAT aircraft is to hold their weapons and to ignore enemy threads. --- --- # Test cases: --- --- 1. Four two-ship flights of Bf-109 get random routes restricted to red airfields. --- 2. Two two-ship flights of FW-190 similar to the Bf-109s. --- 3. Three two-ship flights of TF-51 get random routes restricted to blue airfields. --- 4. Two two-ship flights of Spitfires are set up analogously to the TF-51 --- 5. One two-ship flight of Spitfires is explicitly ordered to fly back and forth across the channel. - --- ----------------------------------------------------------------------------------------------------------------------------------------------------------------- - --- Create RAT object from Bf-109 template. -local bf109=RAT:New("RAT_Bf109") - --- Airports are restricted to red. -bf109:SetCoalition("sameonly") - --- Spawn four Bf-109. -bf109:Spawn(4) - --- Create RAT object from FW-190 template. -local fw190=RAT:New("RAT_Fw190") - --- Again, airports restricted to red. -fw190:SetCoalition("sameonly") - --- Spawn two FW-190. -fw190:Spawn(2) - --- ----------------------------------------------------------------------------------------------------------------------------------------------------------------- - --- Create RAT object from TF-51 template. -local tf51=RAT:New("RAT_TF-51") - --- Allow only blue airports for departure and destination. -tf51:SetCoalition("sameonly") - --- We exclude ever airport across the channel. -tf51:ExcludedAirports({"Needs Oar Point", "Funtington", "Tangmere", "Ford", "Chailey"}) - --- Spawn three TF-51. -tf51:Spawn(3) - - --- Creat RAT object from Spitfire template. -local spit=RAT:New("RAT_Spit") - --- Blue airports only. -spit:SetCoalition("sameonly") - --- We exclude ever airport across the channel. -spit:ExcludedAirports({"Needs Oar Point", "Funtington", "Tangmere", "Ford", "Chailey"}) - --- Spawn two two-ship flights. -spit:Spawn(2) - --- Create RAT object from Spitfire template. --- NOTE that since we have already used this template, we need to give it another name. --- This is done by the second parameter, which is the alias name for RAT aircraft. --- In particular, this will be the name given in the F10 Menu. --- IMPORTANT: It is no problem to reuse the same template multiple times. But each template must get its own alias! -local spit_commute=RAT:New("RAT_Spit", "RAT_Spit_Commute") - --- These Spitfires get the order fly across the channel and to commute between Chailey and Le Molay. -spit_commute:SetDeparture("Chailey") -spit_commute:SetDestination("Le Molay") -spit_commute:Commute() - --- Set another livery for these aircraft. -spit_commute:Livery("RAF, No. 126 Squadron, Harrowbeer") - --- Spawn one two-ship flight. -spit_commute:Spawn() - +-- Name: RAT-020 - WWII Scenario +-- Author: funkyfranky +-- Date Created: 16 Sep 2017 +-- +-- # Situation: +-- +-- We want to generate some random air traffic of WWII units in 1944 Normandy. +-- In the mission editor we have defined a couple of red and blue airfields. +-- Germans are located to the east while the allies hold the western airfiels and those of southern England. +-- Note that the default setting of the RAT aircraft is to hold their weapons and to ignore enemy threads. +-- +-- # Test cases: +-- +-- 1. Four two-ship flights of Bf-109 get random routes restricted to red airfields. +-- 2. Two two-ship flights of FW-190 similar to the Bf-109s. +-- 3. Three two-ship flights of TF-51 get random routes restricted to blue airfields. +-- 4. Two two-ship flights of Spitfires are set up analogously to the TF-51 +-- 5. One two-ship flight of Spitfires is explicitly ordered to fly back and forth across the channel. + +-- ----------------------------------------------------------------------------------------------------------------------------------------------------------------- + +-- Create RAT object from Bf-109 template. +local bf109=RAT:New("RAT_Bf109") + +-- Airports are restricted to red. +bf109:SetCoalition("sameonly") + +-- Spawn four Bf-109. +bf109:Spawn(4) + +-- Create RAT object from FW-190 template. +local fw190=RAT:New("RAT_Fw190") + +-- Again, airports restricted to red. +fw190:SetCoalition("sameonly") + +-- Spawn two FW-190. +fw190:Spawn(2) + +-- ----------------------------------------------------------------------------------------------------------------------------------------------------------------- + +-- Create RAT object from TF-51 template. +local tf51=RAT:New("RAT_TF-51") + +-- Allow only blue airports for departure and destination. +tf51:SetCoalition("sameonly") + +-- We exclude ever airport across the channel. +tf51:ExcludedAirports({"Needs Oar Point", "Funtington", "Tangmere", "Ford", "Chailey"}) + +-- Spawn three TF-51. +tf51:Spawn(3) + + +-- Creat RAT object from Spitfire template. +local spit=RAT:New("RAT_Spit") + +-- Blue airports only. +spit:SetCoalition("sameonly") + +-- We exclude ever airport across the channel. +spit:ExcludedAirports({"Needs Oar Point", "Funtington", "Tangmere", "Ford", "Chailey"}) + +-- Spawn two two-ship flights. +spit:Spawn(2) + +-- Create RAT object from Spitfire template. +-- NOTE that since we have already used this template, we need to give it another name. +-- This is done by the second parameter, which is the alias name for RAT aircraft. +-- In particular, this will be the name given in the F10 Menu. +-- IMPORTANT: It is no problem to reuse the same template multiple times. But each template must get its own alias! +local spit_commute=RAT:New("RAT_Spit", "RAT_Spit_Commute") + +-- These Spitfires get the order fly across the channel and to commute between Chailey and Le Molay. +spit_commute:SetDeparture("Chailey") +spit_commute:SetDestination("Le Molay") +spit_commute:Commute() + +-- Set another livery for these aircraft. +spit_commute:Livery("RAF, No. 126 Squadron, Harrowbeer") + +-- Spawn one two-ship flight. +spit_commute:Spawn() + -- ----------------------------------------------------------------------------------------------------------------------------------------------------------------- \ No newline at end of file diff --git a/RAT - Random Air Traffic/Normandy/RAT-020 - WWII Scenario/RAT-020 - WWII Scenario.miz b/RAT - Random Air Traffic/Normandy/RAT-020 - WWII Scenario/RAT-020 - WWII Scenario.miz index c41c1bf568..53ebf66296 100644 Binary files a/RAT - Random Air Traffic/Normandy/RAT-020 - WWII Scenario/RAT-020 - WWII Scenario.miz and b/RAT - Random Air Traffic/Normandy/RAT-020 - WWII Scenario/RAT-020 - WWII Scenario.miz differ diff --git a/SCH - Scheduler/SCH-000 - Simple Scheduling/SCH-000 - Simple Scheduling.lua b/SCH - Scheduler/SCH-000 - Simple Scheduling/SCH-000 - Simple Scheduling.lua index be50637aa0..4220dc0947 100644 --- a/SCH - Scheduler/SCH-000 - Simple Scheduling/SCH-000 - Simple Scheduling.lua +++ b/SCH - Scheduler/SCH-000 - Simple Scheduling/SCH-000 - Simple Scheduling.lua @@ -1,33 +1,33 @@ ---- Simple function scheduling --- --- === --- --- Author: FlightControl --- Date Created: 12 Dec 2016 --- --- # Situation --- Uses the Tracing functions from BASE within the DCS.log file. Check the DCS.log file for the results. --- Create a new SCHEDULER object. --- Check the DCS.log. --- --- # Test cases: --- --- 1. The log should contain a "Hello World" line that is fired off 10 seconds after mission start. --- --- --- # Status: TESTED - 12 Dec 2016 - -local TestScheduler = SCHEDULER:New( nil, - function() - BASE:E( "Hello World 1") - end, {}, 1 - ) - -SCHEDULER:New( nil, - function() - BASE:E( "Hello World 2") - end, {}, 2 - ) - -collectgarbage() - +--- Simple function scheduling +-- +-- === +-- +-- Author: FlightControl +-- Date Created: 12 Dec 2016 +-- +-- # Situation +-- Uses the Tracing functions from BASE within the DCS.log file. Check the DCS.log file for the results. +-- Create a new SCHEDULER object. +-- Check the DCS.log. +-- +-- # Test cases: +-- +-- 1. The log should contain a "Hello World" line that is fired off 10 seconds after mission start. +-- +-- +-- # Status: TESTED - 12 Dec 2016 + +local TestScheduler = SCHEDULER:New( nil, + function() + BASE:E( "Hello World 1") + end, {}, 1 + ) + +SCHEDULER:New( nil, + function() + BASE:E( "Hello World 2") + end, {}, 2 + ) + +collectgarbage() + diff --git a/SCH - Scheduler/SCH-000 - Simple Scheduling/SCH-000 - Simple Scheduling.miz b/SCH - Scheduler/SCH-000 - Simple Scheduling/SCH-000 - Simple Scheduling.miz index 32bbe558b8..16f1e00065 100644 Binary files a/SCH - Scheduler/SCH-000 - Simple Scheduling/SCH-000 - Simple Scheduling.miz and b/SCH - Scheduler/SCH-000 - Simple Scheduling/SCH-000 - Simple Scheduling.miz differ diff --git a/SCH - Scheduler/SCH-001 - Simple Object Scheduling/SCH-001 - Simple Object Scheduling.lua b/SCH - Scheduler/SCH-001 - Simple Object Scheduling/SCH-001 - Simple Object Scheduling.lua index e759b7017e..421eb9a220 100644 --- a/SCH - Scheduler/SCH-001 - Simple Object Scheduling/SCH-001 - Simple Object Scheduling.lua +++ b/SCH - Scheduler/SCH-001 - Simple Object Scheduling/SCH-001 - Simple Object Scheduling.lua @@ -1,34 +1,34 @@ ---- Simple Object Scheduling --- --- === --- --- Author: FlightControl --- Date Created: 12 Dec 2016 --- --- # Situation --- Uses the Tracing functions from BASE within the DCS.log file. Check the DCS.log file for the results. --- Create a new SCHEDULER object. --- Check the DCS.log. --- --- # Test cases: --- --- 1. Tracing of a scheduler in an Object. --- The log should contain a "Hello World" line of the object, that is fired off 1 seconds after mission start. --- --- # Status: TESTED - 12 Dec 2016 - -local TEST_BASE = { - ClassName = "TEST_BASE", - } - -function TEST_BASE:New( Message ) - self = BASE:Inherit( self, BASE:New() ) - - local TestScheduler = SCHEDULER:New( self, - function( Object, Message ) - Object:E( Message ) - end, { Message }, 1 - ) -end - +--- Simple Object Scheduling +-- +-- === +-- +-- Author: FlightControl +-- Date Created: 12 Dec 2016 +-- +-- # Situation +-- Uses the Tracing functions from BASE within the DCS.log file. Check the DCS.log file for the results. +-- Create a new SCHEDULER object. +-- Check the DCS.log. +-- +-- # Test cases: +-- +-- 1. Tracing of a scheduler in an Object. +-- The log should contain a "Hello World" line of the object, that is fired off 1 seconds after mission start. +-- +-- # Status: TESTED - 12 Dec 2016 + +local TEST_BASE = { + ClassName = "TEST_BASE", + } + +function TEST_BASE:New( Message ) + self = BASE:Inherit( self, BASE:New() ) + + local TestScheduler = SCHEDULER:New( self, + function( Object, Message ) + Object:E( Message ) + end, { Message }, 1 + ) +end + local Test = TEST_BASE:New( "Hello World" ) \ No newline at end of file diff --git a/SCH - Scheduler/SCH-001 - Simple Object Scheduling/SCH-001 - Simple Object Scheduling.miz b/SCH - Scheduler/SCH-001 - Simple Object Scheduling/SCH-001 - Simple Object Scheduling.miz index e7fc4ad4df..65736bfdf8 100644 Binary files a/SCH - Scheduler/SCH-001 - Simple Object Scheduling/SCH-001 - Simple Object Scheduling.miz and b/SCH - Scheduler/SCH-001 - Simple Object Scheduling/SCH-001 - Simple Object Scheduling.miz differ diff --git a/SCH - Scheduler/SCH-100 - Simple Repeat Scheduling/SCH-100 - Simple Repeat Scheduling.lua b/SCH - Scheduler/SCH-100 - Simple Repeat Scheduling/SCH-100 - Simple Repeat Scheduling.lua index 4e1c84183c..f36fdb29eb 100644 --- a/SCH - Scheduler/SCH-100 - Simple Repeat Scheduling/SCH-100 - Simple Repeat Scheduling.lua +++ b/SCH - Scheduler/SCH-100 - Simple Repeat Scheduling/SCH-100 - Simple Repeat Scheduling.lua @@ -1,24 +1,24 @@ ---- Simple repeat scheduling of a function. --- --- === --- --- Author: FlightControl --- Date Created: 13 Dec 2016 --- --- # Situation --- Uses the Tracing functions from BASE within the DCS.log file. Check the DCS.log file for the results. --- Create a new SCHEDULER object. --- Check the DCS.log. --- --- # Test cases: --- --- 1. The log should contain "Hello World Repeat" lines that is fired off 1 second after mission start and is repeated every 1 seconds. --- --- --- # Status: TESTED - 13 Dec 2016 - -local TestScheduler = SCHEDULER:New( nil, - function() - BASE:E( "Hello World Repeat") - end, {}, 1, 1 +--- Simple repeat scheduling of a function. +-- +-- === +-- +-- Author: FlightControl +-- Date Created: 13 Dec 2016 +-- +-- # Situation +-- Uses the Tracing functions from BASE within the DCS.log file. Check the DCS.log file for the results. +-- Create a new SCHEDULER object. +-- Check the DCS.log. +-- +-- # Test cases: +-- +-- 1. The log should contain "Hello World Repeat" lines that is fired off 1 second after mission start and is repeated every 1 seconds. +-- +-- +-- # Status: TESTED - 13 Dec 2016 + +local TestScheduler = SCHEDULER:New( nil, + function() + BASE:E( "Hello World Repeat") + end, {}, 1, 1 ) \ No newline at end of file diff --git a/SCH - Scheduler/SCH-100 - Simple Repeat Scheduling/SCH-100 - Simple Repeat Scheduling.miz b/SCH - Scheduler/SCH-100 - Simple Repeat Scheduling/SCH-100 - Simple Repeat Scheduling.miz index 500c0254b1..70c6f50588 100644 Binary files a/SCH - Scheduler/SCH-100 - Simple Repeat Scheduling/SCH-100 - Simple Repeat Scheduling.miz and b/SCH - Scheduler/SCH-100 - Simple Repeat Scheduling/SCH-100 - Simple Repeat Scheduling.miz differ diff --git a/SCH - Scheduler/SCH-110 - Object Repeat Scheduling/SCH-110 - Object Repeat Scheduling.lua b/SCH - Scheduler/SCH-110 - Object Repeat Scheduling/SCH-110 - Object Repeat Scheduling.lua index 67f721125b..185b25927a 100644 --- a/SCH - Scheduler/SCH-110 - Object Repeat Scheduling/SCH-110 - Object Repeat Scheduling.lua +++ b/SCH - Scheduler/SCH-110 - Object Repeat Scheduling/SCH-110 - Object Repeat Scheduling.lua @@ -1,44 +1,44 @@ ---- Object Repeat Scheduling. --- --- === --- --- Author: FlightControl --- Date Created: 13 Dec 2016 --- --- # Situation --- Uses the Tracing functions from BASE within the DCS.log file. Check the DCS.log file for the results. --- Create a new SCHEDULER object. --- Check the DCS.log. --- --- Three Test objects are created. --- --- # Test cases: --- --- 1. Object Test1 should start after 1 seconds showing every second "Hello World Repeat 1". --- 2. Object Test2 should start after 2 seconds showing every 2 seconds "Hello World Repeat 2" and stop after one minute. --- 3. Object Test3 should start after 10 seconds showing with a 10 seconds randomized interval of 10 seconds "Hello World Repeat 3" and stop after one minute. --- --- # Status: TESTED - 13 Dec 2016 - -local TEST_BASE = { - ClassName = "TEST_BASE", - } - -function TEST_BASE:New( Message, Start, Repeat, Randomize, Stop ) - self = BASE:Inherit( self, BASE:New() ) - - self.TestScheduler = SCHEDULER:New( self, - function( Object, Message ) - Object:E( Message ) - end, { Message }, Start, Repeat, Randomize, Stop - ) - return self -end - -do -local Test1 = TEST_BASE:New( "Hello World Repeat 1", 1, 1 ) -end - -local Test2 = TEST_BASE:New( "Hello World Repeat 2", 2, 2, 0, 60 ) - -local Test3 = TEST_BASE:New( "Hello World Repeat 3", 10, 10, 1.0, 60 ) +--- Object Repeat Scheduling. +-- +-- === +-- +-- Author: FlightControl +-- Date Created: 13 Dec 2016 +-- +-- # Situation +-- Uses the Tracing functions from BASE within the DCS.log file. Check the DCS.log file for the results. +-- Create a new SCHEDULER object. +-- Check the DCS.log. +-- +-- Three Test objects are created. +-- +-- # Test cases: +-- +-- 1. Object Test1 should start after 1 seconds showing every second "Hello World Repeat 1". +-- 2. Object Test2 should start after 2 seconds showing every 2 seconds "Hello World Repeat 2" and stop after one minute. +-- 3. Object Test3 should start after 10 seconds showing with a 10 seconds randomized interval of 10 seconds "Hello World Repeat 3" and stop after one minute. +-- +-- # Status: TESTED - 13 Dec 2016 + +local TEST_BASE = { + ClassName = "TEST_BASE", + } + +function TEST_BASE:New( Message, Start, Repeat, Randomize, Stop ) + self = BASE:Inherit( self, BASE:New() ) + + self.TestScheduler = SCHEDULER:New( self, + function( Object, Message ) + Object:E( Message ) + end, { Message }, Start, Repeat, Randomize, Stop + ) + return self +end + +do +local Test1 = TEST_BASE:New( "Hello World Repeat 1", 1, 1 ) +end + +local Test2 = TEST_BASE:New( "Hello World Repeat 2", 2, 2, 0, 60 ) + +local Test3 = TEST_BASE:New( "Hello World Repeat 3", 10, 10, 1.0, 60 ) diff --git a/SCH - Scheduler/SCH-110 - Object Repeat Scheduling/SCH-110 - Object Repeat Scheduling.miz b/SCH - Scheduler/SCH-110 - Object Repeat Scheduling/SCH-110 - Object Repeat Scheduling.miz index 758dd72b7b..173735508c 100644 Binary files a/SCH - Scheduler/SCH-110 - Object Repeat Scheduling/SCH-110 - Object Repeat Scheduling.miz and b/SCH - Scheduler/SCH-110 - Object Repeat Scheduling/SCH-110 - Object Repeat Scheduling.miz differ diff --git a/SCH - Scheduler/SCH-200 - Simple Repeat Scheduling Stop and Start/SCH-200 - Simple Repeat Scheduling Stop and Start.lua b/SCH - Scheduler/SCH-200 - Simple Repeat Scheduling Stop and Start/SCH-200 - Simple Repeat Scheduling Stop and Start.lua index 107ba46d1c..06b3a86000 100644 --- a/SCH - Scheduler/SCH-200 - Simple Repeat Scheduling Stop and Start/SCH-200 - Simple Repeat Scheduling Stop and Start.lua +++ b/SCH - Scheduler/SCH-200 - Simple Repeat Scheduling Stop and Start/SCH-200 - Simple Repeat Scheduling Stop and Start.lua @@ -1,41 +1,41 @@ ---- Simple repeat scheduling of a function. --- --- === --- --- Author: FlightControl --- Date Created: 14 Dec 2016 --- --- # Situation --- Uses the Tracing functions from BASE within the DCS.log file. Check the DCS.log file for the results. --- Create a new SCHEDULER object. --- Check the DCS.log. --- --- Start a schedule called TestScheduler. TestScheduler will repeat the words "Hello World Repeat" every second in the log. --- After 10 seconds, TestScheduler will stop the scheduler. --- After 20 seconds, TestScheduler will restart the scheduler. --- --- # Test cases: --- --- 1. Check that the "Hello World Repeat" lines are consistent with the scheduling timing. They should stop showing after 10 seconds, and restart after 20 seconds. --- --- --- # Status: TESTED - 14 Dec 2016 - -local TestScheduler = SCHEDULER:New( nil, - function() - BASE:E( timer.getTime() .. " - Hello World Repeat") - end, {}, 1, 1 - ) - -SCHEDULER:New( nil, - function() - TestScheduler:Stop() - end, {}, 10 - ) - -SCHEDULER:New( nil, - function() - TestScheduler:Start() - end, {}, 20 - ) +--- Simple repeat scheduling of a function. +-- +-- === +-- +-- Author: FlightControl +-- Date Created: 14 Dec 2016 +-- +-- # Situation +-- Uses the Tracing functions from BASE within the DCS.log file. Check the DCS.log file for the results. +-- Create a new SCHEDULER object. +-- Check the DCS.log. +-- +-- Start a schedule called TestScheduler. TestScheduler will repeat the words "Hello World Repeat" every second in the log. +-- After 10 seconds, TestScheduler will stop the scheduler. +-- After 20 seconds, TestScheduler will restart the scheduler. +-- +-- # Test cases: +-- +-- 1. Check that the "Hello World Repeat" lines are consistent with the scheduling timing. They should stop showing after 10 seconds, and restart after 20 seconds. +-- +-- +-- # Status: TESTED - 14 Dec 2016 + +local TestScheduler = SCHEDULER:New( nil, + function() + BASE:E( timer.getTime() .. " - Hello World Repeat") + end, {}, 1, 1 + ) + +SCHEDULER:New( nil, + function() + TestScheduler:Stop() + end, {}, 10 + ) + +SCHEDULER:New( nil, + function() + TestScheduler:Start() + end, {}, 20 + ) \ No newline at end of file diff --git a/SCH - Scheduler/SCH-200 - Simple Repeat Scheduling Stop and Start/SCH-200 - Simple Repeat Scheduling Stop and Start.miz b/SCH - Scheduler/SCH-200 - Simple Repeat Scheduling Stop and Start/SCH-200 - Simple Repeat Scheduling Stop and Start.miz index 85abf8f2f0..45c1779133 100644 Binary files a/SCH - Scheduler/SCH-200 - Simple Repeat Scheduling Stop and Start/SCH-200 - Simple Repeat Scheduling Stop and Start.miz and b/SCH - Scheduler/SCH-200 - Simple Repeat Scheduling Stop and Start/SCH-200 - Simple Repeat Scheduling Stop and Start.miz differ diff --git a/SCH - Scheduler/SCH-300 - GC Simple Object Scheduling/SCH-300 - GC Simple Object Scheduling.lua b/SCH - Scheduler/SCH-300 - GC Simple Object Scheduling/SCH-300 - GC Simple Object Scheduling.lua index f5e5dab2d3..5d6dc7f83f 100644 --- a/SCH - Scheduler/SCH-300 - GC Simple Object Scheduling/SCH-300 - GC Simple Object Scheduling.lua +++ b/SCH - Scheduler/SCH-300 - GC Simple Object Scheduling/SCH-300 - GC Simple Object Scheduling.lua @@ -1,60 +1,60 @@ ---- No Object Scheduling because of garbage collect and Object nillification. --- --- === --- --- Author: FlightControl --- Date Created: 12 Dec 2016 --- --- # Situation --- Uses the Tracing functions from BASE within the DCS.log file. Check the DCS.log file for the results. --- Create a new SCHEDULER object. --- Check the DCS.log. --- --- A Test object is created. --- It is nillified directly after the Schedule has been planned. --- There should be no schedule fired. --- The Test object should be garbage collected! --- --- THIS IS A VERY IMPORTANT TEST! --- --- # Test cases: --- --- 1. No schedule should be fired! The destructors of the Test object should be shown. --- 2. Commend the nillification of the Test object in the source, and test again. --- The schedule should now be fired and Hello World should be logged through the Test object. --- --- # Status: STARTED - 12 Dec 2016 - -local TEST_BASE = { - ClassName = "TEST_BASE", - } - -function TEST_BASE:New( Message ) - self = BASE:Inherit( self, BASE:New() ) - - self.TestScheduler = SCHEDULER:New( self, - function( Object, Message ) - Object:E( Message ) - end, { Message }, 1 - ) - return self -end - -do -local Test1 = TEST_BASE:New( "Hello World Test 1" ) -Test1 = nil -BASE:E( Test1 ) -end - -local Test2 = TEST_BASE:New( "Hello World Test 2" ) -BASE:E( Test2 ) - -local Test3 = TEST_BASE:New( "Hello World Test 3" ) -Test3 = nil -BASE:E( Test3 ) - -collectgarbage() - -BASE:E( "Collect Garbage executed." ) -BASE:E( "You should only see a Hello Worlld message for Test 2!" ) +--- No Object Scheduling because of garbage collect and Object nillification. +-- +-- === +-- +-- Author: FlightControl +-- Date Created: 12 Dec 2016 +-- +-- # Situation +-- Uses the Tracing functions from BASE within the DCS.log file. Check the DCS.log file for the results. +-- Create a new SCHEDULER object. +-- Check the DCS.log. +-- +-- A Test object is created. +-- It is nillified directly after the Schedule has been planned. +-- There should be no schedule fired. +-- The Test object should be garbage collected! +-- +-- THIS IS A VERY IMPORTANT TEST! +-- +-- # Test cases: +-- +-- 1. No schedule should be fired! The destructors of the Test object should be shown. +-- 2. Commend the nillification of the Test object in the source, and test again. +-- The schedule should now be fired and Hello World should be logged through the Test object. +-- +-- # Status: STARTED - 12 Dec 2016 + +local TEST_BASE = { + ClassName = "TEST_BASE", + } + +function TEST_BASE:New( Message ) + self = BASE:Inherit( self, BASE:New() ) + + self.TestScheduler = SCHEDULER:New( self, + function( Object, Message ) + Object:E( Message ) + end, { Message }, 1 + ) + return self +end + +do +local Test1 = TEST_BASE:New( "Hello World Test 1" ) +Test1 = nil +BASE:E( Test1 ) +end + +local Test2 = TEST_BASE:New( "Hello World Test 2" ) +BASE:E( Test2 ) + +local Test3 = TEST_BASE:New( "Hello World Test 3" ) +Test3 = nil +BASE:E( Test3 ) + +collectgarbage() + +BASE:E( "Collect Garbage executed." ) +BASE:E( "You should only see a Hello Worlld message for Test 2!" ) BASE:E( "Check if Test 1 and Test 3 are garbage collected!" ) \ No newline at end of file diff --git a/SCH - Scheduler/SCH-300 - GC Simple Object Scheduling/SCH-300 - GC Simple Object Scheduling.miz b/SCH - Scheduler/SCH-300 - GC Simple Object Scheduling/SCH-300 - GC Simple Object Scheduling.miz index be82aa417e..294297da5d 100644 Binary files a/SCH - Scheduler/SCH-300 - GC Simple Object Scheduling/SCH-300 - GC Simple Object Scheduling.miz and b/SCH - Scheduler/SCH-300 - GC Simple Object Scheduling/SCH-300 - GC Simple Object Scheduling.miz differ diff --git a/SCH - Scheduler/SCH-310 - GC Object Repeat Scheduling/SCH-310 - GC Object Repeat Scheduling.lua b/SCH - Scheduler/SCH-310 - GC Object Repeat Scheduling/SCH-310 - GC Object Repeat Scheduling.lua index 54faeb6024..8c3e243a5b 100644 --- a/SCH - Scheduler/SCH-310 - GC Object Repeat Scheduling/SCH-310 - GC Object Repeat Scheduling.lua +++ b/SCH - Scheduler/SCH-310 - GC Object Repeat Scheduling/SCH-310 - GC Object Repeat Scheduling.lua @@ -1,80 +1,80 @@ ---- Object Repeat Scheduling. --- --- === --- --- Author: FlightControl --- Date Created: 13 Dec 2016 --- --- # Situation --- Three objects Test1, Test2, Test 3 are created with schedule a function. --- After 15 seconds, Test1 is nillified and Garbage Collect is done. --- After 30 seconds, Test2 is nillified and Garbage Collect is done. --- After 45 seconds, Test3 is nillified and Garbage Collect is done. --- Uses the Tracing functions from BASE within the DCS.log file. Check the DCS.log file for the results. --- Create a new SCHEDULER object. --- Check the DCS.log. --- --- --- Three Test objects are created. --- --- # Test cases: --- --- 1. Object Test1 should start after 1 seconds showing every second "Hello World Repeat 1". --- 2. Object Test2 should start after 2 seconds showing every 2 seconds "Hello World Repeat 2" and stop after one minute. --- 3. Object Test3 should start after 10 seconds showing with a 10 seconds randomized interval of 10 seconds "Hello World Repeat 3" and stop after one minute. --- 4. After 15 seconds, Test1 should stop working. No "Hello World Repeat 1" may be shown after 15 seconds. --- 5. After 30 seconds, Test2 should stop working. No "Hello World Repeat 2" may be shown after 30 seconds. --- 6. After 45 seconds, Test3 should stop working. No "Hello World Repeat 3" may be shown after 45 seconds. --- --- # Status: TESTED - 13 Dec 2016 - -local TEST_BASE = { - ClassName = "TEST_BASE", - } - -function TEST_BASE:New( Message, Start, Repeat, Randomize, Stop ) - self = BASE:Inherit( self, BASE:New() ) - - self.TestScheduler = SCHEDULER:New( self, - function( Object, Message ) - Object:E( Message ) - end, { Message }, Start, Repeat, Randomize, Stop - ) - return self -end - -do -local Test1 = TEST_BASE:New( "Hello World Repeat 1", 1, 1 ) - --- Nillify Test1 after 15 seconds and garbage collect. -local Nil1 = SCHEDULER:New( nil, - function() - BASE:E( "Nillify Test1 and Garbage Collect" ) - Test1 = nil - collectgarbage() - end, {}, 15 ) - -end - -local Test2 = TEST_BASE:New( "Hello World Repeat 2", 2, 2, 0, 60 ) - - -local Test3 = TEST_BASE:New( "Hello World Repeat 3", 10, 10, 1.0, 60 ) - --- Nillify Test2 after 30 seconds and garbage collect. -local Nil2 = SCHEDULER:New( nil, - function() - BASE:E( "Nillify Test2 and Garbage Collect" ) - Test2 = nil - collectgarbage() - end, {}, 30 ) - --- Nillify Test3 after 45 seconds and garbage collect. -local Nil3 = SCHEDULER:New( nil, - function() - BASE:E( "Nillify Test3 and Garbage Collect" ) - Test3 = nil - collectgarbage() - end, {}, 45 ) - -collectgarbage() +--- Object Repeat Scheduling. +-- +-- === +-- +-- Author: FlightControl +-- Date Created: 13 Dec 2016 +-- +-- # Situation +-- Three objects Test1, Test2, Test 3 are created with schedule a function. +-- After 15 seconds, Test1 is nillified and Garbage Collect is done. +-- After 30 seconds, Test2 is nillified and Garbage Collect is done. +-- After 45 seconds, Test3 is nillified and Garbage Collect is done. +-- Uses the Tracing functions from BASE within the DCS.log file. Check the DCS.log file for the results. +-- Create a new SCHEDULER object. +-- Check the DCS.log. +-- +-- +-- Three Test objects are created. +-- +-- # Test cases: +-- +-- 1. Object Test1 should start after 1 seconds showing every second "Hello World Repeat 1". +-- 2. Object Test2 should start after 2 seconds showing every 2 seconds "Hello World Repeat 2" and stop after one minute. +-- 3. Object Test3 should start after 10 seconds showing with a 10 seconds randomized interval of 10 seconds "Hello World Repeat 3" and stop after one minute. +-- 4. After 15 seconds, Test1 should stop working. No "Hello World Repeat 1" may be shown after 15 seconds. +-- 5. After 30 seconds, Test2 should stop working. No "Hello World Repeat 2" may be shown after 30 seconds. +-- 6. After 45 seconds, Test3 should stop working. No "Hello World Repeat 3" may be shown after 45 seconds. +-- +-- # Status: TESTED - 13 Dec 2016 + +local TEST_BASE = { + ClassName = "TEST_BASE", + } + +function TEST_BASE:New( Message, Start, Repeat, Randomize, Stop ) + self = BASE:Inherit( self, BASE:New() ) + + self.TestScheduler = SCHEDULER:New( self, + function( Object, Message ) + Object:E( Message ) + end, { Message }, Start, Repeat, Randomize, Stop + ) + return self +end + +do +local Test1 = TEST_BASE:New( "Hello World Repeat 1", 1, 1 ) + +-- Nillify Test1 after 15 seconds and garbage collect. +local Nil1 = SCHEDULER:New( nil, + function() + BASE:E( "Nillify Test1 and Garbage Collect" ) + Test1 = nil + collectgarbage() + end, {}, 15 ) + +end + +local Test2 = TEST_BASE:New( "Hello World Repeat 2", 2, 2, 0, 60 ) + + +local Test3 = TEST_BASE:New( "Hello World Repeat 3", 10, 10, 1.0, 60 ) + +-- Nillify Test2 after 30 seconds and garbage collect. +local Nil2 = SCHEDULER:New( nil, + function() + BASE:E( "Nillify Test2 and Garbage Collect" ) + Test2 = nil + collectgarbage() + end, {}, 30 ) + +-- Nillify Test3 after 45 seconds and garbage collect. +local Nil3 = SCHEDULER:New( nil, + function() + BASE:E( "Nillify Test3 and Garbage Collect" ) + Test3 = nil + collectgarbage() + end, {}, 45 ) + +collectgarbage() diff --git a/SCH - Scheduler/SCH-310 - GC Object Repeat Scheduling/SCH-310 - GC Object Repeat Scheduling.miz b/SCH - Scheduler/SCH-310 - GC Object Repeat Scheduling/SCH-310 - GC Object Repeat Scheduling.miz index 9e9ec9ac53..513d421a12 100644 Binary files a/SCH - Scheduler/SCH-310 - GC Object Repeat Scheduling/SCH-310 - GC Object Repeat Scheduling.miz and b/SCH - Scheduler/SCH-310 - GC Object Repeat Scheduling/SCH-310 - GC Object Repeat Scheduling.miz differ diff --git a/SCO - Scoring/SCO-100 - Scoring Demo/SCO-100 - Scoring Demo.lua b/SCO - Scoring/SCO-100 - Scoring Demo/SCO-100 - Scoring Demo.lua index a64c35bdf2..c63131658c 100644 --- a/SCO - Scoring/SCO-100 - Scoring Demo/SCO-100 - Scoring Demo.lua +++ b/SCO - Scoring/SCO-100 - Scoring Demo/SCO-100 - Scoring Demo.lua @@ -1,38 +1,38 @@ ---- --- Name: SCO-100 - Scoring Demo --- Author: FlightControl --- Date Created: 21 Feb 2017 --- --- # Situation: --- --- A shooting range has been setup. Fly the Ka-50 or the Su-25T to the statics and units located near the airport, and shoot them. --- --- # Test cases: --- --- 1. Observe the scoring granted to your flight when you hit and kill targets. - - -HQ = GROUP:FindByName( "HQ", "Bravo HQ" ) - -CommandCenter = COMMANDCENTER:New( HQ, "Bravo" ) - -Scoring = SCORING:New( "Shooting Range 1" ) - -Scoring:SetScaleDestroyScore( 10 ) - -Scoring:SetScaleDestroyPenalty( 40 ) - -Scoring:AddUnitScore( UNIT:FindByName( "Unit #001" ), 200 ) - --- Test for zone scores. - --- This one is to test scoring on normal units. -ShootingRangeZone = ZONE:New( "ScoringZone1" ) -Scoring:AddZoneScore( ShootingRangeZone, 200 ) - --- This one is to test scoring on scenery. --- Note that you can only destroy scenery with heavy weapons. -SceneryZone = ZONE:New( "ScoringZone2" ) -Scoring:AddZoneScore( SceneryZone, 200 ) - -Scoring:AddStaticScore(STATIC:FindByName( "Shooting Range #010" ), 100 ) +--- +-- Name: SCO-100 - Scoring Demo +-- Author: FlightControl +-- Date Created: 21 Feb 2017 +-- +-- # Situation: +-- +-- A shooting range has been setup. Fly the Ka-50 or the Su-25T to the statics and units located near the airport, and shoot them. +-- +-- # Test cases: +-- +-- 1. Observe the scoring granted to your flight when you hit and kill targets. + + +HQ = GROUP:FindByName( "HQ", "Bravo HQ" ) + +CommandCenter = COMMANDCENTER:New( HQ, "Bravo" ) + +Scoring = SCORING:New( "Shooting Range 1" ) + +Scoring:SetScaleDestroyScore( 10 ) + +Scoring:SetScaleDestroyPenalty( 40 ) + +Scoring:AddUnitScore( UNIT:FindByName( "Unit #001" ), 200 ) + +-- Test for zone scores. + +-- This one is to test scoring on normal units. +ShootingRangeZone = ZONE:New( "ScoringZone1" ) +Scoring:AddZoneScore( ShootingRangeZone, 200 ) + +-- This one is to test scoring on scenery. +-- Note that you can only destroy scenery with heavy weapons. +SceneryZone = ZONE:New( "ScoringZone2" ) +Scoring:AddZoneScore( SceneryZone, 200 ) + +Scoring:AddStaticScore(STATIC:FindByName( "Shooting Range #010" ), 100 ) diff --git a/SCO - Scoring/SCO-100 - Scoring Demo/SCO-100 - Scoring Demo.miz b/SCO - Scoring/SCO-100 - Scoring Demo/SCO-100 - Scoring Demo.miz index e252c73698..1058669cae 100644 Binary files a/SCO - Scoring/SCO-100 - Scoring Demo/SCO-100 - Scoring Demo.miz and b/SCO - Scoring/SCO-100 - Scoring Demo/SCO-100 - Scoring Demo.miz differ diff --git a/SCO - Scoring/SCO-101 - Scoring Client to Client/SCO-101 - Scoring Client to Client.lua b/SCO - Scoring/SCO-101 - Scoring Client to Client/SCO-101 - Scoring Client to Client.lua index 176e709ab2..76213478db 100644 --- a/SCO - Scoring/SCO-101 - Scoring Client to Client/SCO-101 - Scoring Client to Client.lua +++ b/SCO - Scoring/SCO-101 - Scoring Client to Client/SCO-101 - Scoring Client to Client.lua @@ -1,21 +1,21 @@ ---- --- Name: SCO-101 - Scoring Client to Client --- Author: FlightControl --- Date Created: 24 Feb 2017 --- --- # Situation: --- --- A shooting range has been setup to test client to client scoring. --- --- # Test cases: --- --- 1. Observe the scoring granted to your flight when you hit and kill other clients. - - -HQ = GROUP:FindByName( "HQ", "Bravo HQ" ) - -CommandCenter = COMMANDCENTER:New( HQ, "Lima" ) - -Scoring = SCORING:New( "Detect Demo" ) - - +--- +-- Name: SCO-101 - Scoring Client to Client +-- Author: FlightControl +-- Date Created: 24 Feb 2017 +-- +-- # Situation: +-- +-- A shooting range has been setup to test client to client scoring. +-- +-- # Test cases: +-- +-- 1. Observe the scoring granted to your flight when you hit and kill other clients. + + +HQ = GROUP:FindByName( "HQ", "Bravo HQ" ) + +CommandCenter = COMMANDCENTER:New( HQ, "Lima" ) + +Scoring = SCORING:New( "Detect Demo" ) + + diff --git a/SCO - Scoring/SCO-101 - Scoring Client to Client/SCO-101 - Scoring Client to Client.miz b/SCO - Scoring/SCO-101 - Scoring Client to Client/SCO-101 - Scoring Client to Client.miz index f6ee0f196c..9a827978d9 100644 Binary files a/SCO - Scoring/SCO-101 - Scoring Client to Client/SCO-101 - Scoring Client to Client.miz and b/SCO - Scoring/SCO-101 - Scoring Client to Client/SCO-101 - Scoring Client to Client.miz differ diff --git a/SCO - Scoring/SCO-200 - Telemetry/SCO-200 - Telemetry.lua b/SCO - Scoring/SCO-200 - Telemetry/SCO-200 - Telemetry.lua index 0161bdd339..84d8ae6f59 100644 --- a/SCO - Scoring/SCO-200 - Telemetry/SCO-200 - Telemetry.lua +++ b/SCO - Scoring/SCO-200 - Telemetry/SCO-200 - Telemetry.lua @@ -1,41 +1,41 @@ ---- --- Name: SCO-200 - Telemetry --- Author: FlightControl --- Date Created: 24 Sep 2017 --- --- # Situation: --- --- A shooting range has been setup. Fly the Ka-50 or the Su-25T to the statics and objects located near the airport, and shoot them. --- --- # Test cases: --- --- 1. Observe the scoring granted to your flight when you hit and kill targets. --- 2. Check the scoring telemetry communicated to the website. - - -HQ = GROUP:FindByName( "HQ", "Bravo HQ" ) - -CommandCenter = COMMANDCENTER:New( HQ, "Bravo" ) - -Scoring = SCORING:New( "Shooting Range 1" ) - -Scoring:SetTelemetryServer( "96.49.78.227", 5010 ) - -Scoring:SetScaleDestroyScore( 10 ) - -Scoring:SetScaleDestroyPenalty( 40 ) - -Scoring:AddUnitScore( UNIT:FindByName( "Unit #001" ), 200 ) - --- Test for zone scores. - --- This one is to test scoring on normal units. -ShootingRangeZone = ZONE:New( "ScoringZone1" ) -Scoring:AddZoneScore( ShootingRangeZone, 200 ) - --- This one is to test scoring on scenery. --- Note that you can only destroy scenery with heavy weapons. -SceneryZone = ZONE:New( "ScoringZone2" ) -Scoring:AddZoneScore( SceneryZone, 200 ) - -Scoring:AddStaticScore(STATIC:FindByName( "Shooting Range #010" ), 100 ) +--- +-- Name: SCO-200 - Telemetry +-- Author: FlightControl +-- Date Created: 24 Sep 2017 +-- +-- # Situation: +-- +-- A shooting range has been setup. Fly the Ka-50 or the Su-25T to the statics and objects located near the airport, and shoot them. +-- +-- # Test cases: +-- +-- 1. Observe the scoring granted to your flight when you hit and kill targets. +-- 2. Check the scoring telemetry communicated to the website. + + +HQ = GROUP:FindByName( "HQ", "Bravo HQ" ) + +CommandCenter = COMMANDCENTER:New( HQ, "Bravo" ) + +Scoring = SCORING:New( "Shooting Range 1" ) + +Scoring:SetTelemetryServer( "96.49.78.227", 5010 ) + +Scoring:SetScaleDestroyScore( 10 ) + +Scoring:SetScaleDestroyPenalty( 40 ) + +Scoring:AddUnitScore( UNIT:FindByName( "Unit #001" ), 200 ) + +-- Test for zone scores. + +-- This one is to test scoring on normal units. +ShootingRangeZone = ZONE:New( "ScoringZone1" ) +Scoring:AddZoneScore( ShootingRangeZone, 200 ) + +-- This one is to test scoring on scenery. +-- Note that you can only destroy scenery with heavy weapons. +SceneryZone = ZONE:New( "ScoringZone2" ) +Scoring:AddZoneScore( SceneryZone, 200 ) + +Scoring:AddStaticScore(STATIC:FindByName( "Shooting Range #010" ), 100 ) diff --git a/SCO - Scoring/SCO-200 - Telemetry/SCO-200 - Telemetry.miz b/SCO - Scoring/SCO-200 - Telemetry/SCO-200 - Telemetry.miz index 1c8c5a3e33..39b42a277d 100644 Binary files a/SCO - Scoring/SCO-200 - Telemetry/SCO-200 - Telemetry.miz and b/SCO - Scoring/SCO-200 - Telemetry/SCO-200 - Telemetry.miz differ diff --git a/SCO - Scoring/SCO-500 - Scoring Multi Player Demo Mission 1/SCO-500 - Scoring Multi Player Demo Mission 1.lua b/SCO - Scoring/SCO-500 - Scoring Multi Player Demo Mission 1/SCO-500 - Scoring Multi Player Demo Mission 1.lua index 127735351b..078bef2e8e 100644 --- a/SCO - Scoring/SCO-500 - Scoring Multi Player Demo Mission 1/SCO-500 - Scoring Multi Player Demo Mission 1.lua +++ b/SCO - Scoring/SCO-500 - Scoring Multi Player Demo Mission 1/SCO-500 - Scoring Multi Player Demo Mission 1.lua @@ -1,139 +1,139 @@ ---- --- Name: SCO-500 - Scoring Multi Player Demo Mission 1 --- Author: Pikey and FlightControl --- Date Created: 1 Mar 2017 --- --- # Situation: --- --- A demo mission for the scoring. Read the briefing and have fun. --- --- # Test cases: --- --- 1. Observe the scoring granted to your flight when you hit and kill targets. - --- Define the patrol zones -BlueCapZone = ZONE_POLYGON:New( "BlueCapZone", GROUP:FindByName( "Blue CAP Zone Patrol" ) ) -RedCapZone = ZONE_POLYGON:New( "RedCapZone", GROUP:FindByName( "Red CAP Zone Patrol" ) ) - --- Define the engage zones -BlueEngageZone = ZONE_POLYGON:New( "BlueEngageZone", GROUP:FindByName( "Blue CAP Zone Engage" ) ) -RedEngageZone = ZONE_POLYGON:New( "RedEngageZone", GROUP:FindByName( "Red CAP Zone Engage" ) ) - --- Define the Spawn zones for ground vehicles -BlueSpawnGroundZone = ZONE_POLYGON:New( "BlueSpawnGroundZone", GROUP:FindByName( "Blue Spawn Zone" ) ) ---RedSpawnGroundZone = ZONE_POLYGON:New( "RedSpawnGroundZone", GROUP:FindByName( "Red Spawn Zone" ) ) - -RedSpawnGroundZone = ZONE:New( "Red Spawn Zone" ) - --- Define the Scoring zones that define the shelters -BlueShelterZone = ZONE_POLYGON:New( "Blue Shelters", GROUP:FindByName( "Blue Shelters" ) ) -RedShelterZone = ZONE_POLYGON:New( "Red Shelters", GROUP:FindByName( "Red Shelters" ) ) - --- Define the Set of Clients that are used for the AI Balancers -BluePlanesClientSet = SET_CLIENT:New():FilterCoalitions( "blue" ):FilterCategories( "plane" ):FilterPrefixes( "Blue Player") -RedPlanesClientSet = SET_CLIENT:New():FilterCoalitions( "red" ):FilterCategories( "plane" ):FilterPrefixes( "Red Player") - --- Define the Spawn objects for the AI planes -BluePlanesSpawn = SPAWN:New( "BlueAICAP" ):InitCleanUp( 120 ):InitLimit( 5, 0 ) -RedPlanesSpawn = SPAWN:New( "RedAICAP" ):InitCleanUp( 120 ):InitLimit( 5, 0 ) - --- Define the AI Balancers for the planes -BlueAIB = AI_BALANCER:New( BluePlanesClientSet, BluePlanesSpawn ):InitSpawnInterval( 60, 1200 ) -RedAIB = AI_BALANCER:New( RedPlanesClientSet, RedPlanesSpawn ):InitSpawnInterval( 60, 1200 ) - --- Define the Spawn objects for the airbase defenses -BlueAirbaseDefense1Spawn = SPAWN:New( "Blue Airbase Defense 1" ):InitLimit( 10, 10 ):SpawnScheduled( 60, 0 ) -BlueAirbaseDefense2Spawn = SPAWN:New( "Blue Airbase Defense 2" ):InitLimit( 2, 10 ):SpawnScheduled( 60, 0 ) -RedAirbaseDefense1Spawn = SPAWN:New( "Red Airbase Defense 1" ):InitLimit( 10, 10 ):SpawnScheduled( 60, 0 ) -RedAirbaseDefense2Spawn = SPAWN:New( "Red Airbase Defense 2" ):InitLimit( 2, 10 ):SpawnScheduled( 60, 0 ) - --- Define the ground forces spawning engines... - --- First define the template arrays. -BlueGroundTemplates = { "Blue Ground Forces 1", "Blue Ground Forces 2", "Blue Ground Forces 3" } -RedGroundTemplates = { "Red Ground Forces 2", "Red Ground Forces 2", "Red Ground Forces 3" } - --- New we are using these templates to define the spawn objects for the ground forces. --- We spawn them at random places into the define zone. -BlueGroundSpawn = SPAWN - :New( "Blue Ground Forces" ) - :InitLimit( 12, 30 ) - :InitRandomizeZones( { BlueSpawnGroundZone } ) - :InitRandomizeTemplate( BlueGroundTemplates ) - :SpawnScheduled( 60, 0.2 ) - -RedGroundSpawn = SPAWN - :New( "Red Ground Forces" ) - :InitLimit( 12, 30 ) - :InitRandomizeTemplate( RedGroundTemplates ) - :InitRandomizeZones( { RedSpawnGroundZone } ) - :SpawnScheduled( 60, 0.2 ) - - - -BlueCap = {} -RedCap = {} - --- Define the OnAfterSpawned events of the AI balancer Spawn Groups -function BlueAIB:OnAfterSpawned( SetGroup, From, Event, To, AIGroup ) - if AIGroup then - BlueCap[AIGroup] = BlueCap[AIGroup] or AI_CAP_ZONE:New( BlueCapZone, 500, 3000, 450, 1200 ) - local Cap = BlueCap[AIGroup] -- AI.AI_CAP#AI_CAP_ZONE - - Cap:ManageFuel( 0.4, 180 ) - Cap:SetEngageZone( BlueEngageZone ) - Cap:SetControllable( AIGroup ) - Cap:Start() - end -end - -function RedAIB:OnAfterSpawned( SetGroup, From, Event, To, AIGroup ) - - if AIGroup then - RedCap[AIGroup] = RedCap[AIGroup] or AI_CAP_ZONE:New( RedCapZone, 500, 3000, 450, 1200 ) - local Cap = RedCap[AIGroup] -- AI.AI_CAP#AI_CAP_ZONE - - Cap:ManageFuel( 0.4, 180 ) - Cap:SetEngageZone( BlueEngageZone ) - Cap:SetControllable( AIGroup ) - Cap:Start() - end -end - - - - --- Okay, now that we defined all this stuff, now make the SCORING setup ... - --- First define a Scoring object -local Scoring = SCORING:New( "SCO-500 - Scoring Demonstration Mission" ) - --- Define within the scoring the shelter designated targets. -Scoring:AddZoneScore( BlueShelterZone, 50 ) -- Per shelter destroyed, 50 extra points are granted. -Scoring:AddZoneScore( RedShelterZone, 50 ) -- Per shelter destroyed, 50 extra points are granted. - --- Define the static objects that give extra scores -Scoring:AddStaticScore( STATIC:FindByName( "Red Factory 1"), 100 ) -Scoring:AddStaticScore( STATIC:FindByName( "Red Factory 2"), 100 ) -Scoring:AddStaticScore( STATIC:FindByName( "Red Factory 3"), 100 ) -Scoring:AddStaticScore( STATIC:FindByName( "Red Factory 4"), 100 ) - -Scoring:AddStaticScore( STATIC:FindByName( "Red Truck #001"), 80 ) -Scoring:AddStaticScore( STATIC:FindByName( "Red Truck #002"), 80 ) -Scoring:AddStaticScore( STATIC:FindByName( "Red Truck #003"), 80 ) -Scoring:AddStaticScore( STATIC:FindByName( "Red Truck #004"), 80 ) - -Scoring:AddStaticScore( STATIC:FindByName( "Blue Factory 1" ), 100 ) -Scoring:AddStaticScore( STATIC:FindByName( "Blue Factory 2" ), 100 ) -Scoring:AddStaticScore( STATIC:FindByName( "Blue Factory 3" ), 100 ) -Scoring:AddStaticScore( STATIC:FindByName( "Blue Factory 4" ), 100 ) - -Scoring:AddStaticScore( STATIC:FindByName( "Blue Truck #001" ), 80 ) -Scoring:AddStaticScore( STATIC:FindByName( "Blue Truck #002" ), 80 ) -Scoring:AddStaticScore( STATIC:FindByName( "Blue Truck #003" ), 80 ) -Scoring:AddStaticScore( STATIC:FindByName( "Blue Truck #004" ), 80 ) - --- Scale the scoring rewarded. -Scoring:SetScaleDestroyScore( 30 ) -Scoring:SetScaleDestroyPenalty( 90 ) -- Penalties are punished more than normal destroys. - +--- +-- Name: SCO-500 - Scoring Multi Player Demo Mission 1 +-- Author: Pikey and FlightControl +-- Date Created: 1 Mar 2017 +-- +-- # Situation: +-- +-- A demo mission for the scoring. Read the briefing and have fun. +-- +-- # Test cases: +-- +-- 1. Observe the scoring granted to your flight when you hit and kill targets. + +-- Define the patrol zones +BlueCapZone = ZONE_POLYGON:New( "BlueCapZone", GROUP:FindByName( "Blue CAP Zone Patrol" ) ) +RedCapZone = ZONE_POLYGON:New( "RedCapZone", GROUP:FindByName( "Red CAP Zone Patrol" ) ) + +-- Define the engage zones +BlueEngageZone = ZONE_POLYGON:New( "BlueEngageZone", GROUP:FindByName( "Blue CAP Zone Engage" ) ) +RedEngageZone = ZONE_POLYGON:New( "RedEngageZone", GROUP:FindByName( "Red CAP Zone Engage" ) ) + +-- Define the Spawn zones for ground vehicles +BlueSpawnGroundZone = ZONE_POLYGON:New( "BlueSpawnGroundZone", GROUP:FindByName( "Blue Spawn Zone" ) ) +--RedSpawnGroundZone = ZONE_POLYGON:New( "RedSpawnGroundZone", GROUP:FindByName( "Red Spawn Zone" ) ) + +RedSpawnGroundZone = ZONE:New( "Red Spawn Zone" ) + +-- Define the Scoring zones that define the shelters +BlueShelterZone = ZONE_POLYGON:New( "Blue Shelters", GROUP:FindByName( "Blue Shelters" ) ) +RedShelterZone = ZONE_POLYGON:New( "Red Shelters", GROUP:FindByName( "Red Shelters" ) ) + +-- Define the Set of Clients that are used for the AI Balancers +BluePlanesClientSet = SET_CLIENT:New():FilterCoalitions( "blue" ):FilterCategories( "plane" ):FilterPrefixes( "Blue Player") +RedPlanesClientSet = SET_CLIENT:New():FilterCoalitions( "red" ):FilterCategories( "plane" ):FilterPrefixes( "Red Player") + +-- Define the Spawn objects for the AI planes +BluePlanesSpawn = SPAWN:New( "BlueAICAP" ):InitCleanUp( 120 ):InitLimit( 5, 0 ) +RedPlanesSpawn = SPAWN:New( "RedAICAP" ):InitCleanUp( 120 ):InitLimit( 5, 0 ) + +-- Define the AI Balancers for the planes +BlueAIB = AI_BALANCER:New( BluePlanesClientSet, BluePlanesSpawn ):InitSpawnInterval( 60, 1200 ) +RedAIB = AI_BALANCER:New( RedPlanesClientSet, RedPlanesSpawn ):InitSpawnInterval( 60, 1200 ) + +-- Define the Spawn objects for the airbase defenses +BlueAirbaseDefense1Spawn = SPAWN:New( "Blue Airbase Defense 1" ):InitLimit( 10, 10 ):SpawnScheduled( 60, 0 ) +BlueAirbaseDefense2Spawn = SPAWN:New( "Blue Airbase Defense 2" ):InitLimit( 2, 10 ):SpawnScheduled( 60, 0 ) +RedAirbaseDefense1Spawn = SPAWN:New( "Red Airbase Defense 1" ):InitLimit( 10, 10 ):SpawnScheduled( 60, 0 ) +RedAirbaseDefense2Spawn = SPAWN:New( "Red Airbase Defense 2" ):InitLimit( 2, 10 ):SpawnScheduled( 60, 0 ) + +-- Define the ground forces spawning engines... + +-- First define the template arrays. +BlueGroundTemplates = { "Blue Ground Forces 1", "Blue Ground Forces 2", "Blue Ground Forces 3" } +RedGroundTemplates = { "Red Ground Forces 2", "Red Ground Forces 2", "Red Ground Forces 3" } + +-- New we are using these templates to define the spawn objects for the ground forces. +-- We spawn them at random places into the define zone. +BlueGroundSpawn = SPAWN + :New( "Blue Ground Forces" ) + :InitLimit( 12, 30 ) + :InitRandomizeZones( { BlueSpawnGroundZone } ) + :InitRandomizeTemplate( BlueGroundTemplates ) + :SpawnScheduled( 60, 0.2 ) + +RedGroundSpawn = SPAWN + :New( "Red Ground Forces" ) + :InitLimit( 12, 30 ) + :InitRandomizeTemplate( RedGroundTemplates ) + :InitRandomizeZones( { RedSpawnGroundZone } ) + :SpawnScheduled( 60, 0.2 ) + + + +BlueCap = {} +RedCap = {} + +-- Define the OnAfterSpawned events of the AI balancer Spawn Groups +function BlueAIB:OnAfterSpawned( SetGroup, From, Event, To, AIGroup ) + if AIGroup then + BlueCap[AIGroup] = BlueCap[AIGroup] or AI_CAP_ZONE:New( BlueCapZone, 500, 3000, 450, 1200 ) + local Cap = BlueCap[AIGroup] -- AI.AI_CAP#AI_CAP_ZONE + + Cap:ManageFuel( 0.4, 180 ) + Cap:SetEngageZone( BlueEngageZone ) + Cap:SetControllable( AIGroup ) + Cap:Start() + end +end + +function RedAIB:OnAfterSpawned( SetGroup, From, Event, To, AIGroup ) + + if AIGroup then + RedCap[AIGroup] = RedCap[AIGroup] or AI_CAP_ZONE:New( RedCapZone, 500, 3000, 450, 1200 ) + local Cap = RedCap[AIGroup] -- AI.AI_CAP#AI_CAP_ZONE + + Cap:ManageFuel( 0.4, 180 ) + Cap:SetEngageZone( BlueEngageZone ) + Cap:SetControllable( AIGroup ) + Cap:Start() + end +end + + + + +-- Okay, now that we defined all this stuff, now make the SCORING setup ... + +-- First define a Scoring object +local Scoring = SCORING:New( "SCO-500 - Scoring Demonstration Mission" ) + +-- Define within the scoring the shelter designated targets. +Scoring:AddZoneScore( BlueShelterZone, 50 ) -- Per shelter destroyed, 50 extra points are granted. +Scoring:AddZoneScore( RedShelterZone, 50 ) -- Per shelter destroyed, 50 extra points are granted. + +-- Define the static objects that give extra scores +Scoring:AddStaticScore( STATIC:FindByName( "Red Factory 1"), 100 ) +Scoring:AddStaticScore( STATIC:FindByName( "Red Factory 2"), 100 ) +Scoring:AddStaticScore( STATIC:FindByName( "Red Factory 3"), 100 ) +Scoring:AddStaticScore( STATIC:FindByName( "Red Factory 4"), 100 ) + +Scoring:AddStaticScore( STATIC:FindByName( "Red Truck #001"), 80 ) +Scoring:AddStaticScore( STATIC:FindByName( "Red Truck #002"), 80 ) +Scoring:AddStaticScore( STATIC:FindByName( "Red Truck #003"), 80 ) +Scoring:AddStaticScore( STATIC:FindByName( "Red Truck #004"), 80 ) + +Scoring:AddStaticScore( STATIC:FindByName( "Blue Factory 1" ), 100 ) +Scoring:AddStaticScore( STATIC:FindByName( "Blue Factory 2" ), 100 ) +Scoring:AddStaticScore( STATIC:FindByName( "Blue Factory 3" ), 100 ) +Scoring:AddStaticScore( STATIC:FindByName( "Blue Factory 4" ), 100 ) + +Scoring:AddStaticScore( STATIC:FindByName( "Blue Truck #001" ), 80 ) +Scoring:AddStaticScore( STATIC:FindByName( "Blue Truck #002" ), 80 ) +Scoring:AddStaticScore( STATIC:FindByName( "Blue Truck #003" ), 80 ) +Scoring:AddStaticScore( STATIC:FindByName( "Blue Truck #004" ), 80 ) + +-- Scale the scoring rewarded. +Scoring:SetScaleDestroyScore( 30 ) +Scoring:SetScaleDestroyPenalty( 90 ) -- Penalties are punished more than normal destroys. + diff --git a/SCO - Scoring/SCO-500 - Scoring Multi Player Demo Mission 1/SCO-500 - Scoring Multi Player Demo Mission 1.miz b/SCO - Scoring/SCO-500 - Scoring Multi Player Demo Mission 1/SCO-500 - Scoring Multi Player Demo Mission 1.miz index c2d9b8a768..387b491cbc 100644 Binary files a/SCO - Scoring/SCO-500 - Scoring Multi Player Demo Mission 1/SCO-500 - Scoring Multi Player Demo Mission 1.miz and b/SCO - Scoring/SCO-500 - Scoring Multi Player Demo Mission 1/SCO-500 - Scoring Multi Player Demo Mission 1.miz differ diff --git a/SET - Data Sets/SET-001 - Airbase Sets/SET-001 - Airbase Sets.lua b/SET - Data Sets/SET-001 - Airbase Sets/SET-001 - Airbase Sets.lua index e53f6d9367..0d80a560d9 100644 --- a/SET - Data Sets/SET-001 - Airbase Sets/SET-001 - Airbase Sets.lua +++ b/SET - Data Sets/SET-001 - Airbase Sets/SET-001 - Airbase Sets.lua @@ -1,16 +1,16 @@ - -BlueAirbaseSet = SET_AIRBASE:New():FilterCoalitions("blue"):FilterStart() - -RedAirbaseSet = SET_AIRBASE:New():FilterCoalitions("red"):FilterStart() - -RedAirbaseHelipadSet = SET_AIRBASE:New():FilterCoalitions("red"):FilterCategories("helipad"):FilterStart() - -BlueAirbaseShipSet = SET_AIRBASE:New():FilterCoalitions("blue"):FilterCategories("ship"):FilterStart() - -BlueAirbaseSet:Flush() - -RedAirbaseSet:Flush() - -RedAirbaseHelipadSet:Flush() - + +BlueAirbaseSet = SET_AIRBASE:New():FilterCoalitions("blue"):FilterStart() + +RedAirbaseSet = SET_AIRBASE:New():FilterCoalitions("red"):FilterStart() + +RedAirbaseHelipadSet = SET_AIRBASE:New():FilterCoalitions("red"):FilterCategories("helipad"):FilterStart() + +BlueAirbaseShipSet = SET_AIRBASE:New():FilterCoalitions("blue"):FilterCategories("ship"):FilterStart() + +BlueAirbaseSet:Flush() + +RedAirbaseSet:Flush() + +RedAirbaseHelipadSet:Flush() + BlueAirbaseShipSet:Flush() \ No newline at end of file diff --git a/SET - Data Sets/SET-001 - Airbase Sets/SET-001 - Airbase Sets.miz b/SET - Data Sets/SET-001 - Airbase Sets/SET-001 - Airbase Sets.miz index 5b307a89bf..261778236f 100644 Binary files a/SET - Data Sets/SET-001 - Airbase Sets/SET-001 - Airbase Sets.miz and b/SET - Data Sets/SET-001 - Airbase Sets/SET-001 - Airbase Sets.miz differ diff --git a/SET - Data Sets/SET-102 - Test SET_GROUP object against ZONE/SET-102 - Test SET_GROUP object against ZONE.lua b/SET - Data Sets/SET-102 - Test SET_GROUP object against ZONE/SET-102 - Test SET_GROUP object against ZONE.lua index 98700a4be3..db60dc57a0 100644 --- a/SET - Data Sets/SET-102 - Test SET_GROUP object against ZONE/SET-102 - Test SET_GROUP object against ZONE.lua +++ b/SET - Data Sets/SET-102 - Test SET_GROUP object against ZONE/SET-102 - Test SET_GROUP object against ZONE.lua @@ -1,34 +1,34 @@ ---- --- Name: SET-102 - Test SET_GROUP object against ZONE --- Author: FlightControl --- Date Created: 31 Mar 2017 --- --- # Situation: --- --- A ZONE has been defined, and the SET_GROUP object is checked against the zone. --- --- # Test cases: --- --- 1. Observe the zone perimeter, and place the SET_GROUP object in or out of the zone. --- 2. Observe the results of the functions. - - -SetGroupObject = SET_GROUP:New():FilterCoalitions("blue"):FilterPrefixes("Group Object"):FilterStart() - -Zone = ZONE:New( "Zone" ) - -SetGroupObject:ForEachGroupCompletelyInZone( Zone, - function( GroupObject ) - GroupObject:E( { GroupObject:GetName(), "I am completely in Zone" } ) - end ) - -SetGroupObject:ForEachGroupPartlyInZone( Zone, - function( GroupObject ) - GroupObject:E( { GroupObject:GetName(), "I am partially in Zone" } ) - end ) - -SetGroupObject:ForEachGroupNotInZone( Zone, - function( GroupObject ) - GroupObject:E( { GroupObject:GetName(), "I am not in Zone" } ) - end ) - +--- +-- Name: SET-102 - Test SET_GROUP object against ZONE +-- Author: FlightControl +-- Date Created: 31 Mar 2017 +-- +-- # Situation: +-- +-- A ZONE has been defined, and the SET_GROUP object is checked against the zone. +-- +-- # Test cases: +-- +-- 1. Observe the zone perimeter, and place the SET_GROUP object in or out of the zone. +-- 2. Observe the results of the functions. + + +SetGroupObject = SET_GROUP:New():FilterCoalitions("blue"):FilterPrefixes("Group Object"):FilterStart() + +Zone = ZONE:New( "Zone" ) + +SetGroupObject:ForEachGroupCompletelyInZone( Zone, + function( GroupObject ) + GroupObject:E( { GroupObject:GetName(), "I am completely in Zone" } ) + end ) + +SetGroupObject:ForEachGroupPartlyInZone( Zone, + function( GroupObject ) + GroupObject:E( { GroupObject:GetName(), "I am partially in Zone" } ) + end ) + +SetGroupObject:ForEachGroupNotInZone( Zone, + function( GroupObject ) + GroupObject:E( { GroupObject:GetName(), "I am not in Zone" } ) + end ) + diff --git a/SET - Data Sets/SET-102 - Test SET_GROUP object against ZONE/SET-102 - Test SET_GROUP object against ZONE.miz b/SET - Data Sets/SET-102 - Test SET_GROUP object against ZONE/SET-102 - Test SET_GROUP object against ZONE.miz index ec9bf3f628..e81d3f2365 100644 Binary files a/SET - Data Sets/SET-102 - Test SET_GROUP object against ZONE/SET-102 - Test SET_GROUP object against ZONE.miz and b/SET - Data Sets/SET-102 - Test SET_GROUP object against ZONE/SET-102 - Test SET_GROUP object against ZONE.miz differ diff --git a/SET - Data Sets/SET-102 - Test SET_GROUP object against ZONE/ZON-103 - Test if GROUP object is in ZONE.lua b/SET - Data Sets/SET-102 - Test SET_GROUP object against ZONE/ZON-103 - Test if GROUP object is in ZONE.lua new file mode 100644 index 0000000000..8271df5e89 --- /dev/null +++ b/SET - Data Sets/SET-102 - Test SET_GROUP object against ZONE/ZON-103 - Test if GROUP object is in ZONE.lua @@ -0,0 +1,24 @@ +--- +-- Name: ZON-103 - Test if GROUP object is in ZONE +-- Author: FlightControl +-- Date Created: 31 Mar 2017 +-- +-- # Situation: +-- +-- A ZONE has been defined, and it is checked if a GROUP object is within the zone. +-- +-- # Test cases: +-- +-- 1. Observe the zone perimeter, and place the GROUP object in or out of the zone. +-- 2. Observe the results of the functions. + + +GroupObject = GROUP:FindByName( "Group Object" ) + +Zone = ZONE:New( "Zone" ) + + +Zone:E( { "Group is completely in Zone:", GroupObject:IsCompletelyInZone( Zone ) } ) +Zone:E( { "Group is partially in Zone:", GroupObject:IsPartlyInZone( Zone ) } ) +Zone:E( { "Group is not in Zone:", GroupObject:IsNotInZone( Zone ) } ) + diff --git a/SET - Data Sets/SET-103 - Test SET_GROUP players added and deleted/SET-103 - Test SET_GROUP players added and deleted.lua b/SET - Data Sets/SET-103 - Test SET_GROUP players added and deleted/SET-103 - Test SET_GROUP players added and deleted.lua index 985aee42b8..e699343f45 100644 --- a/SET - Data Sets/SET-103 - Test SET_GROUP players added and deleted/SET-103 - Test SET_GROUP players added and deleted.lua +++ b/SET - Data Sets/SET-103 - Test SET_GROUP players added and deleted/SET-103 - Test SET_GROUP players added and deleted.lua @@ -1,17 +1,17 @@ ---- --- Name: SET-103 - Test SET_GROUP players added and deleted --- Author: FlightControl --- Date Created: 31 Mar 2017 --- --- # Situation: --- --- Multiple groups of ground vehicles have been defined. --- There are collected in a SET_GROUP. --- A human player is jumping into the seat on one of these vehicles of the SET_GROUP. --- --- # Test cases: --- --- 1. Observe the player added and deleted from the SET_GROUP depending on the behaviour. - - -SetGroupObject = SET_GROUP:New():FilterCoalitions("blue"):FilterPrefixes("Group Object"):FilterStart() +--- +-- Name: SET-103 - Test SET_GROUP players added and deleted +-- Author: FlightControl +-- Date Created: 31 Mar 2017 +-- +-- # Situation: +-- +-- Multiple groups of ground vehicles have been defined. +-- There are collected in a SET_GROUP. +-- A human player is jumping into the seat on one of these vehicles of the SET_GROUP. +-- +-- # Test cases: +-- +-- 1. Observe the player added and deleted from the SET_GROUP depending on the behaviour. + + +SetGroupObject = SET_GROUP:New():FilterCoalitions("blue"):FilterPrefixes("Group Object"):FilterStart() diff --git a/SET - Data Sets/SET-103 - Test SET_GROUP players added and deleted/SET-103 - Test SET_GROUP players added and deleted.miz b/SET - Data Sets/SET-103 - Test SET_GROUP players added and deleted/SET-103 - Test SET_GROUP players added and deleted.miz index 14d8c44ddc..313d6e8f18 100644 Binary files a/SET - Data Sets/SET-103 - Test SET_GROUP players added and deleted/SET-103 - Test SET_GROUP players added and deleted.miz and b/SET - Data Sets/SET-103 - Test SET_GROUP players added and deleted/SET-103 - Test SET_GROUP players added and deleted.miz differ diff --git a/SET - Data Sets/SET-201 - Client Sets/SET-201 - Client Sets.lua b/SET - Data Sets/SET-201 - Client Sets/SET-201 - Client Sets.lua index af79af84f2..8cb55e3ecf 100644 --- a/SET - Data Sets/SET-201 - Client Sets/SET-201 - Client Sets.lua +++ b/SET - Data Sets/SET-201 - Client Sets/SET-201 - Client Sets.lua @@ -1,3 +1,3 @@ - -SetClient = SET_CLIENT:New():FilterCoalitions("blue"):FilterCategories("plane"):FilterCountries("USA"):FilterStart() - + +SetClient = SET_CLIENT:New():FilterCoalitions("blue"):FilterCategories("plane"):FilterCountries("USA"):FilterStart() + diff --git a/SET - Data Sets/SET-201 - Client Sets/SET-201 - Client Sets.miz b/SET - Data Sets/SET-201 - Client Sets/SET-201 - Client Sets.miz index 801c21d1f1..3c442b0ed2 100644 Binary files a/SET - Data Sets/SET-201 - Client Sets/SET-201 - Client Sets.miz and b/SET - Data Sets/SET-201 - Client Sets/SET-201 - Client Sets.miz differ diff --git a/SET - Data Sets/SET-GRP/SET-GRP-000 - Add and Remove/SET-101 - Group Sets.lua b/SET - Data Sets/SET-GRP/SET-GRP-000 - Add and Remove/SET-101 - Group Sets.lua new file mode 100644 index 0000000000..ba7685e8e3 --- /dev/null +++ b/SET - Data Sets/SET-GRP/SET-GRP-000 - Add and Remove/SET-101 - Group Sets.lua @@ -0,0 +1,163 @@ + + + + +SetVehicles = SET_GROUP:New() + +SetVehicles:AddGroupsByName( { "Vehicle A", "Vehicle B", "Vehicle C" } ) + +SetVehicles:ForEachGroup( + --- @param Wrapper.Group#GROUP MooseGroup + function( MooseGroup ) + for UnitId, UnitData in pairs( MooseGroup:GetUnits() ) do + local UnitAction = UnitData -- Wrapper.Unit#UNIT + UnitAction:SmokeGreen() + end + end +) + + + +SetBluePlanesGroup = SET_GROUP:New() + :FilterCoalitions( "blue" ) + :FilterCategories( "plane" ) + :FilterStart() + +SetNorthKoreaGroup = SET_GROUP:New() + :FilterCountries( "RUSSIA" ) + :FilterStart() + +SetSAMGroup = SET_GROUP:New() + :FilterPrefixes( "SAM" ) + :FilterStart() + :SetIteratorIntervals( 5, 10 ) + +SetGroundGroup = SET_GROUP:New() + :FilterCategories( "ground" ) + :FilterStart() + +SetGroundGroup:Flush() + +SpawnUS_Plane = SPAWN:New( 'Spawn Test USA Plane') +GroupUS_Plane = SpawnUS_Plane:Spawn() + +SpawnUS_Vehicle = SPAWN:New( 'Spawn Test USA Vehicle') +GroupUS_Vehicle = SpawnUS_Vehicle:Spawn() + +SpawnUS_Ship = SPAWN:New( 'Spawn Test USA Ship') +GroupUS_Ship = SpawnUS_Ship:Spawn() + +SpawnRU_Vehicle = SPAWN:New( 'Spawn Test RUSSIA Vehicle') +GroupRU_Vehicle = SpawnRU_Vehicle:Spawn() + +SpawnRU_Ship = SPAWN:New( 'Spawn Test RUSSIA Ship') +GroupRU_Ship = SpawnRU_Ship:Spawn() + +SpawnM2A2_AttackVehicle = SPAWN:New( 'Spawn Test M2A2 Attack Vehicle' ):InitRandomizeUnits( true, 10, 4 ) +SpawnSAM_AttackVehicle = SPAWN:New( 'Spawn Test SAM Attack Vehicle' ):InitRandomizeUnits( true, 10, 4 ) + +for i = 1, 30 do + GroupM2A2_AttackVehicle = SpawnM2A2_AttackVehicle:SpawnInZone( ZONE:New("Spawn Zone") ) + GroupSAM_AttackVehicle = SpawnSAM_AttackVehicle:SpawnInZone( ZONE:New("Spawn Zone") ) +end + +SetVehicleCompletely = SET_GROUP:New() + :FilterPrefixes( "Spawn Vehicle Zone Completely" ) + :FilterStart() + +SetVehiclePartly = SET_GROUP:New() + :FilterPrefixes( "Spawn Vehicle Zone Partly" ) + :FilterStart() + +SetVehicleNot = SET_GROUP:New() + :FilterPrefixes( "Spawn Vehicle Zone Not" ) + :FilterStart() + +Spawn_Vehicle_Zone_Completely = SPAWN:New( 'Spawn Vehicle Zone Completely' ):InitRandomizeUnits( true, 10, 4) +Spawn_Vehicle_Zone_Partly = SPAWN:New( 'Spawn Vehicle Zone Partly' ):InitRandomizeUnits( true, 10, 4 ) +Spawn_Vehicle_Zone_Not = SPAWN:New( 'Spawn Vehicle Zone Not' ):InitRandomizeUnits( true, 10, 4 ) +for i = 1, 30 do + Spawn_Vehicle_Zone_Completely:SpawnInZone( ZONE:New("Spawn Zone Completely") ) + Spawn_Vehicle_Zone_Partly:SpawnInZone( ZONE:New("Spawn Zone Partly") ) + Spawn_Vehicle_Zone_Not:SpawnInZone( ZONE:New("Spawn Zone Not") ) +end + +--DBBlue:TraceDatabase() +--SCHEDULER:New( DBBluePlanes, DBBluePlanes.Flush, { }, 1 ) +--SCHEDULER:New( DBRedVehicles, DBRedVehicles.Flush, { }, 1 ) +--SCHEDULER:New( DBShips, DBShips.Flush, { }, 1 ) +--SCHEDULER:New( DBBelgium, DBBelgium.Flush, { }, 1 ) +--SCHEDULER:New( DBNorthKorea, DBNorthKorea.Flush, { }, 1 ) +--SCHEDULER:New( DBKA50Vinson, DBKA50Vinson.Flush, { }, 1 ) +-- +--SCHEDULER:New( DBBluePlanesGroup, DBBluePlanesGroup.Flush, { }, 1 ) +--SCHEDULER:New( DBNorthKoreaGroup, DBNorthKoreaGroup.Flush, { }, 1 ) + +SetBluePlanesGroup:ForEachGroup( + --- @param Wrapper.Group#GROUP MooseGroup + function( MooseGroup ) + for UnitId, UnitData in pairs( MooseGroup:GetUnits() ) do + local UnitAction = UnitData -- Wrapper.Unit#UNIT + UnitAction:SmokeBlue() + end + end +) + +SetNorthKoreaGroup:ForEachGroup( + --- @param Wrapper.Group#GROUP MooseGroup + function( MooseGroup ) + for UnitId, UnitData in pairs( MooseGroup:GetUnits() ) do + local UnitAction = UnitData -- Wrapper.Unit#UNIT + UnitAction:SmokeRed() + end + end +) + +SetSAMGroup:ForEachGroup( + --- @param Wrapper.Group#GROUP MooseGroup + function( MooseGroup ) + for UnitId, UnitData in pairs( MooseGroup:GetUnits() ) do + local UnitAction = UnitData -- Wrapper.Unit#UNIT + UnitAction:SmokeOrange() + end + end +) + +GroupZoneCompletely = GROUP:FindByName( "Zone Completely" ) +GroupZonePartly = GROUP:FindByName( "Zone Partly" ) +GroupZoneNot = GROUP:FindByName( "Zone Not" ) + +ZoneCompletely = ZONE_POLYGON:New( "Zone Completely", GroupZoneCompletely ):SmokeZone( SMOKECOLOR.White ) +ZonePartly = ZONE_POLYGON:New( "Zone Partly", GroupZonePartly ):SmokeZone( SMOKECOLOR.White ) +ZoneNot = ZONE_POLYGON:New( "Zone Not", GroupZoneNot ):SmokeZone( SMOKECOLOR.White ) + +SetVehicleCompletely:ForEachGroupCompletelyInZone( ZoneCompletely, + --- @param Wrapper.Group#GROUP MooseGroup + function( MooseGroup ) + for UnitId, UnitData in pairs( MooseGroup:GetUnits() ) do + local UnitAction = UnitData -- Wrapper.Unit#UNIT + UnitAction:SmokeBlue() + end + end +) + +SetVehiclePartly:ForEachGroupPartlyInZone( ZonePartly, + --- @param Wrapper.Group#GROUP MooseGroup + function( MooseGroup ) + for UnitId, UnitData in pairs( MooseGroup:GetUnits() ) do + local UnitAction = UnitData -- Wrapper.Unit#UNIT + UnitAction:SmokeBlue() + end + end +) + +SetVehicleNot:ForEachGroupNotInZone( ZoneNot, + --- @param Wrapper.Group#GROUP MooseGroup + function( MooseGroup ) + for UnitId, UnitData in pairs( MooseGroup:GetUnits() ) do + local UnitAction = UnitData -- Wrapper.Unit#UNIT + UnitAction:SmokeBlue() + end + end +) + \ No newline at end of file diff --git a/SET - Data Sets/SET-GRP/SET-GRP-000 - Add and Remove/SET-GRP-000 - Add and Remove.miz b/SET - Data Sets/SET-GRP/SET-GRP-000 - Add and Remove/SET-GRP-000 - Add and Remove.miz index 46b36db351..37ec400dfc 100644 Binary files a/SET - Data Sets/SET-GRP/SET-GRP-000 - Add and Remove/SET-GRP-000 - Add and Remove.miz and b/SET - Data Sets/SET-GRP/SET-GRP-000 - Add and Remove/SET-GRP-000 - Add and Remove.miz differ diff --git a/SET - Data Sets/SET-GRP/SET-GRP-101 - Group Sets/SET-101 - Group Sets.lua b/SET - Data Sets/SET-GRP/SET-GRP-101 - Group Sets/SET-101 - Group Sets.lua index d15682cbc0..ba7685e8e3 100644 --- a/SET - Data Sets/SET-GRP/SET-GRP-101 - Group Sets/SET-101 - Group Sets.lua +++ b/SET - Data Sets/SET-GRP/SET-GRP-101 - Group Sets/SET-101 - Group Sets.lua @@ -1,159 +1,163 @@ -SetVehicles = SET_GROUP:New() - -SetVehicles:AddGroupsByName( { "Vehicle A", "Vehicle B", "Vehicle C" } ) - -SetVehicles:ForEachGroup( - --- @param Wrapper.Group#GROUP MooseGroup - function( MooseGroup ) - for UnitId, UnitData in pairs( MooseGroup:GetUnits() ) do - local UnitAction = UnitData -- Wrapper.Unit#UNIT - UnitAction:SmokeGreen() - end - end -) - - - -SetBluePlanesGroup = SET_GROUP:New() - :FilterCoalitions( "blue" ) - :FilterCategories( "plane" ) - :FilterStart() - -SetNorthKoreaGroup = SET_GROUP:New() - :FilterCountries( "RUSSIA" ) - :FilterStart() - -SetSAMGroup = SET_GROUP:New() - :FilterPrefixes( "SAM" ) - :FilterStart() - :SetIteratorIntervals( 5, 10 ) - -SetGroundGroup = SET_GROUP:New() - :FilterCategories( "ground" ) - :FilterStart() - -SetGroundGroup:Flush() - -SpawnUS_Plane = SPAWN:New( 'Spawn Test USA Plane') -GroupUS_Plane = SpawnUS_Plane:Spawn() - -SpawnUS_Vehicle = SPAWN:New( 'Spawn Test USA Vehicle') -GroupUS_Vehicle = SpawnUS_Vehicle:Spawn() - -SpawnUS_Ship = SPAWN:New( 'Spawn Test USA Ship') -GroupUS_Ship = SpawnUS_Ship:Spawn() - -SpawnRU_Vehicle = SPAWN:New( 'Spawn Test RUSSIA Vehicle') -GroupRU_Vehicle = SpawnRU_Vehicle:Spawn() - -SpawnRU_Ship = SPAWN:New( 'Spawn Test RUSSIA Ship') -GroupRU_Ship = SpawnRU_Ship:Spawn() - -SpawnM2A2_AttackVehicle = SPAWN:New( 'Spawn Test M2A2 Attack Vehicle' ):InitRandomizeUnits( true, 10, 4 ) -SpawnSAM_AttackVehicle = SPAWN:New( 'Spawn Test SAM Attack Vehicle' ):InitRandomizeUnits( true, 10, 4 ) - -for i = 1, 30 do - GroupM2A2_AttackVehicle = SpawnM2A2_AttackVehicle:SpawnInZone( ZONE:New("Spawn Zone") ) - GroupSAM_AttackVehicle = SpawnSAM_AttackVehicle:SpawnInZone( ZONE:New("Spawn Zone") ) -end - -SetVehicleCompletely = SET_GROUP:New() - :FilterPrefixes( "Spawn Vehicle Zone Completely" ) - :FilterStart() - -SetVehiclePartly = SET_GROUP:New() - :FilterPrefixes( "Spawn Vehicle Zone Partly" ) - :FilterStart() - -SetVehicleNot = SET_GROUP:New() - :FilterPrefixes( "Spawn Vehicle Zone Not" ) - :FilterStart() - -Spawn_Vehicle_Zone_Completely = SPAWN:New( 'Spawn Vehicle Zone Completely' ):InitRandomizeUnits( true, 10, 4) -Spawn_Vehicle_Zone_Partly = SPAWN:New( 'Spawn Vehicle Zone Partly' ):InitRandomizeUnits( true, 10, 4 ) -Spawn_Vehicle_Zone_Not = SPAWN:New( 'Spawn Vehicle Zone Not' ):InitRandomizeUnits( true, 10, 4 ) -for i = 1, 30 do - Spawn_Vehicle_Zone_Completely:SpawnInZone( ZONE:New("Spawn Zone Completely") ) - Spawn_Vehicle_Zone_Partly:SpawnInZone( ZONE:New("Spawn Zone Partly") ) - Spawn_Vehicle_Zone_Not:SpawnInZone( ZONE:New("Spawn Zone Not") ) -end - ---DBBlue:TraceDatabase() ---SCHEDULER:New( DBBluePlanes, DBBluePlanes.Flush, { }, 1 ) ---SCHEDULER:New( DBRedVehicles, DBRedVehicles.Flush, { }, 1 ) ---SCHEDULER:New( DBShips, DBShips.Flush, { }, 1 ) ---SCHEDULER:New( DBBelgium, DBBelgium.Flush, { }, 1 ) ---SCHEDULER:New( DBNorthKorea, DBNorthKorea.Flush, { }, 1 ) ---SCHEDULER:New( DBKA50Vinson, DBKA50Vinson.Flush, { }, 1 ) --- ---SCHEDULER:New( DBBluePlanesGroup, DBBluePlanesGroup.Flush, { }, 1 ) ---SCHEDULER:New( DBNorthKoreaGroup, DBNorthKoreaGroup.Flush, { }, 1 ) - -SetBluePlanesGroup:ForEachGroup( - --- @param Wrapper.Group#GROUP MooseGroup - function( MooseGroup ) - for UnitId, UnitData in pairs( MooseGroup:GetUnits() ) do - local UnitAction = UnitData -- Wrapper.Unit#UNIT - UnitAction:SmokeBlue() - end - end -) - -SetNorthKoreaGroup:ForEachGroup( - --- @param Wrapper.Group#GROUP MooseGroup - function( MooseGroup ) - for UnitId, UnitData in pairs( MooseGroup:GetUnits() ) do - local UnitAction = UnitData -- Wrapper.Unit#UNIT - UnitAction:SmokeRed() - end - end -) - -SetSAMGroup:ForEachGroup( - --- @param Wrapper.Group#GROUP MooseGroup - function( MooseGroup ) - for UnitId, UnitData in pairs( MooseGroup:GetUnits() ) do - local UnitAction = UnitData -- Wrapper.Unit#UNIT - UnitAction:SmokeOrange() - end - end -) - -GroupZoneCompletely = GROUP:FindByName( "Zone Completely" ) -GroupZonePartly = GROUP:FindByName( "Zone Partly" ) -GroupZoneNot = GROUP:FindByName( "Zone Not" ) - -ZoneCompletely = ZONE_POLYGON:New( "Zone Completely", GroupZoneCompletely ):SmokeZone( SMOKECOLOR.White ) -ZonePartly = ZONE_POLYGON:New( "Zone Partly", GroupZonePartly ):SmokeZone( SMOKECOLOR.White ) -ZoneNot = ZONE_POLYGON:New( "Zone Not", GroupZoneNot ):SmokeZone( SMOKECOLOR.White ) - -SetVehicleCompletely:ForEachGroupCompletelyInZone( ZoneCompletely, - --- @param Wrapper.Group#GROUP MooseGroup - function( MooseGroup ) - for UnitId, UnitData in pairs( MooseGroup:GetUnits() ) do - local UnitAction = UnitData -- Wrapper.Unit#UNIT - UnitAction:SmokeBlue() - end - end -) - -SetVehiclePartly:ForEachGroupPartlyInZone( ZonePartly, - --- @param Wrapper.Group#GROUP MooseGroup - function( MooseGroup ) - for UnitId, UnitData in pairs( MooseGroup:GetUnits() ) do - local UnitAction = UnitData -- Wrapper.Unit#UNIT - UnitAction:SmokeBlue() - end - end -) - -SetVehicleNot:ForEachGroupNotInZone( ZoneNot, - --- @param Wrapper.Group#GROUP MooseGroup - function( MooseGroup ) - for UnitId, UnitData in pairs( MooseGroup:GetUnits() ) do - local UnitAction = UnitData -- Wrapper.Unit#UNIT - UnitAction:SmokeBlue() - end - end -) - + + + + +SetVehicles = SET_GROUP:New() + +SetVehicles:AddGroupsByName( { "Vehicle A", "Vehicle B", "Vehicle C" } ) + +SetVehicles:ForEachGroup( + --- @param Wrapper.Group#GROUP MooseGroup + function( MooseGroup ) + for UnitId, UnitData in pairs( MooseGroup:GetUnits() ) do + local UnitAction = UnitData -- Wrapper.Unit#UNIT + UnitAction:SmokeGreen() + end + end +) + + + +SetBluePlanesGroup = SET_GROUP:New() + :FilterCoalitions( "blue" ) + :FilterCategories( "plane" ) + :FilterStart() + +SetNorthKoreaGroup = SET_GROUP:New() + :FilterCountries( "RUSSIA" ) + :FilterStart() + +SetSAMGroup = SET_GROUP:New() + :FilterPrefixes( "SAM" ) + :FilterStart() + :SetIteratorIntervals( 5, 10 ) + +SetGroundGroup = SET_GROUP:New() + :FilterCategories( "ground" ) + :FilterStart() + +SetGroundGroup:Flush() + +SpawnUS_Plane = SPAWN:New( 'Spawn Test USA Plane') +GroupUS_Plane = SpawnUS_Plane:Spawn() + +SpawnUS_Vehicle = SPAWN:New( 'Spawn Test USA Vehicle') +GroupUS_Vehicle = SpawnUS_Vehicle:Spawn() + +SpawnUS_Ship = SPAWN:New( 'Spawn Test USA Ship') +GroupUS_Ship = SpawnUS_Ship:Spawn() + +SpawnRU_Vehicle = SPAWN:New( 'Spawn Test RUSSIA Vehicle') +GroupRU_Vehicle = SpawnRU_Vehicle:Spawn() + +SpawnRU_Ship = SPAWN:New( 'Spawn Test RUSSIA Ship') +GroupRU_Ship = SpawnRU_Ship:Spawn() + +SpawnM2A2_AttackVehicle = SPAWN:New( 'Spawn Test M2A2 Attack Vehicle' ):InitRandomizeUnits( true, 10, 4 ) +SpawnSAM_AttackVehicle = SPAWN:New( 'Spawn Test SAM Attack Vehicle' ):InitRandomizeUnits( true, 10, 4 ) + +for i = 1, 30 do + GroupM2A2_AttackVehicle = SpawnM2A2_AttackVehicle:SpawnInZone( ZONE:New("Spawn Zone") ) + GroupSAM_AttackVehicle = SpawnSAM_AttackVehicle:SpawnInZone( ZONE:New("Spawn Zone") ) +end + +SetVehicleCompletely = SET_GROUP:New() + :FilterPrefixes( "Spawn Vehicle Zone Completely" ) + :FilterStart() + +SetVehiclePartly = SET_GROUP:New() + :FilterPrefixes( "Spawn Vehicle Zone Partly" ) + :FilterStart() + +SetVehicleNot = SET_GROUP:New() + :FilterPrefixes( "Spawn Vehicle Zone Not" ) + :FilterStart() + +Spawn_Vehicle_Zone_Completely = SPAWN:New( 'Spawn Vehicle Zone Completely' ):InitRandomizeUnits( true, 10, 4) +Spawn_Vehicle_Zone_Partly = SPAWN:New( 'Spawn Vehicle Zone Partly' ):InitRandomizeUnits( true, 10, 4 ) +Spawn_Vehicle_Zone_Not = SPAWN:New( 'Spawn Vehicle Zone Not' ):InitRandomizeUnits( true, 10, 4 ) +for i = 1, 30 do + Spawn_Vehicle_Zone_Completely:SpawnInZone( ZONE:New("Spawn Zone Completely") ) + Spawn_Vehicle_Zone_Partly:SpawnInZone( ZONE:New("Spawn Zone Partly") ) + Spawn_Vehicle_Zone_Not:SpawnInZone( ZONE:New("Spawn Zone Not") ) +end + +--DBBlue:TraceDatabase() +--SCHEDULER:New( DBBluePlanes, DBBluePlanes.Flush, { }, 1 ) +--SCHEDULER:New( DBRedVehicles, DBRedVehicles.Flush, { }, 1 ) +--SCHEDULER:New( DBShips, DBShips.Flush, { }, 1 ) +--SCHEDULER:New( DBBelgium, DBBelgium.Flush, { }, 1 ) +--SCHEDULER:New( DBNorthKorea, DBNorthKorea.Flush, { }, 1 ) +--SCHEDULER:New( DBKA50Vinson, DBKA50Vinson.Flush, { }, 1 ) +-- +--SCHEDULER:New( DBBluePlanesGroup, DBBluePlanesGroup.Flush, { }, 1 ) +--SCHEDULER:New( DBNorthKoreaGroup, DBNorthKoreaGroup.Flush, { }, 1 ) + +SetBluePlanesGroup:ForEachGroup( + --- @param Wrapper.Group#GROUP MooseGroup + function( MooseGroup ) + for UnitId, UnitData in pairs( MooseGroup:GetUnits() ) do + local UnitAction = UnitData -- Wrapper.Unit#UNIT + UnitAction:SmokeBlue() + end + end +) + +SetNorthKoreaGroup:ForEachGroup( + --- @param Wrapper.Group#GROUP MooseGroup + function( MooseGroup ) + for UnitId, UnitData in pairs( MooseGroup:GetUnits() ) do + local UnitAction = UnitData -- Wrapper.Unit#UNIT + UnitAction:SmokeRed() + end + end +) + +SetSAMGroup:ForEachGroup( + --- @param Wrapper.Group#GROUP MooseGroup + function( MooseGroup ) + for UnitId, UnitData in pairs( MooseGroup:GetUnits() ) do + local UnitAction = UnitData -- Wrapper.Unit#UNIT + UnitAction:SmokeOrange() + end + end +) + +GroupZoneCompletely = GROUP:FindByName( "Zone Completely" ) +GroupZonePartly = GROUP:FindByName( "Zone Partly" ) +GroupZoneNot = GROUP:FindByName( "Zone Not" ) + +ZoneCompletely = ZONE_POLYGON:New( "Zone Completely", GroupZoneCompletely ):SmokeZone( SMOKECOLOR.White ) +ZonePartly = ZONE_POLYGON:New( "Zone Partly", GroupZonePartly ):SmokeZone( SMOKECOLOR.White ) +ZoneNot = ZONE_POLYGON:New( "Zone Not", GroupZoneNot ):SmokeZone( SMOKECOLOR.White ) + +SetVehicleCompletely:ForEachGroupCompletelyInZone( ZoneCompletely, + --- @param Wrapper.Group#GROUP MooseGroup + function( MooseGroup ) + for UnitId, UnitData in pairs( MooseGroup:GetUnits() ) do + local UnitAction = UnitData -- Wrapper.Unit#UNIT + UnitAction:SmokeBlue() + end + end +) + +SetVehiclePartly:ForEachGroupPartlyInZone( ZonePartly, + --- @param Wrapper.Group#GROUP MooseGroup + function( MooseGroup ) + for UnitId, UnitData in pairs( MooseGroup:GetUnits() ) do + local UnitAction = UnitData -- Wrapper.Unit#UNIT + UnitAction:SmokeBlue() + end + end +) + +SetVehicleNot:ForEachGroupNotInZone( ZoneNot, + --- @param Wrapper.Group#GROUP MooseGroup + function( MooseGroup ) + for UnitId, UnitData in pairs( MooseGroup:GetUnits() ) do + local UnitAction = UnitData -- Wrapper.Unit#UNIT + UnitAction:SmokeBlue() + end + end +) + \ No newline at end of file diff --git a/SET - Data Sets/SET-GRP/SET-GRP-101 - Group Sets/SET-GRP-101 - Group Sets.miz b/SET - Data Sets/SET-GRP/SET-GRP-101 - Group Sets/SET-GRP-101 - Group Sets.miz index e401744ed8..37ec400dfc 100644 Binary files a/SET - Data Sets/SET-GRP/SET-GRP-101 - Group Sets/SET-GRP-101 - Group Sets.miz and b/SET - Data Sets/SET-GRP/SET-GRP-101 - Group Sets/SET-GRP-101 - Group Sets.miz differ diff --git a/SET - Data Sets/SET-GRP/SET-GRP-300 - FilterActive Scenario 1/SET-GRP-300 - FilterActive Scenario 1.lua b/SET - Data Sets/SET-GRP/SET-GRP-300 - FilterActive Scenario 1/SET-GRP-300 - FilterActive Scenario 1.lua index a851d9ac86..3df1ec5d54 100644 --- a/SET - Data Sets/SET-GRP/SET-GRP-300 - FilterActive Scenario 1/SET-GRP-300 - FilterActive Scenario 1.lua +++ b/SET - Data Sets/SET-GRP/SET-GRP-300 - FilterActive Scenario 1/SET-GRP-300 - FilterActive Scenario 1.lua @@ -1,8 +1,8 @@ --- The mission contains templates, which are late activated groups. Only the active groups should be included. --- It should count 3 groups in DCS.log. - -SetGroup = SET_GROUP:New():FilterCoalitions("blue"):FilterCategories("ground"):FilterActive():FilterOnce() -SetGroup:Flush() -SetGroup:I( { Count = SetGroup:Count() } ) - -MESSAGE:NewType( "There are " .. SetGroup:Count() .. " groups in the SetGroup.", MESSAGE.Type.Information ):ToAll() +-- The mission contains templates, which are late activated groups. Only the active groups should be included. +-- It should count 3 groups in DCS.log. + +SetGroup = SET_GROUP:New():FilterCoalitions("blue"):FilterCategories("ground"):FilterActive():FilterOnce() +SetGroup:Flush() +SetGroup:I( { Count = SetGroup:Count() } ) + +MESSAGE:NewType( "There are " .. SetGroup:Count() .. " groups in the SetGroup.", MESSAGE.Type.Information ):ToAll() diff --git a/SET - Data Sets/SET-GRP/SET-GRP-300 - FilterActive Scenario 1/SET-GRP-300 - FilterActive Scenario 1.miz b/SET - Data Sets/SET-GRP/SET-GRP-300 - FilterActive Scenario 1/SET-GRP-300 - FilterActive Scenario 1.miz index d4ce8d008c..33294b4833 100644 Binary files a/SET - Data Sets/SET-GRP/SET-GRP-300 - FilterActive Scenario 1/SET-GRP-300 - FilterActive Scenario 1.miz and b/SET - Data Sets/SET-GRP/SET-GRP-300 - FilterActive Scenario 1/SET-GRP-300 - FilterActive Scenario 1.miz differ diff --git a/SET - Data Sets/SET-GRP/SET-GRP-300 - FilterActive Scenario 2/SET-GRP-300 - FilterActive Scenario 2.lua b/SET - Data Sets/SET-GRP/SET-GRP-300 - FilterActive Scenario 2/SET-GRP-300 - FilterActive Scenario 2.lua index 6d8db5d616..c41818504f 100644 --- a/SET - Data Sets/SET-GRP/SET-GRP-300 - FilterActive Scenario 2/SET-GRP-300 - FilterActive Scenario 2.lua +++ b/SET - Data Sets/SET-GRP/SET-GRP-300 - FilterActive Scenario 2/SET-GRP-300 - FilterActive Scenario 2.lua @@ -1,8 +1,8 @@ --- The mission contains templates, which are late activated groups. All groups should be included. --- It should count 7 groups in DCS.log. - -SetGroup = SET_GROUP:New():FilterCoalitions("blue"):FilterCategories("ground"):FilterOnce() -SetGroup:Flush() -SetGroup:I( { Count = SetGroup:Count() } ) - -MESSAGE:NewType( "There are " .. SetGroup:Count() .. " groups in the SetGroup.", MESSAGE.Type.Information ):ToAll() +-- The mission contains templates, which are late activated groups. All groups should be included. +-- It should count 7 groups in DCS.log. + +SetGroup = SET_GROUP:New():FilterCoalitions("blue"):FilterCategories("ground"):FilterOnce() +SetGroup:Flush() +SetGroup:I( { Count = SetGroup:Count() } ) + +MESSAGE:NewType( "There are " .. SetGroup:Count() .. " groups in the SetGroup.", MESSAGE.Type.Information ):ToAll() diff --git a/SET - Data Sets/SET-GRP/SET-GRP-300 - FilterActive Scenario 2/SET-GRP-300 - FilterActive Scenario 2.miz b/SET - Data Sets/SET-GRP/SET-GRP-300 - FilterActive Scenario 2/SET-GRP-300 - FilterActive Scenario 2.miz index baea2d9f38..b7fa1d066d 100644 Binary files a/SET - Data Sets/SET-GRP/SET-GRP-300 - FilterActive Scenario 2/SET-GRP-300 - FilterActive Scenario 2.miz and b/SET - Data Sets/SET-GRP/SET-GRP-300 - FilterActive Scenario 2/SET-GRP-300 - FilterActive Scenario 2.miz differ diff --git a/SET - Data Sets/SET-UNT/SET-UNT-100 - FilterOnce Scenario 1/SET-UNT-100 - FilterOnce Scenario 1.miz b/SET - Data Sets/SET-UNT/SET-UNT-100 - FilterOnce Scenario 1/SET-UNT-100 - FilterOnce Scenario 1.miz index d18a0cfe6e..ff4e972c62 100644 Binary files a/SET - Data Sets/SET-UNT/SET-UNT-100 - FilterOnce Scenario 1/SET-UNT-100 - FilterOnce Scenario 1.miz and b/SET - Data Sets/SET-UNT/SET-UNT-100 - FilterOnce Scenario 1/SET-UNT-100 - FilterOnce Scenario 1.miz differ diff --git a/SET - Data Sets/SET-UNT/SET-UNT-100 - FilterOnce Scenario 1/SET-UNT-100 - Unit Sets.lua b/SET - Data Sets/SET-UNT/SET-UNT-100 - FilterOnce Scenario 1/SET-UNT-100 - Unit Sets.lua index 9b2806f476..ed0518e126 100644 --- a/SET - Data Sets/SET-UNT/SET-UNT-100 - FilterOnce Scenario 1/SET-UNT-100 - Unit Sets.lua +++ b/SET - Data Sets/SET-UNT/SET-UNT-100 - FilterOnce Scenario 1/SET-UNT-100 - Unit Sets.lua @@ -1,7 +1,7 @@ - -SetUnit = SET_UNIT:New():FilterCoalitions("blue"):FilterCategories("ground"):FilterOnce() - -SetUnit:Flush() - -SetUnit:I(SetUnit:Count()) - + +SetUnit = SET_UNIT:New():FilterCoalitions("blue"):FilterCategories("ground"):FilterOnce() + +SetUnit:Flush() + +SetUnit:I(SetUnit:Count()) + diff --git a/SET - Data Sets/SET-UNT/SET-UNT-110 - FilterOnce Scenario 2/SET-UNT-110 - FilterOnce Ground.lua b/SET - Data Sets/SET-UNT/SET-UNT-110 - FilterOnce Scenario 2/SET-UNT-110 - FilterOnce Ground.lua index da158a4dda..1183395618 100644 --- a/SET - Data Sets/SET-UNT/SET-UNT-110 - FilterOnce Scenario 2/SET-UNT-110 - FilterOnce Ground.lua +++ b/SET - Data Sets/SET-UNT/SET-UNT-110 - FilterOnce Scenario 2/SET-UNT-110 - FilterOnce Ground.lua @@ -1,11 +1,12 @@ -SetUnit = SET_UNIT:New():FilterCoalitions("blue"):FilterCategories("ground"):FilterOnce() -SetUnit:Flush() -SetUnit:I( { Count = SetUnit:Count() } ) - -SCHEDULER:New( nil, - function() - SetUnit = SET_UNIT:New():FilterCoalitions("blue"):FilterCategories("ground"):FilterOnce() - SetUnit:Flush() - SetUnit:I( { Count = SetUnit:Count() } ) - end, {}, 60 ) - + +SetUnit = SET_UNIT:New():FilterCoalitions("blue"):FilterCategories("ground"):FilterOnce() +SetUnit:Flush() +SetUnit:I( { Count = SetUnit:Count() } ) + +SCHEDULER:New( nil, + function() + SetUnit = SET_UNIT:New():FilterCoalitions("blue"):FilterCategories("ground"):FilterOnce() + SetUnit:Flush() + SetUnit:I( { Count = SetUnit:Count() } ) + end, {}, 60 ) + diff --git a/SET - Data Sets/SET-UNT/SET-UNT-110 - FilterOnce Scenario 2/SET-UNT-110 - FilterOnce Scenario 2.miz b/SET - Data Sets/SET-UNT/SET-UNT-110 - FilterOnce Scenario 2/SET-UNT-110 - FilterOnce Scenario 2.miz index 12c9c1d559..6c4bc65212 100644 Binary files a/SET - Data Sets/SET-UNT/SET-UNT-110 - FilterOnce Scenario 2/SET-UNT-110 - FilterOnce Scenario 2.miz and b/SET - Data Sets/SET-UNT/SET-UNT-110 - FilterOnce Scenario 2/SET-UNT-110 - FilterOnce Scenario 2.miz differ diff --git a/SET - Data Sets/SET-UNT/SET-UNT-120 - FilterOnce Scenario 3/SET-UNT-120 - FilterOnce Scenario 3.lua b/SET - Data Sets/SET-UNT/SET-UNT-120 - FilterOnce Scenario 3/SET-UNT-120 - FilterOnce Scenario 3.lua index 0be25eb3a5..82d3b015c8 100644 --- a/SET - Data Sets/SET-UNT/SET-UNT-120 - FilterOnce Scenario 3/SET-UNT-120 - FilterOnce Scenario 3.lua +++ b/SET - Data Sets/SET-UNT/SET-UNT-120 - FilterOnce Scenario 3/SET-UNT-120 - FilterOnce Scenario 3.lua @@ -1,16 +1,16 @@ -SCHEDULER:New( nil, - function() - SetUnit = SET_UNIT:New():FilterCoalitions("blue"):FilterCategories("ground"):FilterOnce() - SetUnit:Flush() - SetUnit:I( { Count = SetUnit:Count() } ) - end, {}, 0, 30 ) - -GroupPlanes = GROUP:FindByName( "Planes #001" ) - -GroupPlanes:HandleEvent( EVENTS.EngineShutdown ) - -function GroupPlanes:OnEventEngineShutdown( EventData ) - - EventData.IniUnit:Destroy() - +SCHEDULER:New( nil, + function() + SetUnit = SET_UNIT:New():FilterCoalitions("blue"):FilterCategories("ground"):FilterOnce() + SetUnit:Flush() + SetUnit:I( { Count = SetUnit:Count() } ) + end, {}, 0, 30 ) + +GroupPlanes = GROUP:FindByName( "Planes #001" ) + +GroupPlanes:HandleEvent( EVENTS.EngineShutdown ) + +function GroupPlanes:OnEventEngineShutdown( EventData ) + + EventData.IniUnit:Destroy() + end \ No newline at end of file diff --git a/SET - Data Sets/SET-UNT/SET-UNT-120 - FilterOnce Scenario 3/SET-UNT-120 - FilterOnce Scenario 3.miz b/SET - Data Sets/SET-UNT/SET-UNT-120 - FilterOnce Scenario 3/SET-UNT-120 - FilterOnce Scenario 3.miz index 8e4cbd96b6..f60172af74 100644 Binary files a/SET - Data Sets/SET-UNT/SET-UNT-120 - FilterOnce Scenario 3/SET-UNT-120 - FilterOnce Scenario 3.miz and b/SET - Data Sets/SET-UNT/SET-UNT-120 - FilterOnce Scenario 3/SET-UNT-120 - FilterOnce Scenario 3.miz differ diff --git a/SET - Data Sets/SET-UNT/SET-UNT-300 - FilterActive Scenario 1/SET-UNT-300 - FilterActive Scenario 1.lua b/SET - Data Sets/SET-UNT/SET-UNT-300 - FilterActive Scenario 1/SET-UNT-300 - FilterActive Scenario 1.lua index d85a435745..2143e54c53 100644 --- a/SET - Data Sets/SET-UNT/SET-UNT-300 - FilterActive Scenario 1/SET-UNT-300 - FilterActive Scenario 1.lua +++ b/SET - Data Sets/SET-UNT/SET-UNT-300 - FilterActive Scenario 1/SET-UNT-300 - FilterActive Scenario 1.lua @@ -1,8 +1,8 @@ --- The mission contains templates, which are late activated groups. Only the active units should be included. --- It should count 24 units in DCS.log. - -SetUnit = SET_UNIT:New():FilterCoalitions("blue"):FilterCategories("ground"):FilterActive():FilterOnce() -SetUnit:Flush() -SetUnit:I( { Count = SetUnit:Count() } ) - -MESSAGE:NewType( "There are " .. SetUnit:Count() .. " units in the SetUnit.", MESSAGE.Type.Information ):ToAll() +-- The mission contains templates, which are late activated groups. Only the active units should be included. +-- It should count 24 units in DCS.log. + +SetUnit = SET_UNIT:New():FilterCoalitions("blue"):FilterCategories("ground"):FilterActive():FilterOnce() +SetUnit:Flush() +SetUnit:I( { Count = SetUnit:Count() } ) + +MESSAGE:NewType( "There are " .. SetUnit:Count() .. " units in the SetUnit.", MESSAGE.Type.Information ):ToAll() diff --git a/SET - Data Sets/SET-UNT/SET-UNT-300 - FilterActive Scenario 1/SET-UNT-300 - FilterActive Scenario 1.miz b/SET - Data Sets/SET-UNT/SET-UNT-300 - FilterActive Scenario 1/SET-UNT-300 - FilterActive Scenario 1.miz index d61eff9165..38932f79d7 100644 Binary files a/SET - Data Sets/SET-UNT/SET-UNT-300 - FilterActive Scenario 1/SET-UNT-300 - FilterActive Scenario 1.miz and b/SET - Data Sets/SET-UNT/SET-UNT-300 - FilterActive Scenario 1/SET-UNT-300 - FilterActive Scenario 1.miz differ diff --git a/SEV - SEAD Evasion/SEV-001 - SEAD Evasion/SEV-001 - SEAD Evasion.lua b/SEV - SEAD Evasion/SEV-001 - SEAD Evasion/SEV-001 - SEAD Evasion.lua index ea28a16be7..e4cb4ab944 100644 --- a/SEV - SEAD Evasion/SEV-001 - SEAD Evasion/SEV-001 - SEAD Evasion.lua +++ b/SEV - SEAD Evasion/SEV-001 - SEAD Evasion/SEV-001 - SEAD Evasion.lua @@ -1,11 +1,11 @@ - - - --- CCCP SEAD Defenses -SEAD_RU_SAM_Defenses = SEAD - :New( - { 'SAM Test' - } - ) - + + + +-- CCCP SEAD Defenses +SEAD_RU_SAM_Defenses = SEAD + :New( + { 'SAM Test' + } + ) + \ No newline at end of file diff --git a/SEV - SEAD Evasion/SEV-001 - SEAD Evasion/SEV-001 - SEAD Evasion.miz b/SEV - SEAD Evasion/SEV-001 - SEAD Evasion/SEV-001 - SEAD Evasion.miz index 7559ec85c1..2255be7d91 100644 Binary files a/SEV - SEAD Evasion/SEV-001 - SEAD Evasion/SEV-001 - SEAD Evasion.miz and b/SEV - SEAD Evasion/SEV-001 - SEAD Evasion/SEV-001 - SEAD Evasion.miz differ diff --git a/SPA - Spawning/SPA-011 - Ground Ops - Simple Spawning/SPA-011 - Ground Ops - Simple Spawning.lua b/SPA - Spawning/SPA-011 - Ground Ops - Simple Spawning/SPA-011 - Ground Ops - Simple Spawning.lua index 3dcfab741c..004b07b59a 100644 --- a/SPA - Spawning/SPA-011 - Ground Ops - Simple Spawning/SPA-011 - Ground Ops - Simple Spawning.lua +++ b/SPA - Spawning/SPA-011 - Ground Ops - Simple Spawning/SPA-011 - Ground Ops - Simple Spawning.lua @@ -1,23 +1,22 @@ --- Name: SPA-011 - Ground Ops - Simple Spawning --- Author: FlightControl --- Date Created: 10 Jan 2017 --- Checked in 15 dez 2020 by ZERO --- --- # Situation: --- --- At Gudauta spawn a ground vehicle. --- --- # Test cases: --- --- 1. Observe that the ground vehicle is spawned. - - - --- Tests Gudauta --- ------------- --- Spawn a gound vehicle... -Spawn_Vehicle_1 = SPAWN:New( "Spawn Vehicle 1" ) -Spawn_Group_1 = Spawn_Vehicle_1:Spawn() - - - +-- Name: SPA-011 - Ground Ops - Simple Spawning +-- Author: FlightControl +-- Date Created: 10 Jan 2017 +-- +-- # Situation: +-- +-- At Gudauta spawn a ground vehicle. +-- +-- # Test cases: +-- +-- 1. Observe that the ground vehicle is spawned. + + + +-- Tests Gudauta +-- ------------- +-- Spawn a gound vehicle... +Spawn_Vehicle_1 = SPAWN:New( "Spawn Vehicle 1" ) +Spawn_Group_1 = Spawn_Vehicle_1:Spawn() + + + diff --git a/SPA - Spawning/SPA-011 - Ground Ops - Simple Spawning/SPA-011 - Ground Ops - Simple Spawning.miz b/SPA - Spawning/SPA-011 - Ground Ops - Simple Spawning/SPA-011 - Ground Ops - Simple Spawning.miz index bdaaa1cb31..3d81ed8565 100644 Binary files a/SPA - Spawning/SPA-011 - Ground Ops - Simple Spawning/SPA-011 - Ground Ops - Simple Spawning.miz and b/SPA - Spawning/SPA-011 - Ground Ops - Simple Spawning/SPA-011 - Ground Ops - Simple Spawning.miz differ diff --git a/SPA - Spawning/SPA-012 - Ground Ops - Multiple Spawns/SPA-012 - Ground Ops - Multiple Spawns.lua b/SPA - Spawning/SPA-012 - Ground Ops - Multiple Spawns/SPA-012 - Ground Ops - Multiple Spawns.lua index 5acad6f394..edaa3c7316 100644 --- a/SPA - Spawning/SPA-012 - Ground Ops - Multiple Spawns/SPA-012 - Ground Ops - Multiple Spawns.lua +++ b/SPA - Spawning/SPA-012 - Ground Ops - Multiple Spawns/SPA-012 - Ground Ops - Multiple Spawns.lua @@ -1,27 +1,26 @@ --- Name: SPA-012 - Ground Ops - Multiple Spawns --- Author: FlightControl --- Date Created: 10 Jan 2017 --- Checked in 15 dez 2020 by ZERO --- --- # Situation: --- --- At Gudauta spawn multiple ground vehicles. --- --- # Test cases: --- --- 1. Observe that the ground vehicles are spawned at the position declared within the mission editor. - - - --- Tests Gudauta --- ------------- --- Spawn a gound vehicle... -Spawn_Vehicle_1 = SPAWN:New( "Spawn Vehicle 1" ) -Spawn_Group_1 = Spawn_Vehicle_1:Spawn() -Spawn_Group_2 = Spawn_Vehicle_1:Spawn() -Spawn_Group_3 = Spawn_Vehicle_1:Spawn() -Spawn_Group_4 = Spawn_Vehicle_1:Spawn() -Spawn_Group_5 = Spawn_Vehicle_1:Spawn() - - - +-- Name: SPA-012 - Ground Ops - Multiple Spawns +-- Author: FlightControl +-- Date Created: 10 Jan 2017 +-- +-- # Situation: +-- +-- At Gudauta spawn multiple ground vehicles. +-- +-- # Test cases: +-- +-- 1. Observe that the ground vehicles are spawned at the position declared within the mission editor. + + + +-- Tests Gudauta +-- ------------- +-- Spawn a gound vehicle... +Spawn_Vehicle_1 = SPAWN:New( "Spawn Vehicle 1" ) +Spawn_Group_1 = Spawn_Vehicle_1:Spawn() +Spawn_Group_2 = Spawn_Vehicle_1:Spawn() +Spawn_Group_3 = Spawn_Vehicle_1:Spawn() +Spawn_Group_4 = Spawn_Vehicle_1:Spawn() +Spawn_Group_5 = Spawn_Vehicle_1:Spawn() + + + diff --git a/SPA - Spawning/SPA-012 - Ground Ops - Multiple Spawns/SPA-012 - Ground Ops - Multiple Spawns.miz b/SPA - Spawning/SPA-012 - Ground Ops - Multiple Spawns/SPA-012 - Ground Ops - Multiple Spawns.miz index 00e86760db..a0182ab53e 100644 Binary files a/SPA - Spawning/SPA-012 - Ground Ops - Multiple Spawns/SPA-012 - Ground Ops - Multiple Spawns.miz and b/SPA - Spawning/SPA-012 - Ground Ops - Multiple Spawns/SPA-012 - Ground Ops - Multiple Spawns.miz differ diff --git a/SPA - Spawning/SPA-013 - Ground Ops - Scheduled Spawns/SPA-013 - Ground Ops - Scheduled Spawns.lua b/SPA - Spawning/SPA-013 - Ground Ops - Scheduled Spawns/SPA-013 - Ground Ops - Scheduled Spawns.lua index c24b978cfb..f6bb11296c 100644 --- a/SPA - Spawning/SPA-013 - Ground Ops - Scheduled Spawns/SPA-013 - Ground Ops - Scheduled Spawns.lua +++ b/SPA - Spawning/SPA-013 - Ground Ops - Scheduled Spawns/SPA-013 - Ground Ops - Scheduled Spawns.lua @@ -1,23 +1,22 @@ --- Name: SPA-013 - Ground Ops - Scheduled Spawns --- Author: FlightControl --- Date Created: 10 Jan 2017 --- Checked in 15 dez 2020 by ZERO --- --- # Situation: --- --- At Gudauta spawn multiple ground vehicles, in a scheduled fashion. --- --- # Test cases: --- --- 1. Observe that the ground vehicles are spawned at the position declared within the mission editor. --- 2. The vehicles should spawn according the scheduler parameters. - - - --- Tests Gudauta --- ------------- -Spawn_Vehicle_1 = SPAWN:New( "Spawn Vehicle 1" ):SpawnScheduled( 10, 0.5 ) - - - - +-- Name: SPA-013 - Ground Ops - Scheduled Spawns +-- Author: FlightControl +-- Date Created: 10 Jan 2017 +-- +-- # Situation: +-- +-- At Gudauta spawn multiple ground vehicles, in a scheduled fashion. +-- +-- # Test cases: +-- +-- 1. Observe that the ground vehicles are spawned at the position declared within the mission editor. +-- 2. The vehicles should spawn according the scheduler parameters. + + + +-- Tests Gudauta +-- ------------- +Spawn_Vehicle_1 = SPAWN:New( "Spawn Vehicle 1" ):SpawnScheduled( 10, 0.5 ) + + + + diff --git a/SPA - Spawning/SPA-013 - Ground Ops - Scheduled Spawns/SPA-013 - Ground Ops - Scheduled Spawns.miz b/SPA - Spawning/SPA-013 - Ground Ops - Scheduled Spawns/SPA-013 - Ground Ops - Scheduled Spawns.miz index 32c8b02c16..8aa6d5fcc1 100644 Binary files a/SPA - Spawning/SPA-013 - Ground Ops - Scheduled Spawns/SPA-013 - Ground Ops - Scheduled Spawns.miz and b/SPA - Spawning/SPA-013 - Ground Ops - Scheduled Spawns/SPA-013 - Ground Ops - Scheduled Spawns.miz differ diff --git a/SPA - Spawning/SPA-014 - Ground Ops - Scheduled Spawns Limited/SPA-014 - Ground Ops - Scheduled Spawns Limited.lua b/SPA - Spawning/SPA-014 - Ground Ops - Scheduled Spawns Limited/SPA-014 - Ground Ops - Scheduled Spawns Limited.lua index 9751a86793..dc7002bad7 100644 --- a/SPA - Spawning/SPA-014 - Ground Ops - Scheduled Spawns Limited/SPA-014 - Ground Ops - Scheduled Spawns Limited.lua +++ b/SPA - Spawning/SPA-014 - Ground Ops - Scheduled Spawns Limited/SPA-014 - Ground Ops - Scheduled Spawns Limited.lua @@ -1,22 +1,21 @@ --- Name: SPA-014 - Ground Ops - Scheduled Spawns Limited --- Author: FlightControl --- Date Created: 10 Jan 2017 --- Checked in 15 dez 2020 by ZERO --- --- # Situation: --- --- At Gudauta spawn multiple ground vehicles, in a scheduled fashion. --- --- # Test cases: --- --- 1. Observe that the ground vehicles are spawned at the position declared within the mission editor. --- 2. The vehicles should spawn according the scheduler parameters. --- 3. There should not be more than 5 groups spawned. - - - --- Tests Gudauta --- ------------- -Spawn_Vehicle_1 = SPAWN:New( "Spawn Vehicle 1" ):InitLimit( 5, 0 ):SpawnScheduled( 5, .5 ) - - +-- Name: SPA-014 - Ground Ops - Scheduled Spawns Limited +-- Author: FlightControl +-- Date Created: 10 Jan 2017 +-- +-- # Situation: +-- +-- At Gudauta spawn multiple ground vehicles, in a scheduled fashion. +-- +-- # Test cases: +-- +-- 1. Observe that the ground vehicles are spawned at the position declared within the mission editor. +-- 2. The vehicles should spawn according the scheduler parameters. +-- 3. There should not be more than 5 groups spawned. + + + +-- Tests Gudauta +-- ------------- +Spawn_Vehicle_1 = SPAWN:New( "Spawn Vehicle 1" ):InitLimit( 5, 0 ):SpawnScheduled( 5, .5 ) + + diff --git a/SPA - Spawning/SPA-014 - Ground Ops - Scheduled Spawns Limited/SPA-014 - Ground Ops - Scheduled Spawns Limited.miz b/SPA - Spawning/SPA-014 - Ground Ops - Scheduled Spawns Limited/SPA-014 - Ground Ops - Scheduled Spawns Limited.miz index fa26327d3f..2bb4b36c1f 100644 Binary files a/SPA - Spawning/SPA-014 - Ground Ops - Scheduled Spawns Limited/SPA-014 - Ground Ops - Scheduled Spawns Limited.miz and b/SPA - Spawning/SPA-014 - Ground Ops - Scheduled Spawns Limited/SPA-014 - Ground Ops - Scheduled Spawns Limited.miz differ diff --git a/SPA - Spawning/SPA-015 - Ground Ops - Randomize Route/SPA-015 - Ground Ops - Randomize Route.lua b/SPA - Spawning/SPA-015 - Ground Ops - Randomize Route/SPA-015 - Ground Ops - Randomize Route.lua index 1cc6cfb6e5..e6c7dc830a 100644 --- a/SPA - Spawning/SPA-015 - Ground Ops - Randomize Route/SPA-015 - Ground Ops - Randomize Route.lua +++ b/SPA - Spawning/SPA-015 - Ground Ops - Randomize Route/SPA-015 - Ground Ops - Randomize Route.lua @@ -1,28 +1,27 @@ --- Name: SPA-015 - Ground Ops - Randomize Route --- Author: FlightControl --- Date Created: 10 Jan 2017 --- Checked in 15 dez 2020 by ZERO --- --- # Situation: --- --- At Gudauta spawn multiple ground vehicles, in a scheduled fashion. --- --- # Test cases: --- --- 1. Observe that the ground vehicles are spawned at the position declared within the mission editor. --- 2. The vehicles should spawn according the scheduler parameters. --- 3. There should not be more than 5 groups spawned. --- 4. Observe that the route that the vehicles follow is randomized starting from point 1 till point 3. - - - --- Tests Gudauta --- ------------- -Spawn_Vehicle_1 = SPAWN:New( "Spawn Vehicle 1" ) - :InitLimit( 10, 10 ) - :InitRandomizeRoute( 1, 1, 200 ) -- Randomize route starting from point 1 till point 3, with a radius of 200 meters around each point. - :SpawnScheduled( 5, .5 ) - - - - +-- Name: SPA-015 - Ground Ops - Randomize Route +-- Author: FlightControl +-- Date Created: 10 Jan 2017 +-- +-- # Situation: +-- +-- At Gudauta spawn multiple ground vehicles, in a scheduled fashion. +-- +-- # Test cases: +-- +-- 1. Observe that the ground vehicles are spawned at the position declared within the mission editor. +-- 2. The vehicles should spawn according the scheduler parameters. +-- 3. There should not be more than 5 groups spawned. +-- 4. Observe that the route that the vehicles follow is randomized starting from point 1 till point 3. + + + +-- Tests Gudauta +-- ------------- +Spawn_Vehicle_1 = SPAWN:New( "Spawn Vehicle 1" ) + :InitLimit( 10, 10 ) + :InitRandomizeRoute( 1, 1, 200 ) -- Randomize route starting from point 1 till point 3, with a radius of 200 meters around each point. + :SpawnScheduled( 5, .5 ) + + + + diff --git a/SPA - Spawning/SPA-015 - Ground Ops - Randomize Route/SPA-015 - Ground Ops - Randomize Route.miz b/SPA - Spawning/SPA-015 - Ground Ops - Randomize Route/SPA-015 - Ground Ops - Randomize Route.miz index b91611f590..b864596858 100644 Binary files a/SPA - Spawning/SPA-015 - Ground Ops - Randomize Route/SPA-015 - Ground Ops - Randomize Route.miz and b/SPA - Spawning/SPA-015 - Ground Ops - Randomize Route/SPA-015 - Ground Ops - Randomize Route.miz differ diff --git a/SPA - Spawning/SPA-016 - Ground Ops - Randomize Zones/SPA-016 - Ground Ops - Randomize Zones.lua b/SPA - Spawning/SPA-016 - Ground Ops - Randomize Zones/SPA-016 - Ground Ops - Randomize Zones.lua index 867e5a5593..2675f03586 100644 --- a/SPA - Spawning/SPA-016 - Ground Ops - Randomize Zones/SPA-016 - Ground Ops - Randomize Zones.lua +++ b/SPA - Spawning/SPA-016 - Ground Ops - Randomize Zones/SPA-016 - Ground Ops - Randomize Zones.lua @@ -1,30 +1,29 @@ --- Name: SPA-016 - Ground Ops - Randomize Zones --- Author: FlightControl --- Date Created: 10 Jan 2017 --- Checked in 15 dez 2020 by ZERO --- --- # Situation: --- --- At Gudauta spawn multiple ground vehicles, in a scheduled fashion. --- --- # Test cases: --- --- 1. Observe that the ground vehicles are spawned at the position declared within the mission editor. --- 2. The vehicles should spawn according the scheduler parameters. --- 3. There should not be more than 5 groups spawned. --- 4. Observe that the route that the vehicles follow is randomized starting from point 1 till point 3. --- 5. Observe that the position where the units are spawned, is randomized according the zones. - - - --- Tests Gudauta --- ------------- --- Create a zone table of the 2 zones. -ZoneTable = { ZONE:New( "Zone1" ), ZONE:New( "Zone2" ) } - -Spawn_Vehicle_1 = SPAWN:New( "Spawn Vehicle 1" ) - :InitLimit( 10, 10 ) - :InitRandomizeRoute( 1, 1, 200 ) - :InitRandomizeZones( ZoneTable ) - :SpawnScheduled( 5, .5 ) - +-- Name: SPA-016 - Ground Ops - Randomize Zones +-- Author: FlightControl +-- Date Created: 10 Jan 2017 +-- +-- # Situation: +-- +-- At Gudauta spawn multiple ground vehicles, in a scheduled fashion. +-- +-- # Test cases: +-- +-- 1. Observe that the ground vehicles are spawned at the position declared within the mission editor. +-- 2. The vehicles should spawn according the scheduler parameters. +-- 3. There should not be more than 5 groups spawned. +-- 4. Observe that the route that the vehicles follow is randomized starting from point 1 till point 3. +-- 5. Observe that the position where the units are spawned, is randomized according the zones. + + + +-- Tests Gudauta +-- ------------- +-- Create a zone table of the 2 zones. +ZoneTable = { ZONE:New( "Zone1" ), ZONE:New( "Zone2" ) } + +Spawn_Vehicle_1 = SPAWN:New( "Spawn Vehicle 1" ) + :InitLimit( 10, 10 ) + :InitRandomizeRoute( 1, 1, 200 ) + :InitRandomizeZones( ZoneTable ) + :SpawnScheduled( 5, .5 ) + diff --git a/SPA - Spawning/SPA-016 - Ground Ops - Randomize Zones/SPA-016 - Ground Ops - Randomize Zones.miz b/SPA - Spawning/SPA-016 - Ground Ops - Randomize Zones/SPA-016 - Ground Ops - Randomize Zones.miz index 356331dc1f..54d5c16327 100644 Binary files a/SPA - Spawning/SPA-016 - Ground Ops - Randomize Zones/SPA-016 - Ground Ops - Randomize Zones.miz and b/SPA - Spawning/SPA-016 - Ground Ops - Randomize Zones/SPA-016 - Ground Ops - Randomize Zones.miz differ diff --git a/SPA - Spawning/SPA-017 - Ground Ops - Set AI inactive while spawning/SPA-017 - Ground Ops - Set AI inactive while spawning.lua b/SPA - Spawning/SPA-017 - Ground Ops - Set AI inactive while spawning/SPA-017 - Ground Ops - Set AI inactive while spawning.lua index 434ab1f863..1fbda73872 100644 --- a/SPA - Spawning/SPA-017 - Ground Ops - Set AI inactive while spawning/SPA-017 - Ground Ops - Set AI inactive while spawning.lua +++ b/SPA - Spawning/SPA-017 - Ground Ops - Set AI inactive while spawning/SPA-017 - Ground Ops - Set AI inactive while spawning.lua @@ -1,32 +1,32 @@ --- Name: SPA-017 - Ground Ops - Set AI inactive while spawning --- Author: FlightControl --- Date Created: 24 Jan 2017 --- Checked in 15 dez 2020 by ZERO --- --- # Situation: --- --- At Gudauta spawn multiple ground vehicles, in a scheduled fashion. --- But set the AI inactive when spawning. --- --- # Test cases: --- --- 1. Observe that the ground vehicles are spawned at the position declared within the mission editor. --- 2. The vehicles should spawn according the scheduler parameters. --- 3. There should not be more than 10 groups spawned. --- 4. Observe that the AI is inactivated, and thus, the vehicles aren't moving. --- 5. Observe that the position where the units are spawned, is randomized in the zones perimeters. - - - --- Tests Gudauta --- ------------- --- Create a zone table of the 2 zones. -ZoneTable = { ZONE:New( "Zone1" ), ZONE:New( "Zone2" ) } - -Spawn_Vehicle_1 = SPAWN:New( "Spawn Vehicle 1" ) - :InitLimit( 10, 10 ) - :InitRandomizeRoute( 1, 1, 200 ) - :InitRandomizeZones( ZoneTable ) - :InitAIOnOff( false ) -- This will disable the AI. You can also use :InitAIOff(). Set AI On (for those groups with AI Off in the ME), with :InitAIOn(). - :SpawnScheduled( 5, .5 ) - +-- Name: SPA-017 - Ground Ops - Set AI inactive while spawning +-- Author: FlightControl +-- Date Created: 24 Jan 2017 +-- Checked in 15 dez 2020 by ZERO +-- +-- # Situation: +-- +-- At Gudauta spawn multiple ground vehicles, in a scheduled fashion. +-- But set the AI inactive when spawning. +-- +-- # Test cases: +-- +-- 1. Observe that the ground vehicles are spawned at the position declared within the mission editor. +-- 2. The vehicles should spawn according the scheduler parameters. +-- 3. There should not be more than 10 groups spawned. +-- 4. Observe that the AI is inactivated, and thus, the vehicles aren't moving. +-- 5. Observe that the position where the units are spawned, is randomized in the zones perimeters. + + + +-- Tests Gudauta +-- ------------- +-- Create a zone table of the 2 zones. +ZoneTable = { ZONE:New( "Zone1" ), ZONE:New( "Zone2" ) } + +Spawn_Vehicle_1 = SPAWN:New( "Spawn Vehicle 1" ) + :InitLimit( 10, 10 ) + :InitRandomizeRoute( 1, 1, 200 ) + :InitRandomizeZones( ZoneTable ) + :InitAIOnOff( false ) -- This will disable the AI. You can also use :InitAIOff(). Set AI On (for those groups with AI Off in the ME), with :InitAIOn(). + :SpawnScheduled( 5, .5 ) + diff --git a/SPA - Spawning/SPA-017 - Ground Ops - Set AI inactive while spawning/SPA-017 - Ground Ops - Set AI inactive while spawning.miz b/SPA - Spawning/SPA-017 - Ground Ops - Set AI inactive while spawning/SPA-017 - Ground Ops - Set AI inactive while spawning.miz index c84337da7d..3f68be6aa9 100644 Binary files a/SPA - Spawning/SPA-017 - Ground Ops - Set AI inactive while spawning/SPA-017 - Ground Ops - Set AI inactive while spawning.miz and b/SPA - Spawning/SPA-017 - Ground Ops - Set AI inactive while spawning/SPA-017 - Ground Ops - Set AI inactive while spawning.miz differ diff --git a/SPA - Spawning/SPA-018 - Ground Ops - Randomize Templates/SPA-018 - Ground Ops - Randomize Templates.lua b/SPA - Spawning/SPA-018 - Ground Ops - Randomize Templates/SPA-018 - Ground Ops - Randomize Templates.lua index 73463d3068..378dc12c49 100644 --- a/SPA - Spawning/SPA-018 - Ground Ops - Randomize Templates/SPA-018 - Ground Ops - Randomize Templates.lua +++ b/SPA - Spawning/SPA-018 - Ground Ops - Randomize Templates/SPA-018 - Ground Ops - Randomize Templates.lua @@ -1,34 +1,34 @@ ---- --- Name: SPA-018 - Ground Ops - Randomize Templates --- Author: FlightControl --- Date Created: 10 Jan 2017 --- Checked in 15 dez 2020 by ZERO --- --- # Situation: --- --- At Gudauta spawn multiple ground vehicles, in a scheduled fashion. --- --- # Test cases: --- --- 1. Observe that the ground vehicles are spawned at the position declared within the mission editor. --- 2. The vehicles should spawn according the scheduler parameters. --- 3. There should not be more than 10 units spawned. Make sure that group count have less than 10 units or 10 groups. --- 4. Observe that the route that the vehicles follow is randomized starting from point 1 till point 3. --- 5. Observe that the position where the units are spawned, is randomized according the zones. --- 6. Observe that the ground vehicles are spawned with randomized templates. - - --- Tests Gudauta --- ------------- --- Create a zone table of the 2 zones. -ZoneTable = { ZONE:New( "Zone1" ), ZONE:New( "Zone2" ) } - -TemplateTable = { "A", "B", "C" } - -Spawn_Vehicle_1 = SPAWN:New( "Spawn Vehicle 1" ) - :InitLimit( 10, 10 ) - :InitRandomizeRoute( 1, 1, 200 ) - :InitRandomizeZones( ZoneTable ) - :InitRandomizeTemplate( TemplateTable ) - :SpawnScheduled( 5, .5 ) - +--- +-- Name: SPA-018 - Ground Ops - Randomize Templates +-- Author: FlightControl +-- Date Created: 10 Jan 2017 +-- Checked in 15 dez 2020 by ZERO +-- +-- # Situation: +-- +-- At Gudauta spawn multiple ground vehicles, in a scheduled fashion. +-- +-- # Test cases: +-- +-- 1. Observe that the ground vehicles are spawned at the position declared within the mission editor. +-- 2. The vehicles should spawn according the scheduler parameters. +-- 3. There should not be more than 10 groups spawned. +-- 4. Observe that the route that the vehicles follow is randomized starting from point 1 till point 3. +-- 5. Observe that the position where the units are spawned, is randomized according the zones. +-- 6. Observe that the ground vehicles are spawned with randomized templates. + + +-- Tests Gudauta +-- ------------- +-- Create a zone table of the 2 zones. +ZoneTable = { ZONE:New( "Zone1" ), ZONE:New( "Zone2" ) } + +TemplateTable = { "A", "B", "C" } + +Spawn_Vehicle_1 = SPAWN:New( "Spawn Vehicle 1" ) + :InitLimit( 10, 10 ) + :InitRandomizeRoute( 1, 1, 200 ) + :InitRandomizeZones( ZoneTable ) + :InitRandomizeTemplate( TemplateTable ) + :SpawnScheduled( 5, .5 ) + diff --git a/SPA - Spawning/SPA-018 - Ground Ops - Randomize Templates/SPA-018 - Ground Ops - Randomize Templates.miz b/SPA - Spawning/SPA-018 - Ground Ops - Randomize Templates/SPA-018 - Ground Ops - Randomize Templates.miz index 93eb9f2eb0..b078079111 100644 Binary files a/SPA - Spawning/SPA-018 - Ground Ops - Randomize Templates/SPA-018 - Ground Ops - Randomize Templates.miz and b/SPA - Spawning/SPA-018 - Ground Ops - Randomize Templates/SPA-018 - Ground Ops - Randomize Templates.miz differ diff --git a/SPA - Spawning/SPA-019 - Ground Ops - Randomize Templates without Waypoints/SPA-019 - Ground Ops - Randomize Templates without Waypoints.lua b/SPA - Spawning/SPA-019 - Ground Ops - Randomize Templates without Waypoints/SPA-019 - Ground Ops - Randomize Templates without Waypoints.lua index 55947f7c37..cfd64c10de 100644 --- a/SPA - Spawning/SPA-019 - Ground Ops - Randomize Templates without Waypoints/SPA-019 - Ground Ops - Randomize Templates without Waypoints.lua +++ b/SPA - Spawning/SPA-019 - Ground Ops - Randomize Templates without Waypoints/SPA-019 - Ground Ops - Randomize Templates without Waypoints.lua @@ -1,29 +1,27 @@ ---- --- Name: SPA-019 - Ground Ops - Randomize Templates without Waypoints --- Author: FlightControl --- Date Created: 24 Feb 2017 --- Checked in 15 dez 2020 by ZERO --- --- # Situation: --- --- At Gudauta spawn multiple ground vehicles, in a scheduled fashion. --- --- # Test cases: --- --- 1. Observe that the ground vehicles are spawned with randomized templates. --- 2. Observe that the ground vehicles are spread around the spawning area and are not stacked upon each other. --- Note by ZERO (15/12/2020): the vehicles are spawned upon each other - - --- Tests Gudauta --- ------------- --- Create a zone table of the 2 zones. -ZoneTable = { ZONE:New( "Zone1" ), ZONE:New( "Zone2" ) } - -TemplateTable = { "A", "B", "C" } - -Spawn_Vehicle_1 = SPAWN:New( "Spawn Vehicle 1" ) - :InitLimit( 10, 10 ) - :InitRandomizeTemplate( TemplateTable ) - :SpawnScheduled( 5, .5 ) - +--- +-- Name: SPA-019 - Ground Ops - Randomize Templates with Waypoints +-- Author: FlightControl +-- Date Created: 24 Feb 2017 +-- +-- # Situation: +-- +-- At Gudauta spawn multiple ground vehicles, in a scheduled fashion. +-- +-- # Test cases: +-- +-- 1. Observe that the ground vehicles are spawned with randomized templates. +-- 2. Observe that the ground vehicles are spread around the spawning area and are not stacked upon each other. + + +-- Tests Gudauta +-- ------------- +-- Create a zone table of the 2 zones. +ZoneTable = { ZONE:New( "Zone1" ), ZONE:New( "Zone2" ) } + +TemplateTable = { "A", "B", "C" } + +Spawn_Vehicle_1 = SPAWN:New( "Spawn Vehicle 1" ) + :InitLimit( 10, 10 ) + :InitRandomizeTemplate( TemplateTable ) + :SpawnScheduled( 5, .5 ) + diff --git a/SPA - Spawning/SPA-019 - Ground Ops - Randomize Templates without Waypoints/SPA-019 - Ground Ops - Randomize Templates without Waypoints.miz b/SPA - Spawning/SPA-019 - Ground Ops - Randomize Templates without Waypoints/SPA-019 - Ground Ops - Randomize Templates without Waypoints.miz index da84489974..04db055200 100644 Binary files a/SPA - Spawning/SPA-019 - Ground Ops - Randomize Templates without Waypoints/SPA-019 - Ground Ops - Randomize Templates without Waypoints.miz and b/SPA - Spawning/SPA-019 - Ground Ops - Randomize Templates without Waypoints/SPA-019 - Ground Ops - Randomize Templates without Waypoints.miz differ diff --git a/SPA - Spawning/SPA-020 - Ground Ops - Randomize Templates in Zones no WP/SPA-020 - Ground Ops - Randomize Templates in Zones no WP.lua b/SPA - Spawning/SPA-020 - Ground Ops - Randomize Templates in Zones no WP/SPA-020 - Ground Ops - Randomize Templates in Zones no WP.lua index 4f011f1984..87c0a4be1d 100644 --- a/SPA - Spawning/SPA-020 - Ground Ops - Randomize Templates in Zones no WP/SPA-020 - Ground Ops - Randomize Templates in Zones no WP.lua +++ b/SPA - Spawning/SPA-020 - Ground Ops - Randomize Templates in Zones no WP/SPA-020 - Ground Ops - Randomize Templates in Zones no WP.lua @@ -1,30 +1,29 @@ ---- --- Name: SPA-020 - Ground Ops - Randomize Templates in Random Zones without Waypoints --- Author: FlightControl --- Date Created: 24 Feb 2017 --- Checked in 15 dez 2020 by ZERO --- --- # Situation: --- --- At Gudauta spawn multiple ground vehicles, in a scheduled fashion. --- --- # Test cases: --- --- 1. Observe that the ground vehicles are spawned with randomized templates. --- 2. Observe that the ground vehicles are spread around the spawning area and are not stacked upon each other. --- 3. Observe that the ground vehicles are spread over the random zones, and that the initial templates formations are kept. - - --- Tests Gudauta --- ------------- --- Create a zone table of the 2 zones. -ZoneTable = { ZONE:New( "Zone1" ), ZONE:New( "Zone2" ) } - -TemplateTable = { "A", "B", "C" } - -Spawn_Vehicle_1 = SPAWN:New( "Spawn Vehicle 1" ) - :InitLimit( 100, 10 ) - :InitRandomizeTemplate( TemplateTable ) - :InitRandomizeZones( ZoneTable ) - :SpawnScheduled( 5, .5 ) - +--- +-- Name: SPA-020 - Ground Ops - Randomize Templates in Random Zones without Waypoints +-- Author: FlightControl +-- Date Created: 24 Feb 2017 +-- +-- # Situation: +-- +-- At Gudauta spawn multiple ground vehicles, in a scheduled fashion. +-- +-- # Test cases: +-- +-- 1. Observe that the ground vehicles are spawned with randomized templates. +-- 2. Observe that the ground vehicles are spread around the spawning area and are not stacked upon each other. +-- 3. Observe that the ground vehicles are spread over the random zones, and that the initial templates formations are kept. + + +-- Tests Gudauta +-- ------------- +-- Create a zone table of the 2 zones. +ZoneTable = { ZONE:New( "Zone1" ), ZONE:New( "Zone2" ) } + +TemplateTable = { "A", "B", "C" } + +Spawn_Vehicle_1 = SPAWN:New( "Spawn Vehicle 1" ) + :InitLimit( 100, 10 ) + :InitRandomizeTemplate( TemplateTable ) + :InitRandomizeZones( ZoneTable ) + :SpawnScheduled( 5, .5 ) + diff --git a/SPA - Spawning/SPA-020 - Ground Ops - Randomize Templates in Zones no WP/SPA-020 - Ground Ops - Randomize Templates in Zones no WP.miz b/SPA - Spawning/SPA-020 - Ground Ops - Randomize Templates in Zones no WP/SPA-020 - Ground Ops - Randomize Templates in Zones no WP.miz index 9e56bdd29f..ae7fe56b9a 100644 Binary files a/SPA - Spawning/SPA-020 - Ground Ops - Randomize Templates in Zones no WP/SPA-020 - Ground Ops - Randomize Templates in Zones no WP.miz and b/SPA - Spawning/SPA-020 - Ground Ops - Randomize Templates in Zones no WP/SPA-020 - Ground Ops - Randomize Templates in Zones no WP.miz differ diff --git a/SPA - Spawning/SPA-021 - Ground Ops - Scheduled Spawns Limited Keep Unit Names/SPA-021 - Ground Ops - Scheduled Spawns Limited Keep Unit Names.lua b/SPA - Spawning/SPA-021 - Ground Ops - Scheduled Spawns Limited Keep Unit Names/SPA-021 - Ground Ops - Scheduled Spawns Limited Keep Unit Names.lua index 32d56ed6d3..efe844c314 100644 --- a/SPA - Spawning/SPA-021 - Ground Ops - Scheduled Spawns Limited Keep Unit Names/SPA-021 - Ground Ops - Scheduled Spawns Limited Keep Unit Names.lua +++ b/SPA - Spawning/SPA-021 - Ground Ops - Scheduled Spawns Limited Keep Unit Names/SPA-021 - Ground Ops - Scheduled Spawns Limited Keep Unit Names.lua @@ -1,28 +1,28 @@ ---- --- Name: SPA-021 - Ground Ops - Scheduled Spawns Limited Keep Unit Names --- Author: FlightControl --- Date Created: 14 Mar 2017 --- Checked in 15 dez 2020 by ZERO --- --- # Situation: --- --- At Gudauta spawn multiple ground vehicles, in a scheduled fashion. --- --- # Test cases: --- --- 1. Observe that the ground vehicles are spawned at the position declared within the mission editor. --- 2. The vehicles should spawn according the scheduler parameters. --- 3. There should not be more than 5 groups spawned. (Number of units is 5 groups x 4 units in group = 20 that is a unit limits in :initLimit function in this implementation (:InitLimit( 20 , 10 ))) --- 4. Observe the unit names, they should have the name as defined within the ME. - - - --- Tests Gudauta --- ------------- -Spawn_Vehicle_1 = SPAWN - :New( "Spawn Vehicle 1" ) - :InitKeepUnitNames() - :InitLimit( 20 , 10 ) - :SpawnScheduled( 5, .5 ) - - +--- +-- Name: SPA-021 - Ground Ops - Scheduled Spawns Limited Keep Unit Names +-- Author: FlightControl +-- Date Created: 14 Mar 2017 +-- Checked in 15 dez 2020 by ZERO +-- +-- # Situation: +-- +-- At Gudauta spawn multiple ground vehicles, in a scheduled fashion. +-- +-- # Test cases: +-- +-- 1. Observe that the ground vehicles are spawned at the position declared within the mission editor. +-- 2. The vehicles should spawn according the scheduler parameters. +-- 3. There should not be more than 5 groups spawned. (Number of units is 5 groups x 4 units in group = 20 that is a unit limits in :initLimit function in this implementation (:InitLimit( 20 , 10 ))) +-- 4. Observe the unit names, they should have the name as defined within the ME. + + + +-- Tests Gudauta +-- ------------- +Spawn_Vehicle_1 = SPAWN + :New( "Spawn Vehicle 1" ) + :InitKeepUnitNames() + :InitLimit( 20 , 10 ) + :SpawnScheduled( 5, .5 ) + + diff --git a/SPA - Spawning/SPA-021 - Ground Ops - Scheduled Spawns Limited Keep Unit Names/SPA-021 - Ground Ops - Scheduled Spawns Limited Keep Unit Names.miz b/SPA - Spawning/SPA-021 - Ground Ops - Scheduled Spawns Limited Keep Unit Names/SPA-021 - Ground Ops - Scheduled Spawns Limited Keep Unit Names.miz index 68ad4b794c..dfeda5b51f 100644 Binary files a/SPA - Spawning/SPA-021 - Ground Ops - Scheduled Spawns Limited Keep Unit Names/SPA-021 - Ground Ops - Scheduled Spawns Limited Keep Unit Names.miz and b/SPA - Spawning/SPA-021 - Ground Ops - Scheduled Spawns Limited Keep Unit Names/SPA-021 - Ground Ops - Scheduled Spawns Limited Keep Unit Names.miz differ diff --git a/SPA - Spawning/SPA-022 - Ground Ops - Scheduled Spawns Limited with long interval/SPA-022 - Ground Ops - Scheduled Spawns Limited with long interval.lua b/SPA - Spawning/SPA-022 - Ground Ops - Scheduled Spawns Limited with long interval/SPA-022 - Ground Ops - Scheduled Spawns Limited with long interval.lua index 5096cddc56..01978f8be7 100644 --- a/SPA - Spawning/SPA-022 - Ground Ops - Scheduled Spawns Limited with long interval/SPA-022 - Ground Ops - Scheduled Spawns Limited with long interval.lua +++ b/SPA - Spawning/SPA-022 - Ground Ops - Scheduled Spawns Limited with long interval/SPA-022 - Ground Ops - Scheduled Spawns Limited with long interval.lua @@ -1,23 +1,23 @@ --- Name: SPA-022 - Ground Ops - Scheduled Spawns Limited with long interval --- Author: FlightControl --- Date Created: 18 Mar 2017 --- --- # Situation: --- --- At Gudauta spawn multiple ground vehicles, in a scheduled fashion. --- The vehicle should respawn when killed. --- --- # Test cases: --- --- 1. Observe that the ground vehicles are spawned at the position declared within the mission editor. --- 2. The vehicles should spawn according the scheduler parameters. - - - --- Tests Gudauta --- ------------- -Spawn_Vehicle_1 = SPAWN:New( "Spawn Vehicle 1" ):InitLimit( 1, 0 ):SpawnScheduled( 30, .5 ) - - - - +-- Name: SPA-022 - Ground Ops - Scheduled Spawns Limited with long interval +-- Author: FlightControl +-- Date Created: 18 Mar 2017 +-- +-- # Situation: +-- +-- At Gudauta spawn multiple ground vehicles, in a scheduled fashion. +-- The vehicle should respawn when killed. +-- +-- # Test cases: +-- +-- 1. Observe that the ground vehicles are spawned at the position declared within the mission editor. +-- 2. The vehicles should spawn according the scheduler parameters. + + + +-- Tests Gudauta +-- ------------- +Spawn_Vehicle_1 = SPAWN:New( "Spawn Vehicle 1" ):InitLimit( 1, 0 ):SpawnScheduled( 30, .5 ) + + + + diff --git a/SPA - Spawning/SPA-022 - Ground Ops - Scheduled Spawns Limited with long interval/SPA-022 - Ground Ops - Scheduled Spawns Limited with long interval.miz b/SPA - Spawning/SPA-022 - Ground Ops - Scheduled Spawns Limited with long interval/SPA-022 - Ground Ops - Scheduled Spawns Limited with long interval.miz index fa47bd3dc9..d13a525233 100644 Binary files a/SPA - Spawning/SPA-022 - Ground Ops - Scheduled Spawns Limited with long interval/SPA-022 - Ground Ops - Scheduled Spawns Limited with long interval.miz and b/SPA - Spawning/SPA-022 - Ground Ops - Scheduled Spawns Limited with long interval/SPA-022 - Ground Ops - Scheduled Spawns Limited with long interval.miz differ diff --git a/SPA - Spawning/SPA-023 - Ground Ops - SpawnStart and SpawnStop/SPA-023 - Ground Ops - SpawnStart and SpawnStop.lua b/SPA - Spawning/SPA-023 - Ground Ops - SpawnStart and SpawnStop/SPA-023 - Ground Ops - SpawnStart and SpawnStop.lua index 17c3d32d80..0c3647a3cd 100644 --- a/SPA - Spawning/SPA-023 - Ground Ops - SpawnStart and SpawnStop/SPA-023 - Ground Ops - SpawnStart and SpawnStop.lua +++ b/SPA - Spawning/SPA-023 - Ground Ops - SpawnStart and SpawnStop/SPA-023 - Ground Ops - SpawnStart and SpawnStop.lua @@ -1,26 +1,26 @@ ---- --- Name: SPA-023 - Ground Ops - SpawnStart and SpawnStop --- Author: FlightControl --- Date Created: 10 Jan 2017 --- --- # Situation: --- --- At Gudauta spawn multiple ground vehicles, in a scheduled fashion. --- The schedule is immediately stopped and started. --- --- # Test cases: --- --- 1. Observe that the ground vehicles are spawned at the position declared within the mission editor. --- 2. The vehicles should spawn according the scheduler parameters. - - - --- Tests Gudauta --- ------------- -Spawn_Vehicle = SPAWN:New( "Spawn Vehicle 1" ):SpawnScheduled( 10, 0.5 ):SpawnScheduleStop() - -Spawn_Vehicle:SpawnScheduleStart() - - - - +--- +-- Name: SPA-023 - Ground Ops - SpawnStart and SpawnStop +-- Author: FlightControl +-- Date Created: 10 Jan 2017 +-- +-- # Situation: +-- +-- At Gudauta spawn multiple ground vehicles, in a scheduled fashion. +-- The schedule is immediately stopped and started. +-- +-- # Test cases: +-- +-- 1. Observe that the ground vehicles are spawned at the position declared within the mission editor. +-- 2. The vehicles should spawn according the scheduler parameters. + + + +-- Tests Gudauta +-- ------------- +Spawn_Vehicle = SPAWN:New( "Spawn Vehicle 1" ):SpawnScheduled( 10, 0.5 ):SpawnScheduleStop() + +Spawn_Vehicle:SpawnScheduleStart() + + + + diff --git a/SPA - Spawning/SPA-023 - Ground Ops - SpawnStart and SpawnStop/SPA-023 - Ground Ops - SpawnStart and SpawnStop.miz b/SPA - Spawning/SPA-023 - Ground Ops - SpawnStart and SpawnStop/SPA-023 - Ground Ops - SpawnStart and SpawnStop.miz index 1779f1fe66..fc53f4a8e7 100644 Binary files a/SPA - Spawning/SPA-023 - Ground Ops - SpawnStart and SpawnStop/SPA-023 - Ground Ops - SpawnStart and SpawnStop.miz and b/SPA - Spawning/SPA-023 - Ground Ops - SpawnStart and SpawnStop/SPA-023 - Ground Ops - SpawnStart and SpawnStop.miz differ diff --git a/SPA - Spawning/SPA-024 - Ground Ops - Arrays Normandy/SPA-024 - Ground Ops - Arrays Normandy.miz b/SPA - Spawning/SPA-024 - Ground Ops - Arrays Normandy/SPA-024 - Ground Ops - Arrays Normandy.miz index 1f65887bea..eb04cfa997 100644 Binary files a/SPA - Spawning/SPA-024 - Ground Ops - Arrays Normandy/SPA-024 - Ground Ops - Arrays Normandy.miz and b/SPA - Spawning/SPA-024 - Ground Ops - Arrays Normandy/SPA-024 - Ground Ops - Arrays Normandy.miz differ diff --git a/SPA - Spawning/SPA-024 - Ground Ops - Arrays Normandy/SPA-024 - Ground Ops - Arrays.lua b/SPA - Spawning/SPA-024 - Ground Ops - Arrays Normandy/SPA-024 - Ground Ops - Arrays.lua new file mode 100644 index 0000000000..1bdb911081 --- /dev/null +++ b/SPA - Spawning/SPA-024 - Ground Ops - Arrays Normandy/SPA-024 - Ground Ops - Arrays.lua @@ -0,0 +1,27 @@ +--- +-- Name: SPA-024 - Ground Ops - Arrays +-- Author: FlightControl +-- Date Created: 19 Jul 2017 +-- +-- # Situation: +-- +-- At Gudauta spawn multiple ground vehicles, in an array. +-- +-- # Test cases: +-- +-- 1. Observe that the ground vehicles are spawned at the position declared within the mission editor. +-- 2. The vehicles should spawn according the array parameters. + + + +-- Tests Gudauta +-- ------------- +Spawn_Vehicle = SPAWN + :New( "Spawn Vehicles" ) + :InitLimit( 12, 60 ) + :InitArray( 90, 10, 10, 10 ) + + + + + diff --git a/SPA - Spawning/SPA-024 - Ground Ops - Arrays/SPA-024 - Ground Ops - Arrays.lua b/SPA - Spawning/SPA-024 - Ground Ops - Arrays/SPA-024 - Ground Ops - Arrays.lua index 43730154a9..1bdb911081 100644 --- a/SPA - Spawning/SPA-024 - Ground Ops - Arrays/SPA-024 - Ground Ops - Arrays.lua +++ b/SPA - Spawning/SPA-024 - Ground Ops - Arrays/SPA-024 - Ground Ops - Arrays.lua @@ -1,27 +1,27 @@ ---- --- Name: SPA-024 - Ground Ops - Arrays --- Author: FlightControl --- Date Created: 19 Jul 2017 --- --- # Situation: --- --- At Gudauta spawn multiple ground vehicles, in an array. --- --- # Test cases: --- --- 1. Observe that the ground vehicles are spawned at the position declared within the mission editor. --- 2. The vehicles should spawn according the array parameters. - - - --- Tests Gudauta --- ------------- -Spawn_Vehicle = SPAWN - :New( "Spawn Vehicles" ) - :InitLimit( 12, 60 ) - :InitArray( 90, 10, 10, 10 ) - - - - - +--- +-- Name: SPA-024 - Ground Ops - Arrays +-- Author: FlightControl +-- Date Created: 19 Jul 2017 +-- +-- # Situation: +-- +-- At Gudauta spawn multiple ground vehicles, in an array. +-- +-- # Test cases: +-- +-- 1. Observe that the ground vehicles are spawned at the position declared within the mission editor. +-- 2. The vehicles should spawn according the array parameters. + + + +-- Tests Gudauta +-- ------------- +Spawn_Vehicle = SPAWN + :New( "Spawn Vehicles" ) + :InitLimit( 12, 60 ) + :InitArray( 90, 10, 10, 10 ) + + + + + diff --git a/SPA - Spawning/SPA-024 - Ground Ops - Arrays/SPA-024 - Ground Ops - Arrays.miz b/SPA - Spawning/SPA-024 - Ground Ops - Arrays/SPA-024 - Ground Ops - Arrays.miz index ab2adb7aa9..eb04cfa997 100644 Binary files a/SPA - Spawning/SPA-024 - Ground Ops - Arrays/SPA-024 - Ground Ops - Arrays.miz and b/SPA - Spawning/SPA-024 - Ground Ops - Arrays/SPA-024 - Ground Ops - Arrays.miz differ diff --git a/SPA - Spawning/SPA-025 - Ground Ops - Spawn Hidden/SPA-025 - Ground Ops - Spawn Hidden.lua b/SPA - Spawning/SPA-025 - Ground Ops - Spawn Hidden/SPA-025 - Ground Ops - Spawn Hidden.lua index 58c162e33d..1d7837712f 100644 --- a/SPA - Spawning/SPA-025 - Ground Ops - Spawn Hidden/SPA-025 - Ground Ops - Spawn Hidden.lua +++ b/SPA - Spawning/SPA-025 - Ground Ops - Spawn Hidden/SPA-025 - Ground Ops - Spawn Hidden.lua @@ -1,22 +1,22 @@ --- Name: SPA-025 - Ground Ops - Spawn Hidden --- Author: FlightControl --- Date Created: 06 Sep 2017 --- --- # Situation: --- --- At Gudauta spawn a ground vehicle, hidden --- --- # Test cases: --- --- 1. Observe that the ground vehicle is spawned and his hidden. - - - --- Tests Gudauta --- ------------- --- Spawn a gound vehicle... -Spawn_Vehicle_1 = SPAWN:New( "Spawn Vehicle 1" ) -Spawn_Group_1 = Spawn_Vehicle_1:Spawn() - - - +-- Name: SPA-025 - Ground Ops - Spawn Hidden +-- Author: FlightControl +-- Date Created: 06 Sep 2017 +-- +-- # Situation: +-- +-- At Gudauta spawn a ground vehicle, hidden +-- +-- # Test cases: +-- +-- 1. Observe that the ground vehicle is spawned and his hidden. + + + +-- Tests Gudauta +-- ------------- +-- Spawn a gound vehicle... +Spawn_Vehicle_1 = SPAWN:New( "Spawn Vehicle 1" ) +Spawn_Group_1 = Spawn_Vehicle_1:Spawn() + + + diff --git a/SPA - Spawning/SPA-025 - Ground Ops - Spawn Hidden/SPA-025 - Ground Ops - Spawn Hidden.miz b/SPA - Spawning/SPA-025 - Ground Ops - Spawn Hidden/SPA-025 - Ground Ops - Spawn Hidden.miz index 31a701f687..3306dc9e63 100644 Binary files a/SPA - Spawning/SPA-025 - Ground Ops - Spawn Hidden/SPA-025 - Ground Ops - Spawn Hidden.miz and b/SPA - Spawning/SPA-025 - Ground Ops - Spawn Hidden/SPA-025 - Ground Ops - Spawn Hidden.miz differ diff --git a/SPA - Spawning/SPA-026 - Ground Ops - Spawn RandomizeTemplate Hidden/SPA-026 - Ground Ops - Spawn RandomizeTemplate Hidden.lua b/SPA - Spawning/SPA-026 - Ground Ops - Spawn RandomizeTemplate Hidden/SPA-026 - Ground Ops - Spawn RandomizeTemplate Hidden.lua index 50e602b532..be23d79481 100644 --- a/SPA - Spawning/SPA-026 - Ground Ops - Spawn RandomizeTemplate Hidden/SPA-026 - Ground Ops - Spawn RandomizeTemplate Hidden.lua +++ b/SPA - Spawning/SPA-026 - Ground Ops - Spawn RandomizeTemplate Hidden/SPA-026 - Ground Ops - Spawn RandomizeTemplate Hidden.lua @@ -1,26 +1,26 @@ --- Name: SPA-026 - Ground Ops - Spawn RandomizeTemplate Hidden --- Author: FlightControl --- Date Created: 06 Sep 2017 --- --- # Situation: --- --- At Gudauta spawn a ground vehicle, hidden, based on a randomized template. --- --- # Test cases: --- --- 1. Observe that a random ground vehicle is spawned and his hidden. - - - --- Tests Gudauta --- ------------- --- Spawn a gound vehicle... - -Templates = { "A", "B" } - -Spawn_Vehicle_1 = SPAWN:New( "Vehicle" ) -Spawn_Vehicle_1:InitRandomizeTemplate( Templates ) -Spawn_Group_1 = Spawn_Vehicle_1:Spawn() - - - +-- Name: SPA-026 - Ground Ops - Spawn RandomizeTemplate Hidden +-- Author: FlightControl +-- Date Created: 06 Sep 2017 +-- +-- # Situation: +-- +-- At Gudauta spawn a ground vehicle, hidden, based on a randomized template. +-- +-- # Test cases: +-- +-- 1. Observe that a random ground vehicle is spawned and his hidden. + + + +-- Tests Gudauta +-- ------------- +-- Spawn a gound vehicle... + +Templates = { "A", "B" } + +Spawn_Vehicle_1 = SPAWN:New( "Vehicle" ) +Spawn_Vehicle_1:InitRandomizeTemplate( Templates ) +Spawn_Group_1 = Spawn_Vehicle_1:Spawn() + + + diff --git a/SPA - Spawning/SPA-026 - Ground Ops - Spawn RandomizeTemplate Hidden/SPA-026 - Ground Ops - Spawn RandomizeTemplate Hidden.miz b/SPA - Spawning/SPA-026 - Ground Ops - Spawn RandomizeTemplate Hidden/SPA-026 - Ground Ops - Spawn RandomizeTemplate Hidden.miz index 68f78452e8..ea5ea3ceff 100644 Binary files a/SPA - Spawning/SPA-026 - Ground Ops - Spawn RandomizeTemplate Hidden/SPA-026 - Ground Ops - Spawn RandomizeTemplate Hidden.miz and b/SPA - Spawning/SPA-026 - Ground Ops - Spawn RandomizeTemplate Hidden/SPA-026 - Ground Ops - Spawn RandomizeTemplate Hidden.miz differ diff --git a/SPA - Spawning/SPA-027 - Ground Ops - Respawning After Destroy/SPA-027 - Ground Ops - Respawning After Destroy.lua b/SPA - Spawning/SPA-027 - Ground Ops - Respawning After Destroy/SPA-027 - Ground Ops - Respawning After Destroy.lua index 75d481066d..b749e58a8f 100644 --- a/SPA - Spawning/SPA-027 - Ground Ops - Respawning After Destroy/SPA-027 - Ground Ops - Respawning After Destroy.lua +++ b/SPA - Spawning/SPA-027 - Ground Ops - Respawning After Destroy/SPA-027 - Ground Ops - Respawning After Destroy.lua @@ -1,25 +1,25 @@ --- Name: SPA-027 - Ground Ops - Respawning After Destroy --- Author: FlightControl --- Date Created: 10 Dec 2017 --- --- At Gudauta spawns ground vehicle, in a scheduled fashion. --- There can only be a maximum of 2 grond vehicles alive. --- When a ground vehicle is destroyed, a new one needs to be spawned at a different location in the zone. --- Until that one is also destroyed. --- --- Red is attacking the spawned blue vehicles. --- Once blue is destroyed, a new blue needs to spawn. --- Until all 10 blue vehicles are spawned. --- The position of blue is randomized in the zone. --- Blue has ROE hold weapons. --- - - -BlueVehicleSpawn = SPAWN - :New( "Tank" ) - :InitLimit( 2, 10 ) - :InitRandomizePosition( true, 200, 50 ) - :SpawnScheduled( 5, .5 ) - - - +-- Name: SPA-027 - Ground Ops - Respawning After Destroy +-- Author: FlightControl +-- Date Created: 10 Dec 2017 +-- +-- At Gudauta spawns ground vehicle, in a scheduled fashion. +-- There can only be a maximum of 2 grond vehicles alive. +-- When a ground vehicle is destroyed, a new one needs to be spawned at a different location in the zone. +-- Until that one is also destroyed. +-- +-- Red is attacking the spawned blue vehicles. +-- Once blue is destroyed, a new blue needs to spawn. +-- Until all 10 blue vehicles are spawned. +-- The position of blue is randomized in the zone. +-- Blue has ROE hold weapons. +-- + + +BlueVehicleSpawn = SPAWN + :New( "Tank" ) + :InitLimit( 2, 10 ) + :InitRandomizePosition( true, 200, 50 ) + :SpawnScheduled( 5, .5 ) + + + diff --git a/SPA - Spawning/SPA-027 - Ground Ops - Respawning After Destroy/SPA-027 - Ground Ops - Respawning After Destroy.miz b/SPA - Spawning/SPA-027 - Ground Ops - Respawning After Destroy/SPA-027 - Ground Ops - Respawning After Destroy.miz index 8a327c2b72..25ef90bce9 100644 Binary files a/SPA - Spawning/SPA-027 - Ground Ops - Respawning After Destroy/SPA-027 - Ground Ops - Respawning After Destroy.miz and b/SPA - Spawning/SPA-027 - Ground Ops - Respawning After Destroy/SPA-027 - Ground Ops - Respawning After Destroy.miz differ diff --git a/SPA - Spawning/SPA-100 - Air Ops - CleanUp of Inactive Units/SPA-100 - Air Ops - CleanUp of Inactive Units.miz b/SPA - Spawning/SPA-100 - Air Ops - CleanUp of Inactive Units/SPA-100 - Air Ops - CleanUp of Inactive Units.miz index a56a3e5149..93bbd05701 100644 Binary files a/SPA - Spawning/SPA-100 - Air Ops - CleanUp of Inactive Units/SPA-100 - Air Ops - CleanUp of Inactive Units.miz and b/SPA - Spawning/SPA-100 - Air Ops - CleanUp of Inactive Units/SPA-100 - Air Ops - CleanUp of Inactive Units.miz differ diff --git a/SPA - Spawning/SPA-100 - Air Ops - CleanUp of Inactive Units/SPA-100 - Air Ops - Scheduled Spawn Helicopters with CleanUp of Inactive Units.lua b/SPA - Spawning/SPA-100 - Air Ops - CleanUp of Inactive Units/SPA-100 - Air Ops - Scheduled Spawn Helicopters with CleanUp of Inactive Units.lua new file mode 100644 index 0000000000..0d07b33fc1 --- /dev/null +++ b/SPA - Spawning/SPA-100 - Air Ops - CleanUp of Inactive Units/SPA-100 - Air Ops - Scheduled Spawn Helicopters with CleanUp of Inactive Units.lua @@ -0,0 +1,8 @@ +-- Tests Kutaisi +-- ------------- +-- Tests the CleanUp functionality. +-- Limited spawning of groups, scheduled every 10 seconds, who are engaging into combat. Some helicopters may crash land on the ground. +-- Observe when helicopters land but are not dead and are out of the danger zone, that they get removed after a while (+/- 180 seconds) and ReSpawn. +Spawn_Helicopter_Scheduled_CleanUp = SPAWN:New( "Spawn Helicopter Scheduled CleanUp" ):InitLimit( 3, 100 ):InitRandomizeRoute( 1, 1, 1000 ):InitCleanUp( 60 ):SpawnScheduled( 10, 0 ) +Spawn_Vehicle_Scheduled_CleanUp = SPAWN:New( "Spawn Vehicle Scheduled CleanUp" ):InitLimit( 3, 100 ):InitRandomizeRoute( 1, 1, 1000 ):SpawnScheduled( 10, 0 ) + diff --git a/SPA - Spawning/SPA-110 - Limit Spawning/SPA-110 - Limit Spawning.lua b/SPA - Spawning/SPA-110 - Limit Spawning/SPA-110 - Limit Spawning.lua index 1ff4c90c02..eb0b7e1eb4 100644 --- a/SPA - Spawning/SPA-110 - Limit Spawning/SPA-110 - Limit Spawning.lua +++ b/SPA - Spawning/SPA-110 - Limit Spawning/SPA-110 - Limit Spawning.lua @@ -1,17 +1,17 @@ ---- --- Tests Gudauta --- ------------- --- Limited scheduled spawning of groups... -Spawn_Plane_Limited_Scheduled = SPAWN:New( "Spawn Plane Limited Scheduled" ):InitLimit( 4, 20 ):SpawnScheduled( 30, 0 ) -Spawn_Helicopter_Limited_Scheduled = SPAWN:New( "Spawn Helicopter Limited Scheduled" ):InitLimit( 4, 20 ):SpawnScheduled( 30, 0 ) -Spawn_Ground_Limited_Scheduled = SPAWN:New( "Spawn Vehicle Limited Scheduled" ):InitLimit( 4, 20 ):SpawnScheduled( 90, 0 ) - ---- --- Tests Sukhumi --- ------------- --- Limited scheduled spawning of groups with destruction... -Spawn_Plane_Limited_Scheduled_RandomizeRoute = SPAWN:New( "Spawn Plane Limited Scheduled Destroy" ):InitLimit( 4, 20 ):SpawnScheduled( 10, 0 ) -Spawn_Helicopter_Limited_Scheduled_RandomizeRoute = SPAWN:New( "Spawn Helicopter Limited Scheduled Destroy" ):InitLimit( 4, 20 ):SpawnScheduled( 10, 0 ) -Spawn_Vehicle_Limited_Scheduled_RandomizeRoute = SPAWN:New( "Spawn Vehicle Limited Scheduled Destroy" ):InitLimit( 4, 20 ):SpawnScheduled( 10, 0 ) - - +--- +-- Tests Gudauta +-- ------------- +-- Limited scheduled spawning of groups... +Spawn_Plane_Limited_Scheduled = SPAWN:New( "Spawn Plane Limited Scheduled" ):InitLimit( 4, 20 ):SpawnScheduled( 30, 0 ) +Spawn_Helicopter_Limited_Scheduled = SPAWN:New( "Spawn Helicopter Limited Scheduled" ):InitLimit( 4, 20 ):SpawnScheduled( 30, 0 ) +Spawn_Ground_Limited_Scheduled = SPAWN:New( "Spawn Vehicle Limited Scheduled" ):InitLimit( 4, 20 ):SpawnScheduled( 90, 0 ) + +--- +-- Tests Sukhumi +-- ------------- +-- Limited scheduled spawning of groups with destruction... +Spawn_Plane_Limited_Scheduled_RandomizeRoute = SPAWN:New( "Spawn Plane Limited Scheduled Destroy" ):InitLimit( 4, 20 ):SpawnScheduled( 10, 0 ) +Spawn_Helicopter_Limited_Scheduled_RandomizeRoute = SPAWN:New( "Spawn Helicopter Limited Scheduled Destroy" ):InitLimit( 4, 20 ):SpawnScheduled( 10, 0 ) +Spawn_Vehicle_Limited_Scheduled_RandomizeRoute = SPAWN:New( "Spawn Vehicle Limited Scheduled Destroy" ):InitLimit( 4, 20 ):SpawnScheduled( 10, 0 ) + + diff --git a/SPA - Spawning/SPA-110 - Limit Spawning/SPA-110 - Limit Spawning.miz b/SPA - Spawning/SPA-110 - Limit Spawning/SPA-110 - Limit Spawning.miz index fd6002786c..520a962dad 100644 Binary files a/SPA - Spawning/SPA-110 - Limit Spawning/SPA-110 - Limit Spawning.miz and b/SPA - Spawning/SPA-110 - Limit Spawning/SPA-110 - Limit Spawning.miz differ diff --git a/SPA - Spawning/SPA-120 - Air Ops - Scheduled Spawn with Repeat on Landing with Limit/SPA-120 - Air Ops - Scheduled Spawn with Repeat on Landing with Limit.lua b/SPA - Spawning/SPA-120 - Air Ops - Scheduled Spawn with Repeat on Landing with Limit/SPA-120 - Air Ops - Scheduled Spawn with Repeat on Landing with Limit.lua index 536e568ded..a08603b410 100644 --- a/SPA - Spawning/SPA-120 - Air Ops - Scheduled Spawn with Repeat on Landing with Limit/SPA-120 - Air Ops - Scheduled Spawn with Repeat on Landing with Limit.lua +++ b/SPA - Spawning/SPA-120 - Air Ops - Scheduled Spawn with Repeat on Landing with Limit/SPA-120 - Air Ops - Scheduled Spawn with Repeat on Landing with Limit.lua @@ -1,35 +1,35 @@ ---- --- Name: SPA-120 - Air Ops - Scheduled Spawns with Repeat on Landing with Limit --- Author: FlightControl --- Date Created: 05 Feb 2017 --- --- # Situation: --- --- One airplane and one helicopter will be spawned. --- Only one airplane and one helicopter can be alive at the same time. --- Upon landing, the airplane and helicopter will respawn at Kutaisi. --- --- # Test cases: --- --- 1. Observe the spawning of the airplane and helicopter --- 2. There should not be more airplanes alive than there are set by InitLimit. --- 3. Upon landing, the planes should respawn. --- 5. The plane should respawn itself when the air unit has parked at the ramp or has landed. - - -do - - -- Declare SPAWN objects - Spawn_Plane = SPAWN:New("Plane"):InitLimit( 2, 0 ) - - -- Choose repeat functionality - - -- Repeat on ... (when landed on the airport) - Spawn_Plane:InitRepeatOnEngineShutDown() - - -- Now SPAWN the GROUPs - Spawn_Plane:SpawnScheduled(30,0) - - -- Now run the mission and observe the behaviour. - -end +--- +-- Name: SPA-120 - Air Ops - Scheduled Spawns with Repeat on Landing with Limit +-- Author: FlightControl +-- Date Created: 05 Feb 2017 +-- +-- # Situation: +-- +-- One airplane and one helicopter will be spawned. +-- Only one airplane and one helicopter can be alive at the same time. +-- Upon landing, the airplane and helicopter will respawn at Kutaisi. +-- +-- # Test cases: +-- +-- 1. Observe the spawning of the airplane and helicopter +-- 2. There should not be more airplanes alive than there are set by InitLimit. +-- 3. Upon landing, the planes should respawn. +-- 5. The plane should respawn itself when the air unit has parked at the ramp or has landed. + + +do + + -- Declare SPAWN objects + Spawn_Plane = SPAWN:New("Plane"):InitLimit( 2, 0 ) + + -- Choose repeat functionality + + -- Repeat on ... (when landed on the airport) + Spawn_Plane:InitRepeatOnEngineShutDown() + + -- Now SPAWN the GROUPs + Spawn_Plane:SpawnScheduled(30,0) + + -- Now run the mission and observe the behaviour. + +end diff --git a/SPA - Spawning/SPA-120 - Air Ops - Scheduled Spawn with Repeat on Landing with Limit/SPA-120 - Air Ops - Scheduled Spawn with Repeat on Landing with Limit.miz b/SPA - Spawning/SPA-120 - Air Ops - Scheduled Spawn with Repeat on Landing with Limit/SPA-120 - Air Ops - Scheduled Spawn with Repeat on Landing with Limit.miz index 31e0ff457b..9e40c0745e 100644 Binary files a/SPA - Spawning/SPA-120 - Air Ops - Scheduled Spawn with Repeat on Landing with Limit/SPA-120 - Air Ops - Scheduled Spawn with Repeat on Landing with Limit.miz and b/SPA - Spawning/SPA-120 - Air Ops - Scheduled Spawn with Repeat on Landing with Limit/SPA-120 - Air Ops - Scheduled Spawn with Repeat on Landing with Limit.miz differ diff --git a/SPA - Spawning/SPA-120 - Repeat Spawning/SPA-120 - Repeat Spawning.lua b/SPA - Spawning/SPA-120 - Repeat Spawning/SPA-120 - Repeat Spawning.lua new file mode 100644 index 0000000000..209ce7e169 --- /dev/null +++ b/SPA - Spawning/SPA-120 - Repeat Spawning/SPA-120 - Repeat Spawning.lua @@ -0,0 +1,41 @@ +--- +-- MOOSE SPAWN repeat test scenario +-- ------------------------------- +-- There are 8 GROUPs Spawned. +-- They fly around Kutaisi and will land. +-- Upon landing: +-- 1. The KA-50 and the C-101EB should respawn itself directly when landed. +-- 2. the MI-8MTV2 and the A-10C should respawn itself when the air unit has parked at the ramp. +-- + +do + + -- Declare SPAWN objects + local Spawn_KA_50 = SPAWN:New("KA-50") + local Spawn_MI_8MTV2 = SPAWN:New("MI-8MTV2") + local Spawn_C_101EB = SPAWN:New("C-101EB") + local Spawn_A_10C = SPAWN:New("A-10C") + + -- Choose repeat functionality + + -- Repeat on landing + Spawn_KA_50:InitRepeatOnLanding() + Spawn_C_101EB:InitRepeatOnLanding() + + -- Repeat on enging shutdown (when landed on the airport) + Spawn_MI_8MTV2:InitRepeatOnEngineShutDown() + Spawn_A_10C:InitRepeatOnEngineShutDown() + + -- Now SPAWN the GROUPs + Spawn_KA_50:Spawn() + Spawn_C_101EB:Spawn() + Spawn_MI_8MTV2:Spawn() + Spawn_A_10C:Spawn() + Spawn_KA_50:Spawn() + Spawn_C_101EB:Spawn() + Spawn_MI_8MTV2:Spawn() + Spawn_A_10C:Spawn() + + -- Now run the mission and observe the behaviour. + +end diff --git a/SPA - Spawning/SPA-120 - Repeat Spawning/SPA-120 - Repeat Spawning.miz b/SPA - Spawning/SPA-120 - Repeat Spawning/SPA-120 - Repeat Spawning.miz index c44d352884..79d6b11a11 100644 Binary files a/SPA - Spawning/SPA-120 - Repeat Spawning/SPA-120 - Repeat Spawning.miz and b/SPA - Spawning/SPA-120 - Repeat Spawning/SPA-120 - Repeat Spawning.miz differ diff --git a/SPA - Spawning/SPA-121 - Air Ops - Scheduled Spawns with Repeat on Landing with Limit/SPA-121 - Air Ops - Scheduled Spawns with Repeat on Landing with Limit.lua b/SPA - Spawning/SPA-121 - Air Ops - Scheduled Spawns with Repeat on Landing with Limit/SPA-121 - Air Ops - Scheduled Spawns with Repeat on Landing with Limit.lua index e65470a72d..c5f8affe7f 100644 --- a/SPA - Spawning/SPA-121 - Air Ops - Scheduled Spawns with Repeat on Landing with Limit/SPA-121 - Air Ops - Scheduled Spawns with Repeat on Landing with Limit.lua +++ b/SPA - Spawning/SPA-121 - Air Ops - Scheduled Spawns with Repeat on Landing with Limit/SPA-121 - Air Ops - Scheduled Spawns with Repeat on Landing with Limit.lua @@ -1,51 +1,51 @@ ---- --- Name: SPA-121 - Air Ops - Scheduled Spawns with Repeat on Landing with Limit --- Author: FlightControl --- Date Created: 05 Feb 2017 --- --- # Situation: --- --- Multiple airplanes will be spawned at a scheduled interval. --- There is a limit on how many airplanes can be alive at the same time. --- Upon landing, the airplanes will respawn at Kutaisi. --- --- # Test cases: --- --- 1. Observe the spawning of the airplanes --- 2. There should not be more airplanes alive than there are set by InitLimit. --- 3. Upon landing, the planes should respawn. --- 4. The KA-50 and the C-101EB should respawn itself directly when landed. --- 5. the MI-8MTV2 and the A-10C should respawn itself when the air unit has parked at the ramp. - - -do - - -- Declare SPAWN objects - Spawn_KA_50 = SPAWN:New("KA-50"):InitLimit( 2, 10 ) - Spawn_MI_8MTV2 = SPAWN:New("MI-8MTV2"):InitLimit( 2, 10 ) - Spawn_C_101EB = SPAWN:New("C-101EB"):InitLimit( 2, 10 ) - Spawn_A_10C = SPAWN:New("A-10C") - :InitLimit( 2, 10 ) - - -- Choose repeat functionality - - -- Repeat on landing - Spawn_KA_50:InitRepeatOnLanding() - Spawn_KA_50:InitDelayOff() - - Spawn_C_101EB:InitRepeatOnLanding() - Spawn_C_101EB:InitDelayOff() - - -- Repeat on enging shutdown (when landed on the airport) - Spawn_MI_8MTV2:InitRepeatOnEngineShutDown() - Spawn_A_10C:InitRepeatOnEngineShutDown() - - -- Now SPAWN the GROUPs - Spawn_KA_50:SpawnScheduled(180,0) - Spawn_C_101EB:SpawnScheduled(180,0) - Spawn_MI_8MTV2:SpawnScheduled(180,0) - Spawn_A_10C:SpawnScheduled(180,0) - - -- Now run the mission and observe the behaviour. - -end +--- +-- Name: SPA-121 - Air Ops - Scheduled Spawns with Repeat on Landing with Limit +-- Author: FlightControl +-- Date Created: 05 Feb 2017 +-- +-- # Situation: +-- +-- Multiple airplanes will be spawned at a scheduled interval. +-- There is a limit on how many airplanes can be alive at the same time. +-- Upon landing, the airplanes will respawn at Kutaisi. +-- +-- # Test cases: +-- +-- 1. Observe the spawning of the airplanes +-- 2. There should not be more airplanes alive than there are set by InitLimit. +-- 3. Upon landing, the planes should respawn. +-- 4. The KA-50 and the C-101EB should respawn itself directly when landed. +-- 5. the MI-8MTV2 and the A-10C should respawn itself when the air unit has parked at the ramp. + + +do + + -- Declare SPAWN objects + Spawn_KA_50 = SPAWN:New("KA-50"):InitLimit( 2, 10 ) + Spawn_MI_8MTV2 = SPAWN:New("MI-8MTV2"):InitLimit( 2, 10 ) + Spawn_C_101EB = SPAWN:New("C-101EB"):InitLimit( 2, 10 ) + Spawn_A_10C = SPAWN:New("A-10C") + :InitLimit( 2, 10 ) + + -- Choose repeat functionality + + -- Repeat on landing + Spawn_KA_50:InitRepeatOnLanding() + Spawn_KA_50:InitDelayOff() + + Spawn_C_101EB:InitRepeatOnLanding() + Spawn_C_101EB:InitDelayOff() + + -- Repeat on enging shutdown (when landed on the airport) + Spawn_MI_8MTV2:InitRepeatOnEngineShutDown() + Spawn_A_10C:InitRepeatOnEngineShutDown() + + -- Now SPAWN the GROUPs + Spawn_KA_50:SpawnScheduled(180,0) + Spawn_C_101EB:SpawnScheduled(180,0) + Spawn_MI_8MTV2:SpawnScheduled(180,0) + Spawn_A_10C:SpawnScheduled(180,0) + + -- Now run the mission and observe the behaviour. + +end diff --git a/SPA - Spawning/SPA-121 - Air Ops - Scheduled Spawns with Repeat on Landing with Limit/SPA-121 - Air Ops - Scheduled Spawns with Repeat on Landing with Limit.miz b/SPA - Spawning/SPA-121 - Air Ops - Scheduled Spawns with Repeat on Landing with Limit/SPA-121 - Air Ops - Scheduled Spawns with Repeat on Landing with Limit.miz index 3f65a10638..449c8dbee0 100644 Binary files a/SPA - Spawning/SPA-121 - Air Ops - Scheduled Spawns with Repeat on Landing with Limit/SPA-121 - Air Ops - Scheduled Spawns with Repeat on Landing with Limit.miz and b/SPA - Spawning/SPA-121 - Air Ops - Scheduled Spawns with Repeat on Landing with Limit/SPA-121 - Air Ops - Scheduled Spawns with Repeat on Landing with Limit.miz differ diff --git a/SPA - Spawning/SPA-122 - Air Ops - OnLand test for Scheduled Spawns/SPA-122 - Air Ops - OnLand test for Scheduled Spawns.lua b/SPA - Spawning/SPA-122 - Air Ops - OnLand test for Scheduled Spawns/SPA-122 - Air Ops - OnLand test for Scheduled Spawns.lua index b2e2028c1b..aa977c793f 100644 --- a/SPA - Spawning/SPA-122 - Air Ops - OnLand test for Scheduled Spawns/SPA-122 - Air Ops - OnLand test for Scheduled Spawns.lua +++ b/SPA - Spawning/SPA-122 - Air Ops - OnLand test for Scheduled Spawns/SPA-122 - Air Ops - OnLand test for Scheduled Spawns.lua @@ -1,47 +1,47 @@ ---- --- Name: SPA-122 - Air Ops - OnLand test for Scheduled Spawns --- Author: FlightControl --- Date Created: 21 Mar 2017 --- --- # Situation: --- --- An airplane is spawned at a scheduled interval. --- There is a limit on how many airplanes can be alive at the same time. --- Upon landing, the airplane will respawn in the air. --- --- # Test cases: --- --- 1. Observe the spawning of the airplanes --- 2. There should not be more airplanes alive than there are set by InitLimit. --- 3. Upon landing, the planes should respawn. --- 4. The KA-50 and the C-101EB should respawn itself directly when landed. --- 5. the MI-8MTV2 and the A-10C should respawn itself when the air unit has parked at the ramp. - - -do - - -- Declare SPAWN objects - Spawn_KA_50 = SPAWN:New("KA-50"):InitLimit( 1, 0 ) - Spawn_MI_8MTV2 = SPAWN:New("MI-8MTV2"):InitLimit( 1, 0 ) - Spawn_C_101EB = SPAWN:New("C-101EB"):InitLimit( 1, 0 ) - Spawn_A_10C = SPAWN:New("A-10C"):InitLimit( 1, 0 ) - - -- Choose repeat functionality - - -- Repeat on landing - Spawn_KA_50:InitRepeatOnLanding() - Spawn_C_101EB:InitRepeatOnLanding() - - -- Repeat on enging shutdown (when landed on the airport) - Spawn_MI_8MTV2:InitRepeatOnEngineShutDown() - Spawn_A_10C:InitRepeatOnEngineShutDown() - - -- Now SPAWN the GROUPs - Spawn_KA_50:SpawnScheduled(30,0) - Spawn_C_101EB:SpawnScheduled(30,0) - Spawn_MI_8MTV2:SpawnScheduled(30,0) - Spawn_A_10C:SpawnScheduled(30,0) - - -- Now run the mission and observe the behaviour. - -end +--- +-- Name: SPA-122 - Air Ops - OnLand test for Scheduled Spawns +-- Author: FlightControl +-- Date Created: 21 Mar 2017 +-- +-- # Situation: +-- +-- An airplane is spawned at a scheduled interval. +-- There is a limit on how many airplanes can be alive at the same time. +-- Upon landing, the airplane will respawn in the air. +-- +-- # Test cases: +-- +-- 1. Observe the spawning of the airplanes +-- 2. There should not be more airplanes alive than there are set by InitLimit. +-- 3. Upon landing, the planes should respawn. +-- 4. The KA-50 and the C-101EB should respawn itself directly when landed. +-- 5. the MI-8MTV2 and the A-10C should respawn itself when the air unit has parked at the ramp. + + +do + + -- Declare SPAWN objects + Spawn_KA_50 = SPAWN:New("KA-50"):InitLimit( 1, 0 ) + Spawn_MI_8MTV2 = SPAWN:New("MI-8MTV2"):InitLimit( 1, 0 ) + Spawn_C_101EB = SPAWN:New("C-101EB"):InitLimit( 1, 0 ) + Spawn_A_10C = SPAWN:New("A-10C"):InitLimit( 1, 0 ) + + -- Choose repeat functionality + + -- Repeat on landing + Spawn_KA_50:InitRepeatOnLanding() + Spawn_C_101EB:InitRepeatOnLanding() + + -- Repeat on enging shutdown (when landed on the airport) + Spawn_MI_8MTV2:InitRepeatOnEngineShutDown() + Spawn_A_10C:InitRepeatOnEngineShutDown() + + -- Now SPAWN the GROUPs + Spawn_KA_50:SpawnScheduled(30,0) + Spawn_C_101EB:SpawnScheduled(30,0) + Spawn_MI_8MTV2:SpawnScheduled(30,0) + Spawn_A_10C:SpawnScheduled(30,0) + + -- Now run the mission and observe the behaviour. + +end diff --git a/SPA - Spawning/SPA-122 - Air Ops - OnLand test for Scheduled Spawns/SPA-122 - Air Ops - OnLand test for Scheduled Spawns.miz b/SPA - Spawning/SPA-122 - Air Ops - OnLand test for Scheduled Spawns/SPA-122 - Air Ops - OnLand test for Scheduled Spawns.miz index 8329fda96f..b3446f12e2 100644 Binary files a/SPA - Spawning/SPA-122 - Air Ops - OnLand test for Scheduled Spawns/SPA-122 - Air Ops - OnLand test for Scheduled Spawns.miz and b/SPA - Spawning/SPA-122 - Air Ops - OnLand test for Scheduled Spawns/SPA-122 - Air Ops - OnLand test for Scheduled Spawns.miz differ diff --git a/SPA - Spawning/SPA-123 - Air Ops - Repeat on Landing and InitCleanUp/SPA-123 - Air Ops - Repeat on Landing and InitCleanUp.lua b/SPA - Spawning/SPA-123 - Air Ops - Repeat on Landing and InitCleanUp/SPA-123 - Air Ops - Repeat on Landing and InitCleanUp.lua index 3cb08ed4b9..076b58e253 100644 --- a/SPA - Spawning/SPA-123 - Air Ops - Repeat on Landing and InitCleanUp/SPA-123 - Air Ops - Repeat on Landing and InitCleanUp.lua +++ b/SPA - Spawning/SPA-123 - Air Ops - Repeat on Landing and InitCleanUp/SPA-123 - Air Ops - Repeat on Landing and InitCleanUp.lua @@ -1,26 +1,28 @@ ---- --- Name: SPA-123 - Air Ops - Repeat on Landing and InitCleanUp --- Author: FlightControl --- Date Created: 15 Sep 2018 --- --- # Situation: --- --- Helicpters spawn and are lightly shot until the crash land, but don't really destroy. --- The should be respawned after a while. --- No performance overhead should be noticed. - -do - - -- Declare SPAWN objects - Spawn_KA_50 = SPAWN:New("KA-50") - Spawn_KA_50:InitLimit( 2, 10 ) - - -- Choose repeat functionality - - Spawn_KA_50:InitDelayOff() - Spawn_KA_50:InitCleanUp( 300 ) - Spawn_KA_50:SpawnScheduled( 180, 0.2 ) - - -- Now run the mission and observe the behaviour. - -end +--- +-- Name: SPA-123 - Air Ops - Repeat on Landing and InitCleanUp +-- Author: FlightControl +-- Date Created: 15 Sep 2018 +-- +-- # Situation: +-- +-- Helicpters spawn and are lightly shot until the crash land, but don't really destroy. +-- The should be respawned after a while. +-- No performance overhead should be noticed. + +do + + -- Declare SPAWN objects + Spawn_KA_50 = SPAWN:New("KA-50"):InitLimit( 2, 10 ) + :InitLimit( 2, 0 ) + + -- Choose repeat functionality + + -- Repeat on landing + Spawn_KA_50:InitRepeatOnLanding() + Spawn_KA_50:InitDelayOff() + Spawn_KA_50:InitCleanUp( 300 ) + Spawn_KA_50:SpawnScheduled( 180, 0.2 ) + + -- Now run the mission and observe the behaviour. + +end diff --git a/SPA - Spawning/SPA-123 - Air Ops - Repeat on Landing and InitCleanUp/SPA-123 - Air Ops - Repeat on Landing and InitCleanUp.miz b/SPA - Spawning/SPA-123 - Air Ops - Repeat on Landing and InitCleanUp/SPA-123 - Air Ops - Repeat on Landing and InitCleanUp.miz index 56d6080302..338271108b 100644 Binary files a/SPA - Spawning/SPA-123 - Air Ops - Repeat on Landing and InitCleanUp/SPA-123 - Air Ops - Repeat on Landing and InitCleanUp.miz and b/SPA - Spawning/SPA-123 - Air Ops - Repeat on Landing and InitCleanUp/SPA-123 - Air Ops - Repeat on Landing and InitCleanUp.miz differ diff --git a/SPA - Spawning/SPA-124 - Air Ops - Scheduled Spawns with OnSpawnGroup/SPA-124 - Air Ops - Scheduled Spawns with Escort Task.lua b/SPA - Spawning/SPA-124 - Air Ops - Scheduled Spawns with OnSpawnGroup/SPA-124 - Air Ops - Scheduled Spawns with Escort Task.lua new file mode 100644 index 0000000000..503df0af73 --- /dev/null +++ b/SPA - Spawning/SPA-124 - Air Ops - Scheduled Spawns with OnSpawnGroup/SPA-124 - Air Ops - Scheduled Spawns with Escort Task.lua @@ -0,0 +1,52 @@ +---------------------------------------------------------------------- +--SPA-124 - Air Ops - Scheduled Spawns with OnSpawnGroup() Escort Task +---------------------------------------------------------------------- + --////////////////////////////////// + --////////////Tankers and awacs v1 + --////////////////////////////////// +--////////// By Targs35 ///////////// +--//////////////// from 62nd Air Wing, Brisbane server.. +--/////////////////////////////////// + ------- With thanks to the guys at MOOSE and in particular Pikes, Nolove, Delta99 and Wingthor + -- Funky Frank is the man.. +-----//////////////////////////////// +--/////////// Spawn Tanker and Escorts /// + + do + + local PointVec1 = POINT_VEC3:New( -100, 20, 80 ) -- This is a Vec3 class - defines the position of the escorts relative to the escorted group + local PointVec2 = POINT_VEC3:New( -100, 20, 150 ) -- This is a Vec3 class - defines the position of the escorts relative to the escorted group + + --Create Spawn Groups, use the OnSpawnGroup() function to spawn two escorts and task them + + local Tanker_Texaco = SPAWN + :New("Tanker_Texaco_Droge") + :InitLimit( 1, 2 ) -- group with one unit, spawn 1 *alive* units max + :InitCleanUp( 240 ) + :OnSpawnGroup(function (tanker) -- tanker contains the GROUP object when the tanker spawns + local Escort_Texaco_1 = SPAWN + :New("Escort_Texaco_F14 001") + :InitLimit( 1, 2 ) + :InitCleanUp( 240 ) + :OnSpawnGroup(function (spawndgroup) -- spawndgrp contains the GROUP object when the escort spawns + local FollowDCSTask1 = spawndgroup:TaskFollow( tanker, PointVec1 ) -- create task + spawndgroup:SetTask( FollowDCSTask1, 1 ) -- push task on the GROUP + end + ) + :SpawnScheduled( 60, 0.5 ) + + local Escort_Texaco_2 = SPAWN + :New("Escort_Texaco_F14 002") + :InitLimit( 1, 2 ) + :InitCleanUp( 240 ) + :OnSpawnGroup(function (spawndgroup) -- spawndgrp contains the GROUP object when the escort spawns + local FollowDCSTask2 = spawndgroup:TaskFollow( tanker, PointVec2 ) + spawndgroup:SetTask( FollowDCSTask2, 1 ) + end + ) + :SpawnScheduled( 60, 0.5 ) + end + ) + :SpawnScheduled( 60, 0.5 ) + +end diff --git a/SPA - Spawning/SPA-124 - Air Ops - Scheduled Spawns with OnSpawnGroup/SPA-124 - Air Ops - Scheduled Spawns with OnSpawnGroup.miz b/SPA - Spawning/SPA-124 - Air Ops - Scheduled Spawns with OnSpawnGroup/SPA-124 - Air Ops - Scheduled Spawns with OnSpawnGroup.miz index 457efc08f4..309fd4a1ec 100644 Binary files a/SPA - Spawning/SPA-124 - Air Ops - Scheduled Spawns with OnSpawnGroup/SPA-124 - Air Ops - Scheduled Spawns with OnSpawnGroup.miz and b/SPA - Spawning/SPA-124 - Air Ops - Scheduled Spawns with OnSpawnGroup/SPA-124 - Air Ops - Scheduled Spawns with OnSpawnGroup.miz differ diff --git a/SPA - Spawning/SPA-130 - Uncontrolled Spawning/SPA-130 - Uncontrolled Spawning.lua b/SPA - Spawning/SPA-130 - Uncontrolled Spawning/SPA-130 - Uncontrolled Spawning.lua index 6eb08c7921..98ef7e11fb 100644 --- a/SPA - Spawning/SPA-130 - Uncontrolled Spawning/SPA-130 - Uncontrolled Spawning.lua +++ b/SPA - Spawning/SPA-130 - Uncontrolled Spawning/SPA-130 - Uncontrolled Spawning.lua @@ -1,47 +1,47 @@ ---- --- Name: SPA-130 - Uncontrolled Spawning --- Author: FlightControl --- Date Created: 04 Feb 2017 --- --- # Situation: --- --- A plane will be spawned Uncontrolled and later one will be spawned Controlled. --- Only the Controlled plane will move, the other will remain idle at the parking spot. --- --- # Test cases: --- --- 1. Observe the spawning of the UnControlled Plane. --- 2. Observe the spawning of the Controlled Plane. - - --- Create the SPAWN object looking for the group (template) "Plane". -SpawnPlane = SPAWN:New( "Plane" ) - --- Set the spawn mode to UnControlled. -SpawnPlane:InitUnControlled( true ) - --- Spawn the UnControlled Group -UnControlledPlane = SpawnPlane:Spawn() - --- Set the spawn mode back to Controlled. -SpawnPlane:InitUnControlled( false ) - -ControlledPlane = SpawnPlane:Spawn() - --- Now, let's create a menu option at a player slot plane... --- We can only create the menu option if the player has joined the slot ... -PlayerPlane = CLIENT:FindByName( "PlayerPlane", "Select Menu item to activate UnControlled plane" ) - -PlayerPlane:Alive( - function( Client, SpawnPlane ) - - --- @param Functional.Spawn#SPAWN SpawnPlane - local function ActivatePlane( SpawnPlane ) - SpawnPlane:InitUnControlled( false ) - SpawnPlane:ReSpawn( 1 ) - end - - local Menu = MENU_CLIENT_COMMAND:New( Client, "Select to activate UnControlled plane", nil, ActivatePlane, SpawnPlane ) - end - , SpawnPlane +--- +-- Name: SPA-130 - Uncontrolled Spawning +-- Author: FlightControl +-- Date Created: 04 Feb 2017 +-- +-- # Situation: +-- +-- A plane will be spawned Uncontrolled and later one will be spawned Controlled. +-- Only the Controlled plane will move, the other will remain idle at the parking spot. +-- +-- # Test cases: +-- +-- 1. Observe the spawning of the UnControlled Plane. +-- 2. Observe the spawning of the Controlled Plane. + + +-- Create the SPAWN object looking for the group (template) "Plane". +SpawnPlane = SPAWN:New( "Plane" ) + +-- Set the spawn mode to UnControlled. +SpawnPlane:InitUnControlled( true ) + +-- Spawn the UnControlled Group +UnControlledPlane = SpawnPlane:Spawn() + +-- Set the spawn mode back to Controlled. +SpawnPlane:InitUnControlled( false ) + +ControlledPlane = SpawnPlane:Spawn() + +-- Now, let's create a menu option at a player slot plane... +-- We can only create the menu option if the player has joined the slot ... +PlayerPlane = CLIENT:FindByName( "PlayerPlane", "Select Menu item to activate UnControlled plane" ) + +PlayerPlane:Alive( + function( Client, SpawnPlane ) + + --- @param Functional.Spawn#SPAWN SpawnPlane + local function ActivatePlane( SpawnPlane ) + SpawnPlane:InitUnControlled( false ) + SpawnPlane:ReSpawn( 1 ) + end + + local Menu = MENU_CLIENT_COMMAND:New( Client, "Select to activate UnControlled plane", nil, ActivatePlane, SpawnPlane ) + end + , SpawnPlane ) \ No newline at end of file diff --git a/SPA - Spawning/SPA-130 - Uncontrolled Spawning/SPA-130 - Uncontrolled Spawning.miz b/SPA - Spawning/SPA-130 - Uncontrolled Spawning/SPA-130 - Uncontrolled Spawning.miz index a8410d3192..49e270060c 100644 Binary files a/SPA - Spawning/SPA-130 - Uncontrolled Spawning/SPA-130 - Uncontrolled Spawning.miz and b/SPA - Spawning/SPA-130 - Uncontrolled Spawning/SPA-130 - Uncontrolled Spawning.miz differ diff --git a/SPA - Spawning/SPA-131 - Air Ops - SpawnAtAirbase/SPA-131 - Air Ops - Nevada - SpawnAtAirbase.lua b/SPA - Spawning/SPA-131 - Air Ops - SpawnAtAirbase/SPA-131 - Air Ops - Nevada - SpawnAtAirbase.lua index b7b1df3a94..13f670b4ca 100644 --- a/SPA - Spawning/SPA-131 - Air Ops - SpawnAtAirbase/SPA-131 - Air Ops - Nevada - SpawnAtAirbase.lua +++ b/SPA - Spawning/SPA-131 - Air Ops - SpawnAtAirbase/SPA-131 - Air Ops - Nevada - SpawnAtAirbase.lua @@ -1,11 +1,11 @@ --- Name: SPA-131 - Air Ops - SpawnAtAirbase --- Author: FlightControl --- Date Created: 14 Sep 2017 --- -Spawn_Plane = SPAWN:New( "Plane" ) -Spawn_Plane:SpawnAtAirbase( AIRBASE:FindByName( AIRBASE.Nevada.Groom_Lake_AFB ), SPAWN.Takeoff.Cold ) -Spawn_Plane:SpawnAtAirbase( AIRBASE:FindByName( AIRBASE.Nevada.Groom_Lake_AFB ), SPAWN.Takeoff.Hot ) -Spawn_Plane:SpawnAtAirbase( AIRBASE:FindByName( AIRBASE.Nevada.Groom_Lake_AFB ), SPAWN.Takeoff.Runway ) - - - +-- Name: SPA-131 - Air Ops - SpawnAtAirbase +-- Author: FlightControl +-- Date Created: 14 Sep 2017 +-- +Spawn_Plane = SPAWN:New( "Plane" ) +Spawn_Plane:SpawnAtAirbase( AIRBASE:FindByName( AIRBASE.Nevada.Groom_Lake_AFB ), SPAWN.Takeoff.Cold ) +Spawn_Plane:SpawnAtAirbase( AIRBASE:FindByName( AIRBASE.Nevada.Groom_Lake_AFB ), SPAWN.Takeoff.Hot ) +Spawn_Plane:SpawnAtAirbase( AIRBASE:FindByName( AIRBASE.Nevada.Groom_Lake_AFB ), SPAWN.Takeoff.Runway ) + + + diff --git a/SPA - Spawning/SPA-131 - Air Ops - SpawnAtAirbase/SPA-131 - Air Ops - SpawnAtAirbase.miz b/SPA - Spawning/SPA-131 - Air Ops - SpawnAtAirbase/SPA-131 - Air Ops - SpawnAtAirbase.miz index 7c4fc642fd..068b009e69 100644 Binary files a/SPA - Spawning/SPA-131 - Air Ops - SpawnAtAirbase/SPA-131 - Air Ops - SpawnAtAirbase.miz and b/SPA - Spawning/SPA-131 - Air Ops - SpawnAtAirbase/SPA-131 - Air Ops - SpawnAtAirbase.miz differ diff --git a/SPA - Spawning/SPA-140 - Spawn Client Slots/SPA-140 - Spawn Client Slots.lua b/SPA - Spawning/SPA-140 - Spawn Client Slots/SPA-140 - Spawn Client Slots.lua index ddb5f4a80c..d1783ea42d 100644 --- a/SPA - Spawning/SPA-140 - Spawn Client Slots/SPA-140 - Spawn Client Slots.lua +++ b/SPA - Spawning/SPA-140 - Spawn Client Slots/SPA-140 - Spawn Client Slots.lua @@ -1,19 +1,19 @@ ---- --- Name: SPA-140 - Spawn Client Slots --- Author: FlightControl --- Date Created: 30 Aug 2017 --- --- # Situation: --- --- A plane will be spawned Uncontrolled and later one will be spawned Controlled. --- Only the Controlled plane will move, the other will remain idle at the parking spot. --- --- # Test cases: --- - --- Create the SPAWN object looking for the group (template) "Plane". -SpawnPlane = SPAWN:New( "Plane" ) - --- Spawn the UnControlled Group -UnControlledPlane = SpawnPlane:SpawnClientAtAirbase( AIRBASE:FindByName( AIRBASE.Caucasus.Kutaisi ) ) - +--- +-- Name: SPA-140 - Spawn Client Slots +-- Author: FlightControl +-- Date Created: 30 Aug 2017 +-- +-- # Situation: +-- +-- A plane will be spawned Uncontrolled and later one will be spawned Controlled. +-- Only the Controlled plane will move, the other will remain idle at the parking spot. +-- +-- # Test cases: +-- + +-- Create the SPAWN object looking for the group (template) "Plane". +SpawnPlane = SPAWN:New( "Plane" ) + +-- Spawn the UnControlled Group +UnControlledPlane = SpawnPlane:SpawnClientAtAirbase( AIRBASE:FindByName( AIRBASE.Caucasus.Kutaisi ) ) + diff --git a/SPA - Spawning/SPA-140 - Spawn Client Slots/SPA-140 - Spawn Client Slots.miz b/SPA - Spawning/SPA-140 - Spawn Client Slots/SPA-140 - Spawn Client Slots.miz index 11abc50357..771ed8d781 100644 Binary files a/SPA - Spawning/SPA-140 - Spawn Client Slots/SPA-140 - Spawn Client Slots.miz and b/SPA - Spawning/SPA-140 - Spawn Client Slots/SPA-140 - Spawn Client Slots.miz differ diff --git a/SPA - Spawning/SPA-200 - Randomize Unit Types/SPA-200 - Randomize Unit Types.lua b/SPA - Spawning/SPA-200 - Randomize Unit Types/SPA-200 - Randomize Unit Types.lua index 4302dd371c..49a51f7e21 100644 --- a/SPA - Spawning/SPA-200 - Randomize Unit Types/SPA-200 - Randomize Unit Types.lua +++ b/SPA - Spawning/SPA-200 - Randomize Unit Types/SPA-200 - Randomize Unit Types.lua @@ -1,11 +1,11 @@ ---- --- Tests Gudauta --- -------------- --- Limited and scheduled spawning of groups, with RandomizeTemplate ... - -Templates = { "Template1", "Template2", "Template3", "Template4" } - -Spawn_Ground1 = SPAWN:New( "Spawn Vehicle1" ):InitLimit( 4, 20 ):InitRandomizeTemplate(Templates):SpawnScheduled( 15, 0 ) -Spawn_Ground2 = SPAWN:New( "Spawn Vehicle2" ):InitLimit( 4, 20 ):InitRandomizeTemplate(Templates):SpawnScheduled( 15, 0 ) - - +--- +-- Tests Gudauta +-- -------------- +-- Limited and scheduled spawning of groups, with RandomizeTemplate ... + +Templates = { "Template1", "Template2", "Template3", "Template4" } + +Spawn_Ground1 = SPAWN:New( "Spawn Vehicle1" ):InitLimit( 4, 20 ):InitRandomizeTemplate(Templates):SpawnScheduled( 15, 0 ) +Spawn_Ground2 = SPAWN:New( "Spawn Vehicle2" ):InitLimit( 4, 20 ):InitRandomizeTemplate(Templates):SpawnScheduled( 15, 0 ) + + diff --git a/SPA - Spawning/SPA-200 - Randomize Unit Types/SPA-200 - Randomize Unit Types.miz b/SPA - Spawning/SPA-200 - Randomize Unit Types/SPA-200 - Randomize Unit Types.miz index 2664604892..28353dd446 100644 Binary files a/SPA - Spawning/SPA-200 - Randomize Unit Types/SPA-200 - Randomize Unit Types.miz and b/SPA - Spawning/SPA-200 - Randomize Unit Types/SPA-200 - Randomize Unit Types.miz differ diff --git a/SPA - Spawning/SPA-220 - Randomize Zones/SPA-220 - Randomize Zones.lua b/SPA - Spawning/SPA-220 - Randomize Zones/SPA-220 - Randomize Zones.lua new file mode 100644 index 0000000000..08b57de998 --- /dev/null +++ b/SPA - Spawning/SPA-220 - Randomize Zones/SPA-220 - Randomize Zones.lua @@ -0,0 +1,51 @@ +-- This test will create 3 different zones of different types. +-- 100 groups of 1 unit will be spawned. +-- The test is about testing the zone randomization, and the place where the units are created. + +local Iterations = 100 +local Iteration = 1 + +-- The PolygonGroup route defines zone 1 +local ZonePolygonGroup = GROUP:FindByName( "ZonePolygon" ) + +-- The ZoneUnit defines zone 4. +local ZoneUnit = UNIT:FindByName( "ZoneUnit" ) + +-- The ZoneGroup defines zone 5 +local ZoneGroup = GROUP:FindByName( "ZoneGroup" ) + +-- This is the array that models the different zones types. +-- The selection of the zones is done by taking into account the probability of the zone. +-- The zone probabibility is 0 = 0%, 1 = 100% +-- The default value of the probability is 1. +-- Note that the SetZoneProbability is a method, that returns the self object of the zone, +-- allowing to use the method within the zone array declaration! +local SpawnZones = { + ZONE_POLYGON:New( "Zone 1", ZonePolygonGroup ):SetZoneProbability( 0.8 ), + ZONE_RADIUS:New( "Zone 2", ZONE:New( "GroundZone2" ):GetVec2(), 5000 ):SetZoneProbability( 0.2 ), + ZONE:New( "GroundZone3" ):SetZoneProbability( 0.2 ), + ZONE_UNIT:New( "Zone 4", ZoneUnit, 5000 ):SetZoneProbability( 0.6 ), + ZONE_GROUP:New( "Zone 5", ZoneGroup, 5000 ):SetZoneProbability( 0.4 ), + } + +HeightLimit = 500 + +SpawnGrounds = SPAWN + :New("Ground") + :InitLimit( 100, 100 ) + -- This method will randomize the selection of the zones for each spawned Group during initialization, + -- taking into account the probability factors. + -- When you explore the code behind this method, you'll see that the GetZoneMaybe() method is used to select "maybe" the zone. + :InitRandomizeZones( SpawnZones ) + +--- Spawns these groups slowly. +SCHEDULER:New( nil, + + function( Interation, Iterations ) + do + -- Spawn Ground + SpawnGrounds:Spawn() + end + + end, {}, 0, 1, 0 +) diff --git a/SPA - Spawning/SPA-220 - Randomize Zones/SPA-220 - Randomize Zones.miz b/SPA - Spawning/SPA-220 - Randomize Zones/SPA-220 - Randomize Zones.miz index fc362fdc3d..aca934c384 100644 Binary files a/SPA - Spawning/SPA-220 - Randomize Zones/SPA-220 - Randomize Zones.miz and b/SPA - Spawning/SPA-220 - Randomize Zones/SPA-220 - Randomize Zones.miz differ diff --git a/SPA - Spawning/SPA-310 - Spawn at Static position/SPA-310 - Spawn at Static position.lua b/SPA - Spawning/SPA-310 - Spawn at Static position/SPA-310 - Spawn at Static position.lua index f33af118ab..90beecd21f 100644 --- a/SPA - Spawning/SPA-310 - Spawn at Static position/SPA-310 - Spawn at Static position.lua +++ b/SPA - Spawning/SPA-310 - Spawn at Static position/SPA-310 - Spawn at Static position.lua @@ -1,52 +1,52 @@ - -local Iterations = 10 -local Iteration = 1 - -GroundStatics = { "GroundStatic1", "GroundStatic2", "GroundStatic3" } -AirplaneStatics = { "AirplaneStatic1", "AirplaneStatic2", "AirplaneStatic3" } -HelicopterStatics = { "HelicopterStatic1", "HelicopterStatic2", "HelicopterStatic3" } -ShipStatics = { "ShipStatic1", "ShipStatic2", "ShipStatic3" } - -HeightLimit = 500 - -SpawnGrounds = SPAWN:New("Ground"):InitLimit( 20, 10 ):InitRandomizeUnits( true, 500, 100 ) -SpawnAirplanes = SPAWN:New("Airplane"):InitLimit( 20, 10 ):InitRandomizeUnits( true, 500, 100 ) -SpawnHelicopters = SPAWN:New("Helicopter"):InitLimit( 20, 10 ):InitRandomizeUnits( true, 500, 100 ) -SpawnShips = SPAWN:New("Ship"):InitLimit( 20, 10 ):InitRandomizeUnits( true, 500, 100 ) - ---- Spawns these groups slowly. -SCHEDULER:New( nil, - - function( Interation, Iterations ) - do - -- Spawn Ground - local StaticName = GroundStatics[ math.random( 1, 3 ) ] - local SpawnStatic = STATIC:FindByName( StaticName ) - SpawnGrounds:SpawnFromUnit( SpawnStatic ) - end - - do - -- Spawn Airplanes - local StaticName = AirplaneStatics[ math.random( 1, 3 ) ] - local SpawnStatic = STATIC:FindByName( StaticName ) - SpawnAirplanes:SpawnFromUnit( SpawnStatic ) - SpawnAirplanes:SpawnFromUnit( SpawnStatic, 2000, 4000 ) - end - - do - -- Spawn Helicopters - local StaticName = HelicopterStatics[ math.random( 1, 3 ) ] - local SpawnStatic = STATIC:FindByName( StaticName ) - SpawnHelicopters:SpawnFromUnit( SpawnStatic ) - SpawnHelicopters:SpawnFromUnit( SpawnStatic, 200, 500 ) -- Spawn between 200 and 500 meters. - end - - do - -- Spawn Ships - local StaticName = ShipStatics[ math.random( 1, 3 ) ] - local SpawnStatic = STATIC:FindByName( StaticName ) - SpawnShips:SpawnFromUnit( SpawnStatic ) - end - - end, {}, 0, 15, 0.5 -) + +local Iterations = 10 +local Iteration = 1 + +GroundStatics = { "GroundStatic1", "GroundStatic2", "GroundStatic3" } +AirplaneStatics = { "AirplaneStatic1", "AirplaneStatic2", "AirplaneStatic3" } +HelicopterStatics = { "HelicopterStatic1", "HelicopterStatic2", "HelicopterStatic3" } +ShipStatics = { "ShipStatic1", "ShipStatic2", "ShipStatic3" } + +HeightLimit = 500 + +SpawnGrounds = SPAWN:New("Ground"):InitLimit( 20, 10 ):InitRandomizeUnits( true, 500, 100 ) +SpawnAirplanes = SPAWN:New("Airplane"):InitLimit( 20, 10 ):InitRandomizeUnits( true, 500, 100 ) +SpawnHelicopters = SPAWN:New("Helicopter"):InitLimit( 20, 10 ):InitRandomizeUnits( true, 500, 100 ) +SpawnShips = SPAWN:New("Ship"):InitLimit( 20, 10 ):InitRandomizeUnits( true, 500, 100 ) + +--- Spawns these groups slowly. +SCHEDULER:New( nil, + + function( Interation, Iterations ) + do + -- Spawn Ground + local StaticName = GroundStatics[ math.random( 1, 3 ) ] + local SpawnStatic = STATIC:FindByName( StaticName ) + SpawnGrounds:SpawnFromUnit( SpawnStatic ) + end + + do + -- Spawn Airplanes + local StaticName = AirplaneStatics[ math.random( 1, 3 ) ] + local SpawnStatic = STATIC:FindByName( StaticName ) + SpawnAirplanes:SpawnFromUnit( SpawnStatic ) + SpawnAirplanes:SpawnFromUnit( SpawnStatic, 2000, 4000 ) + end + + do + -- Spawn Helicopters + local StaticName = HelicopterStatics[ math.random( 1, 3 ) ] + local SpawnStatic = STATIC:FindByName( StaticName ) + SpawnHelicopters:SpawnFromUnit( SpawnStatic ) + SpawnHelicopters:SpawnFromUnit( SpawnStatic, 200, 500 ) -- Spawn between 200 and 500 meters. + end + + do + -- Spawn Ships + local StaticName = ShipStatics[ math.random( 1, 3 ) ] + local SpawnStatic = STATIC:FindByName( StaticName ) + SpawnShips:SpawnFromUnit( SpawnStatic ) + end + + end, {}, 0, 15, 0.5 +) diff --git a/SPA - Spawning/SPA-310 - Spawn at Static position/SPA-310 - Spawn at Static position.miz b/SPA - Spawning/SPA-310 - Spawn at Static position/SPA-310 - Spawn at Static position.miz index 3011c66a8d..0e385d1850 100644 Binary files a/SPA - Spawning/SPA-310 - Spawn at Static position/SPA-310 - Spawn at Static position.miz and b/SPA - Spawning/SPA-310 - Spawn at Static position/SPA-310 - Spawn at Static position.miz differ diff --git a/SPA - Spawning/SPA-320 - Spawn at Unit position/SPA-320 - Spawn at Unit position.lua b/SPA - Spawning/SPA-320 - Spawn at Unit position/SPA-320 - Spawn at Unit position.lua index 01e52eda02..a9a462f44c 100644 --- a/SPA - Spawning/SPA-320 - Spawn at Unit position/SPA-320 - Spawn at Unit position.lua +++ b/SPA - Spawning/SPA-320 - Spawn at Unit position/SPA-320 - Spawn at Unit position.lua @@ -1,52 +1,52 @@ - -local Iterations = 10 -local Iteration = 1 - -GroundUnits = { "GroundUnit1", "GroundUnit2", "GroundUnit3" } -AirplaneUnits = { "AirplaneUnit1", "AirplaneUnit2", "AirplaneUnit3" } -HelicopterUnits = { "HelicopterUnit1", "HelicopterUnit2", "HelicopterUnit3" } -ShipUnits = { "ShipUnit1", "ShipUnit2", "ShipUnit3" } - -HeightLimit = 500 - -SpawnGrounds = SPAWN:New("Ground"):InitLimit( 20, 10 ):InitRandomizeUnits( true, 10, 3 ) -SpawnAirplanes = SPAWN:New("Airplane"):InitLimit( 20, 10 ) -SpawnHelicopters = SPAWN:New("Helicopter"):InitLimit( 20, 10 ) -SpawnShips = SPAWN:New("Ship"):InitLimit( 20, 10 ) - ---- Spawns these groups slowly. -SCHEDULER:New( nil, - - function( Interation, Iterations ) - do - -- Spawn Ground - local UnitName = GroundUnits[ math.random( 1, 3 ) ] - local SpawnUnit = UNIT:FindByName( UnitName ) - SpawnGrounds:SpawnFromUnit( SpawnUnit ) - end - - do - -- Spawn Airplanes - local UnitName = AirplaneUnits[ math.random( 1, 3 ) ] - local SpawnUnit = UNIT:FindByName( UnitName ) - SpawnAirplanes:SpawnFromUnit( SpawnUnit ) - SpawnAirplanes:SpawnFromUnit( SpawnUnit, 200, 500 ) - end - - do - -- Spawn Helicopters - local UnitName = HelicopterUnits[ math.random( 1, 3 ) ] - local SpawnUnit = UNIT:FindByName( UnitName ) - SpawnHelicopters:SpawnFromUnit( SpawnUnit ) - SpawnHelicopters:SpawnFromUnit( SpawnUnit, 500, 2000 ) - end - - do - -- Spawn Ships - local UnitName = ShipUnits[ math.random( 1, 3 ) ] - local SpawnUnit = UNIT:FindByName( UnitName ) - SpawnShips:SpawnFromUnit( SpawnUnit ) - end - - end, {}, 0, 15, 0.5 -) + +local Iterations = 10 +local Iteration = 1 + +GroundUnits = { "GroundUnit1", "GroundUnit2", "GroundUnit3" } +AirplaneUnits = { "AirplaneUnit1", "AirplaneUnit2", "AirplaneUnit3" } +HelicopterUnits = { "HelicopterUnit1", "HelicopterUnit2", "HelicopterUnit3" } +ShipUnits = { "ShipUnit1", "ShipUnit2", "ShipUnit3" } + +HeightLimit = 500 + +SpawnGrounds = SPAWN:New("Ground"):InitLimit( 20, 10 ):InitRandomizeUnits( true, 10, 3 ) +SpawnAirplanes = SPAWN:New("Airplane"):InitLimit( 20, 10 ) +SpawnHelicopters = SPAWN:New("Helicopter"):InitLimit( 20, 10 ) +SpawnShips = SPAWN:New("Ship"):InitLimit( 20, 10 ) + +--- Spawns these groups slowly. +SCHEDULER:New( nil, + + function( Interation, Iterations ) + do + -- Spawn Ground + local UnitName = GroundUnits[ math.random( 1, 3 ) ] + local SpawnUnit = UNIT:FindByName( UnitName ) + SpawnGrounds:SpawnFromUnit( SpawnUnit ) + end + + do + -- Spawn Airplanes + local UnitName = AirplaneUnits[ math.random( 1, 3 ) ] + local SpawnUnit = UNIT:FindByName( UnitName ) + SpawnAirplanes:SpawnFromUnit( SpawnUnit ) + SpawnAirplanes:SpawnFromUnit( SpawnUnit, 200, 500 ) + end + + do + -- Spawn Helicopters + local UnitName = HelicopterUnits[ math.random( 1, 3 ) ] + local SpawnUnit = UNIT:FindByName( UnitName ) + SpawnHelicopters:SpawnFromUnit( SpawnUnit ) + SpawnHelicopters:SpawnFromUnit( SpawnUnit, 500, 2000 ) + end + + do + -- Spawn Ships + local UnitName = ShipUnits[ math.random( 1, 3 ) ] + local SpawnUnit = UNIT:FindByName( UnitName ) + SpawnShips:SpawnFromUnit( SpawnUnit ) + end + + end, {}, 0, 15, 0.5 +) diff --git a/SPA - Spawning/SPA-320 - Spawn at Unit position/SPA-320 - Spawn at Unit position.miz b/SPA - Spawning/SPA-320 - Spawn at Unit position/SPA-320 - Spawn at Unit position.miz index e6da508da5..8afa5013e6 100644 Binary files a/SPA - Spawning/SPA-320 - Spawn at Unit position/SPA-320 - Spawn at Unit position.miz and b/SPA - Spawning/SPA-320 - Spawn at Unit position/SPA-320 - Spawn at Unit position.miz differ diff --git a/SPA - Spawning/SPA-330 - Spawn at Vec2 position/SPA-330 - Spawn at Vec2 position.lua b/SPA - Spawning/SPA-330 - Spawn at Vec2 position/SPA-330 - Spawn at Vec2 position.lua index fbb754c873..a2de3504c7 100644 --- a/SPA - Spawning/SPA-330 - Spawn at Vec2 position/SPA-330 - Spawn at Vec2 position.lua +++ b/SPA - Spawning/SPA-330 - Spawn at Vec2 position/SPA-330 - Spawn at Vec2 position.lua @@ -1,61 +1,61 @@ - -local Iterations = 10 -local Iteration = 1 - -GroundZones = { "GroundZone1", "GroundZone2", "GroundZone3" } -GroundRandomizeZones = { "GroundRandomizeZone1", "GroundRandomizeZone2", "GroundRandomizeZone3" } -AirplaneZones = { "AirplaneZone1", "AirplaneZone2", "AirplaneZone3" } -HelicopterZones = { "HelicopterZone1", "HelicopterZone2", "HelicopterZone3" } -ShipZones = { "ShipZone1", "ShipZone2", "ShipZone3" } - -HeightLimit = 500 - -SpawnGrounds = SPAWN:New("Ground"):InitLimit( 20, 10 ) -SpawnRandomizeGrounds = SPAWN:New("GroundRandomize"):InitLimit( 20, 10 ):InitRandomizeUnits( true, 500, 100 ) -SpawnAirplanes = SPAWN:New("Airplane"):InitLimit( 20, 10 ) -SpawnHelicopters = SPAWN:New("Helicopter"):InitLimit( 20, 10 ) -SpawnShips = SPAWN:New("Ship"):InitLimit( 20, 10 ) - ---- Spawns these groups slowly. -SCHEDULER:New( nil, - - function( Interation, Iterations ) - do - -- Spawn Ground - local ZoneName = GroundZones[ math.random( 1, 3 ) ] - local SpawnVec3 = POINT_VEC3:NewFromVec3( ZONE:New( ZoneName ):GetVec3() ) - SpawnGrounds:SpawnFromVec2( SpawnVec3:GetVec2() ) - end - - do - -- Spawn Ground Randomize - local ZoneName = GroundRandomizeZones[ math.random( 1, 3 ) ] - local SpawnVec3 = POINT_VEC3:NewFromVec3( ZONE:New( ZoneName ):GetVec3() ) - SpawnRandomizeGrounds:SpawnFromVec2( SpawnVec3:GetVec2() ) - end - - do - -- Spawn Airplanes - local ZoneName = AirplaneZones[ math.random( 1, 3 ) ] - local SpawnVec3 = POINT_VEC3:NewFromVec3( ZONE:New( ZoneName ):GetVec3() ) - SpawnAirplanes:SpawnFromVec2( SpawnVec3:GetVec2() ) - SpawnAirplanes:SpawnFromVec2( SpawnVec3:GetVec2(), 200, 500 ) - end - - do - -- Spawn Helicopters - local ZoneName = HelicopterZones[ math.random( 1, 3 ) ] - local SpawnVec3 = POINT_VEC3:NewFromVec3( ZONE:New( ZoneName ):GetVec3() ) - SpawnHelicopters:SpawnFromVec2( SpawnVec3:GetVec2() ) - SpawnHelicopters:SpawnFromVec2( SpawnVec3:GetVec2(), 2000, 4000 ) - end - - do - -- Spawn Ships - local ZoneName = ShipZones[ math.random( 1, 3 ) ] - local SpawnVec3 = POINT_VEC3:NewFromVec3( ZONE:New( ZoneName ):GetVec3() ) - SpawnShips:SpawnFromVec2( SpawnVec3:GetVec2() ) - end - - end, {}, 0, 15, 0.5 -) + +local Iterations = 10 +local Iteration = 1 + +GroundZones = { "GroundZone1", "GroundZone2", "GroundZone3" } +GroundRandomizeZones = { "GroundRandomizeZone1", "GroundRandomizeZone2", "GroundRandomizeZone3" } +AirplaneZones = { "AirplaneZone1", "AirplaneZone2", "AirplaneZone3" } +HelicopterZones = { "HelicopterZone1", "HelicopterZone2", "HelicopterZone3" } +ShipZones = { "ShipZone1", "ShipZone2", "ShipZone3" } + +HeightLimit = 500 + +SpawnGrounds = SPAWN:New("Ground"):InitLimit( 20, 10 ) +SpawnRandomizeGrounds = SPAWN:New("GroundRandomize"):InitLimit( 20, 10 ):InitRandomizeUnits( true, 500, 100 ) +SpawnAirplanes = SPAWN:New("Airplane"):InitLimit( 20, 10 ) +SpawnHelicopters = SPAWN:New("Helicopter"):InitLimit( 20, 10 ) +SpawnShips = SPAWN:New("Ship"):InitLimit( 20, 10 ) + +--- Spawns these groups slowly. +SCHEDULER:New( nil, + + function( Interation, Iterations ) + do + -- Spawn Ground + local ZoneName = GroundZones[ math.random( 1, 3 ) ] + local SpawnVec3 = POINT_VEC3:NewFromVec3( ZONE:New( ZoneName ):GetVec3() ) + SpawnGrounds:SpawnFromVec2( SpawnVec3:GetVec2() ) + end + + do + -- Spawn Ground Randomize + local ZoneName = GroundRandomizeZones[ math.random( 1, 3 ) ] + local SpawnVec3 = POINT_VEC3:NewFromVec3( ZONE:New( ZoneName ):GetVec3() ) + SpawnRandomizeGrounds:SpawnFromVec2( SpawnVec3:GetVec2() ) + end + + do + -- Spawn Airplanes + local ZoneName = AirplaneZones[ math.random( 1, 3 ) ] + local SpawnVec3 = POINT_VEC3:NewFromVec3( ZONE:New( ZoneName ):GetVec3() ) + SpawnAirplanes:SpawnFromVec2( SpawnVec3:GetVec2() ) + SpawnAirplanes:SpawnFromVec2( SpawnVec3:GetVec2(), 200, 500 ) + end + + do + -- Spawn Helicopters + local ZoneName = HelicopterZones[ math.random( 1, 3 ) ] + local SpawnVec3 = POINT_VEC3:NewFromVec3( ZONE:New( ZoneName ):GetVec3() ) + SpawnHelicopters:SpawnFromVec2( SpawnVec3:GetVec2() ) + SpawnHelicopters:SpawnFromVec2( SpawnVec3:GetVec2(), 2000, 4000 ) + end + + do + -- Spawn Ships + local ZoneName = ShipZones[ math.random( 1, 3 ) ] + local SpawnVec3 = POINT_VEC3:NewFromVec3( ZONE:New( ZoneName ):GetVec3() ) + SpawnShips:SpawnFromVec2( SpawnVec3:GetVec2() ) + end + + end, {}, 0, 15, 0.5 +) diff --git a/SPA - Spawning/SPA-330 - Spawn at Vec2 position/SPA-330 - Spawn at Vec2 position.miz b/SPA - Spawning/SPA-330 - Spawn at Vec2 position/SPA-330 - Spawn at Vec2 position.miz index 60846cd560..3237b441dd 100644 Binary files a/SPA - Spawning/SPA-330 - Spawn at Vec2 position/SPA-330 - Spawn at Vec2 position.miz and b/SPA - Spawning/SPA-330 - Spawn at Vec2 position/SPA-330 - Spawn at Vec2 position.miz differ diff --git a/SPA - Spawning/SPA-340 - Spawn at Vec3 position/SPA-340 - Spawn at Vec3 position.lua b/SPA - Spawning/SPA-340 - Spawn at Vec3 position/SPA-340 - Spawn at Vec3 position.lua index df0d253ef1..4032e80cce 100644 --- a/SPA - Spawning/SPA-340 - Spawn at Vec3 position/SPA-340 - Spawn at Vec3 position.lua +++ b/SPA - Spawning/SPA-340 - Spawn at Vec3 position/SPA-340 - Spawn at Vec3 position.lua @@ -1,59 +1,59 @@ - -local Iterations = 10 -local Iteration = 1 - -GroundZones = { "GroundZone1", "GroundZone2", "GroundZone3" } -GroundRandomizeZones = { "GroundRandomizeZone1", "GroundRandomizeZone2", "GroundRandomizeZone3" } -AirplaneZones = { "AirplaneZone1", "AirplaneZone2", "AirplaneZone3" } -HelicopterZones = { "HelicopterZone1", "HelicopterZone2", "HelicopterZone3" } -ShipZones = { "ShipZone1", "ShipZone2", "ShipZone3" } - -HeightLimit = 500 - -SpawnGrounds = SPAWN:New("Ground"):InitLimit( 20, 10 ) -SpawnRandomizeGrounds = SPAWN:New("GroundRandomize"):InitLimit( 20, 10 ):InitRandomizeUnits( true, 500, 100 ) -SpawnAirplanes = SPAWN:New("Airplane"):InitLimit( 20, 10 ) -SpawnHelicopters = SPAWN:New("Helicopter"):InitLimit( 20, 10 ) -SpawnShips = SPAWN:New("Ship"):InitLimit( 20, 10 ) - ---- Spawns these groups slowly. -SCHEDULER:New( nil, - - function( Interation, Iterations ) - do - -- Spawn Ground - local ZoneName = GroundZones[ math.random( 1, 3 ) ] - local SpawnVec3 = POINT_VEC3:NewFromVec3( ZONE:New( ZoneName ):GetVec3() ) - SpawnGrounds:SpawnFromVec3( SpawnVec3:GetVec3() ) - end - - do - -- Spawn Ground Randomize - local ZoneName = GroundRandomizeZones[ math.random( 1, 3 ) ] - local SpawnVec3 = POINT_VEC3:NewFromVec3( ZONE:New( ZoneName ):GetVec3() ) - SpawnRandomizeGrounds:SpawnFromVec3( SpawnVec3:GetVec3() ) - end - - do - -- Spawn Airplanes - local ZoneName = AirplaneZones[ math.random( 1, 3 ) ] - local SpawnVec3 = POINT_VEC3:NewFromVec3( ZONE:New( ZoneName ):GetVec3() ) - SpawnAirplanes:SpawnFromVec3( SpawnVec3:GetVec3() ) - end - - do - -- Spawn Helicopters - local ZoneName = HelicopterZones[ math.random( 1, 3 ) ] - local SpawnVec3 = POINT_VEC3:NewFromVec3( ZONE:New( ZoneName ):GetVec3() ) - SpawnHelicopters:SpawnFromVec3( SpawnVec3:GetVec3() ) - end - - do - -- Spawn Ships - local ZoneName = ShipZones[ math.random( 1, 3 ) ] - local SpawnVec3 = POINT_VEC3:NewFromVec3( ZONE:New( ZoneName ):GetVec3() ) - SpawnShips:SpawnFromVec3( SpawnVec3:GetVec3() ) - end - - end, {}, 0, 15, 0.5 -) + +local Iterations = 10 +local Iteration = 1 + +GroundZones = { "GroundZone1", "GroundZone2", "GroundZone3" } +GroundRandomizeZones = { "GroundRandomizeZone1", "GroundRandomizeZone2", "GroundRandomizeZone3" } +AirplaneZones = { "AirplaneZone1", "AirplaneZone2", "AirplaneZone3" } +HelicopterZones = { "HelicopterZone1", "HelicopterZone2", "HelicopterZone3" } +ShipZones = { "ShipZone1", "ShipZone2", "ShipZone3" } + +HeightLimit = 500 + +SpawnGrounds = SPAWN:New("Ground"):InitLimit( 20, 10 ) +SpawnRandomizeGrounds = SPAWN:New("GroundRandomize"):InitLimit( 20, 10 ):InitRandomizeUnits( true, 500, 100 ) +SpawnAirplanes = SPAWN:New("Airplane"):InitLimit( 20, 10 ) +SpawnHelicopters = SPAWN:New("Helicopter"):InitLimit( 20, 10 ) +SpawnShips = SPAWN:New("Ship"):InitLimit( 20, 10 ) + +--- Spawns these groups slowly. +SCHEDULER:New( nil, + + function( Interation, Iterations ) + do + -- Spawn Ground + local ZoneName = GroundZones[ math.random( 1, 3 ) ] + local SpawnVec3 = POINT_VEC3:NewFromVec3( ZONE:New( ZoneName ):GetVec3() ) + SpawnGrounds:SpawnFromVec3( SpawnVec3:GetVec3() ) + end + + do + -- Spawn Ground Randomize + local ZoneName = GroundRandomizeZones[ math.random( 1, 3 ) ] + local SpawnVec3 = POINT_VEC3:NewFromVec3( ZONE:New( ZoneName ):GetVec3() ) + SpawnRandomizeGrounds:SpawnFromVec3( SpawnVec3:GetVec3() ) + end + + do + -- Spawn Airplanes + local ZoneName = AirplaneZones[ math.random( 1, 3 ) ] + local SpawnVec3 = POINT_VEC3:NewFromVec3( ZONE:New( ZoneName ):GetVec3() ) + SpawnAirplanes:SpawnFromVec3( SpawnVec3:GetVec3() ) + end + + do + -- Spawn Helicopters + local ZoneName = HelicopterZones[ math.random( 1, 3 ) ] + local SpawnVec3 = POINT_VEC3:NewFromVec3( ZONE:New( ZoneName ):GetVec3() ) + SpawnHelicopters:SpawnFromVec3( SpawnVec3:GetVec3() ) + end + + do + -- Spawn Ships + local ZoneName = ShipZones[ math.random( 1, 3 ) ] + local SpawnVec3 = POINT_VEC3:NewFromVec3( ZONE:New( ZoneName ):GetVec3() ) + SpawnShips:SpawnFromVec3( SpawnVec3:GetVec3() ) + end + + end, {}, 0, 15, 0.5 +) diff --git a/SPA - Spawning/SPA-340 - Spawn at Vec3 position/SPA-340 - Spawn at Vec3 position.miz b/SPA - Spawning/SPA-340 - Spawn at Vec3 position/SPA-340 - Spawn at Vec3 position.miz index 29f375153e..9aa7ecbfab 100644 Binary files a/SPA - Spawning/SPA-340 - Spawn at Vec3 position/SPA-340 - Spawn at Vec3 position.miz and b/SPA - Spawning/SPA-340 - Spawn at Vec3 position/SPA-340 - Spawn at Vec3 position.miz differ diff --git a/SPA - Spawning/SPA-350 - Spawn at Vec3 position RandomizePosition/SPA-350 - Spawn at Vec3 position RandomizePosition.lua b/SPA - Spawning/SPA-350 - Spawn at Vec3 position RandomizePosition/SPA-350 - Spawn at Vec3 position RandomizePosition.lua index e3ea496327..3122b26dda 100644 --- a/SPA - Spawning/SPA-350 - Spawn at Vec3 position RandomizePosition/SPA-350 - Spawn at Vec3 position RandomizePosition.lua +++ b/SPA - Spawning/SPA-350 - Spawn at Vec3 position RandomizePosition/SPA-350 - Spawn at Vec3 position RandomizePosition.lua @@ -1,73 +1,73 @@ ---- --- Name: SPA-350 - Spawn at Vec3 position RandomzePosition --- Author: FlightControl --- Date Created: 14 Mar 2017 --- --- # Situation: --- --- Ground troops, Airplanes, Helicopters and Ships are spawning from Vec3 points. --- The API InitRandomizePosition is tested here, ensure that groups are replaced within a 900 to 1000 zone band at random positions. --- --- # Test cases: --- --- 1. Observe the random positioning of the groups. There should be no scattering of units. --- - -local Iterations = 10 -local Iteration = 1 - -GroundZones = { "GroundZone1", "GroundZone2", "GroundZone3" } -GroundRandomizeZones = { "GroundRandomizeZone1", "GroundRandomizeZone2", "GroundRandomizeZone3" } -AirplaneZones = { "AirplaneZone1", "AirplaneZone2", "AirplaneZone3" } -HelicopterZones = { "HelicopterZone1", "HelicopterZone2", "HelicopterZone3" } -ShipZones = { "ShipZone1", "ShipZone2", "ShipZone3" } - -HeightLimit = 500 - -SpawnGrounds = SPAWN:New("Ground"):InitLimit( 20, 10 ):InitRandomizePosition( true , 1000, 900 ) -SpawnRandomizeGrounds = SPAWN:New("GroundRandomize"):InitLimit( 20, 10 ):InitRandomizePosition( true , 1000, 900 ) -SpawnAirplanes = SPAWN:New("Airplane"):InitLimit( 20, 10 ):InitRandomizePosition( true , 1000, 900 ) -SpawnHelicopters = SPAWN:New("Helicopter"):InitLimit( 20, 10 ):InitRandomizePosition( true , 1000, 900 ) -SpawnShips = SPAWN:New("Ship"):InitLimit( 20, 10 ):InitRandomizePosition( true , 1000, 900 ) - ---- Spawns these groups slowly. -SCHEDULER:New( nil, - - function( Interation, Iterations ) - do - -- Spawn Ground - local ZoneName = GroundZones[ math.random( 1, 3 ) ] - local SpawnVec3 = POINT_VEC3:NewFromVec3( ZONE:New( ZoneName ):GetVec3() ) - SpawnGrounds:SpawnFromVec3( SpawnVec3:GetVec3() ) - end - - do - -- Spawn Ground Randomize - local ZoneName = GroundRandomizeZones[ math.random( 1, 3 ) ] - local SpawnVec3 = POINT_VEC3:NewFromVec3( ZONE:New( ZoneName ):GetVec3() ) - SpawnRandomizeGrounds:SpawnFromVec3( SpawnVec3:GetVec3() ) - end - - do - -- Spawn Airplanes - local ZoneName = AirplaneZones[ math.random( 1, 3 ) ] - local SpawnVec3 = POINT_VEC3:NewFromVec3( ZONE:New( ZoneName ):GetVec3() ) - SpawnAirplanes:SpawnFromVec3( SpawnVec3:GetVec3() ) - end - - do - -- Spawn Helicopters - local ZoneName = HelicopterZones[ math.random( 1, 3 ) ] - local SpawnVec3 = POINT_VEC3:NewFromVec3( ZONE:New( ZoneName ):GetVec3() ) - SpawnHelicopters:SpawnFromVec3( SpawnVec3:GetVec3() ) - end - - do - -- Spawn Ships - local ZoneName = ShipZones[ math.random( 1, 3 ) ] - local SpawnVec3 = POINT_VEC3:NewFromVec3( ZONE:New( ZoneName ):GetVec3() ) - SpawnShips:SpawnFromVec3( SpawnVec3:GetVec3() ) - end - - end, {}, 0, 15, 0.5 -) +--- +-- Name: SPA-350 - Spawn at Vec3 position RandomzePosition +-- Author: FlightControl +-- Date Created: 14 Mar 2017 +-- +-- # Situation: +-- +-- Ground troops, Airplanes, Helicopters and Ships are spawning from Vec3 points. +-- The API InitRandomizePosition is tested here, ensure that groups are replaced within a 900 to 1000 zone band at random positions. +-- +-- # Test cases: +-- +-- 1. Observe the random positioning of the groups. There should be no scattering of units. +-- + +local Iterations = 10 +local Iteration = 1 + +GroundZones = { "GroundZone1", "GroundZone2", "GroundZone3" } +GroundRandomizeZones = { "GroundRandomizeZone1", "GroundRandomizeZone2", "GroundRandomizeZone3" } +AirplaneZones = { "AirplaneZone1", "AirplaneZone2", "AirplaneZone3" } +HelicopterZones = { "HelicopterZone1", "HelicopterZone2", "HelicopterZone3" } +ShipZones = { "ShipZone1", "ShipZone2", "ShipZone3" } + +HeightLimit = 500 + +SpawnGrounds = SPAWN:New("Ground"):InitLimit( 20, 10 ):InitRandomizePosition( true , 1000, 900 ) +SpawnRandomizeGrounds = SPAWN:New("GroundRandomize"):InitLimit( 20, 10 ):InitRandomizePosition( true , 1000, 900 ) +SpawnAirplanes = SPAWN:New("Airplane"):InitLimit( 20, 10 ):InitRandomizePosition( true , 1000, 900 ) +SpawnHelicopters = SPAWN:New("Helicopter"):InitLimit( 20, 10 ):InitRandomizePosition( true , 1000, 900 ) +SpawnShips = SPAWN:New("Ship"):InitLimit( 20, 10 ):InitRandomizePosition( true , 1000, 900 ) + +--- Spawns these groups slowly. +SCHEDULER:New( nil, + + function( Interation, Iterations ) + do + -- Spawn Ground + local ZoneName = GroundZones[ math.random( 1, 3 ) ] + local SpawnVec3 = POINT_VEC3:NewFromVec3( ZONE:New( ZoneName ):GetVec3() ) + SpawnGrounds:SpawnFromVec3( SpawnVec3:GetVec3() ) + end + + do + -- Spawn Ground Randomize + local ZoneName = GroundRandomizeZones[ math.random( 1, 3 ) ] + local SpawnVec3 = POINT_VEC3:NewFromVec3( ZONE:New( ZoneName ):GetVec3() ) + SpawnRandomizeGrounds:SpawnFromVec3( SpawnVec3:GetVec3() ) + end + + do + -- Spawn Airplanes + local ZoneName = AirplaneZones[ math.random( 1, 3 ) ] + local SpawnVec3 = POINT_VEC3:NewFromVec3( ZONE:New( ZoneName ):GetVec3() ) + SpawnAirplanes:SpawnFromVec3( SpawnVec3:GetVec3() ) + end + + do + -- Spawn Helicopters + local ZoneName = HelicopterZones[ math.random( 1, 3 ) ] + local SpawnVec3 = POINT_VEC3:NewFromVec3( ZONE:New( ZoneName ):GetVec3() ) + SpawnHelicopters:SpawnFromVec3( SpawnVec3:GetVec3() ) + end + + do + -- Spawn Ships + local ZoneName = ShipZones[ math.random( 1, 3 ) ] + local SpawnVec3 = POINT_VEC3:NewFromVec3( ZONE:New( ZoneName ):GetVec3() ) + SpawnShips:SpawnFromVec3( SpawnVec3:GetVec3() ) + end + + end, {}, 0, 15, 0.5 +) diff --git a/SPA - Spawning/SPA-350 - Spawn at Vec3 position RandomizePosition/SPA-350 - Spawn at Vec3 position RandomizePosition.miz b/SPA - Spawning/SPA-350 - Spawn at Vec3 position RandomizePosition/SPA-350 - Spawn at Vec3 position RandomizePosition.miz index cce7da9c96..7a08242a44 100644 Binary files a/SPA - Spawning/SPA-350 - Spawn at Vec3 position RandomizePosition/SPA-350 - Spawn at Vec3 position RandomizePosition.miz and b/SPA - Spawning/SPA-350 - Spawn at Vec3 position RandomizePosition/SPA-350 - Spawn at Vec3 position RandomizePosition.miz differ diff --git a/SPA - Spawning/SPA-350 - Spawn at Vec3 position RandomizePosition/SPA-350 - Spawn at Vec3 position RandomzePosition.lua b/SPA - Spawning/SPA-350 - Spawn at Vec3 position RandomizePosition/SPA-350 - Spawn at Vec3 position RandomzePosition.lua new file mode 100644 index 0000000000..3122b26dda --- /dev/null +++ b/SPA - Spawning/SPA-350 - Spawn at Vec3 position RandomizePosition/SPA-350 - Spawn at Vec3 position RandomzePosition.lua @@ -0,0 +1,73 @@ +--- +-- Name: SPA-350 - Spawn at Vec3 position RandomzePosition +-- Author: FlightControl +-- Date Created: 14 Mar 2017 +-- +-- # Situation: +-- +-- Ground troops, Airplanes, Helicopters and Ships are spawning from Vec3 points. +-- The API InitRandomizePosition is tested here, ensure that groups are replaced within a 900 to 1000 zone band at random positions. +-- +-- # Test cases: +-- +-- 1. Observe the random positioning of the groups. There should be no scattering of units. +-- + +local Iterations = 10 +local Iteration = 1 + +GroundZones = { "GroundZone1", "GroundZone2", "GroundZone3" } +GroundRandomizeZones = { "GroundRandomizeZone1", "GroundRandomizeZone2", "GroundRandomizeZone3" } +AirplaneZones = { "AirplaneZone1", "AirplaneZone2", "AirplaneZone3" } +HelicopterZones = { "HelicopterZone1", "HelicopterZone2", "HelicopterZone3" } +ShipZones = { "ShipZone1", "ShipZone2", "ShipZone3" } + +HeightLimit = 500 + +SpawnGrounds = SPAWN:New("Ground"):InitLimit( 20, 10 ):InitRandomizePosition( true , 1000, 900 ) +SpawnRandomizeGrounds = SPAWN:New("GroundRandomize"):InitLimit( 20, 10 ):InitRandomizePosition( true , 1000, 900 ) +SpawnAirplanes = SPAWN:New("Airplane"):InitLimit( 20, 10 ):InitRandomizePosition( true , 1000, 900 ) +SpawnHelicopters = SPAWN:New("Helicopter"):InitLimit( 20, 10 ):InitRandomizePosition( true , 1000, 900 ) +SpawnShips = SPAWN:New("Ship"):InitLimit( 20, 10 ):InitRandomizePosition( true , 1000, 900 ) + +--- Spawns these groups slowly. +SCHEDULER:New( nil, + + function( Interation, Iterations ) + do + -- Spawn Ground + local ZoneName = GroundZones[ math.random( 1, 3 ) ] + local SpawnVec3 = POINT_VEC3:NewFromVec3( ZONE:New( ZoneName ):GetVec3() ) + SpawnGrounds:SpawnFromVec3( SpawnVec3:GetVec3() ) + end + + do + -- Spawn Ground Randomize + local ZoneName = GroundRandomizeZones[ math.random( 1, 3 ) ] + local SpawnVec3 = POINT_VEC3:NewFromVec3( ZONE:New( ZoneName ):GetVec3() ) + SpawnRandomizeGrounds:SpawnFromVec3( SpawnVec3:GetVec3() ) + end + + do + -- Spawn Airplanes + local ZoneName = AirplaneZones[ math.random( 1, 3 ) ] + local SpawnVec3 = POINT_VEC3:NewFromVec3( ZONE:New( ZoneName ):GetVec3() ) + SpawnAirplanes:SpawnFromVec3( SpawnVec3:GetVec3() ) + end + + do + -- Spawn Helicopters + local ZoneName = HelicopterZones[ math.random( 1, 3 ) ] + local SpawnVec3 = POINT_VEC3:NewFromVec3( ZONE:New( ZoneName ):GetVec3() ) + SpawnHelicopters:SpawnFromVec3( SpawnVec3:GetVec3() ) + end + + do + -- Spawn Ships + local ZoneName = ShipZones[ math.random( 1, 3 ) ] + local SpawnVec3 = POINT_VEC3:NewFromVec3( ZONE:New( ZoneName ):GetVec3() ) + SpawnShips:SpawnFromVec3( SpawnVec3:GetVec3() ) + end + + end, {}, 0, 15, 0.5 +) diff --git a/SPA-022 - Ground Ops - Scheduled Spawns Limited with long interval/SPA-022 - Ground Ops - Scheduled Spawns Limited with long interval.lua b/SPA-022 - Ground Ops - Scheduled Spawns Limited with long interval/SPA-022 - Ground Ops - Scheduled Spawns Limited with long interval.lua index ce8e37648c..6416b0bcd8 100644 --- a/SPA-022 - Ground Ops - Scheduled Spawns Limited with long interval/SPA-022 - Ground Ops - Scheduled Spawns Limited with long interval.lua +++ b/SPA-022 - Ground Ops - Scheduled Spawns Limited with long interval/SPA-022 - Ground Ops - Scheduled Spawns Limited with long interval.lua @@ -1,25 +1,25 @@ --- Name: SPA-022 - Ground Ops - Scheduled Spawns Limited with long interval --- Author: FlightControl --- Date Created: 18 Mar 2017 --- Checked in 15 dez 2020 by ZERO --- --- # Situation: --- --- At Gudauta spawn multiple ground vehicles, in a scheduled fashion. --- The vehicle should respawn when killed. --- --- # Test cases: --- --- 1. Observe that the ground vehicles are spawned at the position declared within the mission editor. --- 2. The vehicles should spawn according the scheduler parameters. --- 3. When the vehicle spawned die, a new vehicle will be spawned - - - --- Tests Gudauta --- ------------- -Spawn_Vehicle_1 = SPAWN:New( "Spawn Vehicle 1" ):InitLimit( 1, 0 ):SpawnScheduled( 30, .5 ) - - - - +-- Name: SPA-022 - Ground Ops - Scheduled Spawns Limited with long interval +-- Author: FlightControl +-- Date Created: 18 Mar 2017 +-- Checked in 15 dez 2020 by ZERO +-- +-- # Situation: +-- +-- At Gudauta spawn multiple ground vehicles, in a scheduled fashion. +-- The vehicle should respawn when killed. +-- +-- # Test cases: +-- +-- 1. Observe that the ground vehicles are spawned at the position declared within the mission editor. +-- 2. The vehicles should spawn according the scheduler parameters. +-- 3. When the vehicle spawned die, a new vehicle will be spawned + + + +-- Tests Gudauta +-- ------------- +Spawn_Vehicle_1 = SPAWN:New( "Spawn Vehicle 1" ):InitLimit( 1, 0 ):SpawnScheduled( 30, .5 ) + + + + diff --git a/SPA-022 - Ground Ops - Scheduled Spawns Limited with long interval/SPA-022 - Ground Ops - Scheduled Spawns Limited with long interval.miz b/SPA-022 - Ground Ops - Scheduled Spawns Limited with long interval/SPA-022 - Ground Ops - Scheduled Spawns Limited with long interval.miz index b80b0beebf..3700438f17 100644 Binary files a/SPA-022 - Ground Ops - Scheduled Spawns Limited with long interval/SPA-022 - Ground Ops - Scheduled Spawns Limited with long interval.miz and b/SPA-022 - Ground Ops - Scheduled Spawns Limited with long interval/SPA-022 - Ground Ops - Scheduled Spawns Limited with long interval.miz differ diff --git a/SPA-023 - Ground Ops - SpawnStart and SpawnStop/SPA-023 - Ground Ops - SpawnStart and SpawnStop.lua b/SPA-023 - Ground Ops - SpawnStart and SpawnStop/SPA-023 - Ground Ops - SpawnStart and SpawnStop.lua index e3c4d600f0..0c3647a3cd 100644 --- a/SPA-023 - Ground Ops - SpawnStart and SpawnStop/SPA-023 - Ground Ops - SpawnStart and SpawnStop.lua +++ b/SPA-023 - Ground Ops - SpawnStart and SpawnStop/SPA-023 - Ground Ops - SpawnStart and SpawnStop.lua @@ -1,27 +1,26 @@ ---- --- Name: SPA-023 - Ground Ops - SpawnStart and SpawnStop --- Author: FlightControl --- Date Created: 10 Jan 2017 --- Checked in 15 dez 2020 by ZERO --- --- # Situation: --- --- At Gudauta spawn multiple ground vehicles, in a scheduled fashion. --- The schedule is immediately stopped and started. --- --- # Test cases: --- --- 1. Observe that the ground vehicles are spawned at the position declared within the mission editor. --- 2. The vehicles should spawn according the scheduler parameters. - - - --- Tests Gudauta --- ------------- -Spawn_Vehicle = SPAWN:New( "Spawn Vehicle 1" ):SpawnScheduled( 10, 0.5 ):SpawnScheduleStop() - -Spawn_Vehicle:SpawnScheduleStart() - - - - +--- +-- Name: SPA-023 - Ground Ops - SpawnStart and SpawnStop +-- Author: FlightControl +-- Date Created: 10 Jan 2017 +-- +-- # Situation: +-- +-- At Gudauta spawn multiple ground vehicles, in a scheduled fashion. +-- The schedule is immediately stopped and started. +-- +-- # Test cases: +-- +-- 1. Observe that the ground vehicles are spawned at the position declared within the mission editor. +-- 2. The vehicles should spawn according the scheduler parameters. + + + +-- Tests Gudauta +-- ------------- +Spawn_Vehicle = SPAWN:New( "Spawn Vehicle 1" ):SpawnScheduled( 10, 0.5 ):SpawnScheduleStop() + +Spawn_Vehicle:SpawnScheduleStart() + + + + diff --git a/SPA-023 - Ground Ops - SpawnStart and SpawnStop/SPA-023 - Ground Ops - SpawnStart and SpawnStop.miz b/SPA-023 - Ground Ops - SpawnStart and SpawnStop/SPA-023 - Ground Ops - SpawnStart and SpawnStop.miz index 0592b70733..b4a7d7edf0 100644 Binary files a/SPA-023 - Ground Ops - SpawnStart and SpawnStop/SPA-023 - Ground Ops - SpawnStart and SpawnStop.miz and b/SPA-023 - Ground Ops - SpawnStart and SpawnStop/SPA-023 - Ground Ops - SpawnStart and SpawnStop.miz differ diff --git a/SPA-024 - Ground Ops - Arrays Normandy/SPA-024 - Ground Ops - Arrays Normandy.miz b/SPA-024 - Ground Ops - Arrays Normandy/SPA-024 - Ground Ops - Arrays Normandy.miz index 2896a02c74..5b294ff55b 100644 Binary files a/SPA-024 - Ground Ops - Arrays Normandy/SPA-024 - Ground Ops - Arrays Normandy.miz and b/SPA-024 - Ground Ops - Arrays Normandy/SPA-024 - Ground Ops - Arrays Normandy.miz differ diff --git a/SPA-024 - Ground Ops - Arrays Normandy/SPA-024 - Ground Ops - Arrays.lua b/SPA-024 - Ground Ops - Arrays Normandy/SPA-024 - Ground Ops - Arrays.lua new file mode 100644 index 0000000000..1bdb911081 --- /dev/null +++ b/SPA-024 - Ground Ops - Arrays Normandy/SPA-024 - Ground Ops - Arrays.lua @@ -0,0 +1,27 @@ +--- +-- Name: SPA-024 - Ground Ops - Arrays +-- Author: FlightControl +-- Date Created: 19 Jul 2017 +-- +-- # Situation: +-- +-- At Gudauta spawn multiple ground vehicles, in an array. +-- +-- # Test cases: +-- +-- 1. Observe that the ground vehicles are spawned at the position declared within the mission editor. +-- 2. The vehicles should spawn according the array parameters. + + + +-- Tests Gudauta +-- ------------- +Spawn_Vehicle = SPAWN + :New( "Spawn Vehicles" ) + :InitLimit( 12, 60 ) + :InitArray( 90, 10, 10, 10 ) + + + + + diff --git a/SPA-024 - Ground Ops - Arrays/SPA-024 - Ground Ops - Arrays.lua b/SPA-024 - Ground Ops - Arrays/SPA-024 - Ground Ops - Arrays.lua index 1208bf1f1a..1bdb911081 100644 --- a/SPA-024 - Ground Ops - Arrays/SPA-024 - Ground Ops - Arrays.lua +++ b/SPA-024 - Ground Ops - Arrays/SPA-024 - Ground Ops - Arrays.lua @@ -1,28 +1,27 @@ ---- --- Name: SPA-024 - Ground Ops - Arrays --- Author: FlightControl --- Date Created: 19 Jul 2017 --- Checked in 15 dez 2020 by ZERO --- --- # Situation: --- --- At Gudauta spawn multiple ground vehicles, in an array. --- --- # Test cases: --- --- 1. Observe that the ground vehicles are spawned at the position declared within the mission editor. --- 2. The vehicles should spawn according the array parameters. - - - --- Tests Gudauta --- ------------- -Spawn_Vehicle = SPAWN - :New( "Spawn Vehicles" ) - :InitLimit( 12, 60 ) - :InitArray( 90, 10, 10, 10 ) - - - - - +--- +-- Name: SPA-024 - Ground Ops - Arrays +-- Author: FlightControl +-- Date Created: 19 Jul 2017 +-- +-- # Situation: +-- +-- At Gudauta spawn multiple ground vehicles, in an array. +-- +-- # Test cases: +-- +-- 1. Observe that the ground vehicles are spawned at the position declared within the mission editor. +-- 2. The vehicles should spawn according the array parameters. + + + +-- Tests Gudauta +-- ------------- +Spawn_Vehicle = SPAWN + :New( "Spawn Vehicles" ) + :InitLimit( 12, 60 ) + :InitArray( 90, 10, 10, 10 ) + + + + + diff --git a/SPA-024 - Ground Ops - Arrays/SPA-024 - Ground Ops - Arrays.miz b/SPA-024 - Ground Ops - Arrays/SPA-024 - Ground Ops - Arrays.miz index 156e4c1dca..d6e3491ddb 100644 Binary files a/SPA-024 - Ground Ops - Arrays/SPA-024 - Ground Ops - Arrays.miz and b/SPA-024 - Ground Ops - Arrays/SPA-024 - Ground Ops - Arrays.miz differ diff --git a/SPA-025 - Ground Ops - Spawn Hidden/SPA-025 - Ground Ops - Spawn Hidden.lua b/SPA-025 - Ground Ops - Spawn Hidden/SPA-025 - Ground Ops - Spawn Hidden.lua index ae0f67ec74..1d7837712f 100644 --- a/SPA-025 - Ground Ops - Spawn Hidden/SPA-025 - Ground Ops - Spawn Hidden.lua +++ b/SPA-025 - Ground Ops - Spawn Hidden/SPA-025 - Ground Ops - Spawn Hidden.lua @@ -1,23 +1,22 @@ --- Name: SPA-025 - Ground Ops - Spawn Hidden --- Author: FlightControl --- Date Created: 06 Sep 2017 --- Checked in 15 dez 2020 by ZERO --- --- # Situation: --- --- At Gudauta spawn a ground vehicle, hidden --- --- # Test cases: --- --- 1. Observe that the ground vehicle is spawned and his hidden. - - - --- Tests Gudauta --- ------------- --- Spawn a gound vehicle... -Spawn_Vehicle_1 = SPAWN:New( "Spawn Vehicle 1" ) -Spawn_Group_1 = Spawn_Vehicle_1:Spawn() - - - +-- Name: SPA-025 - Ground Ops - Spawn Hidden +-- Author: FlightControl +-- Date Created: 06 Sep 2017 +-- +-- # Situation: +-- +-- At Gudauta spawn a ground vehicle, hidden +-- +-- # Test cases: +-- +-- 1. Observe that the ground vehicle is spawned and his hidden. + + + +-- Tests Gudauta +-- ------------- +-- Spawn a gound vehicle... +Spawn_Vehicle_1 = SPAWN:New( "Spawn Vehicle 1" ) +Spawn_Group_1 = Spawn_Vehicle_1:Spawn() + + + diff --git a/SPA-025 - Ground Ops - Spawn Hidden/SPA-025 - Ground Ops - Spawn Hidden.miz b/SPA-025 - Ground Ops - Spawn Hidden/SPA-025 - Ground Ops - Spawn Hidden.miz index 7c9b97c96c..675cbf833b 100644 Binary files a/SPA-025 - Ground Ops - Spawn Hidden/SPA-025 - Ground Ops - Spawn Hidden.miz and b/SPA-025 - Ground Ops - Spawn Hidden/SPA-025 - Ground Ops - Spawn Hidden.miz differ diff --git a/SPA-026 - Ground Ops - Spawn RandomizeTemplate Hidden/SPA-026 - Ground Ops - Spawn RandomizeTemplate Hidden.lua b/SPA-026 - Ground Ops - Spawn RandomizeTemplate Hidden/SPA-026 - Ground Ops - Spawn RandomizeTemplate Hidden.lua index 7dbc7b7677..de32e8349a 100644 --- a/SPA-026 - Ground Ops - Spawn RandomizeTemplate Hidden/SPA-026 - Ground Ops - Spawn RandomizeTemplate Hidden.lua +++ b/SPA-026 - Ground Ops - Spawn RandomizeTemplate Hidden/SPA-026 - Ground Ops - Spawn RandomizeTemplate Hidden.lua @@ -1,26 +1,26 @@ --- Name: SPA-026 - Ground Ops - Spawn RandomizeTemplate Hidden --- Author: FlightControl --- Date Created: 06 Sep 2017 --- Checked in 15 dez 2020 by ZERO --- --- # Situation: --- --- At Gudauta spawn a ground vehicle, hidden, based on a randomized template. --- --- # Test cases: --- --- 1. Observe that a random ground vehicle is spawned and his hidden. --- 2. Observe that templates are hidden on MAP on Mission Editor - - - --- Tests Gudauta --- ------------- --- Spawn a gound vehicle... - -Templates = { "A", "B" } - -Spawn_Vehicle_1 = SPAWN:New( "vehicle" ) -Spawn_Vehicle_1:InitRandomizeTemplate( Templates ) -Spawn_Group_1 = Spawn_Vehicle_1:Spawn() - +-- Name: SPA-026 - Ground Ops - Spawn RandomizeTemplate Hidden +-- Author: FlightControl +-- Date Created: 06 Sep 2017 +-- Checked in 15 dez 2020 by ZERO +-- +-- # Situation: +-- +-- At Gudauta spawn a ground vehicle, hidden, based on a randomized template. +-- +-- # Test cases: +-- +-- 1. Observe that a random ground vehicle is spawned and his hidden. +-- 2. Observe that templates are hidden on MAP on Mission Editor + + + +-- Tests Gudauta +-- ------------- +-- Spawn a gound vehicle... + +Templates = { "A", "B" } + +Spawn_Vehicle_1 = SPAWN:New( "vehicle" ) +Spawn_Vehicle_1:InitRandomizeTemplate( Templates ) +Spawn_Group_1 = Spawn_Vehicle_1:Spawn() + diff --git a/SPA-026 - Ground Ops - Spawn RandomizeTemplate Hidden/SPA-026 - Ground Ops - Spawn RandomizeTemplate Hidden.miz b/SPA-026 - Ground Ops - Spawn RandomizeTemplate Hidden/SPA-026 - Ground Ops - Spawn RandomizeTemplate Hidden.miz index 0733d7a4bf..8036af90f3 100644 Binary files a/SPA-026 - Ground Ops - Spawn RandomizeTemplate Hidden/SPA-026 - Ground Ops - Spawn RandomizeTemplate Hidden.miz and b/SPA-026 - Ground Ops - Spawn RandomizeTemplate Hidden/SPA-026 - Ground Ops - Spawn RandomizeTemplate Hidden.miz differ diff --git a/SPA-027 - Ground Ops - Respawning After Destroy/SPA-027 - Ground Ops - Respawning After Destroy.lua b/SPA-027 - Ground Ops - Respawning After Destroy/SPA-027 - Ground Ops - Respawning After Destroy.lua index ccbca07176..b749e58a8f 100644 --- a/SPA-027 - Ground Ops - Respawning After Destroy/SPA-027 - Ground Ops - Respawning After Destroy.lua +++ b/SPA-027 - Ground Ops - Respawning After Destroy/SPA-027 - Ground Ops - Respawning After Destroy.lua @@ -1,26 +1,25 @@ --- Name: SPA-027 - Ground Ops - Respawning After Destroy --- Author: FlightControl --- Date Created: 10 Dec 2017 --- Checked in 15 dez 2020 by ZERO --- --- At Gudauta spawns ground vehicle, in a scheduled fashion. --- There can only be a maximum of 2 grond vehicles alive. --- When a ground vehicle is destroyed, a new one needs to be spawned at a different location in the zone. --- Until that one is also destroyed. --- --- Red is attacking the spawned blue vehicles. --- Once blue is destroyed, a new blue needs to spawn. --- Until all 10 blue vehicles (units) are spawned. --- The position of blue is randomized in the zone. --- Blue has ROE hold weapons. --- - - -BlueVehicleSpawn = SPAWN - :New( "Tank" ) - :InitLimit( 2, 10 ) - :InitRandomizePosition( true, 200, 50 ) - :SpawnScheduled( 5, .5 ) - - - +-- Name: SPA-027 - Ground Ops - Respawning After Destroy +-- Author: FlightControl +-- Date Created: 10 Dec 2017 +-- +-- At Gudauta spawns ground vehicle, in a scheduled fashion. +-- There can only be a maximum of 2 grond vehicles alive. +-- When a ground vehicle is destroyed, a new one needs to be spawned at a different location in the zone. +-- Until that one is also destroyed. +-- +-- Red is attacking the spawned blue vehicles. +-- Once blue is destroyed, a new blue needs to spawn. +-- Until all 10 blue vehicles are spawned. +-- The position of blue is randomized in the zone. +-- Blue has ROE hold weapons. +-- + + +BlueVehicleSpawn = SPAWN + :New( "Tank" ) + :InitLimit( 2, 10 ) + :InitRandomizePosition( true, 200, 50 ) + :SpawnScheduled( 5, .5 ) + + + diff --git a/SPA-027 - Ground Ops - Respawning After Destroy/SPA-027 - Ground Ops - Respawning After Destroy.miz b/SPA-027 - Ground Ops - Respawning After Destroy/SPA-027 - Ground Ops - Respawning After Destroy.miz index 6a014a3542..df52c81614 100644 Binary files a/SPA-027 - Ground Ops - Respawning After Destroy/SPA-027 - Ground Ops - Respawning After Destroy.miz and b/SPA-027 - Ground Ops - Respawning After Destroy/SPA-027 - Ground Ops - Respawning After Destroy.miz differ diff --git a/SPA-100 - Air Ops - CleanUp of Inactive Units/SPA-100 - Air Ops - CleanUp of Inactive Units.miz b/SPA-100 - Air Ops - CleanUp of Inactive Units/SPA-100 - Air Ops - CleanUp of Inactive Units.miz index 206ea3924e..70d1a76b46 100644 Binary files a/SPA-100 - Air Ops - CleanUp of Inactive Units/SPA-100 - Air Ops - CleanUp of Inactive Units.miz and b/SPA-100 - Air Ops - CleanUp of Inactive Units/SPA-100 - Air Ops - CleanUp of Inactive Units.miz differ diff --git a/SPA-100 - Air Ops - CleanUp of Inactive Units/SPA-100 - Air Ops - Scheduled Spawn Helicopters with CleanUp of Inactive Units.lua b/SPA-100 - Air Ops - CleanUp of Inactive Units/SPA-100 - Air Ops - Scheduled Spawn Helicopters with CleanUp of Inactive Units.lua new file mode 100644 index 0000000000..0d07b33fc1 --- /dev/null +++ b/SPA-100 - Air Ops - CleanUp of Inactive Units/SPA-100 - Air Ops - Scheduled Spawn Helicopters with CleanUp of Inactive Units.lua @@ -0,0 +1,8 @@ +-- Tests Kutaisi +-- ------------- +-- Tests the CleanUp functionality. +-- Limited spawning of groups, scheduled every 10 seconds, who are engaging into combat. Some helicopters may crash land on the ground. +-- Observe when helicopters land but are not dead and are out of the danger zone, that they get removed after a while (+/- 180 seconds) and ReSpawn. +Spawn_Helicopter_Scheduled_CleanUp = SPAWN:New( "Spawn Helicopter Scheduled CleanUp" ):InitLimit( 3, 100 ):InitRandomizeRoute( 1, 1, 1000 ):InitCleanUp( 60 ):SpawnScheduled( 10, 0 ) +Spawn_Vehicle_Scheduled_CleanUp = SPAWN:New( "Spawn Vehicle Scheduled CleanUp" ):InitLimit( 3, 100 ):InitRandomizeRoute( 1, 1, 1000 ):SpawnScheduled( 10, 0 ) + diff --git a/SPA-110 - Limit Spawning/SPA-110 - Limit Spawning.lua b/SPA-110 - Limit Spawning/SPA-110 - Limit Spawning.lua index 1ff4c90c02..eb0b7e1eb4 100644 --- a/SPA-110 - Limit Spawning/SPA-110 - Limit Spawning.lua +++ b/SPA-110 - Limit Spawning/SPA-110 - Limit Spawning.lua @@ -1,17 +1,17 @@ ---- --- Tests Gudauta --- ------------- --- Limited scheduled spawning of groups... -Spawn_Plane_Limited_Scheduled = SPAWN:New( "Spawn Plane Limited Scheduled" ):InitLimit( 4, 20 ):SpawnScheduled( 30, 0 ) -Spawn_Helicopter_Limited_Scheduled = SPAWN:New( "Spawn Helicopter Limited Scheduled" ):InitLimit( 4, 20 ):SpawnScheduled( 30, 0 ) -Spawn_Ground_Limited_Scheduled = SPAWN:New( "Spawn Vehicle Limited Scheduled" ):InitLimit( 4, 20 ):SpawnScheduled( 90, 0 ) - ---- --- Tests Sukhumi --- ------------- --- Limited scheduled spawning of groups with destruction... -Spawn_Plane_Limited_Scheduled_RandomizeRoute = SPAWN:New( "Spawn Plane Limited Scheduled Destroy" ):InitLimit( 4, 20 ):SpawnScheduled( 10, 0 ) -Spawn_Helicopter_Limited_Scheduled_RandomizeRoute = SPAWN:New( "Spawn Helicopter Limited Scheduled Destroy" ):InitLimit( 4, 20 ):SpawnScheduled( 10, 0 ) -Spawn_Vehicle_Limited_Scheduled_RandomizeRoute = SPAWN:New( "Spawn Vehicle Limited Scheduled Destroy" ):InitLimit( 4, 20 ):SpawnScheduled( 10, 0 ) - - +--- +-- Tests Gudauta +-- ------------- +-- Limited scheduled spawning of groups... +Spawn_Plane_Limited_Scheduled = SPAWN:New( "Spawn Plane Limited Scheduled" ):InitLimit( 4, 20 ):SpawnScheduled( 30, 0 ) +Spawn_Helicopter_Limited_Scheduled = SPAWN:New( "Spawn Helicopter Limited Scheduled" ):InitLimit( 4, 20 ):SpawnScheduled( 30, 0 ) +Spawn_Ground_Limited_Scheduled = SPAWN:New( "Spawn Vehicle Limited Scheduled" ):InitLimit( 4, 20 ):SpawnScheduled( 90, 0 ) + +--- +-- Tests Sukhumi +-- ------------- +-- Limited scheduled spawning of groups with destruction... +Spawn_Plane_Limited_Scheduled_RandomizeRoute = SPAWN:New( "Spawn Plane Limited Scheduled Destroy" ):InitLimit( 4, 20 ):SpawnScheduled( 10, 0 ) +Spawn_Helicopter_Limited_Scheduled_RandomizeRoute = SPAWN:New( "Spawn Helicopter Limited Scheduled Destroy" ):InitLimit( 4, 20 ):SpawnScheduled( 10, 0 ) +Spawn_Vehicle_Limited_Scheduled_RandomizeRoute = SPAWN:New( "Spawn Vehicle Limited Scheduled Destroy" ):InitLimit( 4, 20 ):SpawnScheduled( 10, 0 ) + + diff --git a/SPA-110 - Limit Spawning/SPA-110 - Limit Spawning.miz b/SPA-110 - Limit Spawning/SPA-110 - Limit Spawning.miz index 74218282c6..abe7dc25d0 100644 Binary files a/SPA-110 - Limit Spawning/SPA-110 - Limit Spawning.miz and b/SPA-110 - Limit Spawning/SPA-110 - Limit Spawning.miz differ diff --git a/SPA-120 - Air Ops - Scheduled Spawn with Repeat on Landing with Limit/SPA-120 - Air Ops - Scheduled Spawn with Repeat on Landing with Limit.lua b/SPA-120 - Air Ops - Scheduled Spawn with Repeat on Landing with Limit/SPA-120 - Air Ops - Scheduled Spawn with Repeat on Landing with Limit.lua index 458395472a..a08603b410 100644 --- a/SPA-120 - Air Ops - Scheduled Spawn with Repeat on Landing with Limit/SPA-120 - Air Ops - Scheduled Spawn with Repeat on Landing with Limit.lua +++ b/SPA-120 - Air Ops - Scheduled Spawn with Repeat on Landing with Limit/SPA-120 - Air Ops - Scheduled Spawn with Repeat on Landing with Limit.lua @@ -1,36 +1,35 @@ ---- --- Name: SPA-120 - Air Ops - Scheduled Spawns with Repeat on Landing with Limit --- Author: FlightControl --- Date Created: 05 Feb 2017 --- Checked in 15 dez 2020 by ZERO --- --- # Situation: --- --- One airplane and one helicopter will be spawned. --- Only one airplane and one helicopter can be alive at the same time. --- Upon landing, the airplane and helicopter will respawn at Kutaisi. --- --- # Test cases: --- --- 1. Observe the spawning of the airplane and helicopter --- 2. There should not be more airplanes alive than there are set by InitLimit. --- 3. Upon landing, the planes should respawn. --- 5. The plane should respawn itself when the air unit has parked at the ramp or has landed. - - -do - - -- Declare SPAWN objects - Spawn_Plane = SPAWN:New("Plane"):InitLimit( 2, 0 ) - - -- Choose repeat functionality - - -- Repeat on ... (when landed on the airport) - Spawn_Plane:InitRepeatOnEngineShutDown() - - -- Now SPAWN the GROUPs - Spawn_Plane:SpawnScheduled(30,0) - - -- Now run the mission and observe the behaviour. - -end +--- +-- Name: SPA-120 - Air Ops - Scheduled Spawns with Repeat on Landing with Limit +-- Author: FlightControl +-- Date Created: 05 Feb 2017 +-- +-- # Situation: +-- +-- One airplane and one helicopter will be spawned. +-- Only one airplane and one helicopter can be alive at the same time. +-- Upon landing, the airplane and helicopter will respawn at Kutaisi. +-- +-- # Test cases: +-- +-- 1. Observe the spawning of the airplane and helicopter +-- 2. There should not be more airplanes alive than there are set by InitLimit. +-- 3. Upon landing, the planes should respawn. +-- 5. The plane should respawn itself when the air unit has parked at the ramp or has landed. + + +do + + -- Declare SPAWN objects + Spawn_Plane = SPAWN:New("Plane"):InitLimit( 2, 0 ) + + -- Choose repeat functionality + + -- Repeat on ... (when landed on the airport) + Spawn_Plane:InitRepeatOnEngineShutDown() + + -- Now SPAWN the GROUPs + Spawn_Plane:SpawnScheduled(30,0) + + -- Now run the mission and observe the behaviour. + +end diff --git a/SPA-120 - Air Ops - Scheduled Spawn with Repeat on Landing with Limit/SPA-120 - Air Ops - Scheduled Spawn with Repeat on Landing with Limit.miz b/SPA-120 - Air Ops - Scheduled Spawn with Repeat on Landing with Limit/SPA-120 - Air Ops - Scheduled Spawn with Repeat on Landing with Limit.miz index 1a7f460275..882239c2f1 100644 Binary files a/SPA-120 - Air Ops - Scheduled Spawn with Repeat on Landing with Limit/SPA-120 - Air Ops - Scheduled Spawn with Repeat on Landing with Limit.miz and b/SPA-120 - Air Ops - Scheduled Spawn with Repeat on Landing with Limit/SPA-120 - Air Ops - Scheduled Spawn with Repeat on Landing with Limit.miz differ diff --git a/SPA-120 - Repeat Spawning/SPA-120 - Repeat Spawning.lua b/SPA-120 - Repeat Spawning/SPA-120 - Repeat Spawning.lua new file mode 100644 index 0000000000..b4f84ce3a2 --- /dev/null +++ b/SPA-120 - Repeat Spawning/SPA-120 - Repeat Spawning.lua @@ -0,0 +1,41 @@ +--- +-- MOOSE SPAWN repeat test scenario +-- ------------------------------- +-- There are 8 GROUPs Spawned. +-- They fly around Kutaisi and will land. +-- Upon landing: +-- 1. The KA-50 and the C-101EB should respawn itself directly when landed. +-- 2. the MI-8MTV2 and the A-10C should respawn itself when the air unit has parked at the ramp. +-- + +do + + -- Declare SPAWN objects + local Spawn_KA_50 = SPAWN:New("KA-50") + local Spawn_MI_8MTV2 = SPAWN:New("MI-8MTV2") + local Spawn_C_101EB = SPAWN:New("C-101EB") + local Spawn_A_10C = SPAWN:New("A-10C") + + -- Choose repeat functionality + + -- Repeat on landing + Spawn_KA_50:InitRepeatOnLanding() + Spawn_C_101EB:InitRepeatOnLanding() + + -- Repeat on enging shutdown (when landed on the airport) + Spawn_MI_8MTV2:InitRepeatOnEngineShutDown() + Spawn_A_10C:InitRepeatOnEngineShutDown() + + -- Now SPAWN the GROUPs + Spawn_KA_50:Spawn() + Spawn_C_101EB:Spawn() + Spawn_MI_8MTV2:Spawn() + Spawn_A_10C:Spawn() + Spawn_KA_50:Spawn() + Spawn_C_101EB:Spawn() + Spawn_MI_8MTV2:Spawn() + Spawn_A_10C:Spawn() + + -- Now run the mission and observe the behaviour. + +end diff --git a/SPA-120 - Repeat Spawning/SPA-120 - Repeat Spawning.miz b/SPA-120 - Repeat Spawning/SPA-120 - Repeat Spawning.miz index 159600e669..9411754131 100644 Binary files a/SPA-120 - Repeat Spawning/SPA-120 - Repeat Spawning.miz and b/SPA-120 - Repeat Spawning/SPA-120 - Repeat Spawning.miz differ diff --git a/SPA-121 - Air Ops - Scheduled Spawns with Repeat on Landing with Limit/SPA-121 - Air Ops - Scheduled Spawns with Repeat on Landing with Limit.lua b/SPA-121 - Air Ops - Scheduled Spawns with Repeat on Landing with Limit/SPA-121 - Air Ops - Scheduled Spawns with Repeat on Landing with Limit.lua index 6d3e326735..c5f8affe7f 100644 --- a/SPA-121 - Air Ops - Scheduled Spawns with Repeat on Landing with Limit/SPA-121 - Air Ops - Scheduled Spawns with Repeat on Landing with Limit.lua +++ b/SPA-121 - Air Ops - Scheduled Spawns with Repeat on Landing with Limit/SPA-121 - Air Ops - Scheduled Spawns with Repeat on Landing with Limit.lua @@ -1,52 +1,51 @@ ---- --- Name: SPA-121 - Air Ops - Scheduled Spawns with Repeat on Landing with Limit --- Author: FlightControl --- Date Created: 05 Feb 2017 --- Checked in 15 dez 2020 by ZERO --- --- # Situation: --- --- Multiple airplanes will be spawned at a scheduled interval. --- There is a limit on how many airplanes can be alive at the same time. --- Upon landing, the airplanes will respawn at Kutaisi. --- --- # Test cases: --- --- 1. Observe the spawning of the airplanes --- 2. There should not be more airplanes alive than there are set by InitLimit. --- 3. Upon landing, the planes should respawn. --- 4. The KA-50 and the C-101EB should respawn itself directly when landed. --- 5. the MI-8MTV2 and the A-10C should respawn itself when the air unit has parked at the ramp. - - -do - - -- Declare SPAWN objects - Spawn_KA_50 = SPAWN:New("KA-50"):InitLimit( 2, 10 ) - Spawn_MI_8MTV2 = SPAWN:New("MI-8MTV2"):InitLimit( 2, 10 ) - Spawn_C_101EB = SPAWN:New("C-101EB"):InitLimit( 2, 10 ) - Spawn_A_10C = SPAWN:New("A-10C") - :InitLimit( 2, 10 ) - - -- Choose repeat functionality - - -- Repeat on landing - Spawn_KA_50:InitRepeatOnLanding() - Spawn_KA_50:InitDelayOff() - - Spawn_C_101EB:InitRepeatOnLanding() - Spawn_C_101EB:InitDelayOff() - - -- Repeat on enging shutdown (when landed on the airport) - Spawn_MI_8MTV2:InitRepeatOnEngineShutDown() - Spawn_A_10C:InitRepeatOnEngineShutDown() - - -- Now SPAWN the GROUPs - Spawn_KA_50:SpawnScheduled(180,0) - Spawn_C_101EB:SpawnScheduled(180,0) - Spawn_MI_8MTV2:SpawnScheduled(180,0) - Spawn_A_10C:SpawnScheduled(180,0) - - -- Now run the mission and observe the behaviour. - -end +--- +-- Name: SPA-121 - Air Ops - Scheduled Spawns with Repeat on Landing with Limit +-- Author: FlightControl +-- Date Created: 05 Feb 2017 +-- +-- # Situation: +-- +-- Multiple airplanes will be spawned at a scheduled interval. +-- There is a limit on how many airplanes can be alive at the same time. +-- Upon landing, the airplanes will respawn at Kutaisi. +-- +-- # Test cases: +-- +-- 1. Observe the spawning of the airplanes +-- 2. There should not be more airplanes alive than there are set by InitLimit. +-- 3. Upon landing, the planes should respawn. +-- 4. The KA-50 and the C-101EB should respawn itself directly when landed. +-- 5. the MI-8MTV2 and the A-10C should respawn itself when the air unit has parked at the ramp. + + +do + + -- Declare SPAWN objects + Spawn_KA_50 = SPAWN:New("KA-50"):InitLimit( 2, 10 ) + Spawn_MI_8MTV2 = SPAWN:New("MI-8MTV2"):InitLimit( 2, 10 ) + Spawn_C_101EB = SPAWN:New("C-101EB"):InitLimit( 2, 10 ) + Spawn_A_10C = SPAWN:New("A-10C") + :InitLimit( 2, 10 ) + + -- Choose repeat functionality + + -- Repeat on landing + Spawn_KA_50:InitRepeatOnLanding() + Spawn_KA_50:InitDelayOff() + + Spawn_C_101EB:InitRepeatOnLanding() + Spawn_C_101EB:InitDelayOff() + + -- Repeat on enging shutdown (when landed on the airport) + Spawn_MI_8MTV2:InitRepeatOnEngineShutDown() + Spawn_A_10C:InitRepeatOnEngineShutDown() + + -- Now SPAWN the GROUPs + Spawn_KA_50:SpawnScheduled(180,0) + Spawn_C_101EB:SpawnScheduled(180,0) + Spawn_MI_8MTV2:SpawnScheduled(180,0) + Spawn_A_10C:SpawnScheduled(180,0) + + -- Now run the mission and observe the behaviour. + +end diff --git a/SPA-121 - Air Ops - Scheduled Spawns with Repeat on Landing with Limit/SPA-121 - Air Ops - Scheduled Spawns with Repeat on Landing with Limit.miz b/SPA-121 - Air Ops - Scheduled Spawns with Repeat on Landing with Limit/SPA-121 - Air Ops - Scheduled Spawns with Repeat on Landing with Limit.miz index a33dfc5b8e..d1c90c748e 100644 Binary files a/SPA-121 - Air Ops - Scheduled Spawns with Repeat on Landing with Limit/SPA-121 - Air Ops - Scheduled Spawns with Repeat on Landing with Limit.miz and b/SPA-121 - Air Ops - Scheduled Spawns with Repeat on Landing with Limit/SPA-121 - Air Ops - Scheduled Spawns with Repeat on Landing with Limit.miz differ diff --git a/SPA-122 - Air Ops - OnLand test for Scheduled Spawns/SPA-122 - Air Ops - OnLand test for Scheduled Spawns.lua b/SPA-122 - Air Ops - OnLand test for Scheduled Spawns/SPA-122 - Air Ops - OnLand test for Scheduled Spawns.lua index 90be1f74b9..aa977c793f 100644 --- a/SPA-122 - Air Ops - OnLand test for Scheduled Spawns/SPA-122 - Air Ops - OnLand test for Scheduled Spawns.lua +++ b/SPA-122 - Air Ops - OnLand test for Scheduled Spawns/SPA-122 - Air Ops - OnLand test for Scheduled Spawns.lua @@ -1,48 +1,47 @@ ---- --- Name: SPA-122 - Air Ops - OnLand test for Scheduled Spawns --- Author: FlightControl --- Date Created: 21 Mar 2017 --- Checked in 15 dez 2020 by ZERO --- --- # Situation: --- --- An airplane is spawned at a scheduled interval. --- There is a limit on how many airplanes can be alive at the same time. --- Upon landing, the airplane will respawn in the air. --- --- # Test cases: --- --- 1. Observe the spawning of the airplanes --- 2. There should not be more airplanes alive than there are set by InitLimit. --- 3. Upon landing, the planes should respawn. --- 4. The KA-50 and the C-101EB should respawn itself directly when landed. --- 5. the MI-8MTV2 and the A-10C should respawn itself when the air unit has parked at the ramp. - - -do - - -- Declare SPAWN objects - Spawn_KA_50 = SPAWN:New("KA-50"):InitLimit( 1, 0 ) - Spawn_MI_8MTV2 = SPAWN:New("MI-8MTV2"):InitLimit( 1, 0 ) - Spawn_C_101EB = SPAWN:New("C-101EB"):InitLimit( 1, 0 ) - Spawn_A_10C = SPAWN:New("A-10C"):InitLimit( 1, 0 ) - - -- Choose repeat functionality - - -- Repeat on landing - Spawn_KA_50:InitRepeatOnLanding() - Spawn_C_101EB:InitRepeatOnLanding() - - -- Repeat on enging shutdown (when landed on the airport) - Spawn_MI_8MTV2:InitRepeatOnEngineShutDown() - Spawn_A_10C:InitRepeatOnEngineShutDown() - - -- Now SPAWN the GROUPs - Spawn_KA_50:SpawnScheduled(30,0) - Spawn_C_101EB:SpawnScheduled(30,0) - Spawn_MI_8MTV2:SpawnScheduled(30,0) - Spawn_A_10C:SpawnScheduled(30,0) - - -- Now run the mission and observe the behaviour. - -end +--- +-- Name: SPA-122 - Air Ops - OnLand test for Scheduled Spawns +-- Author: FlightControl +-- Date Created: 21 Mar 2017 +-- +-- # Situation: +-- +-- An airplane is spawned at a scheduled interval. +-- There is a limit on how many airplanes can be alive at the same time. +-- Upon landing, the airplane will respawn in the air. +-- +-- # Test cases: +-- +-- 1. Observe the spawning of the airplanes +-- 2. There should not be more airplanes alive than there are set by InitLimit. +-- 3. Upon landing, the planes should respawn. +-- 4. The KA-50 and the C-101EB should respawn itself directly when landed. +-- 5. the MI-8MTV2 and the A-10C should respawn itself when the air unit has parked at the ramp. + + +do + + -- Declare SPAWN objects + Spawn_KA_50 = SPAWN:New("KA-50"):InitLimit( 1, 0 ) + Spawn_MI_8MTV2 = SPAWN:New("MI-8MTV2"):InitLimit( 1, 0 ) + Spawn_C_101EB = SPAWN:New("C-101EB"):InitLimit( 1, 0 ) + Spawn_A_10C = SPAWN:New("A-10C"):InitLimit( 1, 0 ) + + -- Choose repeat functionality + + -- Repeat on landing + Spawn_KA_50:InitRepeatOnLanding() + Spawn_C_101EB:InitRepeatOnLanding() + + -- Repeat on enging shutdown (when landed on the airport) + Spawn_MI_8MTV2:InitRepeatOnEngineShutDown() + Spawn_A_10C:InitRepeatOnEngineShutDown() + + -- Now SPAWN the GROUPs + Spawn_KA_50:SpawnScheduled(30,0) + Spawn_C_101EB:SpawnScheduled(30,0) + Spawn_MI_8MTV2:SpawnScheduled(30,0) + Spawn_A_10C:SpawnScheduled(30,0) + + -- Now run the mission and observe the behaviour. + +end diff --git a/SPA-122 - Air Ops - OnLand test for Scheduled Spawns/SPA-122 - Air Ops - OnLand test for Scheduled Spawns.miz b/SPA-122 - Air Ops - OnLand test for Scheduled Spawns/SPA-122 - Air Ops - OnLand test for Scheduled Spawns.miz index e63884cee4..6a764dff42 100644 Binary files a/SPA-122 - Air Ops - OnLand test for Scheduled Spawns/SPA-122 - Air Ops - OnLand test for Scheduled Spawns.miz and b/SPA-122 - Air Ops - OnLand test for Scheduled Spawns/SPA-122 - Air Ops - OnLand test for Scheduled Spawns.miz differ diff --git a/SPA-123 - Air Ops - Repeat on Landing and InitCleanUp/SPA-123 - Air Ops - Repeat on Landing and InitCleanUp.lua b/SPA-123 - Air Ops - Repeat on Landing and InitCleanUp/SPA-123 - Air Ops - Repeat on Landing and InitCleanUp.lua index e7b8229170..3ac405d7f1 100644 --- a/SPA-123 - Air Ops - Repeat on Landing and InitCleanUp/SPA-123 - Air Ops - Repeat on Landing and InitCleanUp.lua +++ b/SPA-123 - Air Ops - Repeat on Landing and InitCleanUp/SPA-123 - Air Ops - Repeat on Landing and InitCleanUp.lua @@ -1,29 +1,29 @@ ---- --- Name: SPA-123 - Air Ops - Repeat on Landing and InitCleanUp --- Author: FlightControl --- Date Created: 15 Sep 2018 --- Checked in 15 dez 2020 by ZERO --- --- # Situation: --- --- Helicpters spawn and are lightly shot until the crash land, but don't really destroy. --- The should be respawned after a while. --- No performance overhead should be noticed. - -do - - -- Declare SPAWN objects - Spawn_KA_50 = SPAWN:New("KA-50") - :InitLimit( 2, 0 ) - - -- Choose repeat functionality - - -- Repeat on landing - Spawn_KA_50:InitRepeatOnLanding() - Spawn_KA_50:InitDelayOff() - Spawn_KA_50:InitCleanUp( 300 ) - Spawn_KA_50:SpawnScheduled( 180, 0.2 ) - - -- Now run the mission and observe the behaviour. - -end +--- +-- Name: SPA-123 - Air Ops - Repeat on Landing and InitCleanUp +-- Author: FlightControl +-- Date Created: 15 Sep 2018 +-- Checked in 15 dez 2020 by ZERO +-- +-- # Situation: +-- +-- Helicpters spawn and are lightly shot until the crash land, but don't really destroy. +-- The should be respawned after a while. +-- No performance overhead should be noticed. + +do + + -- Declare SPAWN objects + Spawn_KA_50 = SPAWN:New("KA-50") + :InitLimit( 2, 0 ) + + -- Choose repeat functionality + + -- Repeat on landing + Spawn_KA_50:InitRepeatOnLanding() + Spawn_KA_50:InitDelayOff() + Spawn_KA_50:InitCleanUp( 300 ) + Spawn_KA_50:SpawnScheduled( 180, 0.2 ) + + -- Now run the mission and observe the behaviour. + +end diff --git a/SPA-123 - Air Ops - Repeat on Landing and InitCleanUp/SPA-123 - Air Ops - Repeat on Landing and InitCleanUp.miz b/SPA-123 - Air Ops - Repeat on Landing and InitCleanUp/SPA-123 - Air Ops - Repeat on Landing and InitCleanUp.miz index ad84bfafc7..3b17516d96 100644 Binary files a/SPA-123 - Air Ops - Repeat on Landing and InitCleanUp/SPA-123 - Air Ops - Repeat on Landing and InitCleanUp.miz and b/SPA-123 - Air Ops - Repeat on Landing and InitCleanUp/SPA-123 - Air Ops - Repeat on Landing and InitCleanUp.miz differ diff --git a/SPA-124 - Air Ops - Scheduled Spawns with OnSpawnGroup/SPA-124 - Air Ops - Scheduled Spawns with Escort Task.lua b/SPA-124 - Air Ops - Scheduled Spawns with OnSpawnGroup/SPA-124 - Air Ops - Scheduled Spawns with Escort Task.lua new file mode 100644 index 0000000000..503df0af73 --- /dev/null +++ b/SPA-124 - Air Ops - Scheduled Spawns with OnSpawnGroup/SPA-124 - Air Ops - Scheduled Spawns with Escort Task.lua @@ -0,0 +1,52 @@ +---------------------------------------------------------------------- +--SPA-124 - Air Ops - Scheduled Spawns with OnSpawnGroup() Escort Task +---------------------------------------------------------------------- + --////////////////////////////////// + --////////////Tankers and awacs v1 + --////////////////////////////////// +--////////// By Targs35 ///////////// +--//////////////// from 62nd Air Wing, Brisbane server.. +--/////////////////////////////////// + ------- With thanks to the guys at MOOSE and in particular Pikes, Nolove, Delta99 and Wingthor + -- Funky Frank is the man.. +-----//////////////////////////////// +--/////////// Spawn Tanker and Escorts /// + + do + + local PointVec1 = POINT_VEC3:New( -100, 20, 80 ) -- This is a Vec3 class - defines the position of the escorts relative to the escorted group + local PointVec2 = POINT_VEC3:New( -100, 20, 150 ) -- This is a Vec3 class - defines the position of the escorts relative to the escorted group + + --Create Spawn Groups, use the OnSpawnGroup() function to spawn two escorts and task them + + local Tanker_Texaco = SPAWN + :New("Tanker_Texaco_Droge") + :InitLimit( 1, 2 ) -- group with one unit, spawn 1 *alive* units max + :InitCleanUp( 240 ) + :OnSpawnGroup(function (tanker) -- tanker contains the GROUP object when the tanker spawns + local Escort_Texaco_1 = SPAWN + :New("Escort_Texaco_F14 001") + :InitLimit( 1, 2 ) + :InitCleanUp( 240 ) + :OnSpawnGroup(function (spawndgroup) -- spawndgrp contains the GROUP object when the escort spawns + local FollowDCSTask1 = spawndgroup:TaskFollow( tanker, PointVec1 ) -- create task + spawndgroup:SetTask( FollowDCSTask1, 1 ) -- push task on the GROUP + end + ) + :SpawnScheduled( 60, 0.5 ) + + local Escort_Texaco_2 = SPAWN + :New("Escort_Texaco_F14 002") + :InitLimit( 1, 2 ) + :InitCleanUp( 240 ) + :OnSpawnGroup(function (spawndgroup) -- spawndgrp contains the GROUP object when the escort spawns + local FollowDCSTask2 = spawndgroup:TaskFollow( tanker, PointVec2 ) + spawndgroup:SetTask( FollowDCSTask2, 1 ) + end + ) + :SpawnScheduled( 60, 0.5 ) + end + ) + :SpawnScheduled( 60, 0.5 ) + +end diff --git a/SPA-124 - Air Ops - Scheduled Spawns with OnSpawnGroup/SPA-124 - Air Ops - Scheduled Spawns with OnSpawnGroup.miz b/SPA-124 - Air Ops - Scheduled Spawns with OnSpawnGroup/SPA-124 - Air Ops - Scheduled Spawns with OnSpawnGroup.miz index 6da2bbdc72..4d9987e849 100644 Binary files a/SPA-124 - Air Ops - Scheduled Spawns with OnSpawnGroup/SPA-124 - Air Ops - Scheduled Spawns with OnSpawnGroup.miz and b/SPA-124 - Air Ops - Scheduled Spawns with OnSpawnGroup/SPA-124 - Air Ops - Scheduled Spawns with OnSpawnGroup.miz differ diff --git a/SPA-130 - Uncontrolled Spawning/SPA-130 - Uncontrolled Spawning.lua b/SPA-130 - Uncontrolled Spawning/SPA-130 - Uncontrolled Spawning.lua index 6eb08c7921..98ef7e11fb 100644 --- a/SPA-130 - Uncontrolled Spawning/SPA-130 - Uncontrolled Spawning.lua +++ b/SPA-130 - Uncontrolled Spawning/SPA-130 - Uncontrolled Spawning.lua @@ -1,47 +1,47 @@ ---- --- Name: SPA-130 - Uncontrolled Spawning --- Author: FlightControl --- Date Created: 04 Feb 2017 --- --- # Situation: --- --- A plane will be spawned Uncontrolled and later one will be spawned Controlled. --- Only the Controlled plane will move, the other will remain idle at the parking spot. --- --- # Test cases: --- --- 1. Observe the spawning of the UnControlled Plane. --- 2. Observe the spawning of the Controlled Plane. - - --- Create the SPAWN object looking for the group (template) "Plane". -SpawnPlane = SPAWN:New( "Plane" ) - --- Set the spawn mode to UnControlled. -SpawnPlane:InitUnControlled( true ) - --- Spawn the UnControlled Group -UnControlledPlane = SpawnPlane:Spawn() - --- Set the spawn mode back to Controlled. -SpawnPlane:InitUnControlled( false ) - -ControlledPlane = SpawnPlane:Spawn() - --- Now, let's create a menu option at a player slot plane... --- We can only create the menu option if the player has joined the slot ... -PlayerPlane = CLIENT:FindByName( "PlayerPlane", "Select Menu item to activate UnControlled plane" ) - -PlayerPlane:Alive( - function( Client, SpawnPlane ) - - --- @param Functional.Spawn#SPAWN SpawnPlane - local function ActivatePlane( SpawnPlane ) - SpawnPlane:InitUnControlled( false ) - SpawnPlane:ReSpawn( 1 ) - end - - local Menu = MENU_CLIENT_COMMAND:New( Client, "Select to activate UnControlled plane", nil, ActivatePlane, SpawnPlane ) - end - , SpawnPlane +--- +-- Name: SPA-130 - Uncontrolled Spawning +-- Author: FlightControl +-- Date Created: 04 Feb 2017 +-- +-- # Situation: +-- +-- A plane will be spawned Uncontrolled and later one will be spawned Controlled. +-- Only the Controlled plane will move, the other will remain idle at the parking spot. +-- +-- # Test cases: +-- +-- 1. Observe the spawning of the UnControlled Plane. +-- 2. Observe the spawning of the Controlled Plane. + + +-- Create the SPAWN object looking for the group (template) "Plane". +SpawnPlane = SPAWN:New( "Plane" ) + +-- Set the spawn mode to UnControlled. +SpawnPlane:InitUnControlled( true ) + +-- Spawn the UnControlled Group +UnControlledPlane = SpawnPlane:Spawn() + +-- Set the spawn mode back to Controlled. +SpawnPlane:InitUnControlled( false ) + +ControlledPlane = SpawnPlane:Spawn() + +-- Now, let's create a menu option at a player slot plane... +-- We can only create the menu option if the player has joined the slot ... +PlayerPlane = CLIENT:FindByName( "PlayerPlane", "Select Menu item to activate UnControlled plane" ) + +PlayerPlane:Alive( + function( Client, SpawnPlane ) + + --- @param Functional.Spawn#SPAWN SpawnPlane + local function ActivatePlane( SpawnPlane ) + SpawnPlane:InitUnControlled( false ) + SpawnPlane:ReSpawn( 1 ) + end + + local Menu = MENU_CLIENT_COMMAND:New( Client, "Select to activate UnControlled plane", nil, ActivatePlane, SpawnPlane ) + end + , SpawnPlane ) \ No newline at end of file diff --git a/SPA-130 - Uncontrolled Spawning/SPA-130 - Uncontrolled Spawning.miz b/SPA-130 - Uncontrolled Spawning/SPA-130 - Uncontrolled Spawning.miz index fcaafe8e65..22f8fd7331 100644 Binary files a/SPA-130 - Uncontrolled Spawning/SPA-130 - Uncontrolled Spawning.miz and b/SPA-130 - Uncontrolled Spawning/SPA-130 - Uncontrolled Spawning.miz differ diff --git a/SPA-131 - Air Ops - SpawnAtAirbase/SPA-131 - Air Ops - Nevada - SpawnAtAirbase.lua b/SPA-131 - Air Ops - SpawnAtAirbase/SPA-131 - Air Ops - Nevada - SpawnAtAirbase.lua index b7b1df3a94..13f670b4ca 100644 --- a/SPA-131 - Air Ops - SpawnAtAirbase/SPA-131 - Air Ops - Nevada - SpawnAtAirbase.lua +++ b/SPA-131 - Air Ops - SpawnAtAirbase/SPA-131 - Air Ops - Nevada - SpawnAtAirbase.lua @@ -1,11 +1,11 @@ --- Name: SPA-131 - Air Ops - SpawnAtAirbase --- Author: FlightControl --- Date Created: 14 Sep 2017 --- -Spawn_Plane = SPAWN:New( "Plane" ) -Spawn_Plane:SpawnAtAirbase( AIRBASE:FindByName( AIRBASE.Nevada.Groom_Lake_AFB ), SPAWN.Takeoff.Cold ) -Spawn_Plane:SpawnAtAirbase( AIRBASE:FindByName( AIRBASE.Nevada.Groom_Lake_AFB ), SPAWN.Takeoff.Hot ) -Spawn_Plane:SpawnAtAirbase( AIRBASE:FindByName( AIRBASE.Nevada.Groom_Lake_AFB ), SPAWN.Takeoff.Runway ) - - - +-- Name: SPA-131 - Air Ops - SpawnAtAirbase +-- Author: FlightControl +-- Date Created: 14 Sep 2017 +-- +Spawn_Plane = SPAWN:New( "Plane" ) +Spawn_Plane:SpawnAtAirbase( AIRBASE:FindByName( AIRBASE.Nevada.Groom_Lake_AFB ), SPAWN.Takeoff.Cold ) +Spawn_Plane:SpawnAtAirbase( AIRBASE:FindByName( AIRBASE.Nevada.Groom_Lake_AFB ), SPAWN.Takeoff.Hot ) +Spawn_Plane:SpawnAtAirbase( AIRBASE:FindByName( AIRBASE.Nevada.Groom_Lake_AFB ), SPAWN.Takeoff.Runway ) + + + diff --git a/SPA-131 - Air Ops - SpawnAtAirbase/SPA-131 - Air Ops - SpawnAtAirbase.miz b/SPA-131 - Air Ops - SpawnAtAirbase/SPA-131 - Air Ops - SpawnAtAirbase.miz index 802a2e87c5..6c5dc8558b 100644 Binary files a/SPA-131 - Air Ops - SpawnAtAirbase/SPA-131 - Air Ops - SpawnAtAirbase.miz and b/SPA-131 - Air Ops - SpawnAtAirbase/SPA-131 - Air Ops - SpawnAtAirbase.miz differ diff --git a/SPA-140 - Spawn Client Slots/SPA-140 - Spawn Client Slots.lua b/SPA-140 - Spawn Client Slots/SPA-140 - Spawn Client Slots.lua index e882ddc7a3..d1783ea42d 100644 --- a/SPA-140 - Spawn Client Slots/SPA-140 - Spawn Client Slots.lua +++ b/SPA-140 - Spawn Client Slots/SPA-140 - Spawn Client Slots.lua @@ -1,20 +1,19 @@ ---- --- Name: SPA-140 - Spawn Client Slots --- Author: FlightControl --- Date Created: 30 Aug 2017 --- Checked in 15 dez 2020 by ZERO (doesn't work) --- --- # Situation: --- --- A plane will be spawned Uncontrolled and later one will be spawned Controlled. --- Only the Controlled plane will move, the other will remain idle at the parking spot. --- --- # Test cases: --- - --- Create the SPAWN object looking for the group (template) "Plane". -SpawnPlane = SPAWN:New( "Plane" ) - --- Spawn the UnControlled Group -UnControlledPlane = SpawnPlane:SpawnClientAtAirbase( AIRBASE:FindByName( AIRBASE.Caucasus.Kutaisi ) ) - +--- +-- Name: SPA-140 - Spawn Client Slots +-- Author: FlightControl +-- Date Created: 30 Aug 2017 +-- +-- # Situation: +-- +-- A plane will be spawned Uncontrolled and later one will be spawned Controlled. +-- Only the Controlled plane will move, the other will remain idle at the parking spot. +-- +-- # Test cases: +-- + +-- Create the SPAWN object looking for the group (template) "Plane". +SpawnPlane = SPAWN:New( "Plane" ) + +-- Spawn the UnControlled Group +UnControlledPlane = SpawnPlane:SpawnClientAtAirbase( AIRBASE:FindByName( AIRBASE.Caucasus.Kutaisi ) ) + diff --git a/SPA-140 - Spawn Client Slots/SPA-140 - Spawn Client Slots.miz b/SPA-140 - Spawn Client Slots/SPA-140 - Spawn Client Slots.miz index 06550b72e9..48b5d43a90 100644 Binary files a/SPA-140 - Spawn Client Slots/SPA-140 - Spawn Client Slots.miz and b/SPA-140 - Spawn Client Slots/SPA-140 - Spawn Client Slots.miz differ diff --git a/SPA-200 - Randomize Unit Types/SPA-200 - Randomize Unit Types.lua b/SPA-200 - Randomize Unit Types/SPA-200 - Randomize Unit Types.lua index 4302dd371c..49a51f7e21 100644 --- a/SPA-200 - Randomize Unit Types/SPA-200 - Randomize Unit Types.lua +++ b/SPA-200 - Randomize Unit Types/SPA-200 - Randomize Unit Types.lua @@ -1,11 +1,11 @@ ---- --- Tests Gudauta --- -------------- --- Limited and scheduled spawning of groups, with RandomizeTemplate ... - -Templates = { "Template1", "Template2", "Template3", "Template4" } - -Spawn_Ground1 = SPAWN:New( "Spawn Vehicle1" ):InitLimit( 4, 20 ):InitRandomizeTemplate(Templates):SpawnScheduled( 15, 0 ) -Spawn_Ground2 = SPAWN:New( "Spawn Vehicle2" ):InitLimit( 4, 20 ):InitRandomizeTemplate(Templates):SpawnScheduled( 15, 0 ) - - +--- +-- Tests Gudauta +-- -------------- +-- Limited and scheduled spawning of groups, with RandomizeTemplate ... + +Templates = { "Template1", "Template2", "Template3", "Template4" } + +Spawn_Ground1 = SPAWN:New( "Spawn Vehicle1" ):InitLimit( 4, 20 ):InitRandomizeTemplate(Templates):SpawnScheduled( 15, 0 ) +Spawn_Ground2 = SPAWN:New( "Spawn Vehicle2" ):InitLimit( 4, 20 ):InitRandomizeTemplate(Templates):SpawnScheduled( 15, 0 ) + + diff --git a/SPA-200 - Randomize Unit Types/SPA-200 - Randomize Unit Types.miz b/SPA-200 - Randomize Unit Types/SPA-200 - Randomize Unit Types.miz index 5cc4296572..262aa9ffe7 100644 Binary files a/SPA-200 - Randomize Unit Types/SPA-200 - Randomize Unit Types.miz and b/SPA-200 - Randomize Unit Types/SPA-200 - Randomize Unit Types.miz differ diff --git a/SPA-220 - Randomize Zones/SPA-220 - Randomize Zones.lua b/SPA-220 - Randomize Zones/SPA-220 - Randomize Zones.lua new file mode 100644 index 0000000000..08b57de998 --- /dev/null +++ b/SPA-220 - Randomize Zones/SPA-220 - Randomize Zones.lua @@ -0,0 +1,51 @@ +-- This test will create 3 different zones of different types. +-- 100 groups of 1 unit will be spawned. +-- The test is about testing the zone randomization, and the place where the units are created. + +local Iterations = 100 +local Iteration = 1 + +-- The PolygonGroup route defines zone 1 +local ZonePolygonGroup = GROUP:FindByName( "ZonePolygon" ) + +-- The ZoneUnit defines zone 4. +local ZoneUnit = UNIT:FindByName( "ZoneUnit" ) + +-- The ZoneGroup defines zone 5 +local ZoneGroup = GROUP:FindByName( "ZoneGroup" ) + +-- This is the array that models the different zones types. +-- The selection of the zones is done by taking into account the probability of the zone. +-- The zone probabibility is 0 = 0%, 1 = 100% +-- The default value of the probability is 1. +-- Note that the SetZoneProbability is a method, that returns the self object of the zone, +-- allowing to use the method within the zone array declaration! +local SpawnZones = { + ZONE_POLYGON:New( "Zone 1", ZonePolygonGroup ):SetZoneProbability( 0.8 ), + ZONE_RADIUS:New( "Zone 2", ZONE:New( "GroundZone2" ):GetVec2(), 5000 ):SetZoneProbability( 0.2 ), + ZONE:New( "GroundZone3" ):SetZoneProbability( 0.2 ), + ZONE_UNIT:New( "Zone 4", ZoneUnit, 5000 ):SetZoneProbability( 0.6 ), + ZONE_GROUP:New( "Zone 5", ZoneGroup, 5000 ):SetZoneProbability( 0.4 ), + } + +HeightLimit = 500 + +SpawnGrounds = SPAWN + :New("Ground") + :InitLimit( 100, 100 ) + -- This method will randomize the selection of the zones for each spawned Group during initialization, + -- taking into account the probability factors. + -- When you explore the code behind this method, you'll see that the GetZoneMaybe() method is used to select "maybe" the zone. + :InitRandomizeZones( SpawnZones ) + +--- Spawns these groups slowly. +SCHEDULER:New( nil, + + function( Interation, Iterations ) + do + -- Spawn Ground + SpawnGrounds:Spawn() + end + + end, {}, 0, 1, 0 +) diff --git a/SPA-220 - Randomize Zones/SPA-220 - Randomize Zones.miz b/SPA-220 - Randomize Zones/SPA-220 - Randomize Zones.miz index 34523ec2cd..315d3d10f9 100644 Binary files a/SPA-220 - Randomize Zones/SPA-220 - Randomize Zones.miz and b/SPA-220 - Randomize Zones/SPA-220 - Randomize Zones.miz differ diff --git a/SPA-310 - Spawn at Static position/SPA-310 - Spawn at Static position.lua b/SPA-310 - Spawn at Static position/SPA-310 - Spawn at Static position.lua index f33af118ab..90beecd21f 100644 --- a/SPA-310 - Spawn at Static position/SPA-310 - Spawn at Static position.lua +++ b/SPA-310 - Spawn at Static position/SPA-310 - Spawn at Static position.lua @@ -1,52 +1,52 @@ - -local Iterations = 10 -local Iteration = 1 - -GroundStatics = { "GroundStatic1", "GroundStatic2", "GroundStatic3" } -AirplaneStatics = { "AirplaneStatic1", "AirplaneStatic2", "AirplaneStatic3" } -HelicopterStatics = { "HelicopterStatic1", "HelicopterStatic2", "HelicopterStatic3" } -ShipStatics = { "ShipStatic1", "ShipStatic2", "ShipStatic3" } - -HeightLimit = 500 - -SpawnGrounds = SPAWN:New("Ground"):InitLimit( 20, 10 ):InitRandomizeUnits( true, 500, 100 ) -SpawnAirplanes = SPAWN:New("Airplane"):InitLimit( 20, 10 ):InitRandomizeUnits( true, 500, 100 ) -SpawnHelicopters = SPAWN:New("Helicopter"):InitLimit( 20, 10 ):InitRandomizeUnits( true, 500, 100 ) -SpawnShips = SPAWN:New("Ship"):InitLimit( 20, 10 ):InitRandomizeUnits( true, 500, 100 ) - ---- Spawns these groups slowly. -SCHEDULER:New( nil, - - function( Interation, Iterations ) - do - -- Spawn Ground - local StaticName = GroundStatics[ math.random( 1, 3 ) ] - local SpawnStatic = STATIC:FindByName( StaticName ) - SpawnGrounds:SpawnFromUnit( SpawnStatic ) - end - - do - -- Spawn Airplanes - local StaticName = AirplaneStatics[ math.random( 1, 3 ) ] - local SpawnStatic = STATIC:FindByName( StaticName ) - SpawnAirplanes:SpawnFromUnit( SpawnStatic ) - SpawnAirplanes:SpawnFromUnit( SpawnStatic, 2000, 4000 ) - end - - do - -- Spawn Helicopters - local StaticName = HelicopterStatics[ math.random( 1, 3 ) ] - local SpawnStatic = STATIC:FindByName( StaticName ) - SpawnHelicopters:SpawnFromUnit( SpawnStatic ) - SpawnHelicopters:SpawnFromUnit( SpawnStatic, 200, 500 ) -- Spawn between 200 and 500 meters. - end - - do - -- Spawn Ships - local StaticName = ShipStatics[ math.random( 1, 3 ) ] - local SpawnStatic = STATIC:FindByName( StaticName ) - SpawnShips:SpawnFromUnit( SpawnStatic ) - end - - end, {}, 0, 15, 0.5 -) + +local Iterations = 10 +local Iteration = 1 + +GroundStatics = { "GroundStatic1", "GroundStatic2", "GroundStatic3" } +AirplaneStatics = { "AirplaneStatic1", "AirplaneStatic2", "AirplaneStatic3" } +HelicopterStatics = { "HelicopterStatic1", "HelicopterStatic2", "HelicopterStatic3" } +ShipStatics = { "ShipStatic1", "ShipStatic2", "ShipStatic3" } + +HeightLimit = 500 + +SpawnGrounds = SPAWN:New("Ground"):InitLimit( 20, 10 ):InitRandomizeUnits( true, 500, 100 ) +SpawnAirplanes = SPAWN:New("Airplane"):InitLimit( 20, 10 ):InitRandomizeUnits( true, 500, 100 ) +SpawnHelicopters = SPAWN:New("Helicopter"):InitLimit( 20, 10 ):InitRandomizeUnits( true, 500, 100 ) +SpawnShips = SPAWN:New("Ship"):InitLimit( 20, 10 ):InitRandomizeUnits( true, 500, 100 ) + +--- Spawns these groups slowly. +SCHEDULER:New( nil, + + function( Interation, Iterations ) + do + -- Spawn Ground + local StaticName = GroundStatics[ math.random( 1, 3 ) ] + local SpawnStatic = STATIC:FindByName( StaticName ) + SpawnGrounds:SpawnFromUnit( SpawnStatic ) + end + + do + -- Spawn Airplanes + local StaticName = AirplaneStatics[ math.random( 1, 3 ) ] + local SpawnStatic = STATIC:FindByName( StaticName ) + SpawnAirplanes:SpawnFromUnit( SpawnStatic ) + SpawnAirplanes:SpawnFromUnit( SpawnStatic, 2000, 4000 ) + end + + do + -- Spawn Helicopters + local StaticName = HelicopterStatics[ math.random( 1, 3 ) ] + local SpawnStatic = STATIC:FindByName( StaticName ) + SpawnHelicopters:SpawnFromUnit( SpawnStatic ) + SpawnHelicopters:SpawnFromUnit( SpawnStatic, 200, 500 ) -- Spawn between 200 and 500 meters. + end + + do + -- Spawn Ships + local StaticName = ShipStatics[ math.random( 1, 3 ) ] + local SpawnStatic = STATIC:FindByName( StaticName ) + SpawnShips:SpawnFromUnit( SpawnStatic ) + end + + end, {}, 0, 15, 0.5 +) diff --git a/SPA-310 - Spawn at Static position/SPA-310 - Spawn at Static position.miz b/SPA-310 - Spawn at Static position/SPA-310 - Spawn at Static position.miz index 19d21d7d11..368cdcab6a 100644 Binary files a/SPA-310 - Spawn at Static position/SPA-310 - Spawn at Static position.miz and b/SPA-310 - Spawn at Static position/SPA-310 - Spawn at Static position.miz differ diff --git a/SPA-320 - Spawn at Unit position/SPA-320 - Spawn at Unit position.lua b/SPA-320 - Spawn at Unit position/SPA-320 - Spawn at Unit position.lua index 01e52eda02..a9a462f44c 100644 --- a/SPA-320 - Spawn at Unit position/SPA-320 - Spawn at Unit position.lua +++ b/SPA-320 - Spawn at Unit position/SPA-320 - Spawn at Unit position.lua @@ -1,52 +1,52 @@ - -local Iterations = 10 -local Iteration = 1 - -GroundUnits = { "GroundUnit1", "GroundUnit2", "GroundUnit3" } -AirplaneUnits = { "AirplaneUnit1", "AirplaneUnit2", "AirplaneUnit3" } -HelicopterUnits = { "HelicopterUnit1", "HelicopterUnit2", "HelicopterUnit3" } -ShipUnits = { "ShipUnit1", "ShipUnit2", "ShipUnit3" } - -HeightLimit = 500 - -SpawnGrounds = SPAWN:New("Ground"):InitLimit( 20, 10 ):InitRandomizeUnits( true, 10, 3 ) -SpawnAirplanes = SPAWN:New("Airplane"):InitLimit( 20, 10 ) -SpawnHelicopters = SPAWN:New("Helicopter"):InitLimit( 20, 10 ) -SpawnShips = SPAWN:New("Ship"):InitLimit( 20, 10 ) - ---- Spawns these groups slowly. -SCHEDULER:New( nil, - - function( Interation, Iterations ) - do - -- Spawn Ground - local UnitName = GroundUnits[ math.random( 1, 3 ) ] - local SpawnUnit = UNIT:FindByName( UnitName ) - SpawnGrounds:SpawnFromUnit( SpawnUnit ) - end - - do - -- Spawn Airplanes - local UnitName = AirplaneUnits[ math.random( 1, 3 ) ] - local SpawnUnit = UNIT:FindByName( UnitName ) - SpawnAirplanes:SpawnFromUnit( SpawnUnit ) - SpawnAirplanes:SpawnFromUnit( SpawnUnit, 200, 500 ) - end - - do - -- Spawn Helicopters - local UnitName = HelicopterUnits[ math.random( 1, 3 ) ] - local SpawnUnit = UNIT:FindByName( UnitName ) - SpawnHelicopters:SpawnFromUnit( SpawnUnit ) - SpawnHelicopters:SpawnFromUnit( SpawnUnit, 500, 2000 ) - end - - do - -- Spawn Ships - local UnitName = ShipUnits[ math.random( 1, 3 ) ] - local SpawnUnit = UNIT:FindByName( UnitName ) - SpawnShips:SpawnFromUnit( SpawnUnit ) - end - - end, {}, 0, 15, 0.5 -) + +local Iterations = 10 +local Iteration = 1 + +GroundUnits = { "GroundUnit1", "GroundUnit2", "GroundUnit3" } +AirplaneUnits = { "AirplaneUnit1", "AirplaneUnit2", "AirplaneUnit3" } +HelicopterUnits = { "HelicopterUnit1", "HelicopterUnit2", "HelicopterUnit3" } +ShipUnits = { "ShipUnit1", "ShipUnit2", "ShipUnit3" } + +HeightLimit = 500 + +SpawnGrounds = SPAWN:New("Ground"):InitLimit( 20, 10 ):InitRandomizeUnits( true, 10, 3 ) +SpawnAirplanes = SPAWN:New("Airplane"):InitLimit( 20, 10 ) +SpawnHelicopters = SPAWN:New("Helicopter"):InitLimit( 20, 10 ) +SpawnShips = SPAWN:New("Ship"):InitLimit( 20, 10 ) + +--- Spawns these groups slowly. +SCHEDULER:New( nil, + + function( Interation, Iterations ) + do + -- Spawn Ground + local UnitName = GroundUnits[ math.random( 1, 3 ) ] + local SpawnUnit = UNIT:FindByName( UnitName ) + SpawnGrounds:SpawnFromUnit( SpawnUnit ) + end + + do + -- Spawn Airplanes + local UnitName = AirplaneUnits[ math.random( 1, 3 ) ] + local SpawnUnit = UNIT:FindByName( UnitName ) + SpawnAirplanes:SpawnFromUnit( SpawnUnit ) + SpawnAirplanes:SpawnFromUnit( SpawnUnit, 200, 500 ) + end + + do + -- Spawn Helicopters + local UnitName = HelicopterUnits[ math.random( 1, 3 ) ] + local SpawnUnit = UNIT:FindByName( UnitName ) + SpawnHelicopters:SpawnFromUnit( SpawnUnit ) + SpawnHelicopters:SpawnFromUnit( SpawnUnit, 500, 2000 ) + end + + do + -- Spawn Ships + local UnitName = ShipUnits[ math.random( 1, 3 ) ] + local SpawnUnit = UNIT:FindByName( UnitName ) + SpawnShips:SpawnFromUnit( SpawnUnit ) + end + + end, {}, 0, 15, 0.5 +) diff --git a/SPA-320 - Spawn at Unit position/SPA-320 - Spawn at Unit position.miz b/SPA-320 - Spawn at Unit position/SPA-320 - Spawn at Unit position.miz index 5ecb1b3fc8..b4ea8e4890 100644 Binary files a/SPA-320 - Spawn at Unit position/SPA-320 - Spawn at Unit position.miz and b/SPA-320 - Spawn at Unit position/SPA-320 - Spawn at Unit position.miz differ diff --git a/SPA-330 - Spawn at Vec2 position/SPA-330 - Spawn at Vec2 position.lua b/SPA-330 - Spawn at Vec2 position/SPA-330 - Spawn at Vec2 position.lua index fbb754c873..a2de3504c7 100644 --- a/SPA-330 - Spawn at Vec2 position/SPA-330 - Spawn at Vec2 position.lua +++ b/SPA-330 - Spawn at Vec2 position/SPA-330 - Spawn at Vec2 position.lua @@ -1,61 +1,61 @@ - -local Iterations = 10 -local Iteration = 1 - -GroundZones = { "GroundZone1", "GroundZone2", "GroundZone3" } -GroundRandomizeZones = { "GroundRandomizeZone1", "GroundRandomizeZone2", "GroundRandomizeZone3" } -AirplaneZones = { "AirplaneZone1", "AirplaneZone2", "AirplaneZone3" } -HelicopterZones = { "HelicopterZone1", "HelicopterZone2", "HelicopterZone3" } -ShipZones = { "ShipZone1", "ShipZone2", "ShipZone3" } - -HeightLimit = 500 - -SpawnGrounds = SPAWN:New("Ground"):InitLimit( 20, 10 ) -SpawnRandomizeGrounds = SPAWN:New("GroundRandomize"):InitLimit( 20, 10 ):InitRandomizeUnits( true, 500, 100 ) -SpawnAirplanes = SPAWN:New("Airplane"):InitLimit( 20, 10 ) -SpawnHelicopters = SPAWN:New("Helicopter"):InitLimit( 20, 10 ) -SpawnShips = SPAWN:New("Ship"):InitLimit( 20, 10 ) - ---- Spawns these groups slowly. -SCHEDULER:New( nil, - - function( Interation, Iterations ) - do - -- Spawn Ground - local ZoneName = GroundZones[ math.random( 1, 3 ) ] - local SpawnVec3 = POINT_VEC3:NewFromVec3( ZONE:New( ZoneName ):GetVec3() ) - SpawnGrounds:SpawnFromVec2( SpawnVec3:GetVec2() ) - end - - do - -- Spawn Ground Randomize - local ZoneName = GroundRandomizeZones[ math.random( 1, 3 ) ] - local SpawnVec3 = POINT_VEC3:NewFromVec3( ZONE:New( ZoneName ):GetVec3() ) - SpawnRandomizeGrounds:SpawnFromVec2( SpawnVec3:GetVec2() ) - end - - do - -- Spawn Airplanes - local ZoneName = AirplaneZones[ math.random( 1, 3 ) ] - local SpawnVec3 = POINT_VEC3:NewFromVec3( ZONE:New( ZoneName ):GetVec3() ) - SpawnAirplanes:SpawnFromVec2( SpawnVec3:GetVec2() ) - SpawnAirplanes:SpawnFromVec2( SpawnVec3:GetVec2(), 200, 500 ) - end - - do - -- Spawn Helicopters - local ZoneName = HelicopterZones[ math.random( 1, 3 ) ] - local SpawnVec3 = POINT_VEC3:NewFromVec3( ZONE:New( ZoneName ):GetVec3() ) - SpawnHelicopters:SpawnFromVec2( SpawnVec3:GetVec2() ) - SpawnHelicopters:SpawnFromVec2( SpawnVec3:GetVec2(), 2000, 4000 ) - end - - do - -- Spawn Ships - local ZoneName = ShipZones[ math.random( 1, 3 ) ] - local SpawnVec3 = POINT_VEC3:NewFromVec3( ZONE:New( ZoneName ):GetVec3() ) - SpawnShips:SpawnFromVec2( SpawnVec3:GetVec2() ) - end - - end, {}, 0, 15, 0.5 -) + +local Iterations = 10 +local Iteration = 1 + +GroundZones = { "GroundZone1", "GroundZone2", "GroundZone3" } +GroundRandomizeZones = { "GroundRandomizeZone1", "GroundRandomizeZone2", "GroundRandomizeZone3" } +AirplaneZones = { "AirplaneZone1", "AirplaneZone2", "AirplaneZone3" } +HelicopterZones = { "HelicopterZone1", "HelicopterZone2", "HelicopterZone3" } +ShipZones = { "ShipZone1", "ShipZone2", "ShipZone3" } + +HeightLimit = 500 + +SpawnGrounds = SPAWN:New("Ground"):InitLimit( 20, 10 ) +SpawnRandomizeGrounds = SPAWN:New("GroundRandomize"):InitLimit( 20, 10 ):InitRandomizeUnits( true, 500, 100 ) +SpawnAirplanes = SPAWN:New("Airplane"):InitLimit( 20, 10 ) +SpawnHelicopters = SPAWN:New("Helicopter"):InitLimit( 20, 10 ) +SpawnShips = SPAWN:New("Ship"):InitLimit( 20, 10 ) + +--- Spawns these groups slowly. +SCHEDULER:New( nil, + + function( Interation, Iterations ) + do + -- Spawn Ground + local ZoneName = GroundZones[ math.random( 1, 3 ) ] + local SpawnVec3 = POINT_VEC3:NewFromVec3( ZONE:New( ZoneName ):GetVec3() ) + SpawnGrounds:SpawnFromVec2( SpawnVec3:GetVec2() ) + end + + do + -- Spawn Ground Randomize + local ZoneName = GroundRandomizeZones[ math.random( 1, 3 ) ] + local SpawnVec3 = POINT_VEC3:NewFromVec3( ZONE:New( ZoneName ):GetVec3() ) + SpawnRandomizeGrounds:SpawnFromVec2( SpawnVec3:GetVec2() ) + end + + do + -- Spawn Airplanes + local ZoneName = AirplaneZones[ math.random( 1, 3 ) ] + local SpawnVec3 = POINT_VEC3:NewFromVec3( ZONE:New( ZoneName ):GetVec3() ) + SpawnAirplanes:SpawnFromVec2( SpawnVec3:GetVec2() ) + SpawnAirplanes:SpawnFromVec2( SpawnVec3:GetVec2(), 200, 500 ) + end + + do + -- Spawn Helicopters + local ZoneName = HelicopterZones[ math.random( 1, 3 ) ] + local SpawnVec3 = POINT_VEC3:NewFromVec3( ZONE:New( ZoneName ):GetVec3() ) + SpawnHelicopters:SpawnFromVec2( SpawnVec3:GetVec2() ) + SpawnHelicopters:SpawnFromVec2( SpawnVec3:GetVec2(), 2000, 4000 ) + end + + do + -- Spawn Ships + local ZoneName = ShipZones[ math.random( 1, 3 ) ] + local SpawnVec3 = POINT_VEC3:NewFromVec3( ZONE:New( ZoneName ):GetVec3() ) + SpawnShips:SpawnFromVec2( SpawnVec3:GetVec2() ) + end + + end, {}, 0, 15, 0.5 +) diff --git a/SPA-330 - Spawn at Vec2 position/SPA-330 - Spawn at Vec2 position.miz b/SPA-330 - Spawn at Vec2 position/SPA-330 - Spawn at Vec2 position.miz index b69cdda9ca..4dd55d3aef 100644 Binary files a/SPA-330 - Spawn at Vec2 position/SPA-330 - Spawn at Vec2 position.miz and b/SPA-330 - Spawn at Vec2 position/SPA-330 - Spawn at Vec2 position.miz differ diff --git a/SPA-340 - Spawn at Vec3 position/SPA-340 - Spawn at Vec3 position.lua b/SPA-340 - Spawn at Vec3 position/SPA-340 - Spawn at Vec3 position.lua index df0d253ef1..4032e80cce 100644 --- a/SPA-340 - Spawn at Vec3 position/SPA-340 - Spawn at Vec3 position.lua +++ b/SPA-340 - Spawn at Vec3 position/SPA-340 - Spawn at Vec3 position.lua @@ -1,59 +1,59 @@ - -local Iterations = 10 -local Iteration = 1 - -GroundZones = { "GroundZone1", "GroundZone2", "GroundZone3" } -GroundRandomizeZones = { "GroundRandomizeZone1", "GroundRandomizeZone2", "GroundRandomizeZone3" } -AirplaneZones = { "AirplaneZone1", "AirplaneZone2", "AirplaneZone3" } -HelicopterZones = { "HelicopterZone1", "HelicopterZone2", "HelicopterZone3" } -ShipZones = { "ShipZone1", "ShipZone2", "ShipZone3" } - -HeightLimit = 500 - -SpawnGrounds = SPAWN:New("Ground"):InitLimit( 20, 10 ) -SpawnRandomizeGrounds = SPAWN:New("GroundRandomize"):InitLimit( 20, 10 ):InitRandomizeUnits( true, 500, 100 ) -SpawnAirplanes = SPAWN:New("Airplane"):InitLimit( 20, 10 ) -SpawnHelicopters = SPAWN:New("Helicopter"):InitLimit( 20, 10 ) -SpawnShips = SPAWN:New("Ship"):InitLimit( 20, 10 ) - ---- Spawns these groups slowly. -SCHEDULER:New( nil, - - function( Interation, Iterations ) - do - -- Spawn Ground - local ZoneName = GroundZones[ math.random( 1, 3 ) ] - local SpawnVec3 = POINT_VEC3:NewFromVec3( ZONE:New( ZoneName ):GetVec3() ) - SpawnGrounds:SpawnFromVec3( SpawnVec3:GetVec3() ) - end - - do - -- Spawn Ground Randomize - local ZoneName = GroundRandomizeZones[ math.random( 1, 3 ) ] - local SpawnVec3 = POINT_VEC3:NewFromVec3( ZONE:New( ZoneName ):GetVec3() ) - SpawnRandomizeGrounds:SpawnFromVec3( SpawnVec3:GetVec3() ) - end - - do - -- Spawn Airplanes - local ZoneName = AirplaneZones[ math.random( 1, 3 ) ] - local SpawnVec3 = POINT_VEC3:NewFromVec3( ZONE:New( ZoneName ):GetVec3() ) - SpawnAirplanes:SpawnFromVec3( SpawnVec3:GetVec3() ) - end - - do - -- Spawn Helicopters - local ZoneName = HelicopterZones[ math.random( 1, 3 ) ] - local SpawnVec3 = POINT_VEC3:NewFromVec3( ZONE:New( ZoneName ):GetVec3() ) - SpawnHelicopters:SpawnFromVec3( SpawnVec3:GetVec3() ) - end - - do - -- Spawn Ships - local ZoneName = ShipZones[ math.random( 1, 3 ) ] - local SpawnVec3 = POINT_VEC3:NewFromVec3( ZONE:New( ZoneName ):GetVec3() ) - SpawnShips:SpawnFromVec3( SpawnVec3:GetVec3() ) - end - - end, {}, 0, 15, 0.5 -) + +local Iterations = 10 +local Iteration = 1 + +GroundZones = { "GroundZone1", "GroundZone2", "GroundZone3" } +GroundRandomizeZones = { "GroundRandomizeZone1", "GroundRandomizeZone2", "GroundRandomizeZone3" } +AirplaneZones = { "AirplaneZone1", "AirplaneZone2", "AirplaneZone3" } +HelicopterZones = { "HelicopterZone1", "HelicopterZone2", "HelicopterZone3" } +ShipZones = { "ShipZone1", "ShipZone2", "ShipZone3" } + +HeightLimit = 500 + +SpawnGrounds = SPAWN:New("Ground"):InitLimit( 20, 10 ) +SpawnRandomizeGrounds = SPAWN:New("GroundRandomize"):InitLimit( 20, 10 ):InitRandomizeUnits( true, 500, 100 ) +SpawnAirplanes = SPAWN:New("Airplane"):InitLimit( 20, 10 ) +SpawnHelicopters = SPAWN:New("Helicopter"):InitLimit( 20, 10 ) +SpawnShips = SPAWN:New("Ship"):InitLimit( 20, 10 ) + +--- Spawns these groups slowly. +SCHEDULER:New( nil, + + function( Interation, Iterations ) + do + -- Spawn Ground + local ZoneName = GroundZones[ math.random( 1, 3 ) ] + local SpawnVec3 = POINT_VEC3:NewFromVec3( ZONE:New( ZoneName ):GetVec3() ) + SpawnGrounds:SpawnFromVec3( SpawnVec3:GetVec3() ) + end + + do + -- Spawn Ground Randomize + local ZoneName = GroundRandomizeZones[ math.random( 1, 3 ) ] + local SpawnVec3 = POINT_VEC3:NewFromVec3( ZONE:New( ZoneName ):GetVec3() ) + SpawnRandomizeGrounds:SpawnFromVec3( SpawnVec3:GetVec3() ) + end + + do + -- Spawn Airplanes + local ZoneName = AirplaneZones[ math.random( 1, 3 ) ] + local SpawnVec3 = POINT_VEC3:NewFromVec3( ZONE:New( ZoneName ):GetVec3() ) + SpawnAirplanes:SpawnFromVec3( SpawnVec3:GetVec3() ) + end + + do + -- Spawn Helicopters + local ZoneName = HelicopterZones[ math.random( 1, 3 ) ] + local SpawnVec3 = POINT_VEC3:NewFromVec3( ZONE:New( ZoneName ):GetVec3() ) + SpawnHelicopters:SpawnFromVec3( SpawnVec3:GetVec3() ) + end + + do + -- Spawn Ships + local ZoneName = ShipZones[ math.random( 1, 3 ) ] + local SpawnVec3 = POINT_VEC3:NewFromVec3( ZONE:New( ZoneName ):GetVec3() ) + SpawnShips:SpawnFromVec3( SpawnVec3:GetVec3() ) + end + + end, {}, 0, 15, 0.5 +) diff --git a/SPA-340 - Spawn at Vec3 position/SPA-340 - Spawn at Vec3 position.miz b/SPA-340 - Spawn at Vec3 position/SPA-340 - Spawn at Vec3 position.miz index 1c8f35b56b..a007b3c7db 100644 Binary files a/SPA-340 - Spawn at Vec3 position/SPA-340 - Spawn at Vec3 position.miz and b/SPA-340 - Spawn at Vec3 position/SPA-340 - Spawn at Vec3 position.miz differ diff --git a/SPA-350 - Spawn at Vec3 position RandomizePosition/SPA-350 - Spawn at Vec3 position RandomizePosition.lua b/SPA-350 - Spawn at Vec3 position RandomizePosition/SPA-350 - Spawn at Vec3 position RandomizePosition.lua index e3ea496327..3122b26dda 100644 --- a/SPA-350 - Spawn at Vec3 position RandomizePosition/SPA-350 - Spawn at Vec3 position RandomizePosition.lua +++ b/SPA-350 - Spawn at Vec3 position RandomizePosition/SPA-350 - Spawn at Vec3 position RandomizePosition.lua @@ -1,73 +1,73 @@ ---- --- Name: SPA-350 - Spawn at Vec3 position RandomzePosition --- Author: FlightControl --- Date Created: 14 Mar 2017 --- --- # Situation: --- --- Ground troops, Airplanes, Helicopters and Ships are spawning from Vec3 points. --- The API InitRandomizePosition is tested here, ensure that groups are replaced within a 900 to 1000 zone band at random positions. --- --- # Test cases: --- --- 1. Observe the random positioning of the groups. There should be no scattering of units. --- - -local Iterations = 10 -local Iteration = 1 - -GroundZones = { "GroundZone1", "GroundZone2", "GroundZone3" } -GroundRandomizeZones = { "GroundRandomizeZone1", "GroundRandomizeZone2", "GroundRandomizeZone3" } -AirplaneZones = { "AirplaneZone1", "AirplaneZone2", "AirplaneZone3" } -HelicopterZones = { "HelicopterZone1", "HelicopterZone2", "HelicopterZone3" } -ShipZones = { "ShipZone1", "ShipZone2", "ShipZone3" } - -HeightLimit = 500 - -SpawnGrounds = SPAWN:New("Ground"):InitLimit( 20, 10 ):InitRandomizePosition( true , 1000, 900 ) -SpawnRandomizeGrounds = SPAWN:New("GroundRandomize"):InitLimit( 20, 10 ):InitRandomizePosition( true , 1000, 900 ) -SpawnAirplanes = SPAWN:New("Airplane"):InitLimit( 20, 10 ):InitRandomizePosition( true , 1000, 900 ) -SpawnHelicopters = SPAWN:New("Helicopter"):InitLimit( 20, 10 ):InitRandomizePosition( true , 1000, 900 ) -SpawnShips = SPAWN:New("Ship"):InitLimit( 20, 10 ):InitRandomizePosition( true , 1000, 900 ) - ---- Spawns these groups slowly. -SCHEDULER:New( nil, - - function( Interation, Iterations ) - do - -- Spawn Ground - local ZoneName = GroundZones[ math.random( 1, 3 ) ] - local SpawnVec3 = POINT_VEC3:NewFromVec3( ZONE:New( ZoneName ):GetVec3() ) - SpawnGrounds:SpawnFromVec3( SpawnVec3:GetVec3() ) - end - - do - -- Spawn Ground Randomize - local ZoneName = GroundRandomizeZones[ math.random( 1, 3 ) ] - local SpawnVec3 = POINT_VEC3:NewFromVec3( ZONE:New( ZoneName ):GetVec3() ) - SpawnRandomizeGrounds:SpawnFromVec3( SpawnVec3:GetVec3() ) - end - - do - -- Spawn Airplanes - local ZoneName = AirplaneZones[ math.random( 1, 3 ) ] - local SpawnVec3 = POINT_VEC3:NewFromVec3( ZONE:New( ZoneName ):GetVec3() ) - SpawnAirplanes:SpawnFromVec3( SpawnVec3:GetVec3() ) - end - - do - -- Spawn Helicopters - local ZoneName = HelicopterZones[ math.random( 1, 3 ) ] - local SpawnVec3 = POINT_VEC3:NewFromVec3( ZONE:New( ZoneName ):GetVec3() ) - SpawnHelicopters:SpawnFromVec3( SpawnVec3:GetVec3() ) - end - - do - -- Spawn Ships - local ZoneName = ShipZones[ math.random( 1, 3 ) ] - local SpawnVec3 = POINT_VEC3:NewFromVec3( ZONE:New( ZoneName ):GetVec3() ) - SpawnShips:SpawnFromVec3( SpawnVec3:GetVec3() ) - end - - end, {}, 0, 15, 0.5 -) +--- +-- Name: SPA-350 - Spawn at Vec3 position RandomzePosition +-- Author: FlightControl +-- Date Created: 14 Mar 2017 +-- +-- # Situation: +-- +-- Ground troops, Airplanes, Helicopters and Ships are spawning from Vec3 points. +-- The API InitRandomizePosition is tested here, ensure that groups are replaced within a 900 to 1000 zone band at random positions. +-- +-- # Test cases: +-- +-- 1. Observe the random positioning of the groups. There should be no scattering of units. +-- + +local Iterations = 10 +local Iteration = 1 + +GroundZones = { "GroundZone1", "GroundZone2", "GroundZone3" } +GroundRandomizeZones = { "GroundRandomizeZone1", "GroundRandomizeZone2", "GroundRandomizeZone3" } +AirplaneZones = { "AirplaneZone1", "AirplaneZone2", "AirplaneZone3" } +HelicopterZones = { "HelicopterZone1", "HelicopterZone2", "HelicopterZone3" } +ShipZones = { "ShipZone1", "ShipZone2", "ShipZone3" } + +HeightLimit = 500 + +SpawnGrounds = SPAWN:New("Ground"):InitLimit( 20, 10 ):InitRandomizePosition( true , 1000, 900 ) +SpawnRandomizeGrounds = SPAWN:New("GroundRandomize"):InitLimit( 20, 10 ):InitRandomizePosition( true , 1000, 900 ) +SpawnAirplanes = SPAWN:New("Airplane"):InitLimit( 20, 10 ):InitRandomizePosition( true , 1000, 900 ) +SpawnHelicopters = SPAWN:New("Helicopter"):InitLimit( 20, 10 ):InitRandomizePosition( true , 1000, 900 ) +SpawnShips = SPAWN:New("Ship"):InitLimit( 20, 10 ):InitRandomizePosition( true , 1000, 900 ) + +--- Spawns these groups slowly. +SCHEDULER:New( nil, + + function( Interation, Iterations ) + do + -- Spawn Ground + local ZoneName = GroundZones[ math.random( 1, 3 ) ] + local SpawnVec3 = POINT_VEC3:NewFromVec3( ZONE:New( ZoneName ):GetVec3() ) + SpawnGrounds:SpawnFromVec3( SpawnVec3:GetVec3() ) + end + + do + -- Spawn Ground Randomize + local ZoneName = GroundRandomizeZones[ math.random( 1, 3 ) ] + local SpawnVec3 = POINT_VEC3:NewFromVec3( ZONE:New( ZoneName ):GetVec3() ) + SpawnRandomizeGrounds:SpawnFromVec3( SpawnVec3:GetVec3() ) + end + + do + -- Spawn Airplanes + local ZoneName = AirplaneZones[ math.random( 1, 3 ) ] + local SpawnVec3 = POINT_VEC3:NewFromVec3( ZONE:New( ZoneName ):GetVec3() ) + SpawnAirplanes:SpawnFromVec3( SpawnVec3:GetVec3() ) + end + + do + -- Spawn Helicopters + local ZoneName = HelicopterZones[ math.random( 1, 3 ) ] + local SpawnVec3 = POINT_VEC3:NewFromVec3( ZONE:New( ZoneName ):GetVec3() ) + SpawnHelicopters:SpawnFromVec3( SpawnVec3:GetVec3() ) + end + + do + -- Spawn Ships + local ZoneName = ShipZones[ math.random( 1, 3 ) ] + local SpawnVec3 = POINT_VEC3:NewFromVec3( ZONE:New( ZoneName ):GetVec3() ) + SpawnShips:SpawnFromVec3( SpawnVec3:GetVec3() ) + end + + end, {}, 0, 15, 0.5 +) diff --git a/SPA-350 - Spawn at Vec3 position RandomizePosition/SPA-350 - Spawn at Vec3 position RandomizePosition.miz b/SPA-350 - Spawn at Vec3 position RandomizePosition/SPA-350 - Spawn at Vec3 position RandomizePosition.miz index 22eabe8962..46726ac20d 100644 Binary files a/SPA-350 - Spawn at Vec3 position RandomizePosition/SPA-350 - Spawn at Vec3 position RandomizePosition.miz and b/SPA-350 - Spawn at Vec3 position RandomizePosition/SPA-350 - Spawn at Vec3 position RandomizePosition.miz differ diff --git a/SPA-350 - Spawn at Vec3 position RandomizePosition/SPA-350 - Spawn at Vec3 position RandomzePosition.lua b/SPA-350 - Spawn at Vec3 position RandomizePosition/SPA-350 - Spawn at Vec3 position RandomzePosition.lua new file mode 100644 index 0000000000..3122b26dda --- /dev/null +++ b/SPA-350 - Spawn at Vec3 position RandomizePosition/SPA-350 - Spawn at Vec3 position RandomzePosition.lua @@ -0,0 +1,73 @@ +--- +-- Name: SPA-350 - Spawn at Vec3 position RandomzePosition +-- Author: FlightControl +-- Date Created: 14 Mar 2017 +-- +-- # Situation: +-- +-- Ground troops, Airplanes, Helicopters and Ships are spawning from Vec3 points. +-- The API InitRandomizePosition is tested here, ensure that groups are replaced within a 900 to 1000 zone band at random positions. +-- +-- # Test cases: +-- +-- 1. Observe the random positioning of the groups. There should be no scattering of units. +-- + +local Iterations = 10 +local Iteration = 1 + +GroundZones = { "GroundZone1", "GroundZone2", "GroundZone3" } +GroundRandomizeZones = { "GroundRandomizeZone1", "GroundRandomizeZone2", "GroundRandomizeZone3" } +AirplaneZones = { "AirplaneZone1", "AirplaneZone2", "AirplaneZone3" } +HelicopterZones = { "HelicopterZone1", "HelicopterZone2", "HelicopterZone3" } +ShipZones = { "ShipZone1", "ShipZone2", "ShipZone3" } + +HeightLimit = 500 + +SpawnGrounds = SPAWN:New("Ground"):InitLimit( 20, 10 ):InitRandomizePosition( true , 1000, 900 ) +SpawnRandomizeGrounds = SPAWN:New("GroundRandomize"):InitLimit( 20, 10 ):InitRandomizePosition( true , 1000, 900 ) +SpawnAirplanes = SPAWN:New("Airplane"):InitLimit( 20, 10 ):InitRandomizePosition( true , 1000, 900 ) +SpawnHelicopters = SPAWN:New("Helicopter"):InitLimit( 20, 10 ):InitRandomizePosition( true , 1000, 900 ) +SpawnShips = SPAWN:New("Ship"):InitLimit( 20, 10 ):InitRandomizePosition( true , 1000, 900 ) + +--- Spawns these groups slowly. +SCHEDULER:New( nil, + + function( Interation, Iterations ) + do + -- Spawn Ground + local ZoneName = GroundZones[ math.random( 1, 3 ) ] + local SpawnVec3 = POINT_VEC3:NewFromVec3( ZONE:New( ZoneName ):GetVec3() ) + SpawnGrounds:SpawnFromVec3( SpawnVec3:GetVec3() ) + end + + do + -- Spawn Ground Randomize + local ZoneName = GroundRandomizeZones[ math.random( 1, 3 ) ] + local SpawnVec3 = POINT_VEC3:NewFromVec3( ZONE:New( ZoneName ):GetVec3() ) + SpawnRandomizeGrounds:SpawnFromVec3( SpawnVec3:GetVec3() ) + end + + do + -- Spawn Airplanes + local ZoneName = AirplaneZones[ math.random( 1, 3 ) ] + local SpawnVec3 = POINT_VEC3:NewFromVec3( ZONE:New( ZoneName ):GetVec3() ) + SpawnAirplanes:SpawnFromVec3( SpawnVec3:GetVec3() ) + end + + do + -- Spawn Helicopters + local ZoneName = HelicopterZones[ math.random( 1, 3 ) ] + local SpawnVec3 = POINT_VEC3:NewFromVec3( ZONE:New( ZoneName ):GetVec3() ) + SpawnHelicopters:SpawnFromVec3( SpawnVec3:GetVec3() ) + end + + do + -- Spawn Ships + local ZoneName = ShipZones[ math.random( 1, 3 ) ] + local SpawnVec3 = POINT_VEC3:NewFromVec3( ZONE:New( ZoneName ):GetVec3() ) + SpawnShips:SpawnFromVec3( SpawnVec3:GetVec3() ) + end + + end, {}, 0, 15, 0.5 +) diff --git a/SPS - Spawning Statics/SPS-100 - Simple Spawning/SPS-100 - Simple Spawning.lua b/SPS - Spawning Statics/SPS-100 - Simple Spawning/SPS-100 - Simple Spawning.lua index a533d78eef..44b5fdaf5f 100644 --- a/SPS - Spawning Statics/SPS-100 - Simple Spawning/SPS-100 - Simple Spawning.lua +++ b/SPS - Spawning Statics/SPS-100 - Simple Spawning/SPS-100 - Simple Spawning.lua @@ -1,31 +1,31 @@ ---- Name: SPS-100 - Simple Spawning --- Author: FlightControl --- Date Created: 09 Apr 2017 --- --- # Situation: --- --- At Gudauta spawn a static. --- --- # Test cases: --- --- 1. Observe that the static is spawned. - - -local ZonePosition = ZONE:New( "Position" ) - -local SpawnBuilding = SPAWNSTATIC:NewFromStatic( "Building", country.id.GERMANY ) -local SpawnBarrack = SPAWNSTATIC:NewFromStatic( "Barrack", country.id.GERMANY ) - -local ZonePointVec2 = ZonePosition:GetPointVec2() - -local Building = SpawnBuilding:SpawnFromZone( ZonePosition, 0 ) - -for Heading = 0, 360,60 do - local Radial = Heading * ( math.pi*2 ) / 360 - local x = ZonePointVec2:GetLat() + math.cos( Radial ) * 150 - local y = ZonePointVec2:GetLon() + math.sin( Radial ) * 150 - SpawnBarrack:SpawnFromPointVec2( POINT_VEC2:New( x, y ), Heading + 90 ) -end - - - +--- Name: SPS-100 - Simple Spawning +-- Author: FlightControl +-- Date Created: 09 Apr 2017 +-- +-- # Situation: +-- +-- At Gudauta spawn a static. +-- +-- # Test cases: +-- +-- 1. Observe that the static is spawned. + + +local ZonePosition = ZONE:New( "Position" ) + +local SpawnBuilding = SPAWNSTATIC:NewFromStatic( "Building", country.id.GERMANY ) +local SpawnBarrack = SPAWNSTATIC:NewFromStatic( "Barrack", country.id.GERMANY ) + +local ZonePointVec2 = ZonePosition:GetPointVec2() + +local Building = SpawnBuilding:SpawnFromZone( ZonePosition, 0 ) + +for Heading = 0, 360,60 do + local Radial = Heading * ( math.pi*2 ) / 360 + local x = ZonePointVec2:GetLat() + math.cos( Radial ) * 150 + local y = ZonePointVec2:GetLon() + math.sin( Radial ) * 150 + SpawnBarrack:SpawnFromPointVec2( POINT_VEC2:New( x, y ), Heading + 90 ) +end + + + diff --git a/SPS - Spawning Statics/SPS-100 - Simple Spawning/SPS-100 - Simple Spawning.miz b/SPS - Spawning Statics/SPS-100 - Simple Spawning/SPS-100 - Simple Spawning.miz index 12ea1acbf8..55c83bda28 100644 Binary files a/SPS - Spawning Statics/SPS-100 - Simple Spawning/SPS-100 - Simple Spawning.miz and b/SPS - Spawning Statics/SPS-100 - Simple Spawning/SPS-100 - Simple Spawning.miz differ diff --git a/SRD - SHORAD Defense/SRD-100 - SHORAD - Basic Demo/SRD-100 - SHORAD - Basic Demo.lua b/SRD - SHORAD Defense/SRD-100 - SHORAD - Basic Demo/SRD-100 - SHORAD - Basic Demo.lua index f5106a0a71..e24216674b 100644 --- a/SRD - SHORAD Defense/SRD-100 - SHORAD - Basic Demo/SRD-100 - SHORAD - Basic Demo.lua +++ b/SRD - SHORAD Defense/SRD-100 - SHORAD - Basic Demo/SRD-100 - SHORAD - Basic Demo.lua @@ -1,25 +1,25 @@ -------------------------------------------------------------------------- --- SRD-100 - SHORAD - Basic Demo -------------------------------------------------------------------------- --- Documentation --- --- SHORAD: https://flightcontrol-master.github.io/MOOSE_DOCS/Documentation/Functional.Shorad.html --- --- Note: As of Feb/21, SHORAD is WIP. Needs a recent build of Moose.lua => 2.5.3 --- -------------------------------------------------------------------------- --- Observe a set of Red SAM sites being attacked by Blue SEAD and Helicopters. --- Red SHORAD systems will be switched on for 10 minutes to defend against --- HARMSs and AGMs. --- Red SAMs will try to evade HARMs fired at them. -------------------------------------------------------------------------- --- Date: 16 Feb 2021, Updated 25 Mar 2021 -------------------------------------------------------------------------- - -local SamSet = SET_GROUP:New():FilterPrefixes("Blue SAM"):FilterCoalitions("blue"):FilterStart() --- usage: SHORAD:New(name, prefix, samset, radius, time, coalition) -myshorad = SHORAD:New("BlueShorad", "Blue SHORAD", SamSet, 22000, 600, "blue") -myshorad:SwitchDebug(true) - --- optional - make SAMs evasive (that is, if they can move) +------------------------------------------------------------------------- +-- SRD-100 - SHORAD - Basic Demo +------------------------------------------------------------------------- +-- Documentation +-- +-- SHORAD: https://flightcontrol-master.github.io/MOOSE_DOCS/Documentation/tbd +-- +-- Note: As of Feb/21, SHORAD is WIP. Needs a recent build of Moose.lua => 2.5.3 +-- +------------------------------------------------------------------------- +-- Observe a set of Red SAM sites being attacked by Blue SEAD and Helicopters. +-- Red SHORAD systems will be switched on for 10 minutes to defend against +-- HARMSs and AGMs. +-- Red SAMs will try to evade HARMs fired at them. +------------------------------------------------------------------------- +-- Date: 16 Feb 2021 +------------------------------------------------------------------------- + +local SamSet = SET_GROUP:New():FilterPrefixes("Blue SAM"):FilterCoalitions("blue"):FilterStart() +-- usage: SHORAD:New(name, prefix, samset, radius, time, coalition) +myshorad = SHORAD:New("BlueShorad", "Blue SHORAD", SamSet, 22000, 600, "blue") +myshorad:SwitchDebug(true) + +-- optional - make SAMs evasive (that is, if they can move) mysead = SEAD:New("Blue SAM") \ No newline at end of file diff --git a/SRD - SHORAD Defense/SRD-100 - SHORAD - Basic Demo/SRD-100 - SHORAD - Basic Demo.miz b/SRD - SHORAD Defense/SRD-100 - SHORAD - Basic Demo/SRD-100 - SHORAD - Basic Demo.miz index acb50c6b88..9fe90859a8 100644 Binary files a/SRD - SHORAD Defense/SRD-100 - SHORAD - Basic Demo/SRD-100 - SHORAD - Basic Demo.miz and b/SRD - SHORAD Defense/SRD-100 - SHORAD - Basic Demo/SRD-100 - SHORAD - Basic Demo.miz differ diff --git a/SRD - SHORAD Defense/SRD-110 - SHORAD - Integrate with Mantis/SRD-110 - SHORAD - Integrate with Mantis.lua b/SRD - SHORAD Defense/SRD-110 - SHORAD - Integrate with Mantis/SRD-110 - SHORAD - Integrate with Mantis.lua index 93835085e0..23508b2f0d 100644 --- a/SRD - SHORAD Defense/SRD-110 - SHORAD - Integrate with Mantis/SRD-110 - SHORAD - Integrate with Mantis.lua +++ b/SRD - SHORAD Defense/SRD-110 - SHORAD - Integrate with Mantis/SRD-110 - SHORAD - Integrate with Mantis.lua @@ -1,26 +1,26 @@ -------------------------------------------------------------------------- --- SRD-110 - SHORAD - Integrate with Mantis -------------------------------------------------------------------------- --- Documentation --- --- SHORAD: https://flightcontrol-master.github.io/MOOSE_DOCS/Documentation/tbd --- --- Note: As of Feb/21, SHORAD is WIP. Needs a recent build of Moose.lua => 2.5.3 --- -------------------------------------------------------------------------- --- Observe a set of Blue SAM sites being attacked by Red SEAD and Helicopters. --- Red SHORAD systems will be switched on for 10 minutes to defend against --- HARMSs and AGMs. --- Blue SAMs will try to evade HARMs fired at them. -------------------------------------------------------------------------- --- Date: 16 Feb 2021, Updated 25 Mar 2021 -------------------------------------------------------------------------- - -local SamSet = SET_GROUP:New():FilterPrefixes("Blue SAM"):FilterCoalitions("blue"):FilterStart() --- usage: SHORAD:New(name, prefix, samset, radius, time, coalition) -myshorad = SHORAD:New("BlueShorad", "Blue SHORAD", SamSet, 22000, 600, "blue") -myshorad:SwitchDebug(true) - -mymantis = MANTIS:New("BlueMantis","Blue SAM","Blue EWR",nil,"blue",false,"Blue Awacs") -mymantis:AddShorad(myshorad,720) +------------------------------------------------------------------------- +-- SRD-110 - SHORAD - Integrate with Mantis +------------------------------------------------------------------------- +-- Documentation +-- +-- SHORAD: https://flightcontrol-master.github.io/MOOSE_DOCS/Documentation/tbd +-- +-- Note: As of Feb/21, SHORAD is WIP. Needs a recent build of Moose.lua => 2.5.3 +-- +------------------------------------------------------------------------- +-- Observe a set of Red SAM sites being attacked by Blue SEAD and Helicopters. +-- Red SHORAD systems will be switched on for 10 minutes to defend against +-- HARMSs and AGMs. +-- Red SAMs will try to evade HARMs fired at them. +------------------------------------------------------------------------- +-- Date: 16 Feb 2021 +------------------------------------------------------------------------- + +local SamSet = SET_GROUP:New():FilterPrefixes("Blue SAM"):FilterCoalitions("blue"):FilterStart() +-- usage: SHORAD:New(name, prefix, samset, radius, time, coalition) +myshorad = SHORAD:New("BlueShorad", "Blue SHORAD", SamSet, 22000, 600, "blue") +myshorad:SwitchDebug(true) + +mymantis = MANTIS:New("BlueMantis","Blue SAM","Blue EWR",nil,"blue",false,"Blue Awacs") +mymantis:AddShorad(myshorad,720) mymantis:Start() \ No newline at end of file diff --git a/SRD - SHORAD Defense/SRD-110 - SHORAD - Integrate with Mantis/SRD-110 - SHORAD - Integrate with Mantis.miz b/SRD - SHORAD Defense/SRD-110 - SHORAD - Integrate with Mantis/SRD-110 - SHORAD - Integrate with Mantis.miz index d528c6488d..57fb89f402 100644 Binary files a/SRD - SHORAD Defense/SRD-110 - SHORAD - Integrate with Mantis/SRD-110 - SHORAD - Integrate with Mantis.miz and b/SRD - SHORAD Defense/SRD-110 - SHORAD - Integrate with Mantis/SRD-110 - SHORAD - Integrate with Mantis.miz differ diff --git a/SRD - SHORAD Defense/SRD-120 - SHORAD - Integrate with Detection/SRD-120 - SHORAD - Integrate with Detection.lua b/SRD - SHORAD Defense/SRD-120 - SHORAD - Integrate with Detection/SRD-120 - SHORAD - Integrate with Detection.lua index 35654eefcb..033b1c8a9f 100644 --- a/SRD - SHORAD Defense/SRD-120 - SHORAD - Integrate with Detection/SRD-120 - SHORAD - Integrate with Detection.lua +++ b/SRD - SHORAD Defense/SRD-120 - SHORAD - Integrate with Detection/SRD-120 - SHORAD - Integrate with Detection.lua @@ -1,36 +1,36 @@ -------------------------------------------------------------------------- --- SRD-120 - SHORAD - Integrate with Detection -------------------------------------------------------------------------- --- Documentation --- --- SHORAD: https://flightcontrol-master.github.io/MOOSE_DOCS/Documentation/Functional.Shorad.html --- --- Note: As of Feb/21, SHORAD is WIP. Needs a recent build of Moose.lua => 2.5.3 --- -------------------------------------------------------------------------- --- Observe a set Red High-Value-Target (HVT) being attacked by Blue CAS. --- Red SHORAD systems will be switched on for 10 minutes to defend against --- HARMSs and AGMs. -------------------------------------------------------------------------- --- Date: 17 Feb 2021, Updated 25 Mar 2021 -------------------------------------------------------------------------- - -local SamSet = SET_GROUP:New():FilterPrefixes("Red HVT"):FilterCoalitions("red"):FilterStart() --- usage: SHORAD:New(name, prefix, samset, radius, time, coalition) -myshorad = SHORAD:New("RedShorad", "Red SHORAD", SamSet, 22000, 600, "red") -myshorad:SwitchDebug(true) - -local dectset = SET_GROUP:New():FilterPrefixes("Red EWR"):FilterCoalitions("red"):FilterStart() -local detection = DETECTION_AREAS:New(dectset,1000) -detection:SetRefreshTimeInterval(15) -detection:SetAcceptZones(ZONE:New("Red HVT Zone")) -- defense zone around our HVT -detection:Start() - --- wake up SHORAD when we detect an attacker -function detection:OnAfterDetected(From,Event,To,Units) - for _,_unit in pairs (Units) do - local text = string.format("Unit detected: %s",_unit:GetName()) - local m = MESSAGE:New(text,10,"Info"):ToAll() - end - myshorad:WakeUpShorad("Red SHORAD", 25000, 600) +------------------------------------------------------------------------- +-- SRD-120 - SHORAD - Integrate with Detection +------------------------------------------------------------------------- +-- Documentation +-- +-- SHORAD: https://flightcontrol-master.github.io/MOOSE_DOCS/Documentation/Functional.Shorad.html +-- +-- Note: As of Feb/21, SHORAD is WIP. Needs a recent build of Moose.lua => 2.5.3 +-- +------------------------------------------------------------------------- +-- Observe a set Red High-Value-Target (HVT) being attacked by Blue CAS. +-- Red SHORAD systems will be switched on for 10 minutes to defend against +-- HARMSs and AGMs. +------------------------------------------------------------------------- +-- Date: 17 Feb 2021 +------------------------------------------------------------------------- + +local SamSet = SET_GROUP:New():FilterPrefixes("Red HVT"):FilterCoalitions("red"):FilterStart() +-- usage: SHORAD:New(name, prefix, samset, radius, time, coalition) +myshorad = SHORAD:New("RedShorad", "Red SHORAD", SamSet, 22000, 600, "red") +myshorad:SwitchDebug(true) + +local dectset = SET_GROUP:New():FilterPrefixes("Red EWR"):FilterCoalitions("red"):FilterStart() +local detection = DETECTION_AREAS:New(dectset,1000) +detection:SetRefreshTimeInterval(15) +detection:SetAcceptZones(ZONE:New("Red HVT Zone")) -- defense zone around our HVT +detection:Start() + +-- wake up SHORAD when we detect an attacker +function detection:OnAfterDetected(From,Event,To,Units) + for _,_unit in pairs (Units) do + local text = string.format("Unit detected: %s",_unit:GetName()) + local m = MESSAGE:New(text,10,"Info"):ToAll() + end + myshorad:WakeUpShorad("Red SHORAD", 25000, 600) end \ No newline at end of file diff --git a/SRD - SHORAD Defense/SRD-120 - SHORAD - Integrate with Detection/SRD-120 - SHORAD - Integrate with Detection.miz b/SRD - SHORAD Defense/SRD-120 - SHORAD - Integrate with Detection/SRD-120 - SHORAD - Integrate with Detection.miz index 926c553302..df4928c89e 100644 Binary files a/SRD - SHORAD Defense/SRD-120 - SHORAD - Integrate with Detection/SRD-120 - SHORAD - Integrate with Detection.miz and b/SRD - SHORAD Defense/SRD-120 - SHORAD - Integrate with Detection/SRD-120 - SHORAD - Integrate with Detection.miz differ diff --git a/TAD - Task Dispatching/A2A - Air 2 Air Task Dispatching/TAD-A2A-000 - AREAS - Detection test/TAD-A2A-000 - AREAS - Detection test.lua b/TAD - Task Dispatching/A2A - Air 2 Air Task Dispatching/TAD-A2A-000 - AREAS - Detection test/TAD-A2A-000 - AREAS - Detection test.lua index 75bdd7fa92..97d8b00d48 100644 --- a/TAD - Task Dispatching/A2A - Air 2 Air Task Dispatching/TAD-A2A-000 - AREAS - Detection test/TAD-A2A-000 - AREAS - Detection test.lua +++ b/TAD - Task Dispatching/A2A - Air 2 Air Task Dispatching/TAD-A2A-000 - AREAS - Detection test/TAD-A2A-000 - AREAS - Detection test.lua @@ -1,73 +1,73 @@ ---- --- Name: TAD-A2A-001 - A2A - AREAS detection test --- Author: FlightControl --- Date Created: 17 May 2017 --- --- # Situation: --- --- This mission demonstrates the dynamic task dispatching for Air to Air operations. --- Intruders are flying towards the EWR units. --- The detection method used is the DETECTION_AREAS method, which groups detected targets per detected area. --- --- # Test cases: --- --- 1. Observe the EWR's detecting targets and grouping them. --- 2. Check that the HQ provides menus to engage on a task set by the EWRs. --- -HQ = GROUP:FindByName( "HQ", "Bravo" ) - -CommandCenter = COMMANDCENTER:New( HQ, "Lima" ) - -Scoring = SCORING:New( "A2A Dispatching demo" ) - -Mission = MISSION - :New( CommandCenter, "A2A Mission", "High", "Watch the air enemy units being detected.", coalition.side.RED ) - :AddScoring( Scoring ) - -EWRSet = SET_GROUP:New():FilterPrefixes( "EWR Red" ):FilterCoalitions("red"):FilterStart() - -EWRDetection = DETECTION_AREAS:New( EWRSet, 30000 ) -EWRDetection:SetFriendliesRange( 80000 ) -EWRDetection:SetRefreshTimeInterval( 30 ) - - -AttackGroups = SET_GROUP:New():FilterCoalitions( "red" ):FilterPrefixes( "Defender" ):FilterStart() - -TaskDispatcher = TASK_A2A_DISPATCHER:New( Mission, AttackGroups, EWRDetection ) -TaskDispatcher:SetRefreshTimeInterval( 10 ) - -AIDispatcher = AI_A2A_GCICAP:New( { "EWR Blue" } ) - -BlueTemplates = { - "Defender-1", - "Defender-2" - } - -AIDispatcher:SetSquadron( "001", AIRBASE.Caucasus.Batumi, BlueTemplates, 20 ) -AIDispatcher:SetSquadronGci( "001", 600, 800 ) - -AIDispatcher:SetSquadron( "002", AIRBASE.Caucasus.Senaki_Kolkhi, BlueTemplates, 20 ) -AIDispatcher:SetSquadronGci( "002", 600, 800 ) - -AIDispatcher:SetSquadron( "003", AIRBASE.Caucasus.Kobuleti, BlueTemplates,20 ) -AIDispatcher:SetSquadronGci( "003", 600, 800 ) - -AIDispatcher:SetSquadron( "004", AIRBASE.Caucasus.Kutaisi, BlueTemplates, 20 ) -AIDispatcher:SetSquadronGci( "004", 600, 800 ) - - - - ---- @param #TaskDispatcher self --- @param From --- @param Event --- @param To --- @param Tasking.Task_A2A#TASK_A2A Task --- @param Wrapper.Unit#UNIT TaskUnit --- @param #string PlayerName -function TaskDispatcher:OnAfterAssign( From, Event, To, Task, TaskUnit, PlayerName ) - Task:SetScoreOnProgress( PlayerName, 20, TaskUnit ) - Task:SetScoreOnSuccess( PlayerName, 200, TaskUnit ) - Task:SetScoreOnFail( PlayerName, -100, TaskUnit ) -end - +--- +-- Name: TAD-A2A-001 - A2A - AREAS detection test +-- Author: FlightControl +-- Date Created: 17 May 2017 +-- +-- # Situation: +-- +-- This mission demonstrates the dynamic task dispatching for Air to Air operations. +-- Intruders are flying towards the EWR units. +-- The detection method used is the DETECTION_AREAS method, which groups detected targets per detected area. +-- +-- # Test cases: +-- +-- 1. Observe the EWR's detecting targets and grouping them. +-- 2. Check that the HQ provides menus to engage on a task set by the EWRs. +-- +HQ = GROUP:FindByName( "HQ", "Bravo" ) + +CommandCenter = COMMANDCENTER:New( HQ, "Lima" ) + +Scoring = SCORING:New( "A2A Dispatching demo" ) + +Mission = MISSION + :New( CommandCenter, "A2A Mission", "High", "Watch the air enemy units being detected.", coalition.side.RED ) + :AddScoring( Scoring ) + +EWRSet = SET_GROUP:New():FilterPrefixes( "EWR Red" ):FilterCoalitions("red"):FilterStart() + +EWRDetection = DETECTION_AREAS:New( EWRSet, 30000 ) +EWRDetection:SetFriendliesRange( 80000 ) +EWRDetection:SetRefreshTimeInterval( 30 ) + + +AttackGroups = SET_GROUP:New():FilterCoalitions( "red" ):FilterPrefixes( "Defender" ):FilterStart() + +TaskDispatcher = TASK_A2A_DISPATCHER:New( Mission, AttackGroups, EWRDetection ) +TaskDispatcher:SetRefreshTimeInterval( 10 ) + +AIDispatcher = AI_A2A_GCICAP:New( { "EWR Blue" } ) + +BlueTemplates = { + "Defender-1", + "Defender-2" + } + +AIDispatcher:SetSquadron( "001", AIRBASE.Caucasus.Batumi, BlueTemplates, 20 ) +AIDispatcher:SetSquadronGci( "001", 600, 800 ) + +AIDispatcher:SetSquadron( "002", AIRBASE.Caucasus.Senaki_Kolkhi, BlueTemplates, 20 ) +AIDispatcher:SetSquadronGci( "002", 600, 800 ) + +AIDispatcher:SetSquadron( "003", AIRBASE.Caucasus.Kobuleti, BlueTemplates,20 ) +AIDispatcher:SetSquadronGci( "003", 600, 800 ) + +AIDispatcher:SetSquadron( "004", AIRBASE.Caucasus.Kutaisi, BlueTemplates, 20 ) +AIDispatcher:SetSquadronGci( "004", 600, 800 ) + + + + +--- @param #TaskDispatcher self +-- @param From +-- @param Event +-- @param To +-- @param Tasking.Task_A2A#TASK_A2A Task +-- @param Wrapper.Unit#UNIT TaskUnit +-- @param #string PlayerName +function TaskDispatcher:OnAfterAssign( From, Event, To, Task, TaskUnit, PlayerName ) + Task:SetScoreOnProgress( PlayerName, 20, TaskUnit ) + Task:SetScoreOnSuccess( PlayerName, 200, TaskUnit ) + Task:SetScoreOnFail( PlayerName, -100, TaskUnit ) +end + diff --git a/TAD - Task Dispatching/A2A - Air 2 Air Task Dispatching/TAD-A2A-000 - AREAS - Detection test/TAD-A2A-000 - AREAS - Detection test.miz b/TAD - Task Dispatching/A2A - Air 2 Air Task Dispatching/TAD-A2A-000 - AREAS - Detection test/TAD-A2A-000 - AREAS - Detection test.miz index 6ebc829622..22082b705a 100644 Binary files a/TAD - Task Dispatching/A2A - Air 2 Air Task Dispatching/TAD-A2A-000 - AREAS - Detection test/TAD-A2A-000 - AREAS - Detection test.miz and b/TAD - Task Dispatching/A2A - Air 2 Air Task Dispatching/TAD-A2A-000 - AREAS - Detection test/TAD-A2A-000 - AREAS - Detection test.miz differ diff --git a/TAD - Task Dispatching/A2A - Air 2 Air Task Dispatching/TAD-A2A-010 - AREAS - Intercept Task/TAD-A2A-010 - AREAS - Intercept Task.lua b/TAD - Task Dispatching/A2A - Air 2 Air Task Dispatching/TAD-A2A-010 - AREAS - Intercept Task/TAD-A2A-010 - AREAS - Intercept Task.lua index 3cdd368d54..f86d8dce1f 100644 --- a/TAD - Task Dispatching/A2A - Air 2 Air Task Dispatching/TAD-A2A-010 - AREAS - Intercept Task/TAD-A2A-010 - AREAS - Intercept Task.lua +++ b/TAD - Task Dispatching/A2A - Air 2 Air Task Dispatching/TAD-A2A-010 - AREAS - Intercept Task/TAD-A2A-010 - AREAS - Intercept Task.lua @@ -1,36 +1,36 @@ ---- --- Name: TAD-A2A-010 - AREAS - Intercept Task --- Author: FlightControl --- Date Created: 13 Mar 2017 --- --- This mission demonstrates the dynamic task dispatching for Air to Air operations. --- Intruders are flying towards the EWR units. --- The detection method used is the DETECTION_AREAS method, which groups detected targets per detected area. --- --- Observe the planes flying towards the EWR. --- Upon detection, an INTERCEPT task should be created. --- Join the task and destroy the intruders. --- Check if the task is successful after destroying the target. --- --- -local HQ = GROUP:FindByName( "HQ", "Bravo" ) - -local CommandCenter = COMMANDCENTER:New( HQ, "Bravo" ) - -local Scoring = SCORING:New( "A2A Dispatching Demo" ) - -local Mission = MISSION - :New( CommandCenter, "A2A Intercept Mission", "Primary", "INTERCEPT Task Test. Observe the planes flying towards the EWR. Upon detection, an INTERCEPT task should be created. Join the task and destroy the intruders.Check if the task is successful after destroying the target.", coalition.side.RED ) - :AddScoring( Scoring ) - -local EWRSet = SET_GROUP:New():FilterPrefixes( "EWR" ):FilterCoalitions("red"):FilterStart() - -local EWRDetection = DETECTION_AREAS:New( EWRSet, 6000 ) -EWRDetection:SetFriendliesRange( 10000 ) -EWRDetection:SetRefreshTimeInterval( 10 ) - - -local AttackGroups = SET_GROUP:New():FilterCoalitions( "red" ):FilterPrefixes( "Attack" ):FilterStart() - -TaskDispatcher = TASK_A2A_DISPATCHER:New( Mission, AttackGroups, EWRDetection ) -TaskDispatcher:SetRefreshTimeInterval( 10 ) +--- +-- Name: TAD-A2A-010 - AREAS - Intercept Task +-- Author: FlightControl +-- Date Created: 13 Mar 2017 +-- +-- This mission demonstrates the dynamic task dispatching for Air to Air operations. +-- Intruders are flying towards the EWR units. +-- The detection method used is the DETECTION_AREAS method, which groups detected targets per detected area. +-- +-- Observe the planes flying towards the EWR. +-- Upon detection, an INTERCEPT task should be created. +-- Join the task and destroy the intruders. +-- Check if the task is successful after destroying the target. +-- +-- +local HQ = GROUP:FindByName( "HQ", "Bravo" ) + +local CommandCenter = COMMANDCENTER:New( HQ, "Bravo" ) + +local Scoring = SCORING:New( "A2A Dispatching Demo" ) + +local Mission = MISSION + :New( CommandCenter, "A2A Intercept Mission", "Primary", "INTERCEPT Task Test. Observe the planes flying towards the EWR. Upon detection, an INTERCEPT task should be created. Join the task and destroy the intruders.Check if the task is successful after destroying the target.", coalition.side.RED ) + :AddScoring( Scoring ) + +local EWRSet = SET_GROUP:New():FilterPrefixes( "EWR" ):FilterCoalitions("red"):FilterStart() + +local EWRDetection = DETECTION_AREAS:New( EWRSet, 6000 ) +EWRDetection:SetFriendliesRange( 10000 ) +EWRDetection:SetRefreshTimeInterval( 10 ) + + +local AttackGroups = SET_GROUP:New():FilterCoalitions( "red" ):FilterPrefixes( "Attack" ):FilterStart() + +TaskDispatcher = TASK_A2A_DISPATCHER:New( Mission, AttackGroups, EWRDetection ) +TaskDispatcher:SetRefreshTimeInterval( 10 ) diff --git a/TAD - Task Dispatching/A2A - Air 2 Air Task Dispatching/TAD-A2A-010 - AREAS - Intercept Task/TAD-A2A-010 - AREAS - Intercept Task.miz b/TAD - Task Dispatching/A2A - Air 2 Air Task Dispatching/TAD-A2A-010 - AREAS - Intercept Task/TAD-A2A-010 - AREAS - Intercept Task.miz index e865d55b28..0b75dfaec7 100644 Binary files a/TAD - Task Dispatching/A2A - Air 2 Air Task Dispatching/TAD-A2A-010 - AREAS - Intercept Task/TAD-A2A-010 - AREAS - Intercept Task.miz and b/TAD - Task Dispatching/A2A - Air 2 Air Task Dispatching/TAD-A2A-010 - AREAS - Intercept Task/TAD-A2A-010 - AREAS - Intercept Task.miz differ diff --git a/TAD - Task Dispatching/A2A - Air 2 Air Task Dispatching/TAD-A2A-020 - AREAS - Sweep Task/TAD-A2A-020 - AREAS - Sweep Task.lua b/TAD - Task Dispatching/A2A - Air 2 Air Task Dispatching/TAD-A2A-020 - AREAS - Sweep Task/TAD-A2A-020 - AREAS - Sweep Task.lua index 1b626ac2d5..79cb118ce5 100644 --- a/TAD - Task Dispatching/A2A - Air 2 Air Task Dispatching/TAD-A2A-020 - AREAS - Sweep Task/TAD-A2A-020 - AREAS - Sweep Task.lua +++ b/TAD - Task Dispatching/A2A - Air 2 Air Task Dispatching/TAD-A2A-020 - AREAS - Sweep Task/TAD-A2A-020 - AREAS - Sweep Task.lua @@ -1,47 +1,47 @@ ---- --- Name: TAD-A2A-020 - AREAS - Sweep Task --- Author: FlightControl --- Date Created: 17 May 2017 --- --- # Situation: --- --- This mission demonstrates the dynamic task dispatching for Air to Air operations. --- Intruders are flying towards the EWR units. --- The detection method used is the DETECTION_AREAS method, which groups detected targets per detected area. --- --- # Test cases: --- --- Observe the EWR's detecting targets and grouping them. --- Check that the HQ provides menus to engage on a task set by the EWRs. --- Once the intruder is detected, an INTERCEPT task is created. --- Observe that it goes back into the mountains. --- And the task should return to a SWEEP task. --- -local HQ = GROUP:FindByName( "HQ", "Bravo" ) - -local CommandCenter = COMMANDCENTER:New( HQ, "Bravo" ) - -local Scoring = SCORING:New( "A2A Dispatching Demo" ) - -local Mission = MISSION - :New( CommandCenter, "A2A Sweep Mission", "Primary", - "SWEEP Task Test. " .. - "Observe the EWR's detecting targets and grouping them. " .. - "Check that the HQ provides menus to engage on a task set by the EWRs. " .. - "Once the intruder is detected, an INTERCEPT task is created. " .. - "Observe that it goes back into the mountains. " .. - "And the task should return to a SWEEP task.", - coalition.side.RED ) - :AddScoring( Scoring ) - -local EWRSet = SET_GROUP:New():FilterPrefixes( "EWR" ):FilterCoalitions("red"):FilterStart() - -local EWRDetection = DETECTION_AREAS:New( EWRSet, 6000 ) -EWRDetection:SetFriendliesRange( 10000 ) -EWRDetection:SetRefreshTimeInterval(30) - - -local AttackGroups = SET_GROUP:New():FilterCoalitions( "red" ):FilterPrefixes( "Attack" ):FilterStart() - -TaskDispatcher = TASK_A2A_DISPATCHER:New( Mission, AttackGroups, EWRDetection ) -TaskDispatcher:SetRefreshTimeInterval( 10 ) +--- +-- Name: TAD-A2A-020 - AREAS - Sweep Task +-- Author: FlightControl +-- Date Created: 17 May 2017 +-- +-- # Situation: +-- +-- This mission demonstrates the dynamic task dispatching for Air to Air operations. +-- Intruders are flying towards the EWR units. +-- The detection method used is the DETECTION_AREAS method, which groups detected targets per detected area. +-- +-- # Test cases: +-- +-- Observe the EWR's detecting targets and grouping them. +-- Check that the HQ provides menus to engage on a task set by the EWRs. +-- Once the intruder is detected, an INTERCEPT task is created. +-- Observe that it goes back into the mountains. +-- And the task should return to a SWEEP task. +-- +local HQ = GROUP:FindByName( "HQ", "Bravo" ) + +local CommandCenter = COMMANDCENTER:New( HQ, "Bravo" ) + +local Scoring = SCORING:New( "A2A Dispatching Demo" ) + +local Mission = MISSION + :New( CommandCenter, "A2A Sweep Mission", "Primary", + "SWEEP Task Test. " .. + "Observe the EWR's detecting targets and grouping them. " .. + "Check that the HQ provides menus to engage on a task set by the EWRs. " .. + "Once the intruder is detected, an INTERCEPT task is created. " .. + "Observe that it goes back into the mountains. " .. + "And the task should return to a SWEEP task.", + coalition.side.RED ) + :AddScoring( Scoring ) + +local EWRSet = SET_GROUP:New():FilterPrefixes( "EWR" ):FilterCoalitions("red"):FilterStart() + +local EWRDetection = DETECTION_AREAS:New( EWRSet, 6000 ) +EWRDetection:SetFriendliesRange( 10000 ) +EWRDetection:SetRefreshTimeInterval(30) + + +local AttackGroups = SET_GROUP:New():FilterCoalitions( "red" ):FilterPrefixes( "Attack" ):FilterStart() + +TaskDispatcher = TASK_A2A_DISPATCHER:New( Mission, AttackGroups, EWRDetection ) +TaskDispatcher:SetRefreshTimeInterval( 10 ) diff --git a/TAD - Task Dispatching/A2A - Air 2 Air Task Dispatching/TAD-A2A-020 - AREAS - Sweep Task/TAD-A2A-020 - AREAS - Sweep Task.miz b/TAD - Task Dispatching/A2A - Air 2 Air Task Dispatching/TAD-A2A-020 - AREAS - Sweep Task/TAD-A2A-020 - AREAS - Sweep Task.miz index ab62fe8daf..f7d9cc449e 100644 Binary files a/TAD - Task Dispatching/A2A - Air 2 Air Task Dispatching/TAD-A2A-020 - AREAS - Sweep Task/TAD-A2A-020 - AREAS - Sweep Task.miz and b/TAD - Task Dispatching/A2A - Air 2 Air Task Dispatching/TAD-A2A-020 - AREAS - Sweep Task/TAD-A2A-020 - AREAS - Sweep Task.miz differ diff --git a/TAD - Task Dispatching/A2G - Air 2 Ground Task Dispatching/TAD-A2G-000 - AREAS - Detection test/TAD-A2G-000 - AREAS - Detection test.lua b/TAD - Task Dispatching/A2G - Air 2 Ground Task Dispatching/TAD-A2G-000 - AREAS - Detection test/TAD-A2G-000 - AREAS - Detection test.lua index 0c1c246ba6..7aa2ff8131 100644 --- a/TAD - Task Dispatching/A2G - Air 2 Ground Task Dispatching/TAD-A2G-000 - AREAS - Detection test/TAD-A2G-000 - AREAS - Detection test.lua +++ b/TAD - Task Dispatching/A2G - Air 2 Ground Task Dispatching/TAD-A2G-000 - AREAS - Detection test/TAD-A2G-000 - AREAS - Detection test.lua @@ -1,51 +1,51 @@ - --- --- Name: TAD-A2G-000 - AREAS - Detection test --- Author: FlightControl --- Date Created: 15 Mar 2018 --- --- # Situation: --- --- This mission demonstrates the dynamic task dispatching for Air to Ground operations. --- Reconnassance vehicles are placed at strategic locations, scanning for the enemy locations. --- The detection method used is the DETECTION_AREAS method, which groups detected targets into areas. --- The AttackSet will engage upon the enemy, which is a Set of Groups seated by Players. --- A2G Tasks are being dispatched to the Players as enemy locations are being detected by the Recce. --- Observe that A2G Tasks are being dispatched to the player. - - --- Declare the Command Center -local HQ = GROUP - :FindByName( "HQ", "Bravo HQ" ) - -local CommandCenter = COMMANDCENTER - :New( HQ, "Lima" ) -- Create the CommandCenter. - --- Declare the Mission for the Command Center. -local Mission = MISSION - :New( CommandCenter, "Overlord", "High", "Attack Detect Mission Briefing", coalition.side.RED ) -- Create the Mission. - --- Define the RecceSet that will detect the enemy. -local RecceSet = SET_GROUP - :New() -- Create the RecceSet, which is the set of groups detecting the enemy locations. - :FilterPrefixes( "Recce" ) -- All Recce groups start with the name "Recce". - :FilterCoalitions("red") -- only the red coalition. - :FilterStart() -- Start the dynamic building of the set. - --- Setup the detection. We use DETECTION_AREAS to detect and group the enemies. -local DetectionAreas = DETECTION_AREAS - :New( RecceSet, 3000 ) -- The RecceSet will detect the enemies, and group them into areas of a 3 km radius. - --- Setup the AttackSet, which is a SET_GROUP. --- The SET_GROUP is a dynamic collection of GROUP objects. -local AttackSet = SET_GROUP - :New() -- Create the SET_GROUP object. - :FilterCoalitions( "red" ) -- Only incorporate the RED coalitions. - :FilterPrefixes( "Attack" ) -- Only incorporate groups that start with the name Attack. - :FilterStart() -- Start the dynamic building of the set. - --- Now we have everything to setup the main A2G TaskDispatcher. -TaskDispatcher = TASK_A2G_DISPATCHER - :New( Mission, AttackSet, DetectionAreas ) -- We assign the TaskDispatcher under Mission. The AttackSet will engage the enemy and will recieve the dispatched Tasks. The DetectionAreas will report any detected enemies to the TaskDispatcher. - --- We use the MISSILETRAINER for demonstration purposes. -MissileTrainer = MISSILETRAINER:New( 100, "Missiles will be destroyed for training when they reach your plane." ) + --- +-- Name: TAD-A2G-000 - AREAS - Detection test +-- Author: FlightControl +-- Date Created: 15 Mar 2018 +-- +-- # Situation: +-- +-- This mission demonstrates the dynamic task dispatching for Air to Ground operations. +-- Reconnassance vehicles are placed at strategic locations, scanning for the enemy locations. +-- The detection method used is the DETECTION_AREAS method, which groups detected targets into areas. +-- The AttackSet will engage upon the enemy, which is a Set of Groups seated by Players. +-- A2G Tasks are being dispatched to the Players as enemy locations are being detected by the Recce. +-- Observe that A2G Tasks are being dispatched to the player. + + +-- Declare the Command Center +local HQ = GROUP + :FindByName( "HQ", "Bravo HQ" ) + +local CommandCenter = COMMANDCENTER + :New( HQ, "Lima" ) -- Create the CommandCenter. + +-- Declare the Mission for the Command Center. +local Mission = MISSION + :New( CommandCenter, "Overlord", "High", "Attack Detect Mission Briefing", coalition.side.RED ) -- Create the Mission. + +-- Define the RecceSet that will detect the enemy. +local RecceSet = SET_GROUP + :New() -- Create the RecceSet, which is the set of groups detecting the enemy locations. + :FilterPrefixes( "Recce" ) -- All Recce groups start with the name "Recce". + :FilterCoalitions("red") -- only the red coalition. + :FilterStart() -- Start the dynamic building of the set. + +-- Setup the detection. We use DETECTION_AREAS to detect and group the enemies. +local DetectionAreas = DETECTION_AREAS + :New( RecceSet, 3000 ) -- The RecceSet will detect the enemies, and group them into areas of a 3 km radius. + +-- Setup the AttackSet, which is a SET_GROUP. +-- The SET_GROUP is a dynamic collection of GROUP objects. +local AttackSet = SET_GROUP + :New() -- Create the SET_GROUP object. + :FilterCoalitions( "red" ) -- Only incorporate the RED coalitions. + :FilterPrefixes( "Attack" ) -- Only incorporate groups that start with the name Attack. + :FilterStart() -- Start the dynamic building of the set. + +-- Now we have everything to setup the main A2G TaskDispatcher. +TaskDispatcher = TASK_A2G_DISPATCHER + :New( Mission, AttackSet, DetectionAreas ) -- We assign the TaskDispatcher under Mission. The AttackSet will engage the enemy and will recieve the dispatched Tasks. The DetectionAreas will report any detected enemies to the TaskDispatcher. + +-- We use the MISSILETRAINER for demonstration purposes. +MissileTrainer = MISSILETRAINER:New( 100, "Missiles will be destroyed for training when they reach your plane." ) diff --git a/TAD - Task Dispatching/A2G - Air 2 Ground Task Dispatching/TAD-A2G-000 - AREAS - Detection test/TAD-A2G-000 - AREAS - Detection test.miz b/TAD - Task Dispatching/A2G - Air 2 Ground Task Dispatching/TAD-A2G-000 - AREAS - Detection test/TAD-A2G-000 - AREAS - Detection test.miz index 8557bfb7a2..893dcf1927 100644 Binary files a/TAD - Task Dispatching/A2G - Air 2 Ground Task Dispatching/TAD-A2G-000 - AREAS - Detection test/TAD-A2G-000 - AREAS - Detection test.miz and b/TAD - Task Dispatching/A2G - Air 2 Ground Task Dispatching/TAD-A2G-000 - AREAS - Detection test/TAD-A2G-000 - AREAS - Detection test.miz differ diff --git a/TAD - Task Dispatching/A2G - Air 2 Ground Task Dispatching/TAD-A2G-001 - AREAS - Destroy Test/TAD-A2G-001 - AREAS - Destroy Test.lua b/TAD - Task Dispatching/A2G - Air 2 Ground Task Dispatching/TAD-A2G-001 - AREAS - Destroy Test/TAD-A2G-001 - AREAS - Destroy Test.lua index aea23069d0..e727a85123 100644 --- a/TAD - Task Dispatching/A2G - Air 2 Ground Task Dispatching/TAD-A2G-001 - AREAS - Destroy Test/TAD-A2G-001 - AREAS - Destroy Test.lua +++ b/TAD - Task Dispatching/A2G - Air 2 Ground Task Dispatching/TAD-A2G-001 - AREAS - Destroy Test/TAD-A2G-001 - AREAS - Destroy Test.lua @@ -1,52 +1,52 @@ - --- --- Name: TAD-A2G-001 - AREAS - Destroy Test --- Author: FlightControl --- Date Created: 15 Mar 2018 --- --- This mission demonstrates the dynamic task dispatching for Air to Ground operations. --- Reconnassance vehicles are placed at strategic locations, scanning for the enemy locations. --- The detection method used is the DETECTION_AREAS method, which groups detected targets into areas. --- The AttackSet will engage upon the enemy, which is a Set of Groups seated by Players. --- A2G Tasks are being dispatched to the Players as enemy locations are being detected by the Recce. --- Observe that A2G Tasks are being dispatched to the player. --- Get seated in the Attack Plane, there is also an AI with you, who will attack the ground targets. --- Join the A2G Task that was dispatched to you. --- Once the AI in your group destroys the target, you should see that the A2G task got success. - - --- Declare the Command Center -local HQ = GROUP - :FindByName( "HQ", "Bravo HQ" ) - -local CommandCenter = COMMANDCENTER - :New( HQ, "Lima" ) -- Create the CommandCenter. - --- Declare the Mission for the Command Center. -local Mission = MISSION - :New( CommandCenter, "Overlord", "High", "Attack Detect Mission Briefing", coalition.side.RED ) -- Create the Mission. - --- Define the RecceSet that will detect the enemy. -local RecceSet = SET_GROUP - :New() -- Create the RecceSet, which is the set of groups detecting the enemy locations. - :FilterPrefixes( "Recce" ) -- All Recce groups start with the name "Recce". - :FilterCoalitions("red") -- only the red coalition. - :FilterStart() -- Start the dynamic building of the set. - --- Setup the detection. We use DETECTION_AREAS to detect and group the enemies. -local DetectionAreas = DETECTION_AREAS - :New( RecceSet, 3000 ) -- The RecceSet will detect the enemies, and group them into areas of a 3 km radius. - --- Setup the AttackSet, which is a SET_GROUP. --- The SET_GROUP is a dynamic collection of GROUP objects. -local AttackSet = SET_GROUP - :New() -- Create the SET_GROUP object. - :FilterCoalitions( "red" ) -- Only incorporate the RED coalitions. - :FilterPrefixes( "Attack" ) -- Only incorporate groups that start with the name Attack. - :FilterStart() -- Start the dynamic building of the set. - --- Now we have everything to setup the main A2G TaskDispatcher. -TaskDispatcher = TASK_A2G_DISPATCHER - :New( Mission, AttackSet, DetectionAreas ) -- We assign the TaskDispatcher under Mission. The AttackSet will engage the enemy and will recieve the dispatched Tasks. The DetectionAreas will report any detected enemies to the TaskDispatcher. - --- We use the MISSILETRAINER for demonstration purposes. -MissileTrainer = MISSILETRAINER:New( 100, "Missiles will be destroyed for training when they reach your plane." ) + --- +-- Name: TAD-A2G-001 - AREAS - Destroy Test +-- Author: FlightControl +-- Date Created: 15 Mar 2018 +-- +-- This mission demonstrates the dynamic task dispatching for Air to Ground operations. +-- Reconnassance vehicles are placed at strategic locations, scanning for the enemy locations. +-- The detection method used is the DETECTION_AREAS method, which groups detected targets into areas. +-- The AttackSet will engage upon the enemy, which is a Set of Groups seated by Players. +-- A2G Tasks are being dispatched to the Players as enemy locations are being detected by the Recce. +-- Observe that A2G Tasks are being dispatched to the player. +-- Get seated in the Attack Plane, there is also an AI with you, who will attack the ground targets. +-- Join the A2G Task that was dispatched to you. +-- Once the AI in your group destroys the target, you should see that the A2G task got success. + + +-- Declare the Command Center +local HQ = GROUP + :FindByName( "HQ", "Bravo HQ" ) + +local CommandCenter = COMMANDCENTER + :New( HQ, "Lima" ) -- Create the CommandCenter. + +-- Declare the Mission for the Command Center. +local Mission = MISSION + :New( CommandCenter, "Overlord", "High", "Attack Detect Mission Briefing", coalition.side.RED ) -- Create the Mission. + +-- Define the RecceSet that will detect the enemy. +local RecceSet = SET_GROUP + :New() -- Create the RecceSet, which is the set of groups detecting the enemy locations. + :FilterPrefixes( "Recce" ) -- All Recce groups start with the name "Recce". + :FilterCoalitions("red") -- only the red coalition. + :FilterStart() -- Start the dynamic building of the set. + +-- Setup the detection. We use DETECTION_AREAS to detect and group the enemies. +local DetectionAreas = DETECTION_AREAS + :New( RecceSet, 3000 ) -- The RecceSet will detect the enemies, and group them into areas of a 3 km radius. + +-- Setup the AttackSet, which is a SET_GROUP. +-- The SET_GROUP is a dynamic collection of GROUP objects. +local AttackSet = SET_GROUP + :New() -- Create the SET_GROUP object. + :FilterCoalitions( "red" ) -- Only incorporate the RED coalitions. + :FilterPrefixes( "Attack" ) -- Only incorporate groups that start with the name Attack. + :FilterStart() -- Start the dynamic building of the set. + +-- Now we have everything to setup the main A2G TaskDispatcher. +TaskDispatcher = TASK_A2G_DISPATCHER + :New( Mission, AttackSet, DetectionAreas ) -- We assign the TaskDispatcher under Mission. The AttackSet will engage the enemy and will recieve the dispatched Tasks. The DetectionAreas will report any detected enemies to the TaskDispatcher. + +-- We use the MISSILETRAINER for demonstration purposes. +MissileTrainer = MISSILETRAINER:New( 100, "Missiles will be destroyed for training when they reach your plane." ) diff --git a/TAD - Task Dispatching/A2G - Air 2 Ground Task Dispatching/TAD-A2G-001 - AREAS - Destroy Test/TAD-A2G-001 - AREAS - Destroy Test.miz b/TAD - Task Dispatching/A2G - Air 2 Ground Task Dispatching/TAD-A2G-001 - AREAS - Destroy Test/TAD-A2G-001 - AREAS - Destroy Test.miz index efce96b216..5847c489c5 100644 Binary files a/TAD - Task Dispatching/A2G - Air 2 Ground Task Dispatching/TAD-A2G-001 - AREAS - Destroy Test/TAD-A2G-001 - AREAS - Destroy Test.miz and b/TAD - Task Dispatching/A2G - Air 2 Ground Task Dispatching/TAD-A2G-001 - AREAS - Destroy Test/TAD-A2G-001 - AREAS - Destroy Test.miz differ diff --git a/TAD - Task Dispatching/A2G - Air 2 Ground Task Dispatching/TAD-A2G-002 - AREAS - Task Success Test/TAD-A2G-002 - AREAS - Task Success Test.lua b/TAD - Task Dispatching/A2G - Air 2 Ground Task Dispatching/TAD-A2G-002 - AREAS - Task Success Test/TAD-A2G-002 - AREAS - Task Success Test.lua index 9376e92086..9f251ac838 100644 --- a/TAD - Task Dispatching/A2G - Air 2 Ground Task Dispatching/TAD-A2G-002 - AREAS - Task Success Test/TAD-A2G-002 - AREAS - Task Success Test.lua +++ b/TAD - Task Dispatching/A2G - Air 2 Ground Task Dispatching/TAD-A2G-002 - AREAS - Task Success Test/TAD-A2G-002 - AREAS - Task Success Test.lua @@ -1,66 +1,66 @@ - --- --- Name: TAD-A2G-002 - AREAS - Task Success Test --- Author: FlightControl --- Date Created: 15 Mar 2018 --- --- This mission demonstrates the dynamic task dispatching for Air to Ground operations. --- Reconnassance vehicles are placed at strategic locations, scanning for the enemy locations. --- The detection method used is the DETECTION_AREAS method, which groups detected targets into areas. --- The AttackSet will engage upon the enemy, which is a Set of Groups seated by Players. --- A2G Tasks are being dispatched to the Players as enemy locations are being detected by the Recce. --- Observe that A2G Tasks are being dispatched to the player. --- Get seated in the Attack Plane, there is also an AI with you, who will attack the ground targets. --- Join the A2G Task that was dispatched to you. --- Once the AI in your group destroys the target, you should see that the A2G task got success. - - --- Declare the Command Center -local HQ = GROUP - :FindByName( "HQ", "Bravo HQ" ) - -local CommandCenter = COMMANDCENTER - :New( HQ, "Lima" ) -- Create the CommandCenter. - --- Declare the Mission for the Command Center. -local Mission = MISSION - :New( CommandCenter, "Overlord", "High", "Attack Detect Mission Briefing", coalition.side.RED ) -- Create the Mission. - --- Define the RecceSet that will detect the enemy. -local RecceSet = SET_GROUP - :New() -- Create the RecceSet, which is the set of groups detecting the enemy locations. - :FilterPrefixes( "Recce" ) -- All Recce groups start with the name "Recce". - :FilterCoalitions("red") -- only the red coalition. - :FilterStart() -- Start the dynamic building of the set. - --- Setup the detection. We use DETECTION_AREAS to detect and group the enemies. -local DetectionAreas = DETECTION_AREAS - :New( RecceSet, 3000 ) -- The RecceSet will detect the enemies, and group them into areas of a 3 km radius. - --- Setup the AttackSet, which is a SET_GROUP. --- The SET_GROUP is a dynamic collection of GROUP objects. -local AttackSet = SET_GROUP - :New() -- Create the SET_GROUP object. - :FilterCoalitions( "red" ) -- Only incorporate the RED coalitions. - :FilterPrefixes( "Attack" ) -- Only incorporate groups that start with the name Attack. - :FilterStart() -- Start the dynamic building of the set. - --- Now we have everything to setup the main A2G TaskDispatcher. -TaskDispatcher = TASK_A2G_DISPATCHER - :New( Mission, AttackSet, DetectionAreas ) -- We assign the TaskDispatcher under Mission. The AttackSet will engage the enemy and will recieve the dispatched Tasks. The DetectionAreas will report any detected enemies to the TaskDispatcher. - - - ---- Success Handler OnAfter for TaskDispatcher --- @function [parent=#TaskDispatcher] OnAfterSuccess --- @param #TaskDispatcher self --- @param #string From --- @param #string Event --- @param #string To --- @param Tasking.Task#TASK Task -function TaskDispatcher:OnAfterSuccess( From, Event, To, Task ) - self:E( "Task Success!!!" ) -end - - --- We use the MISSILETRAINER for demonstration purposes. -MissileTrainer = MISSILETRAINER:New( 100, "Missiles will be destroyed for training when they reach your plane." ) + --- +-- Name: TAD-A2G-002 - AREAS - Task Success Test +-- Author: FlightControl +-- Date Created: 15 Mar 2018 +-- +-- This mission demonstrates the dynamic task dispatching for Air to Ground operations. +-- Reconnassance vehicles are placed at strategic locations, scanning for the enemy locations. +-- The detection method used is the DETECTION_AREAS method, which groups detected targets into areas. +-- The AttackSet will engage upon the enemy, which is a Set of Groups seated by Players. +-- A2G Tasks are being dispatched to the Players as enemy locations are being detected by the Recce. +-- Observe that A2G Tasks are being dispatched to the player. +-- Get seated in the Attack Plane, there is also an AI with you, who will attack the ground targets. +-- Join the A2G Task that was dispatched to you. +-- Once the AI in your group destroys the target, you should see that the A2G task got success. + + +-- Declare the Command Center +local HQ = GROUP + :FindByName( "HQ", "Bravo HQ" ) + +local CommandCenter = COMMANDCENTER + :New( HQ, "Lima" ) -- Create the CommandCenter. + +-- Declare the Mission for the Command Center. +local Mission = MISSION + :New( CommandCenter, "Overlord", "High", "Attack Detect Mission Briefing", coalition.side.RED ) -- Create the Mission. + +-- Define the RecceSet that will detect the enemy. +local RecceSet = SET_GROUP + :New() -- Create the RecceSet, which is the set of groups detecting the enemy locations. + :FilterPrefixes( "Recce" ) -- All Recce groups start with the name "Recce". + :FilterCoalitions("red") -- only the red coalition. + :FilterStart() -- Start the dynamic building of the set. + +-- Setup the detection. We use DETECTION_AREAS to detect and group the enemies. +local DetectionAreas = DETECTION_AREAS + :New( RecceSet, 3000 ) -- The RecceSet will detect the enemies, and group them into areas of a 3 km radius. + +-- Setup the AttackSet, which is a SET_GROUP. +-- The SET_GROUP is a dynamic collection of GROUP objects. +local AttackSet = SET_GROUP + :New() -- Create the SET_GROUP object. + :FilterCoalitions( "red" ) -- Only incorporate the RED coalitions. + :FilterPrefixes( "Attack" ) -- Only incorporate groups that start with the name Attack. + :FilterStart() -- Start the dynamic building of the set. + +-- Now we have everything to setup the main A2G TaskDispatcher. +TaskDispatcher = TASK_A2G_DISPATCHER + :New( Mission, AttackSet, DetectionAreas ) -- We assign the TaskDispatcher under Mission. The AttackSet will engage the enemy and will recieve the dispatched Tasks. The DetectionAreas will report any detected enemies to the TaskDispatcher. + + + +--- Success Handler OnAfter for TaskDispatcher +-- @function [parent=#TaskDispatcher] OnAfterSuccess +-- @param #TaskDispatcher self +-- @param #string From +-- @param #string Event +-- @param #string To +-- @param Tasking.Task#TASK Task +function TaskDispatcher:OnAfterSuccess( From, Event, To, Task ) + self:E( "Task Success!!!" ) +end + + +-- We use the MISSILETRAINER for demonstration purposes. +MissileTrainer = MISSILETRAINER:New( 100, "Missiles will be destroyed for training when they reach your plane." ) diff --git a/TAD - Task Dispatching/A2G - Air 2 Ground Task Dispatching/TAD-A2G-002 - AREAS - Task Success Test/TAD-A2G-002 - AREAS - Task Success Test.miz b/TAD - Task Dispatching/A2G - Air 2 Ground Task Dispatching/TAD-A2G-002 - AREAS - Task Success Test/TAD-A2G-002 - AREAS - Task Success Test.miz index 01d3c9e4bd..8f04a8a82e 100644 Binary files a/TAD - Task Dispatching/A2G - Air 2 Ground Task Dispatching/TAD-A2G-002 - AREAS - Task Success Test/TAD-A2G-002 - AREAS - Task Success Test.miz and b/TAD - Task Dispatching/A2G - Air 2 Ground Task Dispatching/TAD-A2G-002 - AREAS - Task Success Test/TAD-A2G-002 - AREAS - Task Success Test.miz differ diff --git a/TAD - Task Dispatching/A2G - Air 2 Ground Task Dispatching/TAD-A2G-010 - AREAS - Split SEAD to BAI and SEAD/TAD-A2G-010 - AREAS - Split SEAD to BAI and SEAD.lua b/TAD - Task Dispatching/A2G - Air 2 Ground Task Dispatching/TAD-A2G-010 - AREAS - Split SEAD to BAI and SEAD/TAD-A2G-010 - AREAS - Split SEAD to BAI and SEAD.lua index bc1b6964a1..cefac732f2 100644 --- a/TAD - Task Dispatching/A2G - Air 2 Ground Task Dispatching/TAD-A2G-010 - AREAS - Split SEAD to BAI and SEAD/TAD-A2G-010 - AREAS - Split SEAD to BAI and SEAD.lua +++ b/TAD - Task Dispatching/A2G - Air 2 Ground Task Dispatching/TAD-A2G-010 - AREAS - Split SEAD to BAI and SEAD/TAD-A2G-010 - AREAS - Split SEAD to BAI and SEAD.lua @@ -1,50 +1,50 @@ --- Name: TAD-A2G-010 - AREAS - Split SEAD to BAI and SEAD --- Author: FlightControl --- Date Created: 05 Dec 2017 --- --- This mission demonstrates the dynamic task dispatching for Air to Ground operations. --- This test is about a SEAD task, dispatched, that is split into a SEAD and BAI task, when units are moving away from the zone. --- While the units are moving away, monitor if the task is correctly split into a SEAD and BAI task! --- This is only applicable for AREA detections. Other detection methods won't have this dynamic. - --- Declare the Command Center -local HQ = GROUP - :FindByName( "HQ", "Bravo HQ" ) - -local CommandCenter = COMMANDCENTER - :New( HQ, "Lima" ) -- Create the CommandCenter. - --- Declare the Mission for the Command Center. -local Mission = MISSION - :New( CommandCenter, "Overlord", "High", - "This mission demonstrates the dynamic task dispatching for Air to Ground operations. " .. - "This test is about a SEAD task, dispatched, that is split into a SEAD and BAI task, when units are moving away from the zone. " .. - "While the units are moving away, monitor if the task is correctly split into a SEAD and BAI task! " .. - "This is only applicable for AREA detections. Other detection methods won't have this dynamic.", - coalition.side.RED ) -- Create the Mission. - --- Define the RecceSet that will detect the enemy. -local RecceSet = SET_GROUP - :New() -- Create the RecceSet, which is the set of groups detecting the enemy locations. - :FilterPrefixes( "Recce" ) -- All Recce groups start with the name "Recce". - :FilterCoalitions("red") -- only the red coalition. - :FilterStart() -- Start the dynamic building of the set. - --- Setup the detection. We use DETECTION_AREAS to detect and group the enemies. -local DetectionAreas = DETECTION_AREAS - :New( RecceSet, 3000 ) -- The RecceSet will detect the enemies, and group them into areas of a 3 km radius. - --- Setup the AttackSet, which is a SET_GROUP. --- The SET_GROUP is a dynamic collection of GROUP objects. -local AttackSet = SET_GROUP - :New() -- Create the SET_GROUP object. - :FilterCoalitions( "red" ) -- Only incorporate the RED coalitions. - :FilterPrefixes( "Attack" ) -- Only incorporate groups that start with the name Attack. - :FilterStart() -- Start the dynamic building of the set. - --- Now we have everything to setup the main A2G TaskDispatcher. -TaskDispatcher = TASK_A2G_DISPATCHER - :New( Mission, AttackSet, DetectionAreas ) -- We assign the TaskDispatcher under Mission. The AttackSet will engage the enemy and will recieve the dispatched Tasks. The DetectionAreas will report any detected enemies to the TaskDispatcher. - --- We use the MISSILETRAINER for demonstration purposes. -MissileTrainer = MISSILETRAINER:New( 100, "Missiles will be destroyed for training when they reach your plane." ) +-- Name: TAD-A2G-010 - AREAS - Split SEAD to BAI and SEAD +-- Author: FlightControl +-- Date Created: 05 Dec 2017 +-- +-- This mission demonstrates the dynamic task dispatching for Air to Ground operations. +-- This test is about a SEAD task, dispatched, that is split into a SEAD and BAI task, when units are moving away from the zone. +-- While the units are moving away, monitor if the task is correctly split into a SEAD and BAI task! +-- This is only applicable for AREA detections. Other detection methods won't have this dynamic. + +-- Declare the Command Center +local HQ = GROUP + :FindByName( "HQ", "Bravo HQ" ) + +local CommandCenter = COMMANDCENTER + :New( HQ, "Lima" ) -- Create the CommandCenter. + +-- Declare the Mission for the Command Center. +local Mission = MISSION + :New( CommandCenter, "Overlord", "High", + "This mission demonstrates the dynamic task dispatching for Air to Ground operations. " .. + "This test is about a SEAD task, dispatched, that is split into a SEAD and BAI task, when units are moving away from the zone. " .. + "While the units are moving away, monitor if the task is correctly split into a SEAD and BAI task! " .. + "This is only applicable for AREA detections. Other detection methods won't have this dynamic.", + coalition.side.RED ) -- Create the Mission. + +-- Define the RecceSet that will detect the enemy. +local RecceSet = SET_GROUP + :New() -- Create the RecceSet, which is the set of groups detecting the enemy locations. + :FilterPrefixes( "Recce" ) -- All Recce groups start with the name "Recce". + :FilterCoalitions("red") -- only the red coalition. + :FilterStart() -- Start the dynamic building of the set. + +-- Setup the detection. We use DETECTION_AREAS to detect and group the enemies. +local DetectionAreas = DETECTION_AREAS + :New( RecceSet, 3000 ) -- The RecceSet will detect the enemies, and group them into areas of a 3 km radius. + +-- Setup the AttackSet, which is a SET_GROUP. +-- The SET_GROUP is a dynamic collection of GROUP objects. +local AttackSet = SET_GROUP + :New() -- Create the SET_GROUP object. + :FilterCoalitions( "red" ) -- Only incorporate the RED coalitions. + :FilterPrefixes( "Attack" ) -- Only incorporate groups that start with the name Attack. + :FilterStart() -- Start the dynamic building of the set. + +-- Now we have everything to setup the main A2G TaskDispatcher. +TaskDispatcher = TASK_A2G_DISPATCHER + :New( Mission, AttackSet, DetectionAreas ) -- We assign the TaskDispatcher under Mission. The AttackSet will engage the enemy and will recieve the dispatched Tasks. The DetectionAreas will report any detected enemies to the TaskDispatcher. + +-- We use the MISSILETRAINER for demonstration purposes. +MissileTrainer = MISSILETRAINER:New( 100, "Missiles will be destroyed for training when they reach your plane." ) diff --git a/TAD - Task Dispatching/A2G - Air 2 Ground Task Dispatching/TAD-A2G-010 - AREAS - Split SEAD to BAI and SEAD/TAD-A2G-010 - AREAS - Split SEAD to BAI and SEAD.miz b/TAD - Task Dispatching/A2G - Air 2 Ground Task Dispatching/TAD-A2G-010 - AREAS - Split SEAD to BAI and SEAD/TAD-A2G-010 - AREAS - Split SEAD to BAI and SEAD.miz index 9d22cc95e0..14077f32e6 100644 Binary files a/TAD - Task Dispatching/A2G - Air 2 Ground Task Dispatching/TAD-A2G-010 - AREAS - Split SEAD to BAI and SEAD/TAD-A2G-010 - AREAS - Split SEAD to BAI and SEAD.miz and b/TAD - Task Dispatching/A2G - Air 2 Ground Task Dispatching/TAD-A2G-010 - AREAS - Split SEAD to BAI and SEAD/TAD-A2G-010 - AREAS - Split SEAD to BAI and SEAD.miz differ diff --git a/TAD - Task Dispatching/A2G - Air 2 Ground Task Dispatching/TAD-A2G-011 - AREAS - Split SEAD to CAS and SEAD/TAD-A2G-011 - AREAS - Split SEAD to CAS and SEAD.lua b/TAD - Task Dispatching/A2G - Air 2 Ground Task Dispatching/TAD-A2G-011 - AREAS - Split SEAD to CAS and SEAD/TAD-A2G-011 - AREAS - Split SEAD to CAS and SEAD.lua index 69171660fd..8d1bd70745 100644 --- a/TAD - Task Dispatching/A2G - Air 2 Ground Task Dispatching/TAD-A2G-011 - AREAS - Split SEAD to CAS and SEAD/TAD-A2G-011 - AREAS - Split SEAD to CAS and SEAD.lua +++ b/TAD - Task Dispatching/A2G - Air 2 Ground Task Dispatching/TAD-A2G-011 - AREAS - Split SEAD to CAS and SEAD/TAD-A2G-011 - AREAS - Split SEAD to CAS and SEAD.lua @@ -1,50 +1,50 @@ --- Name: TAD-A2G-011 - AREAS - Split SEAD to CAS and SEAD --- Author: FlightControl --- Date Created: 05 Dec 2017 --- --- This mission demonstrates the dynamic task dispatching for Air to Ground operations. --- This test is about a SEAD task, dispatched, that is split into a SEAD and CAS task, when units are moving away from the zone. --- While the units are moving away, monitor if the task is correctly split into a SEAD and CAS task! --- This is only applicable for AREA detections. Other detection methods won't have this dynamic. - --- Declare the Command Center -local HQ = GROUP - :FindByName( "HQ", "Bravo HQ" ) - -local CommandCenter = COMMANDCENTER - :New( HQ, "Lima" ) -- Create the CommandCenter. - --- Declare the Mission for the Command Center. -local Mission = MISSION - :New( CommandCenter, "Overlord", "High", - "This mission demonstrates the dynamic task dispatching for Air to Ground operations. " .. - "This test is about a SEAD task, dispatched, that is split into a SEAD and BAI task, when units are moving away from the zone. " .. - "While the units are moving away, monitor if the task is correctly split into a SEAD and BAI task! " .. - "This is only applicable for AREA detections. Other detection methods won't have this dynamic.", - coalition.side.RED ) -- Create the Mission. - --- Define the RecceSet that will detect the enemy. -local RecceSet = SET_GROUP - :New() -- Create the RecceSet, which is the set of groups detecting the enemy locations. - :FilterPrefixes( "Recce" ) -- All Recce groups start with the name "Recce". - :FilterCoalitions("red") -- only the red coalition. - :FilterStart() -- Start the dynamic building of the set. - --- Setup the detection. We use DETECTION_AREAS to detect and group the enemies. -local DetectionAreas = DETECTION_AREAS - :New( RecceSet, 3000 ) -- The RecceSet will detect the enemies, and group them into areas of a 3 km radius. - --- Setup the AttackSet, which is a SET_GROUP. --- The SET_GROUP is a dynamic collection of GROUP objects. -local AttackSet = SET_GROUP - :New() -- Create the SET_GROUP object. - :FilterCoalitions( "red" ) -- Only incorporate the RED coalitions. - :FilterPrefixes( "Attack" ) -- Only incorporate groups that start with the name Attack. - :FilterStart() -- Start the dynamic building of the set. - --- Now we have everything to setup the main A2G TaskDispatcher. -TaskDispatcher = TASK_A2G_DISPATCHER - :New( Mission, AttackSet, DetectionAreas ) -- We assign the TaskDispatcher under Mission. The AttackSet will engage the enemy and will recieve the dispatched Tasks. The DetectionAreas will report any detected enemies to the TaskDispatcher. - --- We use the MISSILETRAINER for demonstration purposes. -MissileTrainer = MISSILETRAINER:New( 100, "Missiles will be destroyed for training when they reach your plane." ) +-- Name: TAD-A2G-011 - AREAS - Split SEAD to CAS and SEAD +-- Author: FlightControl +-- Date Created: 05 Dec 2017 +-- +-- This mission demonstrates the dynamic task dispatching for Air to Ground operations. +-- This test is about a SEAD task, dispatched, that is split into a SEAD and CAS task, when units are moving away from the zone. +-- While the units are moving away, monitor if the task is correctly split into a SEAD and CAS task! +-- This is only applicable for AREA detections. Other detection methods won't have this dynamic. + +-- Declare the Command Center +local HQ = GROUP + :FindByName( "HQ", "Bravo HQ" ) + +local CommandCenter = COMMANDCENTER + :New( HQ, "Lima" ) -- Create the CommandCenter. + +-- Declare the Mission for the Command Center. +local Mission = MISSION + :New( CommandCenter, "Overlord", "High", + "This mission demonstrates the dynamic task dispatching for Air to Ground operations. " .. + "This test is about a SEAD task, dispatched, that is split into a SEAD and BAI task, when units are moving away from the zone. " .. + "While the units are moving away, monitor if the task is correctly split into a SEAD and BAI task! " .. + "This is only applicable for AREA detections. Other detection methods won't have this dynamic.", + coalition.side.RED ) -- Create the Mission. + +-- Define the RecceSet that will detect the enemy. +local RecceSet = SET_GROUP + :New() -- Create the RecceSet, which is the set of groups detecting the enemy locations. + :FilterPrefixes( "Recce" ) -- All Recce groups start with the name "Recce". + :FilterCoalitions("red") -- only the red coalition. + :FilterStart() -- Start the dynamic building of the set. + +-- Setup the detection. We use DETECTION_AREAS to detect and group the enemies. +local DetectionAreas = DETECTION_AREAS + :New( RecceSet, 3000 ) -- The RecceSet will detect the enemies, and group them into areas of a 3 km radius. + +-- Setup the AttackSet, which is a SET_GROUP. +-- The SET_GROUP is a dynamic collection of GROUP objects. +local AttackSet = SET_GROUP + :New() -- Create the SET_GROUP object. + :FilterCoalitions( "red" ) -- Only incorporate the RED coalitions. + :FilterPrefixes( "Attack" ) -- Only incorporate groups that start with the name Attack. + :FilterStart() -- Start the dynamic building of the set. + +-- Now we have everything to setup the main A2G TaskDispatcher. +TaskDispatcher = TASK_A2G_DISPATCHER + :New( Mission, AttackSet, DetectionAreas ) -- We assign the TaskDispatcher under Mission. The AttackSet will engage the enemy and will recieve the dispatched Tasks. The DetectionAreas will report any detected enemies to the TaskDispatcher. + +-- We use the MISSILETRAINER for demonstration purposes. +MissileTrainer = MISSILETRAINER:New( 100, "Missiles will be destroyed for training when they reach your plane." ) diff --git a/TAD - Task Dispatching/A2G - Air 2 Ground Task Dispatching/TAD-A2G-011 - AREAS - Split SEAD to CAS and SEAD/TAD-A2G-011 - AREAS - Split SEAD to CAS and SEAD.miz b/TAD - Task Dispatching/A2G - Air 2 Ground Task Dispatching/TAD-A2G-011 - AREAS - Split SEAD to CAS and SEAD/TAD-A2G-011 - AREAS - Split SEAD to CAS and SEAD.miz index 17ab51ee16..7d05ea43ed 100644 Binary files a/TAD - Task Dispatching/A2G - Air 2 Ground Task Dispatching/TAD-A2G-011 - AREAS - Split SEAD to CAS and SEAD/TAD-A2G-011 - AREAS - Split SEAD to CAS and SEAD.miz and b/TAD - Task Dispatching/A2G - Air 2 Ground Task Dispatching/TAD-A2G-011 - AREAS - Split SEAD to CAS and SEAD/TAD-A2G-011 - AREAS - Split SEAD to CAS and SEAD.miz differ diff --git a/TAD - Task Dispatching/A2G - Air 2 Ground Task Dispatching/TAD-A2G-020 - AREAS - Remain BAI as Player/TAD-A2G-020 - AREAS - Remain BAI as Player.lua b/TAD - Task Dispatching/A2G - Air 2 Ground Task Dispatching/TAD-A2G-020 - AREAS - Remain BAI as Player/TAD-A2G-020 - AREAS - Remain BAI as Player.lua index 1122cdc124..8ef755de83 100644 --- a/TAD - Task Dispatching/A2G - Air 2 Ground Task Dispatching/TAD-A2G-020 - AREAS - Remain BAI as Player/TAD-A2G-020 - AREAS - Remain BAI as Player.lua +++ b/TAD - Task Dispatching/A2G - Air 2 Ground Task Dispatching/TAD-A2G-020 - AREAS - Remain BAI as Player/TAD-A2G-020 - AREAS - Remain BAI as Player.lua @@ -1,52 +1,52 @@ --- Name: TAD-A2G-020 - AREAS - Remain BAI as a Player --- Author: FlightControl --- Date Created: 20 Dec 2017 --- --- This mission demonstrates the dynamic task dispatching for Air to Ground operations. --- This test is about checking that if a player in the air is approaching a BAI task zone, that the task is not converted to a CAS! --- Jump into the helicopter. Fly to the blue targets. They won't fire at you. --- The su-34 will detect the blue targets, but will report a BAI task, even if you are in the helicopter are near to the targets. --- This is a very important aspect of BAI. --- Only ground units should be considered as friendlies and would convert a task in CAS if near the enemy. - --- Declare the Command Center -local HQ = GROUP - :FindByName( "HQ", "Bravo HQ" ) - -local CommandCenter = COMMANDCENTER - :New( HQ, "Lima" ) -- Create the CommandCenter. - --- Declare the Mission for the Command Center. -local Mission = MISSION - :New( CommandCenter, "Overlord", "High", - "This mission demonstrates the dynamic task dispatching for Air to Ground operations. " .. - "This test is about a SEAD task, dispatched, that is split into a SEAD and BAI task, when units are moving away from the zone. " .. - "While the units are moving away, monitor if the task is correctly split into a SEAD and BAI task! " .. - "This is only applicable for AREA detections. Other detection methods won't have this dynamic.", - coalition.side.RED ) -- Create the Mission. - --- Define the RecceSet that will detect the enemy. -local RecceSet = SET_GROUP - :New() -- Create the RecceSet, which is the set of groups detecting the enemy locations. - :FilterPrefixes( "Recce" ) -- All Recce groups start with the name "Recce". - :FilterCoalitions("red") -- only the red coalition. - :FilterStart() -- Start the dynamic building of the set. - --- Setup the detection. We use DETECTION_AREAS to detect and group the enemies. -local DetectionAreas = DETECTION_AREAS - :New( RecceSet, 3000 ) -- The RecceSet will detect the enemies, and group them into areas of a 3 km radius. - --- Setup the AttackSet, which is a SET_GROUP. --- The SET_GROUP is a dynamic collection of GROUP objects. -local AttackSet = SET_GROUP - :New() -- Create the SET_GROUP object. - :FilterCoalitions( "red" ) -- Only incorporate the RED coalitions. - :FilterPrefixes( "Attack" ) -- Only incorporate groups that start with the name Attack. - :FilterStart() -- Start the dynamic building of the set. - --- Now we have everything to setup the main A2G TaskDispatcher. -TaskDispatcher = TASK_A2G_DISPATCHER - :New( Mission, AttackSet, DetectionAreas ) -- We assign the TaskDispatcher under Mission. The AttackSet will engage the enemy and will recieve the dispatched Tasks. The DetectionAreas will report any detected enemies to the TaskDispatcher. - --- We use the MISSILETRAINER for demonstration purposes. -MissileTrainer = MISSILETRAINER:New( 100, "Missiles will be destroyed for training when they reach your plane." ) +-- Name: TAD-A2G-020 - AREAS - Remain BAI as a Player +-- Author: FlightControl +-- Date Created: 20 Dec 2017 +-- +-- This mission demonstrates the dynamic task dispatching for Air to Ground operations. +-- This test is about checking that if a player in the air is approaching a BAI task zone, that the task is not converted to a CAS! +-- Jump into the helicopter. Fly to the blue targets. They won't fire at you. +-- The su-34 will detect the blue targets, but will report a BAI task, even if you are in the helicopter are near to the targets. +-- This is a very important aspect of BAI. +-- Only ground units should be considered as friendlies and would convert a task in CAS if near the enemy. + +-- Declare the Command Center +local HQ = GROUP + :FindByName( "HQ", "Bravo HQ" ) + +local CommandCenter = COMMANDCENTER + :New( HQ, "Lima" ) -- Create the CommandCenter. + +-- Declare the Mission for the Command Center. +local Mission = MISSION + :New( CommandCenter, "Overlord", "High", + "This mission demonstrates the dynamic task dispatching for Air to Ground operations. " .. + "This test is about a SEAD task, dispatched, that is split into a SEAD and BAI task, when units are moving away from the zone. " .. + "While the units are moving away, monitor if the task is correctly split into a SEAD and BAI task! " .. + "This is only applicable for AREA detections. Other detection methods won't have this dynamic.", + coalition.side.RED ) -- Create the Mission. + +-- Define the RecceSet that will detect the enemy. +local RecceSet = SET_GROUP + :New() -- Create the RecceSet, which is the set of groups detecting the enemy locations. + :FilterPrefixes( "Recce" ) -- All Recce groups start with the name "Recce". + :FilterCoalitions("red") -- only the red coalition. + :FilterStart() -- Start the dynamic building of the set. + +-- Setup the detection. We use DETECTION_AREAS to detect and group the enemies. +local DetectionAreas = DETECTION_AREAS + :New( RecceSet, 3000 ) -- The RecceSet will detect the enemies, and group them into areas of a 3 km radius. + +-- Setup the AttackSet, which is a SET_GROUP. +-- The SET_GROUP is a dynamic collection of GROUP objects. +local AttackSet = SET_GROUP + :New() -- Create the SET_GROUP object. + :FilterCoalitions( "red" ) -- Only incorporate the RED coalitions. + :FilterPrefixes( "Attack" ) -- Only incorporate groups that start with the name Attack. + :FilterStart() -- Start the dynamic building of the set. + +-- Now we have everything to setup the main A2G TaskDispatcher. +TaskDispatcher = TASK_A2G_DISPATCHER + :New( Mission, AttackSet, DetectionAreas ) -- We assign the TaskDispatcher under Mission. The AttackSet will engage the enemy and will recieve the dispatched Tasks. The DetectionAreas will report any detected enemies to the TaskDispatcher. + +-- We use the MISSILETRAINER for demonstration purposes. +MissileTrainer = MISSILETRAINER:New( 100, "Missiles will be destroyed for training when they reach your plane." ) diff --git a/TAD - Task Dispatching/A2G - Air 2 Ground Task Dispatching/TAD-A2G-020 - AREAS - Remain BAI as Player/TAD-A2G-020 - AREAS - Remain BAI as Player.miz b/TAD - Task Dispatching/A2G - Air 2 Ground Task Dispatching/TAD-A2G-020 - AREAS - Remain BAI as Player/TAD-A2G-020 - AREAS - Remain BAI as Player.miz index ff848b7e90..3b66efd35a 100644 Binary files a/TAD - Task Dispatching/A2G - Air 2 Ground Task Dispatching/TAD-A2G-020 - AREAS - Remain BAI as Player/TAD-A2G-020 - AREAS - Remain BAI as Player.miz and b/TAD - Task Dispatching/A2G - Air 2 Ground Task Dispatching/TAD-A2G-020 - AREAS - Remain BAI as Player/TAD-A2G-020 - AREAS - Remain BAI as Player.miz differ diff --git a/TAD - Task Dispatching/A2G - Air 2 Ground Task Dispatching/TAD-A2G-021 - AREAS - Remain BAI as AI/TAD-A2G-021 - AREAS - Remain BAI as AI.lua b/TAD - Task Dispatching/A2G - Air 2 Ground Task Dispatching/TAD-A2G-021 - AREAS - Remain BAI as AI/TAD-A2G-021 - AREAS - Remain BAI as AI.lua index cdc3c37280..2442a6b95e 100644 --- a/TAD - Task Dispatching/A2G - Air 2 Ground Task Dispatching/TAD-A2G-021 - AREAS - Remain BAI as AI/TAD-A2G-021 - AREAS - Remain BAI as AI.lua +++ b/TAD - Task Dispatching/A2G - Air 2 Ground Task Dispatching/TAD-A2G-021 - AREAS - Remain BAI as AI/TAD-A2G-021 - AREAS - Remain BAI as AI.lua @@ -1,52 +1,52 @@ --- Name: TAD-A2G-021 - AREAS - Remain BAI as AI --- Author: FlightControl --- Date Created: 20 Dec 2017 --- --- This mission demonstrates the dynamic task dispatching for Air to Ground operations. --- This test is about checking that if a player in the air is approaching a BAI task zone, that the task is not converted to a CAS! --- Jump into the su-25T. The AI Helicopter Attack will fly to the detected blue targets. They won't fire at the helicopters. --- The su-34 will detect the blue targets, but will report a BAI task, even if the AI helicopters is near the targets. --- This is a very important aspect of BAI. --- Only ground units should be considered as friendlies and would convert a task in CAS if near the enemy. - --- Declare the Command Center -local HQ = GROUP - :FindByName( "HQ", "Bravo HQ" ) - -local CommandCenter = COMMANDCENTER - :New( HQ, "Lima" ) -- Create the CommandCenter. - --- Declare the Mission for the Command Center. -local Mission = MISSION - :New( CommandCenter, "Overlord", "High", - "This mission demonstrates the dynamic task dispatching for Air to Ground operations. " .. - "This test is about a SEAD task, dispatched, that is split into a SEAD and BAI task, when units are moving away from the zone. " .. - "While the units are moving away, monitor if the task is correctly split into a SEAD and BAI task! " .. - "This is only applicable for AREA detections. Other detection methods won't have this dynamic.", - coalition.side.RED ) -- Create the Mission. - --- Define the RecceSet that will detect the enemy. -local RecceSet = SET_GROUP - :New() -- Create the RecceSet, which is the set of groups detecting the enemy locations. - :FilterPrefixes( "Recce" ) -- All Recce groups start with the name "Recce". - :FilterCoalitions("red") -- only the red coalition. - :FilterStart() -- Start the dynamic building of the set. - --- Setup the detection. We use DETECTION_AREAS to detect and group the enemies. -local DetectionAreas = DETECTION_AREAS - :New( RecceSet, 3000 ) -- The RecceSet will detect the enemies, and group them into areas of a 3 km radius. - --- Setup the AttackSet, which is a SET_GROUP. --- The SET_GROUP is a dynamic collection of GROUP objects. -local AttackSet = SET_GROUP - :New() -- Create the SET_GROUP object. - :FilterCoalitions( "red" ) -- Only incorporate the RED coalitions. - :FilterPrefixes( "Attack" ) -- Only incorporate groups that start with the name Attack. - :FilterStart() -- Start the dynamic building of the set. - --- Now we have everything to setup the main A2G TaskDispatcher. -TaskDispatcher = TASK_A2G_DISPATCHER - :New( Mission, AttackSet, DetectionAreas ) -- We assign the TaskDispatcher under Mission. The AttackSet will engage the enemy and will recieve the dispatched Tasks. The DetectionAreas will report any detected enemies to the TaskDispatcher. - --- We use the MISSILETRAINER for demonstration purposes. -MissileTrainer = MISSILETRAINER:New( 100, "Missiles will be destroyed for training when they reach your plane." ) +-- Name: TAD-A2G-021 - AREAS - Remain BAI as AI +-- Author: FlightControl +-- Date Created: 20 Dec 2017 +-- +-- This mission demonstrates the dynamic task dispatching for Air to Ground operations. +-- This test is about checking that if a player in the air is approaching a BAI task zone, that the task is not converted to a CAS! +-- Jump into the su-25T. The AI Helicopter Attack will fly to the detected blue targets. They won't fire at the helicopters. +-- The su-34 will detect the blue targets, but will report a BAI task, even if the AI helicopters is near the targets. +-- This is a very important aspect of BAI. +-- Only ground units should be considered as friendlies and would convert a task in CAS if near the enemy. + +-- Declare the Command Center +local HQ = GROUP + :FindByName( "HQ", "Bravo HQ" ) + +local CommandCenter = COMMANDCENTER + :New( HQ, "Lima" ) -- Create the CommandCenter. + +-- Declare the Mission for the Command Center. +local Mission = MISSION + :New( CommandCenter, "Overlord", "High", + "This mission demonstrates the dynamic task dispatching for Air to Ground operations. " .. + "This test is about a SEAD task, dispatched, that is split into a SEAD and BAI task, when units are moving away from the zone. " .. + "While the units are moving away, monitor if the task is correctly split into a SEAD and BAI task! " .. + "This is only applicable for AREA detections. Other detection methods won't have this dynamic.", + coalition.side.RED ) -- Create the Mission. + +-- Define the RecceSet that will detect the enemy. +local RecceSet = SET_GROUP + :New() -- Create the RecceSet, which is the set of groups detecting the enemy locations. + :FilterPrefixes( "Recce" ) -- All Recce groups start with the name "Recce". + :FilterCoalitions("red") -- only the red coalition. + :FilterStart() -- Start the dynamic building of the set. + +-- Setup the detection. We use DETECTION_AREAS to detect and group the enemies. +local DetectionAreas = DETECTION_AREAS + :New( RecceSet, 3000 ) -- The RecceSet will detect the enemies, and group them into areas of a 3 km radius. + +-- Setup the AttackSet, which is a SET_GROUP. +-- The SET_GROUP is a dynamic collection of GROUP objects. +local AttackSet = SET_GROUP + :New() -- Create the SET_GROUP object. + :FilterCoalitions( "red" ) -- Only incorporate the RED coalitions. + :FilterPrefixes( "Attack" ) -- Only incorporate groups that start with the name Attack. + :FilterStart() -- Start the dynamic building of the set. + +-- Now we have everything to setup the main A2G TaskDispatcher. +TaskDispatcher = TASK_A2G_DISPATCHER + :New( Mission, AttackSet, DetectionAreas ) -- We assign the TaskDispatcher under Mission. The AttackSet will engage the enemy and will recieve the dispatched Tasks. The DetectionAreas will report any detected enemies to the TaskDispatcher. + +-- We use the MISSILETRAINER for demonstration purposes. +MissileTrainer = MISSILETRAINER:New( 100, "Missiles will be destroyed for training when they reach your plane." ) diff --git a/TAD - Task Dispatching/A2G - Air 2 Ground Task Dispatching/TAD-A2G-021 - AREAS - Remain BAI as AI/TAD-A2G-021 - AREAS - Remain BAI as AI.miz b/TAD - Task Dispatching/A2G - Air 2 Ground Task Dispatching/TAD-A2G-021 - AREAS - Remain BAI as AI/TAD-A2G-021 - AREAS - Remain BAI as AI.miz index aaada64c24..b46abbee6f 100644 Binary files a/TAD - Task Dispatching/A2G - Air 2 Ground Task Dispatching/TAD-A2G-021 - AREAS - Remain BAI as AI/TAD-A2G-021 - AREAS - Remain BAI as AI.miz and b/TAD - Task Dispatching/A2G - Air 2 Ground Task Dispatching/TAD-A2G-021 - AREAS - Remain BAI as AI/TAD-A2G-021 - AREAS - Remain BAI as AI.miz differ diff --git a/TAD - Task Dispatching/A2G - Air 2 Ground Task Dispatching/TAD-A2G-090 - AREAS - WWII - Reference Points/TAD-A2G-090 - AREAS - WWII - Reference Points.lua b/TAD - Task Dispatching/A2G - Air 2 Ground Task Dispatching/TAD-A2G-090 - AREAS - WWII - Reference Points/TAD-A2G-090 - AREAS - WWII - Reference Points.lua index 11c30eeaa1..f1bfc33caa 100644 --- a/TAD - Task Dispatching/A2G - Air 2 Ground Task Dispatching/TAD-A2G-090 - AREAS - WWII - Reference Points/TAD-A2G-090 - AREAS - WWII - Reference Points.lua +++ b/TAD - Task Dispatching/A2G - Air 2 Ground Task Dispatching/TAD-A2G-090 - AREAS - WWII - Reference Points/TAD-A2G-090 - AREAS - WWII - Reference Points.lua @@ -1,34 +1,34 @@ --- Name: TAD-A2G-090 - AREAS - WWII - Reference Points --- Author: FlightControl --- Date Created: 17 Mar 2017 --- --- Test if the Command Center is working in WWII mode, and that it selects the closest Reference points for each target... --- Join both tasks sequentially (abort when done), and see if the reference points are selected correctly, following the closest ref point logic. --- --- 1. Join the Attack group of RED. --- 2. Wait until the blue tank is detected. --- 3. Three tasks will de defined, CAS and BAI tasks. --- 4. Join each task using the radio menus. --- 5. Observe that the correct WWII compatible reference points are shown. - -local HQ = GROUP:FindByName( "HQ", "Bravo HQ" ) - -local CommandCenter = COMMANDCENTER:New( HQ, "Bravo" ) -CommandCenter:SetModeWWII() -CommandCenter:SetReferenceZones( "Village" ) - -local Mission = MISSION - :New( CommandCenter, - "Overlord", - "Primary", - "Join each task as a result of the detected targets reported. " .. - "Observe that the correct Targets are reported from the correct reference points! " .. - "\n1. Target #001 -> Village#Dziguri" .. - "\n2. Target #002 -> Village#Horshi" .. - "\n3. Target #003 -> Village#Machkhvareti" - , coalition.side.RED ) - -local RecceSet = SET_GROUP:New():FilterPrefixes( "Recce" ):FilterCoalitions( "red" ):FilterStart() -local DetectionAreas = DETECTION_AREAS:New( RecceSet, 500 ) -local AttackGroups = SET_GROUP:New():FilterCoalitions( "red" ):FilterPrefixes( "Attack" ):FilterStart() -TaskDispatcher = TASK_A2G_DISPATCHER:New( Mission, AttackGroups, DetectionAreas ) +-- Name: TAD-A2G-090 - AREAS - WWII - Reference Points +-- Author: FlightControl +-- Date Created: 17 Mar 2017 +-- +-- Test if the Command Center is working in WWII mode, and that it selects the closest Reference points for each target... +-- Join both tasks sequentially (abort when done), and see if the reference points are selected correctly, following the closest ref point logic. +-- +-- 1. Join the Attack group of RED. +-- 2. Wait until the blue tank is detected. +-- 3. Three tasks will de defined, CAS and BAI tasks. +-- 4. Join each task using the radio menus. +-- 5. Observe that the correct WWII compatible reference points are shown. + +local HQ = GROUP:FindByName( "HQ", "Bravo HQ" ) + +local CommandCenter = COMMANDCENTER:New( HQ, "Bravo" ) +CommandCenter:SetModeWWII() +CommandCenter:SetReferenceZones( "Village" ) + +local Mission = MISSION + :New( CommandCenter, + "Overlord", + "Primary", + "Join each task as a result of the detected targets reported. " .. + "Observe that the correct Targets are reported from the correct reference points! " .. + "\n1. Target #001 -> Village#Dziguri" .. + "\n2. Target #002 -> Village#Horshi" .. + "\n3. Target #003 -> Village#Machkhvareti" + , coalition.side.RED ) + +local RecceSet = SET_GROUP:New():FilterPrefixes( "Recce" ):FilterCoalitions( "red" ):FilterStart() +local DetectionAreas = DETECTION_AREAS:New( RecceSet, 500 ) +local AttackGroups = SET_GROUP:New():FilterCoalitions( "red" ):FilterPrefixes( "Attack" ):FilterStart() +TaskDispatcher = TASK_A2G_DISPATCHER:New( Mission, AttackGroups, DetectionAreas ) diff --git a/TAD - Task Dispatching/A2G - Air 2 Ground Task Dispatching/TAD-A2G-090 - AREAS - WWII - Reference Points/TAD-A2G-090 - AREAS - WWII - Reference Points.miz b/TAD - Task Dispatching/A2G - Air 2 Ground Task Dispatching/TAD-A2G-090 - AREAS - WWII - Reference Points/TAD-A2G-090 - AREAS - WWII - Reference Points.miz index cc2d41acb4..58886062fd 100644 Binary files a/TAD - Task Dispatching/A2G - Air 2 Ground Task Dispatching/TAD-A2G-090 - AREAS - WWII - Reference Points/TAD-A2G-090 - AREAS - WWII - Reference Points.miz and b/TAD - Task Dispatching/A2G - Air 2 Ground Task Dispatching/TAD-A2G-090 - AREAS - WWII - Reference Points/TAD-A2G-090 - AREAS - WWII - Reference Points.miz differ diff --git a/TAD - Task Dispatching/A2G - Air 2 Ground Task Dispatching/TAD-A2G-100 - TYPES - Detection Test/TAD-A2G-100 - TYPES - Detection Test.miz b/TAD - Task Dispatching/A2G - Air 2 Ground Task Dispatching/TAD-A2G-100 - TYPES - Detection Test/TAD-A2G-100 - TYPES - Detection Test.miz index 1ebb7507e5..8f8a6a88aa 100644 Binary files a/TAD - Task Dispatching/A2G - Air 2 Ground Task Dispatching/TAD-A2G-100 - TYPES - Detection Test/TAD-A2G-100 - TYPES - Detection Test.miz and b/TAD - Task Dispatching/A2G - Air 2 Ground Task Dispatching/TAD-A2G-100 - TYPES - Detection Test/TAD-A2G-100 - TYPES - Detection Test.miz differ diff --git a/TAD - Task Dispatching/A2G - Air 2 Ground Task Dispatching/TAD-A2G-100 - TYPES - Detection Test/TAD-A2G-100 - TYPES - Detection test.lua b/TAD - Task Dispatching/A2G - Air 2 Ground Task Dispatching/TAD-A2G-100 - TYPES - Detection Test/TAD-A2G-100 - TYPES - Detection test.lua new file mode 100644 index 0000000000..f3c3bb7f5d --- /dev/null +++ b/TAD - Task Dispatching/A2G - Air 2 Ground Task Dispatching/TAD-A2G-100 - TYPES - Detection Test/TAD-A2G-100 - TYPES - Detection test.lua @@ -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." ) diff --git a/TAD - Task Dispatching/A2G - Air 2 Ground Task Dispatching/TAD-A2G-110 - TYPES - Detection Test/TAD-110 - A2G Task Dispatching DETECTION_TYPES.lua b/TAD - Task Dispatching/A2G - Air 2 Ground Task Dispatching/TAD-A2G-110 - TYPES - Detection Test/TAD-110 - A2G Task Dispatching DETECTION_TYPES.lua new file mode 100644 index 0000000000..96f1c2f1bc --- /dev/null +++ b/TAD - Task Dispatching/A2G - Air 2 Ground Task Dispatching/TAD-A2G-110 - TYPES - Detection Test/TAD-110 - A2G Task Dispatching DETECTION_TYPES.lua @@ -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 ) + diff --git a/TAD - Task Dispatching/A2G - Air 2 Ground Task Dispatching/TAD-A2G-110 - TYPES - Detection Test/TAD-A2G-110 - TYPES - Detection Test.miz b/TAD - Task Dispatching/A2G - Air 2 Ground Task Dispatching/TAD-A2G-110 - TYPES - Detection Test/TAD-A2G-110 - TYPES - Detection Test.miz index 6e76d3a199..ecb341b19b 100644 Binary files a/TAD - Task Dispatching/A2G - Air 2 Ground Task Dispatching/TAD-A2G-110 - TYPES - Detection Test/TAD-A2G-110 - TYPES - Detection Test.miz and b/TAD - Task Dispatching/A2G - Air 2 Ground Task Dispatching/TAD-A2G-110 - TYPES - Detection Test/TAD-A2G-110 - TYPES - Detection Test.miz differ diff --git a/TAD - Task Dispatching/A2G - Air 2 Ground Task Dispatching/TAD-A2G-120 - TYPES - Scoring/TAD-220 - A2G Task Dispatching per TYPE and SCORING.lua b/TAD - Task Dispatching/A2G - Air 2 Ground Task Dispatching/TAD-A2G-120 - TYPES - Scoring/TAD-220 - A2G Task Dispatching per TYPE and SCORING.lua new file mode 100644 index 0000000000..2be6e06deb --- /dev/null +++ b/TAD - Task Dispatching/A2G - Air 2 Ground Task Dispatching/TAD-A2G-120 - TYPES - Scoring/TAD-220 - A2G Task Dispatching per TYPE and SCORING.lua @@ -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 \ No newline at end of file diff --git a/TAD - Task Dispatching/A2G - Air 2 Ground Task Dispatching/TAD-A2G-120 - TYPES - Scoring/TAD-A2G-120 - TYPES - Scoring.miz b/TAD - Task Dispatching/A2G - Air 2 Ground Task Dispatching/TAD-A2G-120 - TYPES - Scoring/TAD-A2G-120 - TYPES - Scoring.miz index a679459e03..e01adc5f47 100644 Binary files a/TAD - Task Dispatching/A2G - Air 2 Ground Task Dispatching/TAD-A2G-120 - TYPES - Scoring/TAD-A2G-120 - TYPES - Scoring.miz and b/TAD - Task Dispatching/A2G - Air 2 Ground Task Dispatching/TAD-A2G-120 - TYPES - Scoring/TAD-A2G-120 - TYPES - Scoring.miz differ diff --git a/TAD - Task Dispatching/A2G - Air 2 Ground Task Dispatching/TAD-A2G-200 - UNITS - Detection Test/TAD-A2G-200 - UNITS - Detection Test.lua b/TAD - Task Dispatching/A2G - Air 2 Ground Task Dispatching/TAD-A2G-200 - UNITS - Detection Test/TAD-A2G-200 - UNITS - Detection Test.lua index cb710ab67e..8cbb0ff460 100644 --- a/TAD - Task Dispatching/A2G - Air 2 Ground Task Dispatching/TAD-A2G-200 - UNITS - Detection Test/TAD-A2G-200 - UNITS - Detection Test.lua +++ b/TAD - Task Dispatching/A2G - Air 2 Ground Task Dispatching/TAD-A2G-200 - UNITS - Detection Test/TAD-A2G-200 - UNITS - Detection Test.lua @@ -1,51 +1,51 @@ - --- --- Name: TAD-A2G-200 - UNITS - Detection Test --- Author: FlightControl --- Date Created: 15 Mar 2018 --- --- # Situation: --- --- This mission demonstrates the dynamic task dispatching for Air to Ground operations. --- Reconnassance vehicles are placed at strategic locations, scanning for the enemy locations. --- The detection method used is the DETECTION_UNITS method, which groups detected targets per detected unit. --- The AttackSet will engage upon the enemy, which is a Set of Groups seated by Players. --- A2G Tasks are being dispatched to the Players as enemy locations are being detected by the Recce. --- Observe that A2G Tasks are being dispatched to the player. - - --- Declare the Command Center -local HQ = GROUP - :FindByName( "HQ", "Bravo HQ" ) - -local CommandCenter = COMMANDCENTER - :New( HQ, "Lima" ) -- Create the CommandCenter. - --- Declare the Mission for the Command Center. -local Mission = MISSION - :New( CommandCenter, "Overlord", "High", "Attack Detect Mission Briefing", coalition.side.RED ) -- Create the Mission. - --- Define the RecceSet that will detect the enemy. -local RecceSet = SET_GROUP - :New() -- Create the RecceSet, which is the set of groups detecting the enemy locations. - :FilterPrefixes( "Recce" ) -- All Recce groups start with the name "Recce". - :FilterCoalitions("red") -- only the red coalition. - :FilterStart() -- Start the dynamic building of the set. - --- Setup the detection. We use DETECTION_AREAS to detect and group the enemies. -local DetectionAreas = DETECTION_UNITS - :New( RecceSet ) -- The RecceSet will detect the enemies, and group them per detected unit. - --- Setup the AttackSet, which is a SET_GROUP. --- The SET_GROUP is a dynamic collection of GROUP objects. -local AttackSet = SET_GROUP - :New() -- Create the SET_GROUP object. - :FilterCoalitions( "red" ) -- Only incorporate the RED coalitions. - :FilterPrefixes( "Attack" ) -- Only incorporate groups that start with the name Attack. - :FilterStart() -- Start the dynamic building of the set. - --- Now we have everything to setup the main A2G TaskDispatcher. -TaskDispatcher = TASK_A2G_DISPATCHER - :New( Mission, AttackSet, DetectionAreas ) -- We assign the TaskDispatcher under Mission. The AttackSet will engage the enemy and will recieve the dispatched Tasks. The DetectionAreas will report any detected enemies to the TaskDispatcher. - --- We use the MISSILETRAINER for demonstration purposes. -MissileTrainer = MISSILETRAINER:New( 100, "Missiles will be destroyed for training when they reach your plane." ) + --- +-- Name: TAD-A2G-200 - UNITS - Detection Test +-- Author: FlightControl +-- Date Created: 15 Mar 2018 +-- +-- # Situation: +-- +-- This mission demonstrates the dynamic task dispatching for Air to Ground operations. +-- Reconnassance vehicles are placed at strategic locations, scanning for the enemy locations. +-- The detection method used is the DETECTION_UNITS method, which groups detected targets per detected unit. +-- The AttackSet will engage upon the enemy, which is a Set of Groups seated by Players. +-- A2G Tasks are being dispatched to the Players as enemy locations are being detected by the Recce. +-- Observe that A2G Tasks are being dispatched to the player. + + +-- Declare the Command Center +local HQ = GROUP + :FindByName( "HQ", "Bravo HQ" ) + +local CommandCenter = COMMANDCENTER + :New( HQ, "Lima" ) -- Create the CommandCenter. + +-- Declare the Mission for the Command Center. +local Mission = MISSION + :New( CommandCenter, "Overlord", "High", "Attack Detect Mission Briefing", coalition.side.RED ) -- Create the Mission. + +-- Define the RecceSet that will detect the enemy. +local RecceSet = SET_GROUP + :New() -- Create the RecceSet, which is the set of groups detecting the enemy locations. + :FilterPrefixes( "Recce" ) -- All Recce groups start with the name "Recce". + :FilterCoalitions("red") -- only the red coalition. + :FilterStart() -- Start the dynamic building of the set. + +-- Setup the detection. We use DETECTION_AREAS to detect and group the enemies. +local DetectionAreas = DETECTION_UNITS + :New( RecceSet ) -- The RecceSet will detect the enemies, and group them per detected unit. + +-- Setup the AttackSet, which is a SET_GROUP. +-- The SET_GROUP is a dynamic collection of GROUP objects. +local AttackSet = SET_GROUP + :New() -- Create the SET_GROUP object. + :FilterCoalitions( "red" ) -- Only incorporate the RED coalitions. + :FilterPrefixes( "Attack" ) -- Only incorporate groups that start with the name Attack. + :FilterStart() -- Start the dynamic building of the set. + +-- Now we have everything to setup the main A2G TaskDispatcher. +TaskDispatcher = TASK_A2G_DISPATCHER + :New( Mission, AttackSet, DetectionAreas ) -- We assign the TaskDispatcher under Mission. The AttackSet will engage the enemy and will recieve the dispatched Tasks. The DetectionAreas will report any detected enemies to the TaskDispatcher. + +-- We use the MISSILETRAINER for demonstration purposes. +MissileTrainer = MISSILETRAINER:New( 100, "Missiles will be destroyed for training when they reach your plane." ) diff --git a/TAD - Task Dispatching/A2G - Air 2 Ground Task Dispatching/TAD-A2G-200 - UNITS - Detection Test/TAD-A2G-200 - UNITS - Detection Test.miz b/TAD - Task Dispatching/A2G - Air 2 Ground Task Dispatching/TAD-A2G-200 - UNITS - Detection Test/TAD-A2G-200 - UNITS - Detection Test.miz index c5d5de0a39..cd5532eee4 100644 Binary files a/TAD - Task Dispatching/A2G - Air 2 Ground Task Dispatching/TAD-A2G-200 - UNITS - Detection Test/TAD-A2G-200 - UNITS - Detection Test.miz and b/TAD - Task Dispatching/A2G - Air 2 Ground Task Dispatching/TAD-A2G-200 - UNITS - Detection Test/TAD-A2G-200 - UNITS - Detection Test.miz differ diff --git a/TAD - Task Dispatching/A2G - Air 2 Ground Task Dispatching/TAD-A2G-210 - UNITS - Detection Test/TAD-120 - A2G Task Dispatching DETECTION_UNITS.lua b/TAD - Task Dispatching/A2G - Air 2 Ground Task Dispatching/TAD-A2G-210 - UNITS - Detection Test/TAD-120 - A2G Task Dispatching DETECTION_UNITS.lua new file mode 100644 index 0000000000..6049e078f5 --- /dev/null +++ b/TAD - Task Dispatching/A2G - Air 2 Ground Task Dispatching/TAD-A2G-210 - UNITS - Detection Test/TAD-120 - A2G Task Dispatching DETECTION_UNITS.lua @@ -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 \ No newline at end of file diff --git a/TAD - Task Dispatching/A2G - Air 2 Ground Task Dispatching/TAD-A2G-210 - UNITS - Detection Test/TAD-A2G-210 - UNITS - Detection Test.miz b/TAD - Task Dispatching/A2G - Air 2 Ground Task Dispatching/TAD-A2G-210 - UNITS - Detection Test/TAD-A2G-210 - UNITS - Detection Test.miz index 04028c2451..a3897170f6 100644 Binary files a/TAD - Task Dispatching/A2G - Air 2 Ground Task Dispatching/TAD-A2G-210 - UNITS - Detection Test/TAD-A2G-210 - UNITS - Detection Test.miz and b/TAD - Task Dispatching/A2G - Air 2 Ground Task Dispatching/TAD-A2G-210 - UNITS - Detection Test/TAD-A2G-210 - UNITS - Detection Test.miz differ diff --git a/TAD - Task Dispatching/A2G - Air 2 Ground Task Dispatching/TAD-A2G-220 - UNITS - Scoring/TAD-200 - A2G Task Dispatching with SCORING.lua b/TAD - Task Dispatching/A2G - Air 2 Ground Task Dispatching/TAD-A2G-220 - UNITS - Scoring/TAD-200 - A2G Task Dispatching with SCORING.lua new file mode 100644 index 0000000000..b29d3e07f6 --- /dev/null +++ b/TAD - Task Dispatching/A2G - Air 2 Ground Task Dispatching/TAD-A2G-220 - UNITS - Scoring/TAD-200 - A2G Task Dispatching with SCORING.lua @@ -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 \ No newline at end of file diff --git a/TAD - Task Dispatching/A2G - Air 2 Ground Task Dispatching/TAD-A2G-220 - UNITS - Scoring/TAD-A2G-220 - UNITS - Scoring.miz b/TAD - Task Dispatching/A2G - Air 2 Ground Task Dispatching/TAD-A2G-220 - UNITS - Scoring/TAD-A2G-220 - UNITS - Scoring.miz index c4a47f0538..5aca63d91b 100644 Binary files a/TAD - Task Dispatching/A2G - Air 2 Ground Task Dispatching/TAD-A2G-220 - UNITS - Scoring/TAD-A2G-220 - UNITS - Scoring.miz and b/TAD - Task Dispatching/A2G - Air 2 Ground Task Dispatching/TAD-A2G-220 - UNITS - Scoring/TAD-A2G-220 - UNITS - Scoring.miz differ diff --git a/TAD - Task Dispatching/A2G - Air 2 Ground Task Dispatching/TAD-A2G-320 - AREAS - Scoring/TAD-210 - A2G Task Dispatching #1 for AREAS and SCORING.lua b/TAD - Task Dispatching/A2G - Air 2 Ground Task Dispatching/TAD-A2G-320 - AREAS - Scoring/TAD-210 - A2G Task Dispatching #1 for AREAS and SCORING.lua new file mode 100644 index 0000000000..74af4620db --- /dev/null +++ b/TAD - Task Dispatching/A2G - Air 2 Ground Task Dispatching/TAD-A2G-320 - AREAS - Scoring/TAD-210 - A2G Task Dispatching #1 for AREAS and SCORING.lua @@ -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 \ No newline at end of file diff --git a/TAD - Task Dispatching/A2G - Air 2 Ground Task Dispatching/TAD-A2G-320 - AREAS - Scoring/TAD-210 - A2G Task Dispatching per AREAS and SCORING.lua b/TAD - Task Dispatching/A2G - Air 2 Ground Task Dispatching/TAD-A2G-320 - AREAS - Scoring/TAD-210 - A2G Task Dispatching per AREAS and SCORING.lua new file mode 100644 index 0000000000..f0f5fa30b3 --- /dev/null +++ b/TAD - Task Dispatching/A2G - Air 2 Ground Task Dispatching/TAD-A2G-320 - AREAS - Scoring/TAD-210 - A2G Task Dispatching per AREAS and SCORING.lua @@ -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 \ No newline at end of file diff --git a/TAD - Task Dispatching/A2G - Air 2 Ground Task Dispatching/TAD-A2G-320 - AREAS - Scoring/TAD-A2G-320 - AREAS - Scoring.miz b/TAD - Task Dispatching/A2G - Air 2 Ground Task Dispatching/TAD-A2G-320 - AREAS - Scoring/TAD-A2G-320 - AREAS - Scoring.miz index 74fa18d8df..8e1bfe4cf9 100644 Binary files a/TAD - Task Dispatching/A2G - Air 2 Ground Task Dispatching/TAD-A2G-320 - AREAS - Scoring/TAD-A2G-320 - AREAS - Scoring.miz and b/TAD - Task Dispatching/A2G - Air 2 Ground Task Dispatching/TAD-A2G-320 - AREAS - Scoring/TAD-A2G-320 - AREAS - Scoring.miz differ diff --git a/TAD - Task Dispatching/A2G - Air 2 Ground Task Dispatching/TAD-A2G-601 - ZONES - Destroy/TAD-A2G-001 - AREAS - Destroy Test.lua b/TAD - Task Dispatching/A2G - Air 2 Ground Task Dispatching/TAD-A2G-601 - ZONES - Destroy/TAD-A2G-001 - AREAS - Destroy Test.lua new file mode 100644 index 0000000000..e727a85123 --- /dev/null +++ b/TAD - Task Dispatching/A2G - Air 2 Ground Task Dispatching/TAD-A2G-601 - ZONES - Destroy/TAD-A2G-001 - AREAS - Destroy Test.lua @@ -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." ) diff --git a/TAD - Task Dispatching/A2G - Air 2 Ground Task Dispatching/TAD-A2G-601 - ZONES - Destroy/TAD-A2G-601 - ZONES - Destroy.lua b/TAD - Task Dispatching/A2G - Air 2 Ground Task Dispatching/TAD-A2G-601 - ZONES - Destroy/TAD-A2G-601 - ZONES - Destroy.lua index 789f16df3e..c3b8f03ea1 100644 --- a/TAD - Task Dispatching/A2G - Air 2 Ground Task Dispatching/TAD-A2G-601 - ZONES - Destroy/TAD-A2G-601 - ZONES - Destroy.lua +++ b/TAD - Task Dispatching/A2G - Air 2 Ground Task Dispatching/TAD-A2G-601 - ZONES - Destroy/TAD-A2G-601 - ZONES - Destroy.lua @@ -1,47 +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." ) + --- +-- 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." ) diff --git a/TAD - Task Dispatching/A2G - Air 2 Ground Task Dispatching/TAD-A2G-601 - ZONES - Destroy/TAD-A2G-601 - ZONES - Destroy.miz b/TAD - Task Dispatching/A2G - Air 2 Ground Task Dispatching/TAD-A2G-601 - ZONES - Destroy/TAD-A2G-601 - ZONES - Destroy.miz index 324c2ba608..e03196db4a 100644 Binary files a/TAD - Task Dispatching/A2G - Air 2 Ground Task Dispatching/TAD-A2G-601 - ZONES - Destroy/TAD-A2G-601 - ZONES - Destroy.miz and b/TAD - Task Dispatching/A2G - Air 2 Ground Task Dispatching/TAD-A2G-601 - ZONES - Destroy/TAD-A2G-601 - ZONES - Destroy.miz differ diff --git a/TAD - Task Dispatching/CAP - Capture Task Dispatching/TAD-CAP-000 - Capture Zone Test/TAD-CAP-000 - Capture Zone Test.lua b/TAD - Task Dispatching/CAP - Capture Task Dispatching/TAD-CAP-000 - Capture Zone Test/TAD-CAP-000 - Capture Zone Test.lua index d4229affc7..00e77306d8 100644 --- a/TAD - Task Dispatching/CAP - Capture Task Dispatching/TAD-CAP-000 - Capture Zone Test/TAD-CAP-000 - Capture Zone Test.lua +++ b/TAD - Task Dispatching/CAP - Capture Task Dispatching/TAD-CAP-000 - Capture Zone Test/TAD-CAP-000 - Capture Zone Test.lua @@ -1,117 +1,117 @@ - -do -- Setup the Command Centers - - US_CC = COMMANDCENTER:New( GROUP:FindByName( "BLUEHQ" ), "USA HQ" ) - RU_CC = COMMANDCENTER:New( GROUP:FindByName( "REDHQ" ), "CCCP HQ" ) - -end - -do -- Missions - - US_Mission_EchoBay = MISSION:New( US_CC, "Echo Bay", "Primary", - "Welcome trainee. The airport Groom Lake in Echo Bay needs to be captured.\n" .. - "There are five random capture zones located at the airbase.\n" .. - "Move to one of the capture zones, destroy the fuel tanks in the capture zone, " .. - "and occupy each capture zone with a platoon.\n " .. - "Your orders are to hold position until all capture zones are taken.\n" .. - "Use the map (F10) for a clear indication of the location of each capture zone.\n" .. - "Note that heavy resistance can be expected at the airbase!\n" .. - "Mission 'Echo Bay' is complete when all five capture zones are taken, and held for at least 5 minutes!" - , coalition.side.RED) - - US_Score = SCORING:New( "CAZ-001 - Capture Zone" ) - - US_Mission_EchoBay:AddScoring( US_Score ) - - US_Mission_EchoBay:Start() - -end - - -Players = SET_GROUP:New():FilterPrefixes( "Player" ):FilterStart() - -TaskCaptureZoneDispatcher = TASK_CAPTURE_DISPATCHER:New( US_Mission_EchoBay, Players ) - - ---- define the capture zone - -CaptureZone = ZONE:New( "Alpha-001" ) - -ZoneCaptureCoalition = ZONE_CAPTURE_COALITION:New( CaptureZone, coalition.side.RED ) - - ---- @param Functional.ZoneCaptureCoalition#ZONE_CAPTURE_COALITION self -function ZoneCaptureCoalition:OnEnterGuarded( From, Event, To ) - if From ~= To then - local Coalition = self:GetCoalition() - self:E( { Coalition = Coalition } ) - if Coalition == coalition.side.BLUE then - ZoneCaptureCoalition:Smoke( SMOKECOLOR.Blue ) - US_CC:MessageTypeToCoalition( string.format( "%s is under protection of the USA", ZoneCaptureCoalition:GetZoneName() ), MESSAGE.Type.Information ) - RU_CC:MessageTypeToCoalition( string.format( "%s is under protection of the USA", ZoneCaptureCoalition:GetZoneName() ), MESSAGE.Type.Information ) - else - ZoneCaptureCoalition:Smoke( SMOKECOLOR.Red ) - RU_CC:MessageTypeToCoalition( string.format( "%s is under protection of Russia", ZoneCaptureCoalition:GetZoneName() ), MESSAGE.Type.Information ) - US_CC:MessageTypeToCoalition( string.format( "%s is under protection of Russia", ZoneCaptureCoalition:GetZoneName() ), MESSAGE.Type.Information ) - end - end -end - ---- @param Functional.Protect#ZONE_CAPTURE_COALITION self -function ZoneCaptureCoalition:OnEnterEmpty() - ZoneCaptureCoalition:Smoke( SMOKECOLOR.Green ) - US_CC:MessageTypeToCoalition( string.format( "%s is unprotected, and can be captured!", ZoneCaptureCoalition:GetZoneName() ), MESSAGE.Type.Information ) - RU_CC:MessageTypeToCoalition( string.format( "%s is unprotected, and can be captured!", ZoneCaptureCoalition:GetZoneName() ), MESSAGE.Type.Information ) -end - - ---- @param Functional.Protect#ZONE_CAPTURE_COALITION self -function ZoneCaptureCoalition:OnEnterAttacked() - ZoneCaptureCoalition:Smoke( SMOKECOLOR.White ) - local Coalition = self:GetCoalition() - self:E({Coalition = Coalition}) - if Coalition == coalition.side.BLUE then - US_CC:MessageTypeToCoalition( string.format( "%s is under attack by Russia", ZoneCaptureCoalition:GetZoneName() ), MESSAGE.Type.Information ) - RU_CC:MessageTypeToCoalition( string.format( "We are attacking %s", ZoneCaptureCoalition:GetZoneName() ), MESSAGE.Type.Information ) - else - RU_CC:MessageTypeToCoalition( string.format( "%s is under attack by the USA", ZoneCaptureCoalition:GetZoneName() ), MESSAGE.Type.Information ) - US_CC:MessageTypeToCoalition( string.format( "We are attacking %s", ZoneCaptureCoalition:GetZoneName() ), MESSAGE.Type.Information ) - end -end - ---- @param Functional.Protect#ZONE_CAPTURE_COALITION self -function ZoneCaptureCoalition:OnEnterCaptured() - local Coalition = self:GetCoalition() - self:E({Coalition = Coalition}) - if Coalition == coalition.side.BLUE then - RU_CC:MessageTypeToCoalition( string.format( "%s is captured by the USA, we lost it!", ZoneCaptureCoalition:GetZoneName() ), MESSAGE.Type.Information ) - US_CC:MessageTypeToCoalition( string.format( "We captured %s, Excellent job!", ZoneCaptureCoalition:GetZoneName() ), MESSAGE.Type.Information ) - else - US_CC:MessageTypeToCoalition( string.format( "%s is captured by Russia, we lost it!", ZoneCaptureCoalition:GetZoneName() ), MESSAGE.Type.Information ) - RU_CC:MessageTypeToCoalition( string.format( "We captured %s, Excellent job!", ZoneCaptureCoalition:GetZoneName() ), MESSAGE.Type.Information ) - end - - self:AddScore( "Captured", "Zone captured: Extra points granted.", 200 ) - - self:__Guard( 30 ) -end - -ZoneCaptureCoalition:MonitorDestroyedUnits() -ZoneCaptureCoalition:__Guard( 1 ) -ZoneCaptureCoalition:Start( 5, 15 ) - --- Create the tasks under the mission - -local ZoneCaptureGroupSet = SET_GROUP:New():FilterCoalitions("blue"):FilterStart() - - --- create the capture zone task. - -US_Task_Zone_Capture = TaskCaptureZoneDispatcher:AddCaptureZoneTask( "Capture Zone", ZoneCaptureCoalition, "Capture the zone" ) - -US_CC:SetAutoAssignTasks( true ) -US_CC:SetAutoAcceptTasks( true ) - - - - + +do -- Setup the Command Centers + + US_CC = COMMANDCENTER:New( GROUP:FindByName( "BLUEHQ" ), "USA HQ" ) + RU_CC = COMMANDCENTER:New( GROUP:FindByName( "REDHQ" ), "CCCP HQ" ) + +end + +do -- Missions + + US_Mission_EchoBay = MISSION:New( US_CC, "Echo Bay", "Primary", + "Welcome trainee. The airport Groom Lake in Echo Bay needs to be captured.\n" .. + "There are five random capture zones located at the airbase.\n" .. + "Move to one of the capture zones, destroy the fuel tanks in the capture zone, " .. + "and occupy each capture zone with a platoon.\n " .. + "Your orders are to hold position until all capture zones are taken.\n" .. + "Use the map (F10) for a clear indication of the location of each capture zone.\n" .. + "Note that heavy resistance can be expected at the airbase!\n" .. + "Mission 'Echo Bay' is complete when all five capture zones are taken, and held for at least 5 minutes!" + , coalition.side.RED) + + US_Score = SCORING:New( "CAZ-001 - Capture Zone" ) + + US_Mission_EchoBay:AddScoring( US_Score ) + + US_Mission_EchoBay:Start() + +end + + +Players = SET_GROUP:New():FilterPrefixes( "Player" ):FilterStart() + +TaskCaptureZoneDispatcher = TASK_CAPTURE_DISPATCHER:New( US_Mission_EchoBay, Players ) + + +--- define the capture zone + +CaptureZone = ZONE:New( "Alpha-001" ) + +ZoneCaptureCoalition = ZONE_CAPTURE_COALITION:New( CaptureZone, coalition.side.RED ) + + +--- @param Functional.ZoneCaptureCoalition#ZONE_CAPTURE_COALITION self +function ZoneCaptureCoalition:OnEnterGuarded( From, Event, To ) + if From ~= To then + local Coalition = self:GetCoalition() + self:E( { Coalition = Coalition } ) + if Coalition == coalition.side.BLUE then + ZoneCaptureCoalition:Smoke( SMOKECOLOR.Blue ) + US_CC:MessageTypeToCoalition( string.format( "%s is under protection of the USA", ZoneCaptureCoalition:GetZoneName() ), MESSAGE.Type.Information ) + RU_CC:MessageTypeToCoalition( string.format( "%s is under protection of the USA", ZoneCaptureCoalition:GetZoneName() ), MESSAGE.Type.Information ) + else + ZoneCaptureCoalition:Smoke( SMOKECOLOR.Red ) + RU_CC:MessageTypeToCoalition( string.format( "%s is under protection of Russia", ZoneCaptureCoalition:GetZoneName() ), MESSAGE.Type.Information ) + US_CC:MessageTypeToCoalition( string.format( "%s is under protection of Russia", ZoneCaptureCoalition:GetZoneName() ), MESSAGE.Type.Information ) + end + end +end + +--- @param Functional.Protect#ZONE_CAPTURE_COALITION self +function ZoneCaptureCoalition:OnEnterEmpty() + ZoneCaptureCoalition:Smoke( SMOKECOLOR.Green ) + US_CC:MessageTypeToCoalition( string.format( "%s is unprotected, and can be captured!", ZoneCaptureCoalition:GetZoneName() ), MESSAGE.Type.Information ) + RU_CC:MessageTypeToCoalition( string.format( "%s is unprotected, and can be captured!", ZoneCaptureCoalition:GetZoneName() ), MESSAGE.Type.Information ) +end + + +--- @param Functional.Protect#ZONE_CAPTURE_COALITION self +function ZoneCaptureCoalition:OnEnterAttacked() + ZoneCaptureCoalition:Smoke( SMOKECOLOR.White ) + local Coalition = self:GetCoalition() + self:E({Coalition = Coalition}) + if Coalition == coalition.side.BLUE then + US_CC:MessageTypeToCoalition( string.format( "%s is under attack by Russia", ZoneCaptureCoalition:GetZoneName() ), MESSAGE.Type.Information ) + RU_CC:MessageTypeToCoalition( string.format( "We are attacking %s", ZoneCaptureCoalition:GetZoneName() ), MESSAGE.Type.Information ) + else + RU_CC:MessageTypeToCoalition( string.format( "%s is under attack by the USA", ZoneCaptureCoalition:GetZoneName() ), MESSAGE.Type.Information ) + US_CC:MessageTypeToCoalition( string.format( "We are attacking %s", ZoneCaptureCoalition:GetZoneName() ), MESSAGE.Type.Information ) + end +end + +--- @param Functional.Protect#ZONE_CAPTURE_COALITION self +function ZoneCaptureCoalition:OnEnterCaptured() + local Coalition = self:GetCoalition() + self:E({Coalition = Coalition}) + if Coalition == coalition.side.BLUE then + RU_CC:MessageTypeToCoalition( string.format( "%s is captured by the USA, we lost it!", ZoneCaptureCoalition:GetZoneName() ), MESSAGE.Type.Information ) + US_CC:MessageTypeToCoalition( string.format( "We captured %s, Excellent job!", ZoneCaptureCoalition:GetZoneName() ), MESSAGE.Type.Information ) + else + US_CC:MessageTypeToCoalition( string.format( "%s is captured by Russia, we lost it!", ZoneCaptureCoalition:GetZoneName() ), MESSAGE.Type.Information ) + RU_CC:MessageTypeToCoalition( string.format( "We captured %s, Excellent job!", ZoneCaptureCoalition:GetZoneName() ), MESSAGE.Type.Information ) + end + + self:AddScore( "Captured", "Zone captured: Extra points granted.", 200 ) + + self:__Guard( 30 ) +end + +ZoneCaptureCoalition:MonitorDestroyedUnits() +ZoneCaptureCoalition:__Guard( 1 ) +ZoneCaptureCoalition:Start( 5, 15 ) + +-- Create the tasks under the mission + +local ZoneCaptureGroupSet = SET_GROUP:New():FilterCoalitions("blue"):FilterStart() + + +-- create the capture zone task. + +US_Task_Zone_Capture = TaskCaptureZoneDispatcher:AddCaptureZoneTask( "Capture Zone", ZoneCaptureCoalition, "Capture the zone" ) + +US_CC:SetAutoAssignTasks( true ) +US_CC:SetAutoAcceptTasks( true ) + + + + diff --git a/TAD - Task Dispatching/CAP - Capture Task Dispatching/TAD-CAP-000 - Capture Zone Test/TAD-CAP-000 - Capture Zone Test.miz b/TAD - Task Dispatching/CAP - Capture Task Dispatching/TAD-CAP-000 - Capture Zone Test/TAD-CAP-000 - Capture Zone Test.miz index 32bfd1e20d..b57bd71f30 100644 Binary files a/TAD - Task Dispatching/CAP - Capture Task Dispatching/TAD-CAP-000 - Capture Zone Test/TAD-CAP-000 - Capture Zone Test.miz and b/TAD - Task Dispatching/CAP - Capture Task Dispatching/TAD-CAP-000 - Capture Zone Test/TAD-CAP-000 - Capture Zone Test.miz differ diff --git a/TAD - Task Dispatching/CGO - Cargo Task Dispatching/TAD-CGO-000 - CSAR Test/TAD-CGO-000 - CSAR Test.lua b/TAD - Task Dispatching/CGO - Cargo Task Dispatching/TAD-CGO-000 - CSAR Test/TAD-CGO-000 - CSAR Test.lua index 874d590d70..c8651fcad2 100644 --- a/TAD - Task Dispatching/CGO - Cargo Task Dispatching/TAD-CGO-000 - CSAR Test/TAD-CGO-000 - CSAR Test.lua +++ b/TAD - Task Dispatching/CGO - Cargo Task Dispatching/TAD-CGO-000 - CSAR Test/TAD-CGO-000 - CSAR Test.lua @@ -1,34 +1,34 @@ ---- --- Name: TAD-CGO-000 - CSAR Test --- Author: FlightControl --- Date Created: 31 Mar 2018 --- --- # Situation: --- --- This mission demonstrates the dynamic task dispatching for cargo CSAR operations. --- - -HQ = GROUP:FindByName( "HQ", "Bravo" ) - -CommandCenter = COMMANDCENTER - :New( HQ, "Lima" ) - -Mission = MISSION - :New( CommandCenter, "CSAR Missions", "Tactical", "Rescue downed pilots.", coalition.side.RED ) - -AttackGroups = SET_GROUP:New():FilterCoalitions( "red" ):FilterPrefixes( "Rescue" ):FilterStart() - -TaskDispatcher = TASK_CARGO_DISPATCHER:New( Mission, AttackGroups ) - -TaskDispatcher:StartCSARTasks( - "CSAR", - { ZONE_UNIT:New( "Hospital", STATIC:FindByName( "Hospital" ), 100 ) }, - "One of our pilots has ejected. Go out to Search and Rescue our pilot!\n" .. - "Use the radio menu to let the command center assist you with the CSAR tasking." -) - -function TaskDispatcher:OnAfterCargoDeployed( From, Event, To, Task, TaskPrefix, TaskUnit, Cargo, DeployZone ) - - MESSAGE:NewType( "Unit " .. TaskUnit:GetName().. " has deployed cargo " .. Cargo:GetName() .. " at zone " .. DeployZone:GetName() .. " for task " .. Task:GetName() .. ".", MESSAGE.Type.Information ):ToAll() - -end +--- +-- Name: TAD-CGO-000 - CSAR Test +-- Author: FlightControl +-- Date Created: 31 Mar 2018 +-- +-- # Situation: +-- +-- This mission demonstrates the dynamic task dispatching for cargo CSAR operations. +-- + +HQ = GROUP:FindByName( "HQ", "Bravo" ) + +CommandCenter = COMMANDCENTER + :New( HQ, "Lima" ) + +Mission = MISSION + :New( CommandCenter, "CSAR Missions", "Tactical", "Rescue downed pilots.", coalition.side.RED ) + +AttackGroups = SET_GROUP:New():FilterCoalitions( "red" ):FilterPrefixes( "Rescue" ):FilterStart() + +TaskDispatcher = TASK_CARGO_DISPATCHER:New( Mission, AttackGroups ) + +TaskDispatcher:StartCSARTasks( + "CSAR", + { ZONE_UNIT:New( "Hospital", STATIC:FindByName( "Hospital" ), 100 ) }, + "One of our pilots has ejected. Go out to Search and Rescue our pilot!\n" .. + "Use the radio menu to let the command center assist you with the CSAR tasking." +) + +function TaskDispatcher:OnAfterCargoDeployed( From, Event, To, Task, TaskPrefix, TaskUnit, Cargo, DeployZone ) + + MESSAGE:NewType( "Unit " .. TaskUnit:GetName().. " has deployed cargo " .. Cargo:GetName() .. " at zone " .. DeployZone:GetName() .. " for task " .. Task:GetName() .. ".", MESSAGE.Type.Information ):ToAll() + +end diff --git a/TAD - Task Dispatching/CGO - Cargo Task Dispatching/TAD-CGO-000 - CSAR Test/TAD-CGO-000 - CSAR Test.miz b/TAD - Task Dispatching/CGO - Cargo Task Dispatching/TAD-CGO-000 - CSAR Test/TAD-CGO-000 - CSAR Test.miz index f36535a9b7..e45bc0bd0a 100644 Binary files a/TAD - Task Dispatching/CGO - Cargo Task Dispatching/TAD-CGO-000 - CSAR Test/TAD-CGO-000 - CSAR Test.miz and b/TAD - Task Dispatching/CGO - Cargo Task Dispatching/TAD-CGO-000 - CSAR Test/TAD-CGO-000 - CSAR Test.miz differ diff --git a/TAD - Task Dispatching/CGO - Cargo Task Dispatching/TAD-CGO-001 - Transport Test/TAD-CGO-001 - Transport Test.lua b/TAD - Task Dispatching/CGO - Cargo Task Dispatching/TAD-CGO-001 - Transport Test/TAD-CGO-001 - Transport Test.lua index 2a7247906b..c0d5d13ae4 100644 --- a/TAD - Task Dispatching/CGO - Cargo Task Dispatching/TAD-CGO-001 - Transport Test/TAD-CGO-001 - Transport Test.lua +++ b/TAD - Task Dispatching/CGO - Cargo Task Dispatching/TAD-CGO-001 - Transport Test/TAD-CGO-001 - Transport Test.lua @@ -1,50 +1,50 @@ ---- --- Name: TAD-CGO-001 - Transport Test --- Author: FlightControl --- Date Created: 31 Mar 2018 --- --- # Situation: --- --- This mission demonstrates the dynamic task dispatching for cargo Transport operations. - - -local HQ = GROUP:FindByName( "HQ", "Bravo" ) - -local CommandCenter = COMMANDCENTER - :New( HQ, "Lima" ) - -local Mission = MISSION - :New( CommandCenter, "Infantry Transportation", "Tactical", - "Board the engineers into your MIL-8MTV.", coalition.side.RED ) - --- Within the mission file, there is a helicopter defined with a player slot (client). --- It has the name "Transport Helicopter". --- The SET_GROUP filter will search for all groups that start with the name "Transport" and will add them to the set. --- The TransportGroups object of type SET_GROUP will be added to the TaskDispatcher as a parameter, to indicate the groups that will transport the cargo. -local TransportGroups = SET_GROUP:New():FilterCoalitions( "red" ):FilterPrefixes( "Transport" ):FilterStart() - --- This is the task dispatcher main object! --- It takes a role in the Mission, for the pilots seated in TransportGroups. -TaskDispatcher = TASK_CARGO_DISPATCHER:New( Mission, TransportGroups ) - --- This zone indicates the location where the engineers can be transported towards. --- After boarding the engineers, the pilot can ask the HQ to provide routing assistance towards this zone. -TaskDispatcher:SetDefaultDeployZone( ZONE:New( "Stadium" ) ) - - --- Here we define the "cargo set", which is a collection of cargo objects. --- The cargo set will be the input for the cargo transportation task. --- So a transportation object is handling a cargo set, which is automatically refreshed when new cargo is added/deleted. -local EngineersSet = SET_CARGO:New():FilterTypes( "Engineers" ):FilterStart() - --- CARGO_GROUP can be used to setup cargo with a GROUP object underneath. --- We name this group "Engineers", and is of type "SAM Engineers". --- The cargoset "EngineersSet" will embed all defined cargo of type Engineers (prefix) into its set. -local EngineerGroup1 = CARGO_GROUP:New( GROUP:FindByName( "Engineers#001" ), "Engineers", "SAM Engineers 1", 500 ) -local EngineerGroup2 = CARGO_GROUP:New( GROUP:FindByName( "Engineers#002" ), "Engineers", "SAM Engineers 2", 500 ) -local EngineerGroup3 = CARGO_GROUP:New( GROUP:FindByName( "Engineers#003" ), "Engineers", "SAM Engineers 3", 500 ) - --- -local WorkplaceTask = TaskDispatcher:AddTransportTask( "Transport", EngineersSet, "Transport the SAM Engineers and its equipment to the Stadium." ) - - +--- +-- Name: TAD-CGO-001 - Transport Test +-- Author: FlightControl +-- Date Created: 31 Mar 2018 +-- +-- # Situation: +-- +-- This mission demonstrates the dynamic task dispatching for cargo Transport operations. + + +local HQ = GROUP:FindByName( "HQ", "Bravo" ) + +local CommandCenter = COMMANDCENTER + :New( HQ, "Lima" ) + +local Mission = MISSION + :New( CommandCenter, "Infantry Transportation", "Tactical", + "Board the engineers into your MIL-8MTV.", coalition.side.RED ) + +-- Within the mission file, there is a helicopter defined with a player slot (client). +-- It has the name "Transport Helicopter". +-- The SET_GROUP filter will search for all groups that start with the name "Transport" and will add them to the set. +-- The TransportGroups object of type SET_GROUP will be added to the TaskDispatcher as a parameter, to indicate the groups that will transport the cargo. +local TransportGroups = SET_GROUP:New():FilterCoalitions( "red" ):FilterPrefixes( "Transport" ):FilterStart() + +-- This is the task dispatcher main object! +-- It takes a role in the Mission, for the pilots seated in TransportGroups. +TaskDispatcher = TASK_CARGO_DISPATCHER:New( Mission, TransportGroups ) + +-- This zone indicates the location where the engineers can be transported towards. +-- After boarding the engineers, the pilot can ask the HQ to provide routing assistance towards this zone. +TaskDispatcher:SetDefaultDeployZone( ZONE:New( "Stadium" ) ) + + +-- Here we define the "cargo set", which is a collection of cargo objects. +-- The cargo set will be the input for the cargo transportation task. +-- So a transportation object is handling a cargo set, which is automatically refreshed when new cargo is added/deleted. +local EngineersSet = SET_CARGO:New():FilterTypes( "Engineers" ):FilterStart() + +-- CARGO_GROUP can be used to setup cargo with a GROUP object underneath. +-- We name this group "Engineers", and is of type "SAM Engineers". +-- The cargoset "EngineersSet" will embed all defined cargo of type Engineers (prefix) into its set. +local EngineerGroup1 = CARGO_GROUP:New( GROUP:FindByName( "Engineers#001" ), "Engineers", "SAM Engineers 1", 500 ) +local EngineerGroup2 = CARGO_GROUP:New( GROUP:FindByName( "Engineers#002" ), "Engineers", "SAM Engineers 2", 500 ) +local EngineerGroup3 = CARGO_GROUP:New( GROUP:FindByName( "Engineers#003" ), "Engineers", "SAM Engineers 3", 500 ) + +-- +local WorkplaceTask = TaskDispatcher:AddTransportTask( "Transport", EngineersSet, "Transport the SAM Engineers and its equipment to the Stadium." ) + + diff --git a/TAD - Task Dispatching/CGO - Cargo Task Dispatching/TAD-CGO-001 - Transport Test/TAD-CGO-001 - Transport Test.miz b/TAD - Task Dispatching/CGO - Cargo Task Dispatching/TAD-CGO-001 - Transport Test/TAD-CGO-001 - Transport Test.miz index d60520877e..d8fe3b8b2b 100644 Binary files a/TAD - Task Dispatching/CGO - Cargo Task Dispatching/TAD-CGO-001 - Transport Test/TAD-CGO-001 - Transport Test.miz and b/TAD - Task Dispatching/CGO - Cargo Task Dispatching/TAD-CGO-001 - Transport Test/TAD-CGO-001 - Transport Test.miz differ diff --git a/TAD - Task Dispatching/CGO - Cargo Task Dispatching/TAD-CGO-002 - Transport Test - Crate/TAD-CGO-002 - Transport Test - Crate.lua b/TAD - Task Dispatching/CGO - Cargo Task Dispatching/TAD-CGO-002 - Transport Test - Crate/TAD-CGO-002 - Transport Test - Crate.lua index 6829b41793..43e2c506a8 100644 --- a/TAD - Task Dispatching/CGO - Cargo Task Dispatching/TAD-CGO-002 - Transport Test - Crate/TAD-CGO-002 - Transport Test - Crate.lua +++ b/TAD - Task Dispatching/CGO - Cargo Task Dispatching/TAD-CGO-002 - Transport Test - Crate/TAD-CGO-002 - Transport Test - Crate.lua @@ -1,40 +1,40 @@ ---- --- Name: TAD-CGO-002 - Transport Test - Crate --- Author: FlightControl --- Date Created: 04 Apr 2018 --- --- # Situation: --- --- This mission demonstrates the dynamic task dispatching for cargo Transport operations of a crate. --- - -HQ = GROUP:FindByName( "HQ", "Bravo" ) - -CommandCenter = COMMANDCENTER - :New( HQ, "Lima" ) - -Mission = MISSION - :New( CommandCenter, "Operation SandStorm", "Tactical", "Transport Cargo", coalition.side.RED ) - -TransportGroups = SET_GROUP:New():FilterCoalitions( "red" ):FilterPrefixes( "Transport" ):FilterStart() - -TaskDispatcher = TASK_CARGO_DISPATCHER:New( Mission, TransportGroups ) - -TaskDispatcher:SetDefaultDeployZone( ZONE:New( "Hangar" ) ) - - --- Here we define the "cargo set", which is a collection of cargo objects. --- The cargo set will be the input for the cargo transportation task. --- So a transportation object is handling a cargo set, which is automatically refreshed when new cargo is added/deleted. -local CargoSet = SET_CARGO:New():FilterTypes( "Crates" ):FilterStart() - --- Now we add cargo into the battle scene. -local CrateStatic = STATIC:FindByName( "Crate" ) - --- CARGO_CRATE can be used to setup cargo as a crate or any other static cargo object. --- We name this group "Important things", and is of type "Crates". --- The cargoset "CargoSet" will embed all defined cargo of type Crates into its set. -local CrateCargo = CARGO_CRATE:New( CrateStatic, "Crates", "Important things", 1000, 25 ) - -local WorkplaceTask = TaskDispatcher:AddTransportTask( "Transport Crates", CargoSet, "Transport the Crates near the Hangar." ) - +--- +-- Name: TAD-CGO-002 - Transport Test - Crate +-- Author: FlightControl +-- Date Created: 04 Apr 2018 +-- +-- # Situation: +-- +-- This mission demonstrates the dynamic task dispatching for cargo Transport operations of a crate. +-- + +HQ = GROUP:FindByName( "HQ", "Bravo" ) + +CommandCenter = COMMANDCENTER + :New( HQ, "Lima" ) + +Mission = MISSION + :New( CommandCenter, "Operation SandStorm", "Tactical", "Transport Cargo", coalition.side.RED ) + +TransportGroups = SET_GROUP:New():FilterCoalitions( "red" ):FilterPrefixes( "Transport" ):FilterStart() + +TaskDispatcher = TASK_CARGO_DISPATCHER:New( Mission, TransportGroups ) + +TaskDispatcher:SetDefaultDeployZone( ZONE:New( "Hangar" ) ) + + +-- Here we define the "cargo set", which is a collection of cargo objects. +-- The cargo set will be the input for the cargo transportation task. +-- So a transportation object is handling a cargo set, which is automatically refreshed when new cargo is added/deleted. +local CargoSet = SET_CARGO:New():FilterTypes( "Crates" ):FilterStart() + +-- Now we add cargo into the battle scene. +local CrateStatic = STATIC:FindByName( "Crate" ) + +-- CARGO_CRATE can be used to setup cargo as a crate or any other static cargo object. +-- We name this group "Important things", and is of type "Crates". +-- The cargoset "CargoSet" will embed all defined cargo of type Crates into its set. +local CrateCargo = CARGO_CRATE:New( CrateStatic, "Crates", "Important things", 1000, 25 ) + +local WorkplaceTask = TaskDispatcher:AddTransportTask( "Transport Crates", CargoSet, "Transport the Crates near the Hangar." ) + diff --git a/TAD - Task Dispatching/CGO - Cargo Task Dispatching/TAD-CGO-002 - Transport Test - Crate/TAD-CGO-002 - Transport Test - Crate.miz b/TAD - Task Dispatching/CGO - Cargo Task Dispatching/TAD-CGO-002 - Transport Test - Crate/TAD-CGO-002 - Transport Test - Crate.miz index 377ee5675c..4a1a277ea4 100644 Binary files a/TAD - Task Dispatching/CGO - Cargo Task Dispatching/TAD-CGO-002 - Transport Test - Crate/TAD-CGO-002 - Transport Test - Crate.miz and b/TAD - Task Dispatching/CGO - Cargo Task Dispatching/TAD-CGO-002 - Transport Test - Crate/TAD-CGO-002 - Transport Test - Crate.miz differ diff --git a/TAD - Task Dispatching/CGO - Cargo Task Dispatching/TAD-CGO-003 - Transport Test - Infantry and Crate/TAD-CGO-003 - Transport Test - Infantry and Crate.lua b/TAD - Task Dispatching/CGO - Cargo Task Dispatching/TAD-CGO-003 - Transport Test - Infantry and Crate/TAD-CGO-003 - Transport Test - Infantry and Crate.lua index b5417a7c7c..7c4c5539fe 100644 --- a/TAD - Task Dispatching/CGO - Cargo Task Dispatching/TAD-CGO-003 - Transport Test - Infantry and Crate/TAD-CGO-003 - Transport Test - Infantry and Crate.lua +++ b/TAD - Task Dispatching/CGO - Cargo Task Dispatching/TAD-CGO-003 - Transport Test - Infantry and Crate/TAD-CGO-003 - Transport Test - Infantry and Crate.lua @@ -1,49 +1,49 @@ ---- --- Name: TAD-CGO-003 - Transport Test - Infantry and Crate --- Author: FlightControl --- Date Created: 05 Apr 2018 --- --- # Situation: --- --- This mission demonstrates the dynamic task dispatching for cargo Transport operations of a crate and infantry. --- - -HQ = GROUP:FindByName( "HQ", "Bravo" ) - -CommandCenter = COMMANDCENTER - :New( HQ, "Lima" ) - -Mission = MISSION - :New( CommandCenter, "Operation SandStorm", "Tactical", "Transport Cargo", coalition.side.RED ) - -TransportGroups = SET_GROUP:New():FilterCoalitions( "red" ):FilterPrefixes( "Transport" ):FilterStart() - -TaskDispatcher = TASK_CARGO_DISPATCHER:New( Mission, TransportGroups ) - -TaskDispatcher:SetDefaultDeployZone( ZONE:New( "Hangar" ) ) - - --- Now we add cargo into the battle scene. -local CrateStatic = STATIC:FindByName( "Crate" ) - --- CARGO_CRATE can be used to setup cargo as a crate or any other static cargo object. --- We name this group "Important things", and is of type "Crates". --- The cargoset "CargoSet" will embed all defined cargo of type Crates into its set. -local CrateCargo = CARGO_CRATE:New( CrateStatic, "Football", "Important things", 1000, 25 ) - --- Here we define the "cargo set", which is a collection of cargo objects. --- The cargo set will be the input for the cargo transportation task. --- So a transportation object is handling a cargo set, which is automatically refreshed when new cargo is added/deleted. -local FootballSet = SET_CARGO:New():FilterTypes( "Football" ):FilterStart() - --- Now we add cargo into the battle scene. -local FootballGroup = GROUP:FindByName( "Anderlecht#001" ) - --- CARGO_GROUP can be used to setup cargo with a GROUP object underneath. --- We name this group "FC Anderlecht", and is of type "Football Players". --- The cargoset "EngineersCargoSet" will embed all defined cargo of type Engineers (prefix) into its set. -local FootballPlayerGroup = CARGO_GROUP:New( FootballGroup, "Football", "FC Anderlecht", 500 ) - -local WorkplaceTask = TaskDispatcher:AddTransportTask( "Transport Team", FootballSet, "Transport FC Anderlecht and the equipment near the Hangar." ) - - +--- +-- Name: TAD-CGO-003 - Transport Test - Infantry and Crate +-- Author: FlightControl +-- Date Created: 05 Apr 2018 +-- +-- # Situation: +-- +-- This mission demonstrates the dynamic task dispatching for cargo Transport operations of a crate and infantry. +-- + +HQ = GROUP:FindByName( "HQ", "Bravo" ) + +CommandCenter = COMMANDCENTER + :New( HQ, "Lima" ) + +Mission = MISSION + :New( CommandCenter, "Operation SandStorm", "Tactical", "Transport Cargo", coalition.side.RED ) + +TransportGroups = SET_GROUP:New():FilterCoalitions( "red" ):FilterPrefixes( "Transport" ):FilterStart() + +TaskDispatcher = TASK_CARGO_DISPATCHER:New( Mission, TransportGroups ) + +TaskDispatcher:SetDefaultDeployZone( ZONE:New( "Hangar" ) ) + + +-- Now we add cargo into the battle scene. +local CrateStatic = STATIC:FindByName( "Crate" ) + +-- CARGO_CRATE can be used to setup cargo as a crate or any other static cargo object. +-- We name this group "Important things", and is of type "Crates". +-- The cargoset "CargoSet" will embed all defined cargo of type Crates into its set. +local CrateCargo = CARGO_CRATE:New( CrateStatic, "Football", "Important things", 1000, 25 ) + +-- Here we define the "cargo set", which is a collection of cargo objects. +-- The cargo set will be the input for the cargo transportation task. +-- So a transportation object is handling a cargo set, which is automatically refreshed when new cargo is added/deleted. +local FootballSet = SET_CARGO:New():FilterTypes( "Football" ):FilterStart() + +-- Now we add cargo into the battle scene. +local FootballGroup = GROUP:FindByName( "Anderlecht#001" ) + +-- CARGO_GROUP can be used to setup cargo with a GROUP object underneath. +-- We name this group "FC Anderlecht", and is of type "Football Players". +-- The cargoset "EngineersCargoSet" will embed all defined cargo of type Engineers (prefix) into its set. +local FootballPlayerGroup = CARGO_GROUP:New( FootballGroup, "Football", "FC Anderlecht", 500 ) + +local WorkplaceTask = TaskDispatcher:AddTransportTask( "Transport Team", FootballSet, "Transport FC Anderlecht and the equipment near the Hangar." ) + + diff --git a/TAD - Task Dispatching/CGO - Cargo Task Dispatching/TAD-CGO-003 - Transport Test - Infantry and Crate/TAD-CGO-003 - Transport Test - Infantry and Crate.miz b/TAD - Task Dispatching/CGO - Cargo Task Dispatching/TAD-CGO-003 - Transport Test - Infantry and Crate/TAD-CGO-003 - Transport Test - Infantry and Crate.miz index fe9ad6856b..42c2ec806f 100644 Binary files a/TAD - Task Dispatching/CGO - Cargo Task Dispatching/TAD-CGO-003 - Transport Test - Infantry and Crate/TAD-CGO-003 - Transport Test - Infantry and Crate.miz and b/TAD - Task Dispatching/CGO - Cargo Task Dispatching/TAD-CGO-003 - Transport Test - Infantry and Crate/TAD-CGO-003 - Transport Test - Infantry and Crate.miz differ diff --git a/TAD - Task Dispatching/CGO - Cargo Task Dispatching/TAD-CGO-004 - Transport Test - Infantry and Slingload/TAD-CGO-004 - Transport Test - Infantry and Slingload.lua b/TAD - Task Dispatching/CGO - Cargo Task Dispatching/TAD-CGO-004 - Transport Test - Infantry and Slingload/TAD-CGO-004 - Transport Test - Infantry and Slingload.lua index 3c9b373831..e921cf83bc 100644 --- a/TAD - Task Dispatching/CGO - Cargo Task Dispatching/TAD-CGO-004 - Transport Test - Infantry and Slingload/TAD-CGO-004 - Transport Test - Infantry and Slingload.lua +++ b/TAD - Task Dispatching/CGO - Cargo Task Dispatching/TAD-CGO-004 - Transport Test - Infantry and Slingload/TAD-CGO-004 - Transport Test - Infantry and Slingload.lua @@ -1,50 +1,50 @@ ---- --- Name: TAD-CGO-004 - Transport Test - Infantry and Slingload --- Author: FlightControl --- Date Created: 05 Apr 2018 --- --- # Situation: --- --- This mission demonstrates the dynamic task dispatching for cargo Transport operations of a crate and infantry. --- Slingload the concrete and board the infantry. --- - -HQ = GROUP:FindByName( "HQ", "Bravo" ) - -CommandCenter = COMMANDCENTER - :New( HQ, "Lima" ) - -Mission = MISSION - :New( CommandCenter, "Operation SandStorm", "Tactical", "Transport Cargo", coalition.side.RED ) - -TransportGroups = SET_GROUP:New():FilterCoalitions( "red" ):FilterPrefixes( "Transport" ):FilterStart() - -TaskDispatcher = TASK_CARGO_DISPATCHER:New( Mission, TransportGroups ) - -TaskDispatcher:SetDefaultDeployZone( ZONE:New( "Workplace" ) ) - - --- Now we add cargo into the battle scene. -local CrateStatic = STATIC:FindByName( "Tetrapod" ) - --- CARGO_SLINGLOAD can be used to setup cargo as a crate or any other static cargo object. --- We name this group "Important Concrete", and is of type "Workmaterials". --- The cargoset "CargoSet" will embed all defined cargo of type Crates into its set. -local CrateCargo = CARGO_SLINGLOAD:New( CrateStatic, "Workmaterials", "Concrete", 1000, 25 ) - --- Here we define the "cargo set", which is a collection of cargo objects. --- The cargo set will be the input for the cargo transportation task. --- So a transportation object is handling a cargo set, which is automatically refreshed when new cargo is added/deleted. -local CargoSet = SET_CARGO:New():FilterTypes( "Workmaterials" ):FilterStart() - --- Now we add cargo into the battle scene. -local WorkerGroup = GROUP:FindByName( "Workers" ) - --- CARGO_GROUP can be used to setup cargo with a GROUP object underneath. --- We name this group "Workers", and is of type "Workmaterials". --- The cargoset "CargoSet" will embed all defined cargo of type Workmaterials (prefix) into its set. -local WorkerCargoGroup = CARGO_GROUP:New( WorkerGroup, "Workmaterials", "Workers", 500 ) - -local WorkplaceTask = TaskDispatcher:AddTransportTask( "Transport Team", CargoSet, "Transport the workers and the equipment near the Workplace." ) - - +--- +-- Name: TAD-CGO-004 - Transport Test - Infantry and Slingload +-- Author: FlightControl +-- Date Created: 05 Apr 2018 +-- +-- # Situation: +-- +-- This mission demonstrates the dynamic task dispatching for cargo Transport operations of a crate and infantry. +-- Slingload the concrete and board the infantry. +-- + +HQ = GROUP:FindByName( "HQ", "Bravo" ) + +CommandCenter = COMMANDCENTER + :New( HQ, "Lima" ) + +Mission = MISSION + :New( CommandCenter, "Operation SandStorm", "Tactical", "Transport Cargo", coalition.side.RED ) + +TransportGroups = SET_GROUP:New():FilterCoalitions( "red" ):FilterPrefixes( "Transport" ):FilterStart() + +TaskDispatcher = TASK_CARGO_DISPATCHER:New( Mission, TransportGroups ) + +TaskDispatcher:SetDefaultDeployZone( ZONE:New( "Workplace" ) ) + + +-- Now we add cargo into the battle scene. +local CrateStatic = STATIC:FindByName( "Tetrapod" ) + +-- CARGO_SLINGLOAD can be used to setup cargo as a crate or any other static cargo object. +-- We name this group "Important Concrete", and is of type "Workmaterials". +-- The cargoset "CargoSet" will embed all defined cargo of type Crates into its set. +local CrateCargo = CARGO_SLINGLOAD:New( CrateStatic, "Workmaterials", "Concrete", 1000, 25 ) + +-- Here we define the "cargo set", which is a collection of cargo objects. +-- The cargo set will be the input for the cargo transportation task. +-- So a transportation object is handling a cargo set, which is automatically refreshed when new cargo is added/deleted. +local CargoSet = SET_CARGO:New():FilterTypes( "Workmaterials" ):FilterStart() + +-- Now we add cargo into the battle scene. +local WorkerGroup = GROUP:FindByName( "Workers" ) + +-- CARGO_GROUP can be used to setup cargo with a GROUP object underneath. +-- We name this group "Workers", and is of type "Workmaterials". +-- The cargoset "CargoSet" will embed all defined cargo of type Workmaterials (prefix) into its set. +local WorkerCargoGroup = CARGO_GROUP:New( WorkerGroup, "Workmaterials", "Workers", 500 ) + +local WorkplaceTask = TaskDispatcher:AddTransportTask( "Transport Team", CargoSet, "Transport the workers and the equipment near the Workplace." ) + + diff --git a/TAD - Task Dispatching/CGO - Cargo Task Dispatching/TAD-CGO-004 - Transport Test - Infantry and Slingload/TAD-CGO-004 - Transport Test - Infantry and Slingload.miz b/TAD - Task Dispatching/CGO - Cargo Task Dispatching/TAD-CGO-004 - Transport Test - Infantry and Slingload/TAD-CGO-004 - Transport Test - Infantry and Slingload.miz index 542ed40fcc..108276ddf8 100644 Binary files a/TAD - Task Dispatching/CGO - Cargo Task Dispatching/TAD-CGO-004 - Transport Test - Infantry and Slingload/TAD-CGO-004 - Transport Test - Infantry and Slingload.miz and b/TAD - Task Dispatching/CGO - Cargo Task Dispatching/TAD-CGO-004 - Transport Test - Infantry and Slingload/TAD-CGO-004 - Transport Test - Infantry and Slingload.miz differ diff --git a/TAD - Task Dispatching/CGO - Cargo Task Dispatching/TAD-CGO-005 - Transport Test - Various Cargo/TAD-CGO-005 - Transport Test - Various Cargo.lua b/TAD - Task Dispatching/CGO - Cargo Task Dispatching/TAD-CGO-005 - Transport Test - Various Cargo/TAD-CGO-005 - Transport Test - Various Cargo.lua index f4bef7993c..97fafebf8a 100644 --- a/TAD - Task Dispatching/CGO - Cargo Task Dispatching/TAD-CGO-005 - Transport Test - Various Cargo/TAD-CGO-005 - Transport Test - Various Cargo.lua +++ b/TAD - Task Dispatching/CGO - Cargo Task Dispatching/TAD-CGO-005 - Transport Test - Various Cargo/TAD-CGO-005 - Transport Test - Various Cargo.lua @@ -1,51 +1,51 @@ ---- --- Name: TAD-CGO-005 - Transport Test - Various Cargo --- Author: FlightControl --- Date Created: 05 Apr 2018 --- --- # Situation: --- --- This mission demonstrates the dynamic task dispatching for cargo Transport operations of various cargo types. --- - -HQ = GROUP:FindByName( "HQ", "Bravo" ) - -CommandCenter = COMMANDCENTER - :New( HQ, "Lima" ) - -Mission = MISSION - :New( CommandCenter, "Operation SandStorm", "Tactical", "Transport Cargo", coalition.side.BLUE ) - -TransportGroups = SET_GROUP:New():FilterCoalitions( "blue" ):FilterPrefixes( "Transport" ):FilterStart() - -TaskDispatcher = TASK_CARGO_DISPATCHER:New( Mission, TransportGroups ) - -TaskDispatcher:SetDefaultDeployZone( ZONE:New( "Workplace" ) ) - - -local CargoSet = SET_CARGO:New():FilterTypes( "Workmaterials" ):FilterStart() - -local WorkerCargoGroup = CARGO_GROUP:New( GROUP:FindByName( "Workers" ), "Workmaterials", "Workers", 250 ) -WorkerCargoGroup:ReportSmoke( SMOKECOLOR.Green ) - -local EngineerCargoGroup = CARGO_GROUP:New( GROUP:FindByName( "Engineers" ), "Workmaterials", "Engineers", 100 ) -EngineerCargoGroup:ReportSmoke( SMOKECOLOR.Red ) - -local ConcreteCargo = CARGO_SLINGLOAD:New( STATIC:FindByName( "Concrete" ), "Workmaterials", "Concrete", 100, 25 ) -ConcreteCargo:ReportSmoke( SMOKECOLOR.White ) - -local CrateCargo = CARGO_CRATE:New( STATIC:FindByName( "Crate" ), "Workmaterials", "Crate", 50, 25 ) -CrateCargo:ReportSmoke( SMOKECOLOR.Orange ) - -local EnginesCargo = CARGO_CRATE:New( STATIC:FindByName( "Engines" ), "Workmaterials", "Engines", 150, 25 ) -EnginesCargo:ReportFlare( FLARECOLOR.Red ) - -local FuelCargo = CARGO_SLINGLOAD:New( STATIC:FindByName( "Fuel" ), "Workmaterials", "Fuel", 200, 25 ) -FuelCargo:ReportFlare( FLARECOLOR.Green ) - -local MetalCargo = CARGO_CRATE:New( STATIC:FindByName( "Metal" ), "Workmaterials", "Metal", 500, 25 ) -MetalCargo:ReportFlare( FLARECOLOR.Yellow ) - -local WorkplaceTask = TaskDispatcher:AddTransportTask( "Transport Team", CargoSet, "Transport the workers, engineers and the equipment near the Workplace." ) - - +--- +-- Name: TAD-CGO-005 - Transport Test - Various Cargo +-- Author: FlightControl +-- Date Created: 05 Apr 2018 +-- +-- # Situation: +-- +-- This mission demonstrates the dynamic task dispatching for cargo Transport operations of various cargo types. +-- + +HQ = GROUP:FindByName( "HQ", "Bravo" ) + +CommandCenter = COMMANDCENTER + :New( HQ, "Lima" ) + +Mission = MISSION + :New( CommandCenter, "Operation SandStorm", "Tactical", "Transport Cargo", coalition.side.BLUE ) + +TransportGroups = SET_GROUP:New():FilterCoalitions( "blue" ):FilterPrefixes( "Transport" ):FilterStart() + +TaskDispatcher = TASK_CARGO_DISPATCHER:New( Mission, TransportGroups ) + +TaskDispatcher:SetDefaultDeployZone( ZONE:New( "Workplace" ) ) + + +local CargoSet = SET_CARGO:New():FilterTypes( "Workmaterials" ):FilterStart() + +local WorkerCargoGroup = CARGO_GROUP:New( GROUP:FindByName( "Workers" ), "Workmaterials", "Workers", 250 ) +WorkerCargoGroup:ReportSmoke( SMOKECOLOR.Green ) + +local EngineerCargoGroup = CARGO_GROUP:New( GROUP:FindByName( "Engineers" ), "Workmaterials", "Engineers", 100 ) +EngineerCargoGroup:ReportSmoke( SMOKECOLOR.Red ) + +local ConcreteCargo = CARGO_SLINGLOAD:New( STATIC:FindByName( "Concrete" ), "Workmaterials", "Concrete", 100, 25 ) +ConcreteCargo:ReportSmoke( SMOKECOLOR.White ) + +local CrateCargo = CARGO_CRATE:New( STATIC:FindByName( "Crate" ), "Workmaterials", "Crate", 50, 25 ) +CrateCargo:ReportSmoke( SMOKECOLOR.Orange ) + +local EnginesCargo = CARGO_CRATE:New( STATIC:FindByName( "Engines" ), "Workmaterials", "Engines", 150, 25 ) +EnginesCargo:ReportFlare( FLARECOLOR.Red ) + +local FuelCargo = CARGO_SLINGLOAD:New( STATIC:FindByName( "Fuel" ), "Workmaterials", "Fuel", 200, 25 ) +FuelCargo:ReportFlare( FLARECOLOR.Green ) + +local MetalCargo = CARGO_CRATE:New( STATIC:FindByName( "Metal" ), "Workmaterials", "Metal", 500, 25 ) +MetalCargo:ReportFlare( FLARECOLOR.Yellow ) + +local WorkplaceTask = TaskDispatcher:AddTransportTask( "Transport Team", CargoSet, "Transport the workers, engineers and the equipment near the Workplace." ) + + diff --git a/TAD - Task Dispatching/CGO - Cargo Task Dispatching/TAD-CGO-005 - Transport Test - Various Cargo/TAD-CGO-005 - Transport Test - Various Cargo.miz b/TAD - Task Dispatching/CGO - Cargo Task Dispatching/TAD-CGO-005 - Transport Test - Various Cargo/TAD-CGO-005 - Transport Test - Various Cargo.miz index b13dbde1ca..aa74d7e0c4 100644 Binary files a/TAD - Task Dispatching/CGO - Cargo Task Dispatching/TAD-CGO-005 - Transport Test - Various Cargo/TAD-CGO-005 - Transport Test - Various Cargo.miz and b/TAD - Task Dispatching/CGO - Cargo Task Dispatching/TAD-CGO-005 - Transport Test - Various Cargo/TAD-CGO-005 - Transport Test - Various Cargo.miz differ diff --git a/TAD - Task Dispatching/CGO - Cargo Task Dispatching/TAD-CGO-006 - Transport Test - Multiple Clients/TAD-CGO-006 - Transport Test - Multiple Clients.lua b/TAD - Task Dispatching/CGO - Cargo Task Dispatching/TAD-CGO-006 - Transport Test - Multiple Clients/TAD-CGO-006 - Transport Test - Multiple Clients.lua index 8099bb25a1..09ab7c3b77 100644 --- a/TAD - Task Dispatching/CGO - Cargo Task Dispatching/TAD-CGO-006 - Transport Test - Multiple Clients/TAD-CGO-006 - Transport Test - Multiple Clients.lua +++ b/TAD - Task Dispatching/CGO - Cargo Task Dispatching/TAD-CGO-006 - Transport Test - Multiple Clients/TAD-CGO-006 - Transport Test - Multiple Clients.lua @@ -1,38 +1,38 @@ ---- --- Name: TAD-CGO-006 - Transport Test - Multiple Clients --- Author: FlightControl --- Date Created: 05 Apr 2018 --- --- # Situation: --- --- This mission demonstrates the dynamic task dispatching for cargo Transport operations of various cargo types. --- - -HQ = GROUP:FindByName( "HQ", "Bravo" ) - -CommandCenter = COMMANDCENTER - :New( HQ, "Lima" ) - -Mission = MISSION - :New( CommandCenter, "Operation SandStorm", "Tactical", "Transport Cargo", coalition.side.RED ) - -TransportGroups = SET_GROUP:New():FilterCoalitions( "blue" ):FilterPrefixes( "Transport" ):FilterStart() - -TaskDispatcher = TASK_CARGO_DISPATCHER:New( Mission, TransportGroups ) - -TaskDispatcher:SetDefaultDeployZone( ZONE:New( "Workplace" ) ) - - -local CargoSet = SET_CARGO:New():FilterTypes( "Workmaterials" ):FilterStart() - -local WorkerCargoGroup = CARGO_GROUP:New( GROUP:FindByName( "Workers" ), "Workmaterials", "Workers", 250 ) -local EngineerCargoGroup = CARGO_GROUP:New( GROUP:FindByName( "Engineers" ), "Workmaterials", "Engineers", 100 ) -local ConcreteCargo = CARGO_SLINGLOAD:New( STATIC:FindByName( "Concrete" ), "Workmaterials", "Concrete", 100, 50 ) -local CrateCargo = CARGO_CRATE:New( STATIC:FindByName( "Crate" ), "Workmaterials", "Crate", 150, 50 ) -local EnginesCargo = CARGO_CRATE:New( STATIC:FindByName( "Engines" ), "Workmaterials", "Engines", 150, 50 ) -local FuelCargo = CARGO_SLINGLOAD:New( STATIC:FindByName( "Fuel" ), "Workmaterials", "Fuel", 150, 50 ) -local MetalCargo = CARGO_CRATE:New( STATIC:FindByName( "Metal" ), "Workmaterials", "Metal", 150, 50 ) - -local WorkplaceTask = TaskDispatcher:AddTransportTask( "Transport Team", CargoSet, "Transport the workers, engineers and the equipment near the Workplace." ) - - +--- +-- Name: TAD-CGO-006 - Transport Test - Multiple Clients +-- Author: FlightControl +-- Date Created: 05 Apr 2018 +-- +-- # Situation: +-- +-- This mission demonstrates the dynamic task dispatching for cargo Transport operations of various cargo types. +-- + +HQ = GROUP:FindByName( "HQ", "Bravo" ) + +CommandCenter = COMMANDCENTER + :New( HQ, "Lima" ) + +Mission = MISSION + :New( CommandCenter, "Operation SandStorm", "Tactical", "Transport Cargo", coalition.side.RED ) + +TransportGroups = SET_GROUP:New():FilterCoalitions( "blue" ):FilterPrefixes( "Transport" ):FilterStart() + +TaskDispatcher = TASK_CARGO_DISPATCHER:New( Mission, TransportGroups ) + +TaskDispatcher:SetDefaultDeployZone( ZONE:New( "Workplace" ) ) + + +local CargoSet = SET_CARGO:New():FilterTypes( "Workmaterials" ):FilterStart() + +local WorkerCargoGroup = CARGO_GROUP:New( GROUP:FindByName( "Workers" ), "Workmaterials", "Workers", 250 ) +local EngineerCargoGroup = CARGO_GROUP:New( GROUP:FindByName( "Engineers" ), "Workmaterials", "Engineers", 100 ) +local ConcreteCargo = CARGO_SLINGLOAD:New( STATIC:FindByName( "Concrete" ), "Workmaterials", "Concrete", 100, 50 ) +local CrateCargo = CARGO_CRATE:New( STATIC:FindByName( "Crate" ), "Workmaterials", "Crate", 150, 50 ) +local EnginesCargo = CARGO_CRATE:New( STATIC:FindByName( "Engines" ), "Workmaterials", "Engines", 150, 50 ) +local FuelCargo = CARGO_SLINGLOAD:New( STATIC:FindByName( "Fuel" ), "Workmaterials", "Fuel", 150, 50 ) +local MetalCargo = CARGO_CRATE:New( STATIC:FindByName( "Metal" ), "Workmaterials", "Metal", 150, 50 ) + +local WorkplaceTask = TaskDispatcher:AddTransportTask( "Transport Team", CargoSet, "Transport the workers, engineers and the equipment near the Workplace." ) + + diff --git a/TAD - Task Dispatching/CGO - Cargo Task Dispatching/TAD-CGO-006 - Transport Test - Multiple Clients/TAD-CGO-006 - Transport Test - Multiple Clients.miz b/TAD - Task Dispatching/CGO - Cargo Task Dispatching/TAD-CGO-006 - Transport Test - Multiple Clients/TAD-CGO-006 - Transport Test - Multiple Clients.miz index 4c4dfc2c55..c25fe9fb0f 100644 Binary files a/TAD - Task Dispatching/CGO - Cargo Task Dispatching/TAD-CGO-006 - Transport Test - Multiple Clients/TAD-CGO-006 - Transport Test - Multiple Clients.miz and b/TAD - Task Dispatching/CGO - Cargo Task Dispatching/TAD-CGO-006 - Transport Test - Multiple Clients/TAD-CGO-006 - Transport Test - Multiple Clients.miz differ diff --git a/TAD - Task Dispatching/CGO - Cargo Task Dispatching/TAD-CGO-007 - Transport Test - Cargo Fun/TAD-CGO-007 - Transport Test - Cargo Fun.lua b/TAD - Task Dispatching/CGO - Cargo Task Dispatching/TAD-CGO-007 - Transport Test - Cargo Fun/TAD-CGO-007 - Transport Test - Cargo Fun.lua index 430921d6dc..a70e2a93ab 100644 --- a/TAD - Task Dispatching/CGO - Cargo Task Dispatching/TAD-CGO-007 - Transport Test - Cargo Fun/TAD-CGO-007 - Transport Test - Cargo Fun.lua +++ b/TAD - Task Dispatching/CGO - Cargo Task Dispatching/TAD-CGO-007 - Transport Test - Cargo Fun/TAD-CGO-007 - Transport Test - Cargo Fun.lua @@ -1,53 +1,53 @@ ---- --- Name: TAD-CGO-007 - Transport Test - Cargo Fun --- Author: FlightControl --- Date Created: 05 Apr 2018 --- --- # Situation: --- --- This mission demonstrates the dynamic task dispatching for cargo Transport operations of various cargo types. --- - -HQ = GROUP:FindByName( "HQ", "Bravo" ) - -CommandCenter = COMMANDCENTER - :New( HQ, "Lima" ) - -Mission = MISSION - :New( CommandCenter, "Operation Cargo Fun", "Tactical", "Transport Cargo", coalition.side.RED ) - -TransportGroups = SET_GROUP:New():FilterCoalitions( "blue" ):FilterPrefixes( "Transport" ):FilterStart() - -TaskDispatcher = TASK_CARGO_DISPATCHER:New( Mission, TransportGroups ) - - - -local CargoSetWorkmaterials = SET_CARGO:New():FilterTypes( "Workmaterials" ):FilterStart() -local EngineerCargoGroup = CARGO_GROUP:New( GROUP:FindByName( "Engineers" ), "Workmaterials", "Engineers", 250 ) -local ConcreteCargo = CARGO_SLINGLOAD:New( STATIC:FindByName( "Concrete" ), "Workmaterials", "Concrete", 150, 50 ) -local CrateCargo = CARGO_CRATE:New( STATIC:FindByName( "Crate" ), "Workmaterials", "Crate", 150, 50 ) -local EnginesCargo = CARGO_CRATE:New( STATIC:FindByName( "Engines" ), "Workmaterials", "Engines", 150, 50 ) -local MetalCargo = CARGO_CRATE:New( STATIC:FindByName( "Metal" ), "Workmaterials", "Metal", 150, 50 ) - -local WorkplaceTask = TaskDispatcher:AddTransportTask( "Transport workmaterials", CargoSetWorkmaterials, "Transport the workers, engineers and the equipment near the Workplace." ) -TaskDispatcher:SetTransportDeployZone( WorkplaceTask, ZONE:New( "Workplace" ) ) - -local CargoSetLiquids = SET_CARGO:New():FilterTypes( "Liquids" ):FilterStart() -local FuelCargo = CARGO_SLINGLOAD:New( STATIC:FindByName( "Fuel" ), "Liquids", "Fuel", 100, 35 ) -local GasCargo = CARGO_SLINGLOAD:New( STATIC:FindByName( "Gas" ), "Liquids", "Gas", 100, 35 ) -local OilCargo = CARGO_SLINGLOAD:New( STATIC:FindByName( "Oil" ), "Liquids", "Oil", 100, 35 ) - -local FactoryTask = TaskDispatcher:AddTransportTask( "Transport liquids", CargoSetLiquids, "Transport the milk, gas, fuel, oil to the factory." ) -TaskDispatcher:SetTransportDeployZone( FactoryTask, ZONE:New( "Factory" ) ) - - -local CargoSetFood = SET_CARGO:New():FilterTypes( "Food" ):FilterStart() -local WorkerCargoGroupA = CARGO_GROUP:New( GROUP:FindByName( "Workers Team A" ), "Food", "Workers Team A", 250 ) -local WorkerCargoGroupB = CARGO_GROUP:New( GROUP:FindByName( "Workers Team B" ), "Food", "Workers Team B", 250 ) -local KitchenstuffCargo = CARGO_CRATE:New( STATIC:FindByName( "Kitchenstuff" ), "Food", "Kitchenstuff", 150, 50 ) -local GoodCargo = CARGO_SLINGLOAD:New( STATIC:FindByName( "Food" ), "Food", "Food", 100, 35 ) -local MilkCargo = CARGO_SLINGLOAD:New( STATIC:FindByName( "Milk" ), "Food", "Milk", 100, 35 ) - -local FoodTask = TaskDispatcher:AddTransportTask( "Transport food", CargoSetFood, "Transport the workers and the food to the cantine." ) -TaskDispatcher:SetTransportDeployZone( FoodTask, ZONE:New( "Cantine" ) ) - +--- +-- Name: TAD-CGO-007 - Transport Test - Cargo Fun +-- Author: FlightControl +-- Date Created: 05 Apr 2018 +-- +-- # Situation: +-- +-- This mission demonstrates the dynamic task dispatching for cargo Transport operations of various cargo types. +-- + +HQ = GROUP:FindByName( "HQ", "Bravo" ) + +CommandCenter = COMMANDCENTER + :New( HQ, "Lima" ) + +Mission = MISSION + :New( CommandCenter, "Operation Cargo Fun", "Tactical", "Transport Cargo", coalition.side.RED ) + +TransportGroups = SET_GROUP:New():FilterCoalitions( "blue" ):FilterPrefixes( "Transport" ):FilterStart() + +TaskDispatcher = TASK_CARGO_DISPATCHER:New( Mission, TransportGroups ) + + + +local CargoSetWorkmaterials = SET_CARGO:New():FilterTypes( "Workmaterials" ):FilterStart() +local EngineerCargoGroup = CARGO_GROUP:New( GROUP:FindByName( "Engineers" ), "Workmaterials", "Engineers", 250 ) +local ConcreteCargo = CARGO_SLINGLOAD:New( STATIC:FindByName( "Concrete" ), "Workmaterials", "Concrete", 150, 50 ) +local CrateCargo = CARGO_CRATE:New( STATIC:FindByName( "Crate" ), "Workmaterials", "Crate", 150, 50 ) +local EnginesCargo = CARGO_CRATE:New( STATIC:FindByName( "Engines" ), "Workmaterials", "Engines", 150, 50 ) +local MetalCargo = CARGO_CRATE:New( STATIC:FindByName( "Metal" ), "Workmaterials", "Metal", 150, 50 ) + +local WorkplaceTask = TaskDispatcher:AddTransportTask( "Transport workmaterials", CargoSetWorkmaterials, "Transport the workers, engineers and the equipment near the Workplace." ) +TaskDispatcher:SetTransportDeployZone( WorkplaceTask, ZONE:New( "Workplace" ) ) + +local CargoSetLiquids = SET_CARGO:New():FilterTypes( "Liquids" ):FilterStart() +local FuelCargo = CARGO_SLINGLOAD:New( STATIC:FindByName( "Fuel" ), "Liquids", "Fuel", 100, 35 ) +local GasCargo = CARGO_SLINGLOAD:New( STATIC:FindByName( "Gas" ), "Liquids", "Gas", 100, 35 ) +local OilCargo = CARGO_SLINGLOAD:New( STATIC:FindByName( "Oil" ), "Liquids", "Oil", 100, 35 ) + +local FactoryTask = TaskDispatcher:AddTransportTask( "Transport liquids", CargoSetLiquids, "Transport the milk, gas, fuel, oil to the factory." ) +TaskDispatcher:SetTransportDeployZone( FactoryTask, ZONE:New( "Factory" ) ) + + +local CargoSetFood = SET_CARGO:New():FilterTypes( "Food" ):FilterStart() +local WorkerCargoGroupA = CARGO_GROUP:New( GROUP:FindByName( "Workers Team A" ), "Food", "Workers Team A", 250 ) +local WorkerCargoGroupB = CARGO_GROUP:New( GROUP:FindByName( "Workers Team B" ), "Food", "Workers Team B", 250 ) +local KitchenstuffCargo = CARGO_CRATE:New( STATIC:FindByName( "Kitchenstuff" ), "Food", "Kitchenstuff", 150, 50 ) +local GoodCargo = CARGO_SLINGLOAD:New( STATIC:FindByName( "Food" ), "Food", "Food", 100, 35 ) +local MilkCargo = CARGO_SLINGLOAD:New( STATIC:FindByName( "Milk" ), "Food", "Milk", 100, 35 ) + +local FoodTask = TaskDispatcher:AddTransportTask( "Transport food", CargoSetFood, "Transport the workers and the food to the cantine." ) +TaskDispatcher:SetTransportDeployZone( FoodTask, ZONE:New( "Cantine" ) ) + diff --git a/TAD - Task Dispatching/CGO - Cargo Task Dispatching/TAD-CGO-007 - Transport Test - Cargo Fun/TAD-CGO-007 - Transport Test - Cargo Fun.miz b/TAD - Task Dispatching/CGO - Cargo Task Dispatching/TAD-CGO-007 - Transport Test - Cargo Fun/TAD-CGO-007 - Transport Test - Cargo Fun.miz index 9a2ead91c6..8e86ad8d13 100644 Binary files a/TAD - Task Dispatching/CGO - Cargo Task Dispatching/TAD-CGO-007 - Transport Test - Cargo Fun/TAD-CGO-007 - Transport Test - Cargo Fun.miz and b/TAD - Task Dispatching/CGO - Cargo Task Dispatching/TAD-CGO-007 - Transport Test - Cargo Fun/TAD-CGO-007 - Transport Test - Cargo Fun.miz differ diff --git a/TAD - Task Dispatching/CGO - Cargo Task Dispatching/TAD-CGO-008 - Transport Test - PickedUp and Deployed Handling/TAD-CGO-008 - Transport Test - PickedUp and Deployed Handling.lua b/TAD - Task Dispatching/CGO - Cargo Task Dispatching/TAD-CGO-008 - Transport Test - PickedUp and Deployed Handling/TAD-CGO-008 - Transport Test - PickedUp and Deployed Handling.lua index d0c88b6fd2..b70cca4159 100644 --- a/TAD - Task Dispatching/CGO - Cargo Task Dispatching/TAD-CGO-008 - Transport Test - PickedUp and Deployed Handling/TAD-CGO-008 - Transport Test - PickedUp and Deployed Handling.lua +++ b/TAD - Task Dispatching/CGO - Cargo Task Dispatching/TAD-CGO-008 - Transport Test - PickedUp and Deployed Handling/TAD-CGO-008 - Transport Test - PickedUp and Deployed Handling.lua @@ -1,66 +1,66 @@ ---- --- Name: TAD-CGO-008 - Transport Test - PickedUp and Deployed Handling --- Author: FlightControl --- Date Created: 05 Apr 2018 --- --- # Situation: --- --- This mission demonstrates the dynamic task dispatching for cargo Transport operations of various cargo types. --- --- When cargo is deployed at the Workplace, a large helicopter fleet will descend to the place ... --- When cargo is deployed at the Factory, a SAM site is activated ... --- When cargo is deployed at the Cantine, a some other army soldiers will arrive to join lunch ... --- - -HQ = GROUP:FindByName( "HQ", "Bravo" ) - -CommandCenter = COMMANDCENTER - :New( HQ, "Lima" ) - -Mission = MISSION - :New( CommandCenter, "Operation Cargo Fun", "Tactical", "Transport Cargo", coalition.side.RED ) - -TransportGroups = SET_GROUP:New():FilterCoalitions( "blue" ):FilterPrefixes( "Transport" ):FilterStart() - -TaskDispatcher = TASK_CARGO_DISPATCHER:New( Mission, TransportGroups ) - - -local CargoSetWorkmaterials = SET_CARGO:New():FilterTypes( "Workmaterials" ):FilterStart() -local EngineerCargoGroup = CARGO_GROUP:New( GROUP:FindByName( "Engineers" ), "Workmaterials", "Engineers", 250 ) -local ConcreteCargo = CARGO_SLINGLOAD:New( STATIC:FindByName( "Concrete" ), "Workmaterials", "Concrete", 150, 50 ) -local CrateCargo = CARGO_CRATE:New( STATIC:FindByName( "Crate" ), "Workmaterials", "Crate", 150, 50 ) -local EnginesCargo = CARGO_CRATE:New( STATIC:FindByName( "Engines" ), "Workmaterials", "Engines", 150, 50 ) -local MetalCargo = CARGO_CRATE:New( STATIC:FindByName( "Metal" ), "Workmaterials", "Metal", 150, 50 ) - - -local WorkplaceTask = TaskDispatcher:AddTransportTask( "Build a Workplace", CargoSetWorkmaterials, "Transport the workers, engineers and the equipment near the Workplace." ) -TaskDispatcher:SetTransportDeployZone( WorkplaceTask, ZONE:New( "Workplace" ) ) - - -local CargoSetLiquids = SET_CARGO:New():FilterTypes( "Liquids" ):FilterStart() -local FuelCargo = CARGO_SLINGLOAD:New( STATIC:FindByName( "Fuel" ), "Liquids", "Fuel", 100, 35 ) -local GasCargo = CARGO_SLINGLOAD:New( STATIC:FindByName( "Gas" ), "Liquids", "Gas", 100, 35 ) -local OilCargo = CARGO_SLINGLOAD:New( STATIC:FindByName( "Oil" ), "Liquids", "Oil", 100, 35 ) - -local FactoryTask = TaskDispatcher:AddTransportTask( "Transport liquids", CargoSetLiquids, "Transport the milk, gas, fuel, oil to the factory." ) -TaskDispatcher:SetTransportDeployZone( FactoryTask, ZONE:New( "Factory" ) ) - - -local CargoSetFood = SET_CARGO:New():FilterTypes( "Food" ):FilterStart() -local WorkerCargoGroupA = CARGO_GROUP:New( GROUP:FindByName( "Workers Team A" ), "Food", "Workers Team A", 250 ) -local WorkerCargoGroupB = CARGO_GROUP:New( GROUP:FindByName( "Workers Team B" ), "Food", "Workers Team B", 250 ) -local KitchenstuffCargo = CARGO_CRATE:New( STATIC:FindByName( "Kitchenstuff" ), "Food", "Kitchenstuff", 150, 50 ) -local FoodCargo = CARGO_CRATE:New( STATIC:FindByName( "Food" ), "Food", "Food", 100, 35 ) -local MilkCargo = CARGO_SLINGLOAD:New( STATIC:FindByName( "Milk" ), "Food", "Milk", 100, 35 ) - -local FoodTask = TaskDispatcher:AddTransportTask( "Transport food", CargoSetFood, "Transport the workers and the food to the cantine." ) -TaskDispatcher:SetTransportDeployZone( FoodTask, ZONE:New( "Cantine" ) ) - --- Here we tailor the CargoDeployed event of the TaskDispatcher. - -function TaskDispatcher:OnAfterCargoDeployed( From, Event, To, Task, TaskPrefix, TaskUnit, Cargo, DeployZone ) - - MESSAGE:NewType( "Unit " .. TaskUnit:GetName().. " has deployed cargo " .. Cargo:GetName() .. " at zone " .. DeployZone:GetName() .. " for task " .. Task:GetName() .. ".", MESSAGE.Type.Information ):ToAll() - -end - +--- +-- Name: TAD-CGO-008 - Transport Test - PickedUp and Deployed Handling +-- Author: FlightControl +-- Date Created: 05 Apr 2018 +-- +-- # Situation: +-- +-- This mission demonstrates the dynamic task dispatching for cargo Transport operations of various cargo types. +-- +-- When cargo is deployed at the Workplace, a large helicopter fleet will descend to the place ... +-- When cargo is deployed at the Factory, a SAM site is activated ... +-- When cargo is deployed at the Cantine, a some other army soldiers will arrive to join lunch ... +-- + +HQ = GROUP:FindByName( "HQ", "Bravo" ) + +CommandCenter = COMMANDCENTER + :New( HQ, "Lima" ) + +Mission = MISSION + :New( CommandCenter, "Operation Cargo Fun", "Tactical", "Transport Cargo", coalition.side.RED ) + +TransportGroups = SET_GROUP:New():FilterCoalitions( "blue" ):FilterPrefixes( "Transport" ):FilterStart() + +TaskDispatcher = TASK_CARGO_DISPATCHER:New( Mission, TransportGroups ) + + +local CargoSetWorkmaterials = SET_CARGO:New():FilterTypes( "Workmaterials" ):FilterStart() +local EngineerCargoGroup = CARGO_GROUP:New( GROUP:FindByName( "Engineers" ), "Workmaterials", "Engineers", 250 ) +local ConcreteCargo = CARGO_SLINGLOAD:New( STATIC:FindByName( "Concrete" ), "Workmaterials", "Concrete", 150, 50 ) +local CrateCargo = CARGO_CRATE:New( STATIC:FindByName( "Crate" ), "Workmaterials", "Crate", 150, 50 ) +local EnginesCargo = CARGO_CRATE:New( STATIC:FindByName( "Engines" ), "Workmaterials", "Engines", 150, 50 ) +local MetalCargo = CARGO_CRATE:New( STATIC:FindByName( "Metal" ), "Workmaterials", "Metal", 150, 50 ) + + +local WorkplaceTask = TaskDispatcher:AddTransportTask( "Build a Workplace", CargoSetWorkmaterials, "Transport the workers, engineers and the equipment near the Workplace." ) +TaskDispatcher:SetTransportDeployZone( WorkplaceTask, ZONE:New( "Workplace" ) ) + + +local CargoSetLiquids = SET_CARGO:New():FilterTypes( "Liquids" ):FilterStart() +local FuelCargo = CARGO_SLINGLOAD:New( STATIC:FindByName( "Fuel" ), "Liquids", "Fuel", 100, 35 ) +local GasCargo = CARGO_SLINGLOAD:New( STATIC:FindByName( "Gas" ), "Liquids", "Gas", 100, 35 ) +local OilCargo = CARGO_SLINGLOAD:New( STATIC:FindByName( "Oil" ), "Liquids", "Oil", 100, 35 ) + +local FactoryTask = TaskDispatcher:AddTransportTask( "Transport liquids", CargoSetLiquids, "Transport the milk, gas, fuel, oil to the factory." ) +TaskDispatcher:SetTransportDeployZone( FactoryTask, ZONE:New( "Factory" ) ) + + +local CargoSetFood = SET_CARGO:New():FilterTypes( "Food" ):FilterStart() +local WorkerCargoGroupA = CARGO_GROUP:New( GROUP:FindByName( "Workers Team A" ), "Food", "Workers Team A", 250 ) +local WorkerCargoGroupB = CARGO_GROUP:New( GROUP:FindByName( "Workers Team B" ), "Food", "Workers Team B", 250 ) +local KitchenstuffCargo = CARGO_CRATE:New( STATIC:FindByName( "Kitchenstuff" ), "Food", "Kitchenstuff", 150, 50 ) +local FoodCargo = CARGO_CRATE:New( STATIC:FindByName( "Food" ), "Food", "Food", 100, 35 ) +local MilkCargo = CARGO_SLINGLOAD:New( STATIC:FindByName( "Milk" ), "Food", "Milk", 100, 35 ) + +local FoodTask = TaskDispatcher:AddTransportTask( "Transport food", CargoSetFood, "Transport the workers and the food to the cantine." ) +TaskDispatcher:SetTransportDeployZone( FoodTask, ZONE:New( "Cantine" ) ) + +-- Here we tailor the CargoDeployed event of the TaskDispatcher. + +function TaskDispatcher:OnAfterCargoDeployed( From, Event, To, Task, TaskPrefix, TaskUnit, Cargo, DeployZone ) + + MESSAGE:NewType( "Unit " .. TaskUnit:GetName().. " has deployed cargo " .. Cargo:GetName() .. " at zone " .. DeployZone:GetName() .. " for task " .. Task:GetName() .. ".", MESSAGE.Type.Information ):ToAll() + +end + diff --git a/TAD - Task Dispatching/CGO - Cargo Task Dispatching/TAD-CGO-008 - Transport Test - PickedUp and Deployed Handling/TAD-CGO-008 - Transport Test - PickedUp and Deployed Handling.miz b/TAD - Task Dispatching/CGO - Cargo Task Dispatching/TAD-CGO-008 - Transport Test - PickedUp and Deployed Handling/TAD-CGO-008 - Transport Test - PickedUp and Deployed Handling.miz index aa5e2b997c..2a450a1af9 100644 Binary files a/TAD - Task Dispatching/CGO - Cargo Task Dispatching/TAD-CGO-008 - Transport Test - PickedUp and Deployed Handling/TAD-CGO-008 - Transport Test - PickedUp and Deployed Handling.miz and b/TAD - Task Dispatching/CGO - Cargo Task Dispatching/TAD-CGO-008 - Transport Test - PickedUp and Deployed Handling/TAD-CGO-008 - Transport Test - PickedUp and Deployed Handling.miz differ diff --git a/TAD - Task Dispatching/CGO - Cargo Task Dispatching/TAD-CGO-009 - Transport Test - Respawning Cargo/TAD-CGO-009 - Transport Test - Respawning Cargo.lua b/TAD - Task Dispatching/CGO - Cargo Task Dispatching/TAD-CGO-009 - Transport Test - Respawning Cargo/TAD-CGO-009 - Transport Test - Respawning Cargo.lua index bf6c297a6e..f246547629 100644 --- a/TAD - Task Dispatching/CGO - Cargo Task Dispatching/TAD-CGO-009 - Transport Test - Respawning Cargo/TAD-CGO-009 - Transport Test - Respawning Cargo.lua +++ b/TAD - Task Dispatching/CGO - Cargo Task Dispatching/TAD-CGO-009 - Transport Test - Respawning Cargo/TAD-CGO-009 - Transport Test - Respawning Cargo.lua @@ -1,82 +1,82 @@ ---- --- Name: TAD-CGO-009 - Transport Test - Respawning Cargo --- Author: FlightControl --- Date Created: 05 Apr 2018 --- --- # Situation: --- --- This mission demonstrates the dynamic task dispatching for cargo Transport operations of various cargo types. --- --- When cargo is deployed at the Workplace, a large helicopter fleet will descend to the place ... --- When cargo is deployed at the Factory, a SAM site is activated ... --- When cargo is deployed at the Cantine, a some other army soldiers will arrive to join lunch ... --- - -HQ = GROUP:FindByName( "HQ", "Bravo" ) - -CommandCenter = COMMANDCENTER - :New( HQ, "Lima" ) - -Mission = MISSION - :New( CommandCenter, "Operation Cargo Fun", "Tactical", "Transport Cargo", coalition.side.RED ) - -TransportGroups = SET_GROUP:New():FilterCoalitions( "blue" ):FilterPrefixes( "Transport" ):FilterStart() - -TaskDispatcher = TASK_CARGO_DISPATCHER:New( Mission, TransportGroups ) - - -local CargoSetWorkmaterials = SET_CARGO:New():FilterTypes( "Workmaterials" ):FilterStart() -local EngineerCargoGroup = CARGO_GROUP:New( GROUP:FindByName( "Engineers" ), "Workmaterials", "Engineers", 250 ):RespawnOnDestroyed( true ) -local ConcreteCargo = CARGO_SLINGLOAD:New( STATIC:FindByName( "Concrete" ), "Workmaterials", "Concrete", 150, 50 ):RespawnOnDestroyed( true ) -local CrateCargo = CARGO_CRATE:New( STATIC:FindByName( "Crate" ), "Workmaterials", "Crate", 150, 50 ):RespawnOnDestroyed( true ) -local EnginesCargo = CARGO_CRATE:New( STATIC:FindByName( "Engines" ), "Workmaterials", "Engines", 150, 50 ):RespawnOnDestroyed( true ) -local MetalCargo = CARGO_CRATE:New( STATIC:FindByName( "Metal" ), "Workmaterials", "Metal", 150, 50 ):RespawnOnDestroyed(true) - -local WorkplaceTask = TaskDispatcher:AddTransportTask( "Build a Workplace", CargoSetWorkmaterials, "Transport the workers, engineers and the equipment near the Workplace." ) -TaskDispatcher:SetTransportDeployZone( WorkplaceTask, ZONE:New( "Workplace" ) ) - -Helos = { SPAWN:New( "Helicopters 1" ), SPAWN:New( "Helicopters 2" ), SPAWN:New( "Helicopters 3" ), SPAWN:New( "Helicopters 4" ), SPAWN:New( "Helicopters 5" ) } - -EnemyHelos = { SPAWN:New( "Enemy Helicopters 1" ), SPAWN:New( "Enemy Helicopters 2" ), SPAWN:New( "Enemy Helicopters 3" ) } - -function WorkplaceTask:OnAfterCargoDeployed( From, Event, To, TaskUnit, Cargo, DeployZone ) - Helos[ math.random(1,#Helos) ]:Spawn() - EnemyHelos[ math.random(1,#EnemyHelos) ]:Spawn() - -end - - - -local CargoSetLiquids = SET_CARGO:New():FilterTypes( "Liquids" ):FilterStart() -local FuelCargo = CARGO_SLINGLOAD:New( STATIC:FindByName( "Fuel" ), "Liquids", "Fuel", 100, 35 ):RespawnOnDestroyed( true ) -local GasCargo = CARGO_SLINGLOAD:New( STATIC:FindByName( "Gas" ), "Liquids", "Gas", 100, 35 ):RespawnOnDestroyed( true ) -local OilCargo = CARGO_SLINGLOAD:New( STATIC:FindByName( "Oil" ), "Liquids", "Oil", 100, 35 ):RespawnOnDestroyed( true ) - -local FactoryTask = TaskDispatcher:AddTransportTask( "Transport liquids", CargoSetLiquids, "Transport the milk, gas, fuel, oil to the factory." ) -TaskDispatcher:SetTransportDeployZone( FactoryTask, ZONE:New( "Factory" ) ) - -SAMSites = { SPAWN:New( "SAM Site 1" ), SPAWN:New( "SAM Site 2" ), SPAWN:New( "SAM Site 3" ), SPAWN:New( "SAM Site 4" ), SPAWN:New( "SAM Site 5" ) } - -AirAttack = { SPAWN:New( "Russia Air Attack 1" ), SPAWN:New( "Russia Air Attack 2" ), SPAWN:New( "Russia Air Attack 3" ), SPAWN:New( "Russia Air Attack 4" ) } - -function FactoryTask:OnAfterCargoDeployed( From, Event, To, TaskUnit, Cargo, DeployZone ) - SAMSites[ math.random(1,#SAMSites) ]:Spawn() - AirAttack[ math.random(1,#AirAttack) ]:Spawn() -end - -local CargoSetFood = SET_CARGO:New():FilterTypes( "Food" ):FilterStart() -local WorkerCargoGroupA = CARGO_GROUP:New( GROUP:FindByName( "Workers Team A" ), "Food", "Workers Team A", 250 ):RespawnOnDestroyed( true ) -local WorkerCargoGroupB = CARGO_GROUP:New( GROUP:FindByName( "Workers Team B" ), "Food", "Workers Team B", 250 ):RespawnOnDestroyed( true ) -local KitchenstuffCargo = CARGO_CRATE:New( STATIC:FindByName( "Kitchenstuff" ), "Food", "Kitchenstuff", 150, 50 ):RespawnOnDestroyed( true ) -local FoodCargo = CARGO_CRATE:New( STATIC:FindByName( "Food" ), "Food", "Food", 100, 35 ) -local MilkCargo = CARGO_SLINGLOAD:New( STATIC:FindByName( "Milk" ), "Food", "Milk", 100, 35 ) - -local FoodTask = TaskDispatcher:AddTransportTask( "Transport food", CargoSetFood, "Transport the workers and the food to the cantine." ) -TaskDispatcher:SetTransportDeployZone( FoodTask, ZONE:New( "Cantine" ) ) - -Hungry = { SPAWN:New( "Hungry 1" ), SPAWN:New( "Hungry 2" ), SPAWN:New( "Hungry 3" ), SPAWN:New( "Hungry 4" ), SPAWN:New( "Hungry 5" ) } - -function FoodTask:OnAfterCargoDeployed( From, Event, To, TaskUnit, Cargo, DeployZone ) - Hungry[ math.random(1,#Hungry) ]:Spawn() -end - +--- +-- Name: TAD-CGO-009 - Transport Test - Respawning Cargo +-- Author: FlightControl +-- Date Created: 05 Apr 2018 +-- +-- # Situation: +-- +-- This mission demonstrates the dynamic task dispatching for cargo Transport operations of various cargo types. +-- +-- When cargo is deployed at the Workplace, a large helicopter fleet will descend to the place ... +-- When cargo is deployed at the Factory, a SAM site is activated ... +-- When cargo is deployed at the Cantine, a some other army soldiers will arrive to join lunch ... +-- + +HQ = GROUP:FindByName( "HQ", "Bravo" ) + +CommandCenter = COMMANDCENTER + :New( HQ, "Lima" ) + +Mission = MISSION + :New( CommandCenter, "Operation Cargo Fun", "Tactical", "Transport Cargo", coalition.side.RED ) + +TransportGroups = SET_GROUP:New():FilterCoalitions( "blue" ):FilterPrefixes( "Transport" ):FilterStart() + +TaskDispatcher = TASK_CARGO_DISPATCHER:New( Mission, TransportGroups ) + + +local CargoSetWorkmaterials = SET_CARGO:New():FilterTypes( "Workmaterials" ):FilterStart() +local EngineerCargoGroup = CARGO_GROUP:New( GROUP:FindByName( "Engineers" ), "Workmaterials", "Engineers", 250 ):RespawnOnDestroyed( true ) +local ConcreteCargo = CARGO_SLINGLOAD:New( STATIC:FindByName( "Concrete" ), "Workmaterials", "Concrete", 150, 50 ):RespawnOnDestroyed( true ) +local CrateCargo = CARGO_CRATE:New( STATIC:FindByName( "Crate" ), "Workmaterials", "Crate", 150, 50 ):RespawnOnDestroyed( true ) +local EnginesCargo = CARGO_CRATE:New( STATIC:FindByName( "Engines" ), "Workmaterials", "Engines", 150, 50 ):RespawnOnDestroyed( true ) +local MetalCargo = CARGO_CRATE:New( STATIC:FindByName( "Metal" ), "Workmaterials", "Metal", 150, 50 ):RespawnOnDestroyed(true) + +local WorkplaceTask = TaskDispatcher:AddTransportTask( "Build a Workplace", CargoSetWorkmaterials, "Transport the workers, engineers and the equipment near the Workplace." ) +TaskDispatcher:SetTransportDeployZone( WorkplaceTask, ZONE:New( "Workplace" ) ) + +Helos = { SPAWN:New( "Helicopters 1" ), SPAWN:New( "Helicopters 2" ), SPAWN:New( "Helicopters 3" ), SPAWN:New( "Helicopters 4" ), SPAWN:New( "Helicopters 5" ) } + +EnemyHelos = { SPAWN:New( "Enemy Helicopters 1" ), SPAWN:New( "Enemy Helicopters 2" ), SPAWN:New( "Enemy Helicopters 3" ) } + +function WorkplaceTask:OnAfterCargoDeployed( From, Event, To, TaskUnit, Cargo, DeployZone ) + Helos[ math.random(1,#Helos) ]:Spawn() + EnemyHelos[ math.random(1,#EnemyHelos) ]:Spawn() + +end + + + +local CargoSetLiquids = SET_CARGO:New():FilterTypes( "Liquids" ):FilterStart() +local FuelCargo = CARGO_SLINGLOAD:New( STATIC:FindByName( "Fuel" ), "Liquids", "Fuel", 100, 35 ):RespawnOnDestroyed( true ) +local GasCargo = CARGO_SLINGLOAD:New( STATIC:FindByName( "Gas" ), "Liquids", "Gas", 100, 35 ):RespawnOnDestroyed( true ) +local OilCargo = CARGO_SLINGLOAD:New( STATIC:FindByName( "Oil" ), "Liquids", "Oil", 100, 35 ):RespawnOnDestroyed( true ) + +local FactoryTask = TaskDispatcher:AddTransportTask( "Transport liquids", CargoSetLiquids, "Transport the milk, gas, fuel, oil to the factory." ) +TaskDispatcher:SetTransportDeployZone( FactoryTask, ZONE:New( "Factory" ) ) + +SAMSites = { SPAWN:New( "SAM Site 1" ), SPAWN:New( "SAM Site 2" ), SPAWN:New( "SAM Site 3" ), SPAWN:New( "SAM Site 4" ), SPAWN:New( "SAM Site 5" ) } + +AirAttack = { SPAWN:New( "Russia Air Attack 1" ), SPAWN:New( "Russia Air Attack 2" ), SPAWN:New( "Russia Air Attack 3" ), SPAWN:New( "Russia Air Attack 4" ) } + +function FactoryTask:OnAfterCargoDeployed( From, Event, To, TaskUnit, Cargo, DeployZone ) + SAMSites[ math.random(1,#SAMSites) ]:Spawn() + AirAttack[ math.random(1,#AirAttack) ]:Spawn() +end + +local CargoSetFood = SET_CARGO:New():FilterTypes( "Food" ):FilterStart() +local WorkerCargoGroupA = CARGO_GROUP:New( GROUP:FindByName( "Workers Team A" ), "Food", "Workers Team A", 250 ):RespawnOnDestroyed( true ) +local WorkerCargoGroupB = CARGO_GROUP:New( GROUP:FindByName( "Workers Team B" ), "Food", "Workers Team B", 250 ):RespawnOnDestroyed( true ) +local KitchenstuffCargo = CARGO_CRATE:New( STATIC:FindByName( "Kitchenstuff" ), "Food", "Kitchenstuff", 150, 50 ):RespawnOnDestroyed( true ) +local FoodCargo = CARGO_CRATE:New( STATIC:FindByName( "Food" ), "Food", "Food", 100, 35 ) +local MilkCargo = CARGO_SLINGLOAD:New( STATIC:FindByName( "Milk" ), "Food", "Milk", 100, 35 ) + +local FoodTask = TaskDispatcher:AddTransportTask( "Transport food", CargoSetFood, "Transport the workers and the food to the cantine." ) +TaskDispatcher:SetTransportDeployZone( FoodTask, ZONE:New( "Cantine" ) ) + +Hungry = { SPAWN:New( "Hungry 1" ), SPAWN:New( "Hungry 2" ), SPAWN:New( "Hungry 3" ), SPAWN:New( "Hungry 4" ), SPAWN:New( "Hungry 5" ) } + +function FoodTask:OnAfterCargoDeployed( From, Event, To, TaskUnit, Cargo, DeployZone ) + Hungry[ math.random(1,#Hungry) ]:Spawn() +end + diff --git a/TAD - Task Dispatching/CGO - Cargo Task Dispatching/TAD-CGO-009 - Transport Test - Respawning Cargo/TAD-CGO-009 - Transport Test - Respawning Cargo.miz b/TAD - Task Dispatching/CGO - Cargo Task Dispatching/TAD-CGO-009 - Transport Test - Respawning Cargo/TAD-CGO-009 - Transport Test - Respawning Cargo.miz index da475ae48b..34a3a2b3c5 100644 Binary files a/TAD - Task Dispatching/CGO - Cargo Task Dispatching/TAD-CGO-009 - Transport Test - Respawning Cargo/TAD-CGO-009 - Transport Test - Respawning Cargo.miz and b/TAD - Task Dispatching/CGO - Cargo Task Dispatching/TAD-CGO-009 - Transport Test - Respawning Cargo/TAD-CGO-009 - Transport Test - Respawning Cargo.miz differ diff --git a/TAD - Task Dispatching/CGO - Cargo Task Dispatching/TAD-CGO-010 - Transport Test - Register Cargos/TAD-CGO-010 - Transport Test - Register Cargos.lua b/TAD - Task Dispatching/CGO - Cargo Task Dispatching/TAD-CGO-010 - Transport Test - Register Cargos/TAD-CGO-010 - Transport Test - Register Cargos.lua index 33165c12b1..4c75ae4d83 100644 --- a/TAD - Task Dispatching/CGO - Cargo Task Dispatching/TAD-CGO-010 - Transport Test - Register Cargos/TAD-CGO-010 - Transport Test - Register Cargos.lua +++ b/TAD - Task Dispatching/CGO - Cargo Task Dispatching/TAD-CGO-010 - Transport Test - Register Cargos/TAD-CGO-010 - Transport Test - Register Cargos.lua @@ -1,84 +1,84 @@ ---- --- Name: TAD-CGO-010 - Transport Test - Register Cargos --- Author: FlightControl --- Date Created: 15 Apr 2018 --- --- # Situation: --- --- This mission demonstrates the dynamic task dispatching for cargo Transport operations of various cargo types. --- --- The cargo is defined within the mission editor. --- Each cargo is identified with a ~CARGO tag in the group name. --- --- When cargo is deployed at the Workplace, a large helicopter fleet will descend to the place ... --- When cargo is deployed at the Factory, a SAM site is activated ... --- When cargo is deployed at the Cantine, a some other army soldiers will arrive to join lunch ... --- - -HQ = GROUP:FindByName( "HQ", "Bravo" ) - -CommandCenter = COMMANDCENTER - :New( HQ, "Lima" ) - -Mission = MISSION - :New( CommandCenter, "Operation Cargo Fun", "Tactical", "Transport Cargo", coalition.side.RED ) - -TransportGroups = SET_GROUP:New():FilterCoalitions( "blue" ):FilterPrefixes( "Transport" ):FilterStart() - -TaskDispatcher = TASK_CARGO_DISPATCHER:New( Mission, TransportGroups ) - - --- This is the most important now. You setup a new SET_CARGO filtering the relevant type. --- The actual cargo objects are now created by MOOSE in the background. --- Each cargo is setup in the Mission Editor using the ~CARGO tag in the group name. --- This allows a truly dynamic setup. -local CargoSetWorkmaterials = SET_CARGO:New():FilterTypes( "Workmaterials" ):FilterStart() - -local WorkplaceTask = TaskDispatcher:AddTransportTask( "Build a Workplace", CargoSetWorkmaterials, "Transport the workers, engineers and the equipment near the Workplace." ) -TaskDispatcher:SetTransportDeployZone( WorkplaceTask, ZONE:New( "Workplace" ) ) - -Helos = { SPAWN:New( "Helicopters 1" ), SPAWN:New( "Helicopters 2" ), SPAWN:New( "Helicopters 3" ), SPAWN:New( "Helicopters 4" ), SPAWN:New( "Helicopters 5" ) } - -EnemyHelos = { SPAWN:New( "Enemy Helicopters 1" ), SPAWN:New( "Enemy Helicopters 2" ), SPAWN:New( "Enemy Helicopters 3" ) } - -function WorkplaceTask:OnAfterCargoDeployed( From, Event, To, TaskUnit, Cargo, DeployZone ) - Helos[ math.random(1,#Helos) ]:Spawn() - EnemyHelos[ math.random(1,#EnemyHelos) ]:Spawn() - -end - - - --- This is the most important now. You setup a new SET_CARGO filtering the relevant type. --- The actual cargo objects are now created by MOOSE in the background. --- Each cargo is setup in the Mission Editor using the ~CARGO tag in the group name. --- This allows a truly dynamic setup. -local CargoSetLiquids = SET_CARGO:New():FilterTypes( "Liquids" ):FilterStart() - -local FactoryTask = TaskDispatcher:AddTransportTask( "Transport liquids", CargoSetLiquids, "Transport the milk, gas, fuel, oil to the factory." ) -TaskDispatcher:SetTransportDeployZone( FactoryTask, ZONE:New( "Factory" ) ) - -SAMSites = { SPAWN:New( "SAM Site 1" ), SPAWN:New( "SAM Site 2" ), SPAWN:New( "SAM Site 3" ), SPAWN:New( "SAM Site 4" ), SPAWN:New( "SAM Site 5" ) } - -AirAttack = { SPAWN:New( "Russia Air Attack 1" ), SPAWN:New( "Russia Air Attack 2" ), SPAWN:New( "Russia Air Attack 3" ), SPAWN:New( "Russia Air Attack 4" ) } - -function FactoryTask:OnAfterCargoDeployed( From, Event, To, TaskUnit, Cargo, DeployZone ) - SAMSites[ math.random(1,#SAMSites) ]:Spawn() - AirAttack[ math.random(1,#AirAttack) ]:Spawn() -end - --- This is the most important now. You setup a new SET_CARGO filtering the relevant type. --- The actual cargo objects are now created by MOOSE in the background. --- Each cargo is setup in the Mission Editor using the ~CARGO tag in the group name. --- This allows a truly dynamic setup. -local CargoSetFood = SET_CARGO:New():FilterTypes( "Food" ):FilterStart() - -local FoodTask = TaskDispatcher:AddTransportTask( "Transport food", CargoSetFood, "Transport the workers and the food to the cantine." ) -TaskDispatcher:SetTransportDeployZone( FoodTask, ZONE:New( "Cantine" ) ) - -Hungry = { SPAWN:New( "Hungry 1" ), SPAWN:New( "Hungry 2" ), SPAWN:New( "Hungry 3" ), SPAWN:New( "Hungry 4" ), SPAWN:New( "Hungry 5" ) } - -function FoodTask:OnAfterCargoDeployed( From, Event, To, TaskUnit, Cargo, DeployZone ) - Hungry[ math.random(1,#Hungry) ]:Spawn() -end - +--- +-- Name: TAD-CGO-010 - Transport Test - Register Cargos +-- Author: FlightControl +-- Date Created: 15 Apr 2018 +-- +-- # Situation: +-- +-- This mission demonstrates the dynamic task dispatching for cargo Transport operations of various cargo types. +-- +-- The cargo is defined within the mission editor. +-- Each cargo is identified with a ~CARGO tag in the group name. +-- +-- When cargo is deployed at the Workplace, a large helicopter fleet will descend to the place ... +-- When cargo is deployed at the Factory, a SAM site is activated ... +-- When cargo is deployed at the Cantine, a some other army soldiers will arrive to join lunch ... +-- + +HQ = GROUP:FindByName( "HQ", "Bravo" ) + +CommandCenter = COMMANDCENTER + :New( HQ, "Lima" ) + +Mission = MISSION + :New( CommandCenter, "Operation Cargo Fun", "Tactical", "Transport Cargo", coalition.side.RED ) + +TransportGroups = SET_GROUP:New():FilterCoalitions( "blue" ):FilterPrefixes( "Transport" ):FilterStart() + +TaskDispatcher = TASK_CARGO_DISPATCHER:New( Mission, TransportGroups ) + + +-- This is the most important now. You setup a new SET_CARGO filtering the relevant type. +-- The actual cargo objects are now created by MOOSE in the background. +-- Each cargo is setup in the Mission Editor using the ~CARGO tag in the group name. +-- This allows a truly dynamic setup. +local CargoSetWorkmaterials = SET_CARGO:New():FilterTypes( "Workmaterials" ):FilterStart() + +local WorkplaceTask = TaskDispatcher:AddTransportTask( "Build a Workplace", CargoSetWorkmaterials, "Transport the workers, engineers and the equipment near the Workplace." ) +TaskDispatcher:SetTransportDeployZone( WorkplaceTask, ZONE:New( "Workplace" ) ) + +Helos = { SPAWN:New( "Helicopters 1" ), SPAWN:New( "Helicopters 2" ), SPAWN:New( "Helicopters 3" ), SPAWN:New( "Helicopters 4" ), SPAWN:New( "Helicopters 5" ) } + +EnemyHelos = { SPAWN:New( "Enemy Helicopters 1" ), SPAWN:New( "Enemy Helicopters 2" ), SPAWN:New( "Enemy Helicopters 3" ) } + +function WorkplaceTask:OnAfterCargoDeployed( From, Event, To, TaskUnit, Cargo, DeployZone ) + Helos[ math.random(1,#Helos) ]:Spawn() + EnemyHelos[ math.random(1,#EnemyHelos) ]:Spawn() + +end + + + +-- This is the most important now. You setup a new SET_CARGO filtering the relevant type. +-- The actual cargo objects are now created by MOOSE in the background. +-- Each cargo is setup in the Mission Editor using the ~CARGO tag in the group name. +-- This allows a truly dynamic setup. +local CargoSetLiquids = SET_CARGO:New():FilterTypes( "Liquids" ):FilterStart() + +local FactoryTask = TaskDispatcher:AddTransportTask( "Transport liquids", CargoSetLiquids, "Transport the milk, gas, fuel, oil to the factory." ) +TaskDispatcher:SetTransportDeployZone( FactoryTask, ZONE:New( "Factory" ) ) + +SAMSites = { SPAWN:New( "SAM Site 1" ), SPAWN:New( "SAM Site 2" ), SPAWN:New( "SAM Site 3" ), SPAWN:New( "SAM Site 4" ), SPAWN:New( "SAM Site 5" ) } + +AirAttack = { SPAWN:New( "Russia Air Attack 1" ), SPAWN:New( "Russia Air Attack 2" ), SPAWN:New( "Russia Air Attack 3" ), SPAWN:New( "Russia Air Attack 4" ) } + +function FactoryTask:OnAfterCargoDeployed( From, Event, To, TaskUnit, Cargo, DeployZone ) + SAMSites[ math.random(1,#SAMSites) ]:Spawn() + AirAttack[ math.random(1,#AirAttack) ]:Spawn() +end + +-- This is the most important now. You setup a new SET_CARGO filtering the relevant type. +-- The actual cargo objects are now created by MOOSE in the background. +-- Each cargo is setup in the Mission Editor using the ~CARGO tag in the group name. +-- This allows a truly dynamic setup. +local CargoSetFood = SET_CARGO:New():FilterTypes( "Food" ):FilterStart() + +local FoodTask = TaskDispatcher:AddTransportTask( "Transport food", CargoSetFood, "Transport the workers and the food to the cantine." ) +TaskDispatcher:SetTransportDeployZone( FoodTask, ZONE:New( "Cantine" ) ) + +Hungry = { SPAWN:New( "Hungry 1" ), SPAWN:New( "Hungry 2" ), SPAWN:New( "Hungry 3" ), SPAWN:New( "Hungry 4" ), SPAWN:New( "Hungry 5" ) } + +function FoodTask:OnAfterCargoDeployed( From, Event, To, TaskUnit, Cargo, DeployZone ) + Hungry[ math.random(1,#Hungry) ]:Spawn() +end + diff --git a/TAD - Task Dispatching/CGO - Cargo Task Dispatching/TAD-CGO-010 - Transport Test - Register Cargos/TAD-CGO-010 - Transport Test - Register Cargos.miz b/TAD - Task Dispatching/CGO - Cargo Task Dispatching/TAD-CGO-010 - Transport Test - Register Cargos/TAD-CGO-010 - Transport Test - Register Cargos.miz index e36c2ead3d..4574451af8 100644 Binary files a/TAD - Task Dispatching/CGO - Cargo Task Dispatching/TAD-CGO-010 - Transport Test - Register Cargos/TAD-CGO-010 - Transport Test - Register Cargos.miz and b/TAD - Task Dispatching/CGO - Cargo Task Dispatching/TAD-CGO-010 - Transport Test - Register Cargos/TAD-CGO-010 - Transport Test - Register Cargos.miz differ diff --git a/TAD - Task Dispatching/CGO - Cargo Task Dispatching/TAD-CGO-011 - CSAR - Zone/TAD-CGO-011 - CSAR - Zone.lua b/TAD - Task Dispatching/CGO - Cargo Task Dispatching/TAD-CGO-011 - CSAR - Zone/TAD-CGO-011 - CSAR - Zone.lua index 71cc8daec5..8427057e7b 100644 --- a/TAD - Task Dispatching/CGO - Cargo Task Dispatching/TAD-CGO-011 - CSAR - Zone/TAD-CGO-011 - CSAR - Zone.lua +++ b/TAD - Task Dispatching/CGO - Cargo Task Dispatching/TAD-CGO-011 - CSAR - Zone/TAD-CGO-011 - CSAR - Zone.lua @@ -1,36 +1,36 @@ ---- --- Name: TAD-CGO-011 - CSAR - Zone --- Author: FlightControl --- Date Created: 01 Oct 2018 --- --- # Situation: --- --- This mission demonstrates the dynamic task dispatching for cargo CSAR operations. --- It will only spawn pilots for rescue when the pilots eject in the zones indicated. - -HQ = GROUP:FindByName( "HQ", "Bravo" ) - -CommandCenter = COMMANDCENTER - :New( HQ, "Lima" ) - -Mission = MISSION - :New( CommandCenter, "CSAR Missions", "Tactical", "Rescue downed pilots.", coalition.side.RED ) - -AttackGroups = SET_GROUP:New():FilterCoalitions( "red" ):FilterPrefixes( "Rescue" ):FilterStart() - -TaskDispatcher = TASK_CARGO_DISPATCHER:New( Mission, AttackGroups ) - -TaskDispatcher:SetCSARZones( SET_ZONE:New():FilterPrefixes("CSAR"):FilterOnce() ) - -TaskDispatcher:StartCSARTasks( - "CSAR", - { ZONE_UNIT:New( "Hospital", STATIC:FindByName( "Hospital" ), 100 ) }, - "One of our pilots has ejected. Go out to Search and Rescue our pilot!\n" .. - "Use the radio menu to let the command center assist you with the CSAR tasking." -) - -function TaskDispatcher:OnAfterCargoDeployed( From, Event, To, Task, TaskPrefix, TaskUnit, Cargo, DeployZone ) - - MESSAGE:NewType( "Unit " .. TaskUnit:GetName().. " has deployed cargo " .. Cargo:GetName() .. " at zone " .. DeployZone:GetName() .. " for task " .. Task:GetName() .. ".", MESSAGE.Type.Information ):ToAll() - -end +--- +-- Name: TAD-CGO-011 - CSAR - Zone +-- Author: FlightControl +-- Date Created: 01 Oct 2018 +-- +-- # Situation: +-- +-- This mission demonstrates the dynamic task dispatching for cargo CSAR operations. +-- It will only spawn pilots for rescue when the pilots eject in the zones indicated. + +HQ = GROUP:FindByName( "HQ", "Bravo" ) + +CommandCenter = COMMANDCENTER + :New( HQ, "Lima" ) + +Mission = MISSION + :New( CommandCenter, "CSAR Missions", "Tactical", "Rescue downed pilots.", coalition.side.RED ) + +AttackGroups = SET_GROUP:New():FilterCoalitions( "red" ):FilterPrefixes( "Rescue" ):FilterStart() + +TaskDispatcher = TASK_CARGO_DISPATCHER:New( Mission, AttackGroups ) + +TaskDispatcher:SetCSARZones( SET_ZONE:New():FilterPrefixes("CSAR"):FilterOnce() ) + +TaskDispatcher:StartCSARTasks( + "CSAR", + { ZONE_UNIT:New( "Hospital", STATIC:FindByName( "Hospital" ), 100 ) }, + "One of our pilots has ejected. Go out to Search and Rescue our pilot!\n" .. + "Use the radio menu to let the command center assist you with the CSAR tasking." +) + +function TaskDispatcher:OnAfterCargoDeployed( From, Event, To, Task, TaskPrefix, TaskUnit, Cargo, DeployZone ) + + MESSAGE:NewType( "Unit " .. TaskUnit:GetName().. " has deployed cargo " .. Cargo:GetName() .. " at zone " .. DeployZone:GetName() .. " for task " .. Task:GetName() .. ".", MESSAGE.Type.Information ):ToAll() + +end diff --git a/TAD - Task Dispatching/CGO - Cargo Task Dispatching/TAD-CGO-011 - CSAR - Zone/TAD-CGO-011 - CSAR - Zone.miz b/TAD - Task Dispatching/CGO - Cargo Task Dispatching/TAD-CGO-011 - CSAR - Zone/TAD-CGO-011 - CSAR - Zone.miz index 47bfd9653b..8e2bec0156 100644 Binary files a/TAD - Task Dispatching/CGO - Cargo Task Dispatching/TAD-CGO-011 - CSAR - Zone/TAD-CGO-011 - CSAR - Zone.miz and b/TAD - Task Dispatching/CGO - Cargo Task Dispatching/TAD-CGO-011 - CSAR - Zone/TAD-CGO-011 - CSAR - Zone.miz differ diff --git a/TAD - Task Dispatching/CGO - Cargo Task Dispatching/TAD-CGO-012 - CSAR - Maximum/TAD-CGO-012 - CSAR - Maximum.lua b/TAD - Task Dispatching/CGO - Cargo Task Dispatching/TAD-CGO-012 - CSAR - Maximum/TAD-CGO-012 - CSAR - Maximum.lua index 7560365877..2e76013e6f 100644 --- a/TAD - Task Dispatching/CGO - Cargo Task Dispatching/TAD-CGO-012 - CSAR - Maximum/TAD-CGO-012 - CSAR - Maximum.lua +++ b/TAD - Task Dispatching/CGO - Cargo Task Dispatching/TAD-CGO-012 - CSAR - Maximum/TAD-CGO-012 - CSAR - Maximum.lua @@ -1,36 +1,36 @@ ---- --- Name: TAD-CGO-012 - CSAR - Maximum --- Author: FlightControl --- Date Created: 01 Oct 2018 --- --- # Situation: --- --- This mission demonstrates the dynamic task dispatching for cargo CSAR operations. --- It will only spawn 5 pilots for rescue when the pilots eject. - -HQ = GROUP:FindByName( "HQ", "Bravo" ) - -CommandCenter = COMMANDCENTER - :New( HQ, "Lima" ) - -Mission = MISSION - :New( CommandCenter, "CSAR Missions", "Tactical", "Rescue downed pilots.", coalition.side.RED ) - -AttackGroups = SET_GROUP:New():FilterCoalitions( "red" ):FilterPrefixes( "Rescue" ):FilterStart() - -TaskDispatcher = TASK_CARGO_DISPATCHER:New( Mission, AttackGroups ) - -TaskDispatcher:SetMaxCSAR( 5 ) - -TaskDispatcher:StartCSARTasks( - "CSAR", - { ZONE_UNIT:New( "Hospital", STATIC:FindByName( "Hospital" ), 100 ) }, - "One of our pilots has ejected. Go out to Search and Rescue our pilot!\n" .. - "Use the radio menu to let the command center assist you with the CSAR tasking." -) - -function TaskDispatcher:OnAfterCargoDeployed( From, Event, To, Task, TaskPrefix, TaskUnit, Cargo, DeployZone ) - - MESSAGE:NewType( "Unit " .. TaskUnit:GetName().. " has deployed cargo " .. Cargo:GetName() .. " at zone " .. DeployZone:GetName() .. " for task " .. Task:GetName() .. ".", MESSAGE.Type.Information ):ToAll() - -end +--- +-- Name: TAD-CGO-011 - CSAR - Zone tests +-- Author: FlightControl +-- Date Created: 01 Oct 2018 +-- +-- # Situation: +-- +-- This mission demonstrates the dynamic task dispatching for cargo CSAR operations. +-- It will only spawn pilots for rescue when the pilots eject in the zones indicated. + +HQ = GROUP:FindByName( "HQ", "Bravo" ) + +CommandCenter = COMMANDCENTER + :New( HQ, "Lima" ) + +Mission = MISSION + :New( CommandCenter, "CSAR Missions", "Tactical", "Rescue downed pilots.", coalition.side.RED ) + +AttackGroups = SET_GROUP:New():FilterCoalitions( "red" ):FilterPrefixes( "Rescue" ):FilterStart() + +TaskDispatcher = TASK_CARGO_DISPATCHER:New( Mission, AttackGroups ) + +TaskDispatcher:SetMaxCSAR( 5 ) + +TaskDispatcher:StartCSARTasks( + "CSAR", + { ZONE_UNIT:New( "Hospital", STATIC:FindByName( "Hospital" ), 100 ) }, + "One of our pilots has ejected. Go out to Search and Rescue our pilot!\n" .. + "Use the radio menu to let the command center assist you with the CSAR tasking." +) + +function TaskDispatcher:OnAfterCargoDeployed( From, Event, To, Task, TaskPrefix, TaskUnit, Cargo, DeployZone ) + + MESSAGE:NewType( "Unit " .. TaskUnit:GetName().. " has deployed cargo " .. Cargo:GetName() .. " at zone " .. DeployZone:GetName() .. " for task " .. Task:GetName() .. ".", MESSAGE.Type.Information ):ToAll() + +end diff --git a/TAD - Task Dispatching/CGO - Cargo Task Dispatching/TAD-CGO-012 - CSAR - Maximum/TAD-CGO-012 - CSAR - Maximum.miz b/TAD - Task Dispatching/CGO - Cargo Task Dispatching/TAD-CGO-012 - CSAR - Maximum/TAD-CGO-012 - CSAR - Maximum.miz index 5e754bd64e..56607f9919 100644 Binary files a/TAD - Task Dispatching/CGO - Cargo Task Dispatching/TAD-CGO-012 - CSAR - Maximum/TAD-CGO-012 - CSAR - Maximum.miz and b/TAD - Task Dispatching/CGO - Cargo Task Dispatching/TAD-CGO-012 - CSAR - Maximum/TAD-CGO-012 - CSAR - Maximum.miz differ diff --git a/TAD - Task Dispatching/CGO - Cargo Task Dispatching/TAD-CGO-013 - Transport - Pickup and deploy from roof/TAD-CGO-013 - Transport - Pickup and deploy from roof.lua b/TAD - Task Dispatching/CGO - Cargo Task Dispatching/TAD-CGO-013 - Transport - Pickup and deploy from roof/TAD-CGO-013 - Transport - Pickup and deploy from roof.lua index 04fb48016a..3f08ed4a21 100644 --- a/TAD - Task Dispatching/CGO - Cargo Task Dispatching/TAD-CGO-013 - Transport - Pickup and deploy from roof/TAD-CGO-013 - Transport - Pickup and deploy from roof.lua +++ b/TAD - Task Dispatching/CGO - Cargo Task Dispatching/TAD-CGO-013 - Transport - Pickup and deploy from roof/TAD-CGO-013 - Transport - Pickup and deploy from roof.lua @@ -1,34 +1,34 @@ ---- --- Name: TAD-CGO-008 - Transport Test - PickedUp and Deployed Handling --- Author: FlightControl --- Date Created: 12 Oct 2018 --- --- Test to pickup cargo from the roof of a building. --- - -HQ = GROUP:FindByName( "HQ", "Bravo" ) - -CommandCenter = COMMANDCENTER - :New( HQ, "Lima" ) - -Mission = MISSION - :New( CommandCenter, "Operation Cargo Fun", "Tactical", "Transport Cargo", coalition.side.RED ) - -TransportGroups = SET_GROUP:New():FilterCoalitions( "blue" ):FilterPrefixes( "Transport" ):FilterStart() - -CargoWorkers = SET_CARGO:New():FilterTypes( "Workers" ):FilterStart() - -TaskDispatcher = TASK_CARGO_DISPATCHER:New( Mission, TransportGroups ) - -local WorkersTask = TaskDispatcher:AddTransportTask( "Transport Workers", CargoWorkers, "Transport the workers to the other building." ) -TaskDispatcher:SetTransportDeployZone( WorkersTask, ZONE:New( "Workplace" ) ) - - --- Here we tailor the CargoDeployed event of the TaskDispatcher. - -function TaskDispatcher:OnAfterCargoDeployed( From, Event, To, Task, TaskPrefix, TaskUnit, Cargo, DeployZone ) - - MESSAGE:NewType( "Unit " .. TaskUnit:GetName().. " has deployed cargo " .. Cargo:GetName() .. " at zone " .. DeployZone:GetName() .. " for task " .. Task:GetName() .. ".", MESSAGE.Type.Information ):ToAll() - -end - +--- +-- Name: TAD-CGO-008 - Transport Test - PickedUp and Deployed Handling +-- Author: FlightControl +-- Date Created: 12 Oct 2018 +-- +-- Test to pickup cargo from the roof of a building. +-- + +HQ = GROUP:FindByName( "HQ", "Bravo" ) + +CommandCenter = COMMANDCENTER + :New( HQ, "Lima" ) + +Mission = MISSION + :New( CommandCenter, "Operation Cargo Fun", "Tactical", "Transport Cargo", coalition.side.RED ) + +TransportGroups = SET_GROUP:New():FilterCoalitions( "blue" ):FilterPrefixes( "Transport" ):FilterStart() + +CargoWorkers = SET_CARGO:New():FilterTypes( "Workers" ):FilterStart() + +TaskDispatcher = TASK_CARGO_DISPATCHER:New( Mission, TransportGroups ) + +local WorkersTask = TaskDispatcher:AddTransportTask( "Transport Workers", CargoWorkers, "Transport the workers to the other building." ) +TaskDispatcher:SetTransportDeployZone( WorkersTask, ZONE:New( "Workplace" ) ) + + +-- Here we tailor the CargoDeployed event of the TaskDispatcher. + +function TaskDispatcher:OnAfterCargoDeployed( From, Event, To, Task, TaskPrefix, TaskUnit, Cargo, DeployZone ) + + MESSAGE:NewType( "Unit " .. TaskUnit:GetName().. " has deployed cargo " .. Cargo:GetName() .. " at zone " .. DeployZone:GetName() .. " for task " .. Task:GetName() .. ".", MESSAGE.Type.Information ):ToAll() + +end + diff --git a/TAD - Task Dispatching/CGO - Cargo Task Dispatching/TAD-CGO-013 - Transport - Pickup and deploy from roof/TAD-CGO-013 - Transport - Pickup and deploy from roof.miz b/TAD - Task Dispatching/CGO - Cargo Task Dispatching/TAD-CGO-013 - Transport - Pickup and deploy from roof/TAD-CGO-013 - Transport - Pickup and deploy from roof.miz index 406f3f7acb..489f0a6f92 100644 Binary files a/TAD - Task Dispatching/CGO - Cargo Task Dispatching/TAD-CGO-013 - Transport - Pickup and deploy from roof/TAD-CGO-013 - Transport - Pickup and deploy from roof.miz and b/TAD - Task Dispatching/CGO - Cargo Task Dispatching/TAD-CGO-013 - Transport - Pickup and deploy from roof/TAD-CGO-013 - Transport - Pickup and deploy from roof.miz differ diff --git a/TSK - Task Modelling/A2A - Air to Air/TSK-300 - A2A - SWEEP/TSK-300 - A2A - SWEEP.lua b/TSK - Task Modelling/A2A - Air to Air/TSK-300 - A2A - SWEEP/TSK-300 - A2A - SWEEP.lua index a3740b11c6..5c878cc5dc 100644 --- a/TSK - Task Modelling/A2A - Air to Air/TSK-300 - A2A - SWEEP/TSK-300 - A2A - SWEEP.lua +++ b/TSK - Task Modelling/A2A - Air to Air/TSK-300 - A2A - SWEEP/TSK-300 - A2A - SWEEP.lua @@ -1,31 +1,30 @@ ---- --- Name: TSK-300 - A2A - SWEEP --- Author: FlightControl --- Date Created: 28 May 2017 --- --- # Situation: --- --- This mission demonstrates the Sweeping of target areas. --- --- # Test cases: - - -do - local HQ = GROUP:FindByName( "HQ", "Bravo HQ" ) - - local CommandCenter = COMMANDCENTER:New( HQ, "Bravo" ) - - local Scoring = SCORING:New( "Target Sweeping Demonstration" ) - - local Mission = MISSION - :New( CommandCenter, "Sweeping", "Primary", "Wait until the detected targets get undetected. And see if a SWEEP task is allocated.", coalition.side.BLUE ) - :AddScoring( Scoring ) - - AttackGroups = SET_GROUP:New():FilterCoalitions( "red" ):FilterPrefixes( "Attack" ):FilterStart() - - TargetSetUnit = SET_UNIT:New():FilterCoalitions( "blue" ):FilterPrefixes( "Target" ):FilterStart() - - TaskSWEEP = TASK_A2A_SWEEP:New( Mission, AttackGroups, "SWEEP", TargetSetUnit ) - -end - +--- +-- Name: TSK-300 - A2A - SWEEP +-- Author: FlightControl +-- Date Created: 28 May 2017 +-- +-- # Situation: +-- +-- This mission demonstrates the Sweeping of target areas. +-- +-- # Test cases: + +do + local HQ = GROUP:FindByName( "HQ", "Bravo HQ" ) + + local CommandCenter = COMMANDCENTER:New( HQ, "Bravo" ) + + local Scoring = SCORING:New( "Target Sweeping Demonstration" ) + + local Mission = MISSION + :New( CommandCenter, "Sweeping", "Primary", "Wait until the detected targets get undetected. And see if a SWEEP task is allocated.", coalition.side.BLUE ) + :AddScoring( Scoring ) + + AttackGroups = SET_GROUP:New():FilterCoalitions( "red" ):FilterPrefixes( "Attack" ):FilterStart() + + TargetSetUnit = SET_UNIT:New():FilterCoalitions( "blue" ):FilterPrefixes( "Target" ):FilterStart() + + TaskSWEEP = TASK_A2A_SWEEP:New( Mission, AttackGroups, "SWEEP", TargetSetUnit ) + +end + diff --git a/TSK - Task Modelling/A2A - Air to Air/TSK-300 - A2A - SWEEP/TSK-300 - A2A - SWEEP.miz b/TSK - Task Modelling/A2A - Air to Air/TSK-300 - A2A - SWEEP/TSK-300 - A2A - SWEEP.miz index 4e3c25517f..fb0da038b2 100644 Binary files a/TSK - Task Modelling/A2A - Air to Air/TSK-300 - A2A - SWEEP/TSK-300 - A2A - SWEEP.miz and b/TSK - Task Modelling/A2A - Air to Air/TSK-300 - A2A - SWEEP/TSK-300 - A2A - SWEEP.miz differ diff --git a/TSK - Task Modelling/A2G - Air to Ground/TSK-A2A-100 - SEAD/TSK-010 - Task Modelling - SEAD.lua b/TSK - Task Modelling/A2G - Air to Ground/TSK-A2A-100 - SEAD/TSK-010 - Task Modelling - SEAD.lua new file mode 100644 index 0000000000..26ccd154b2 --- /dev/null +++ b/TSK - Task Modelling/A2G - Air to Ground/TSK-A2A-100 - SEAD/TSK-010 - Task Modelling - SEAD.lua @@ -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) diff --git a/TSK - Task Modelling/A2G - Air to Ground/TSK-A2A-100 - SEAD/TSK-A2A-100 - SEAD.miz b/TSK - Task Modelling/A2G - Air to Ground/TSK-A2A-100 - SEAD/TSK-A2A-100 - SEAD.miz index 5bf7fdf461..7cd2d70aef 100644 Binary files a/TSK - Task Modelling/A2G - Air to Ground/TSK-A2A-100 - SEAD/TSK-A2A-100 - SEAD.miz and b/TSK - Task Modelling/A2G - Air to Ground/TSK-A2A-100 - SEAD/TSK-A2A-100 - SEAD.miz differ diff --git a/TSK - Task Modelling/A2G - Air to Ground/TSK-A2A-200 - BAI/TSK-100 - A2G - BAI.lua b/TSK - Task Modelling/A2G - Air to Ground/TSK-A2A-200 - BAI/TSK-100 - A2G - BAI.lua new file mode 100644 index 0000000000..98f2e43a55 --- /dev/null +++ b/TSK - Task Modelling/A2G - Air to Ground/TSK-A2A-200 - BAI/TSK-100 - A2G - BAI.lua @@ -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 ) diff --git a/TSK - Task Modelling/A2G - Air to Ground/TSK-A2A-200 - BAI/TSK-A2A-200 - BAI.miz b/TSK - Task Modelling/A2G - Air to Ground/TSK-A2A-200 - BAI/TSK-A2A-200 - BAI.miz index d1e46d81c6..5f2c0d2544 100644 Binary files a/TSK - Task Modelling/A2G - Air to Ground/TSK-A2A-200 - BAI/TSK-A2A-200 - BAI.miz and b/TSK - Task Modelling/A2G - Air to Ground/TSK-A2A-200 - BAI/TSK-A2A-200 - BAI.miz differ diff --git a/TSK - Task Modelling/A2G - Air to Ground/TSK-A2G-110 - BAI - WWII Mode/TSK-101 - A2G - BAI - WWII Mode.lua b/TSK - Task Modelling/A2G - Air to Ground/TSK-A2G-110 - BAI - WWII Mode/TSK-101 - A2G - BAI - WWII Mode.lua new file mode 100644 index 0000000000..1aaf6fd36e --- /dev/null +++ b/TSK - Task Modelling/A2G - Air to Ground/TSK-A2G-110 - BAI - WWII Mode/TSK-101 - A2G - BAI - WWII Mode.lua @@ -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 ) diff --git a/TSK - Task Modelling/A2G - Air to Ground/TSK-A2G-110 - BAI - WWII Mode/TSK-A2G-110 - BAI - WWII Mode.miz b/TSK - Task Modelling/A2G - Air to Ground/TSK-A2G-110 - BAI - WWII Mode/TSK-A2G-110 - BAI - WWII Mode.miz index 09a271fd0f..566d408cf3 100644 Binary files a/TSK - Task Modelling/A2G - Air to Ground/TSK-A2G-110 - BAI - WWII Mode/TSK-A2G-110 - BAI - WWII Mode.miz and b/TSK - Task Modelling/A2G - Air to Ground/TSK-A2G-110 - BAI - WWII Mode/TSK-A2G-110 - BAI - WWII Mode.miz differ diff --git a/TSK - Task Modelling/CGO - Cargo Transportation/TSK-CGO-000 - Boarding Test/TSK-CGO-000 - Boarding Test.lua b/TSK - Task Modelling/CGO - Cargo Transportation/TSK-CGO-000 - Boarding Test/TSK-CGO-000 - Boarding Test.lua index 3821de4ec7..1c70f53eca 100644 --- a/TSK - Task Modelling/CGO - Cargo Transportation/TSK-CGO-000 - Boarding Test/TSK-CGO-000 - Boarding Test.lua +++ b/TSK - Task Modelling/CGO - Cargo Transportation/TSK-CGO-000 - Boarding Test/TSK-CGO-000 - Boarding Test.lua @@ -1,78 +1,78 @@ ---- --- Name: TSK-CGO-000 - Boarding Test --- Author: FlightControl --- Date Created: 12 Apr 2017 --- --- This mission demonstrates the transport of a cargo group using an APC. --- --- There is: --- - 1 APC. --- - 2 Transport Tasks - Transport Workers and Transport Engineers. --- - 2 Cargo - Workers and Engineers. --- - 2 Deployment Zones - Alpha and Beta. --- --- Task Engineers: Transport the Engineers to Deployment Zone Alpha or Zone Beta. --- Task Workers: Transport the Workers to Deployment Zone Beta. --- - -do - local HQ = GROUP:FindByName( "HQ", "Bravo HQ" ) - - local CommandCenter = COMMANDCENTER:New( HQ, "Bravo" ) - - local Scoring = SCORING:New( "Cargo Group Transport Demonstration" ) - - local Mission = MISSION - :New( CommandCenter, "Transport", "High", "Transport the team from Deploy Zone 1 to Deploy Zone 2", coalition.side.BLUE ) - :AddScoring( Scoring ) - - -- Allocate the Transport, which is an APC in the field. - local APC = SET_GROUP:New():FilterPrefixes( "Transport" ):FilterStart() - - -- We will setup the transportation for Engineers. - - -- Here we define the "cargo set", which is a collection of cargo objects. - -- The cargo set will be the input for the cargo transportation task. - -- So a transportation object is handling a cargo set, which is automatically refreshed when new cargo is added/deleted. - local EngineersCargoSet = SET_CARGO:New():FilterTypes( "Engineers" ):FilterStart() - - -- Now we add cargo into the battle scene. - local EngineersGroup = GROUP:FindByName( "Engineers" ) - - -- CARGO_GROUP can be used to setup cargo with a GROUP object underneath. - -- We name this group Engineers. - -- Note that the name of the cargo is "Engineers". - -- The cargoset "EngineersCargoSet" will embed all defined cargo of type Engineers (prefix) into its set. - local EngineersCargoGroup = CARGO_GROUP:New( EngineersGroup, "Engineers", "Radar Team", 500 ) - - - -- We setup the task to transport engineers. - EngineersCargoTransportTask = TASK_CARGO_TRANSPORT:New( Mission, APC, "Transport Engineers", EngineersCargoSet ) - - -- We setup to deploy workers in the deploy zone 1 and 2 (the player can choose). - EngineersCargoTransportTask:AddDeployZone( ZONE_POLYGON:New( "Deploy Zone Alpha", GROUP:FindByName("DeployZone Alpha") ) ) - EngineersCargoTransportTask:AddDeployZone( ZONE_POLYGON:New( "Deploy Zone Beta", GROUP:FindByName("DeployZone Beta") ) ) - - - -- Here we define the "cargo set", which is a collection of cargo objects. - -- The cargo set will be the input for the cargo transportation task. - -- So a transportation object is handling a cargo set, which is automatically refreshed when new cargo is added/deleted. - local WorkersCargoSet = SET_CARGO:New():FilterTypes( "Workers" ):FilterStart() - - local WorkersGroup = GROUP:FindByName( "Workers" ) - - -- CARGO_GROUP can be used to setup cargo with a GROUP object underneath. - -- We name this group Engineers. - -- Note that the name of the cargo is "Workers". - -- The cargoset "WorkersCargoSet" will embed all defined cargo of type Workers (prefix) into its set. - local WorkersCargoGroup = CARGO_GROUP:New( WorkersGroup, "Workers", "Mechanics", 500 ) - - - -- We setup the task to transport workers. - WorkersCargoTransportTask = TASK_CARGO_TRANSPORT:New( Mission, APC, "Transport Workers", WorkersCargoSet ) - - -- We setup to deploy workers in the deploy zone 1. - WorkersCargoTransportTask:AddDeployZone( ZONE_POLYGON:New( "Deploy Zone Beta", GROUP:FindByName("DeployZone Beta") ) ) - -end - +--- +-- Name: TSK-CGO-000 - Boarding Test +-- Author: FlightControl +-- Date Created: 12 Apr 2017 +-- +-- This mission demonstrates the transport of a cargo group using an APC. +-- +-- There is: +-- - 1 APC. +-- - 2 Transport Tasks - Transport Workers and Transport Engineers. +-- - 2 Cargo - Workers and Engineers. +-- - 2 Deployment Zones - Alpha and Beta. +-- +-- Task Engineers: Transport the Engineers to Deployment Zone Alpha or Zone Beta. +-- Task Workers: Transport the Workers to Deployment Zone Beta. +-- + +do + local HQ = GROUP:FindByName( "HQ", "Bravo HQ" ) + + local CommandCenter = COMMANDCENTER:New( HQ, "Bravo" ) + + local Scoring = SCORING:New( "Cargo Group Transport Demonstration" ) + + local Mission = MISSION + :New( CommandCenter, "Transport", "High", "Transport the team from Deploy Zone 1 to Deploy Zone 2", coalition.side.BLUE ) + :AddScoring( Scoring ) + + -- Allocate the Transport, which is an APC in the field. + local APC = SET_GROUP:New():FilterPrefixes( "Transport" ):FilterStart() + + -- We will setup the transportation for Engineers. + + -- Here we define the "cargo set", which is a collection of cargo objects. + -- The cargo set will be the input for the cargo transportation task. + -- So a transportation object is handling a cargo set, which is automatically refreshed when new cargo is added/deleted. + local EngineersCargoSet = SET_CARGO:New():FilterTypes( "Engineers" ):FilterStart() + + -- Now we add cargo into the battle scene. + local EngineersGroup = GROUP:FindByName( "Engineers" ) + + -- CARGO_GROUP can be used to setup cargo with a GROUP object underneath. + -- We name this group Engineers. + -- Note that the name of the cargo is "Engineers". + -- The cargoset "EngineersCargoSet" will embed all defined cargo of type Engineers (prefix) into its set. + local EngineersCargoGroup = CARGO_GROUP:New( EngineersGroup, "Engineers", "Radar Team", 500 ) + + + -- We setup the task to transport engineers. + EngineersCargoTransportTask = TASK_CARGO_TRANSPORT:New( Mission, APC, "Transport Engineers", EngineersCargoSet ) + + -- We setup to deploy workers in the deploy zone 1 and 2 (the player can choose). + EngineersCargoTransportTask:AddDeployZone( ZONE_POLYGON:New( "Deploy Zone Alpha", GROUP:FindByName("DeployZone Alpha") ) ) + EngineersCargoTransportTask:AddDeployZone( ZONE_POLYGON:New( "Deploy Zone Beta", GROUP:FindByName("DeployZone Beta") ) ) + + + -- Here we define the "cargo set", which is a collection of cargo objects. + -- The cargo set will be the input for the cargo transportation task. + -- So a transportation object is handling a cargo set, which is automatically refreshed when new cargo is added/deleted. + local WorkersCargoSet = SET_CARGO:New():FilterTypes( "Workers" ):FilterStart() + + local WorkersGroup = GROUP:FindByName( "Workers" ) + + -- CARGO_GROUP can be used to setup cargo with a GROUP object underneath. + -- We name this group Engineers. + -- Note that the name of the cargo is "Workers". + -- The cargoset "WorkersCargoSet" will embed all defined cargo of type Workers (prefix) into its set. + local WorkersCargoGroup = CARGO_GROUP:New( WorkersGroup, "Workers", "Mechanics", 500 ) + + + -- We setup the task to transport workers. + WorkersCargoTransportTask = TASK_CARGO_TRANSPORT:New( Mission, APC, "Transport Workers", WorkersCargoSet ) + + -- We setup to deploy workers in the deploy zone 1. + WorkersCargoTransportTask:AddDeployZone( ZONE_POLYGON:New( "Deploy Zone Beta", GROUP:FindByName("DeployZone Beta") ) ) + +end + diff --git a/TSK - Task Modelling/CGO - Cargo Transportation/TSK-CGO-000 - Boarding Test/TSK-CGO-000 - Boarding Test.miz b/TSK - Task Modelling/CGO - Cargo Transportation/TSK-CGO-000 - Boarding Test/TSK-CGO-000 - Boarding Test.miz index 45138ef9e8..653af552be 100644 Binary files a/TSK - Task Modelling/CGO - Cargo Transportation/TSK-CGO-000 - Boarding Test/TSK-CGO-000 - Boarding Test.miz and b/TSK - Task Modelling/CGO - Cargo Transportation/TSK-CGO-000 - Boarding Test/TSK-CGO-000 - Boarding Test.miz differ diff --git a/TSK - Task Modelling/CGO - Cargo Transportation/TSK-CGO-010 - Ground - Respawn on CargoGroup Destroyed/TSK-CGO-010 - Ground - Respawn on CargoGroup Destroyed.lua b/TSK - Task Modelling/CGO - Cargo Transportation/TSK-CGO-010 - Ground - Respawn on CargoGroup Destroyed/TSK-CGO-010 - Ground - Respawn on CargoGroup Destroyed.lua index 282ba4c27b..12af227c27 100644 --- a/TSK - Task Modelling/CGO - Cargo Transportation/TSK-CGO-010 - Ground - Respawn on CargoGroup Destroyed/TSK-CGO-010 - Ground - Respawn on CargoGroup Destroyed.lua +++ b/TSK - Task Modelling/CGO - Cargo Transportation/TSK-CGO-010 - Ground - Respawn on CargoGroup Destroyed/TSK-CGO-010 - Ground - Respawn on CargoGroup Destroyed.lua @@ -1,78 +1,78 @@ ---- --- Name: TSK-CGO-100 - Ground - APC Test --- Author: FlightControl --- Date Created: 12 Apr 2017 --- --- This mission demonstrates the transport of a cargo group using an APC. --- --- There is: --- - 1 APC. --- - 2 Transport Tasks - Transport Workers and Transport Engineers. --- - 2 Cargo - Workers and Engineers. --- - 2 Deployment Zones - Alpha and Beta. --- --- Task Engineers: Transport the Engineers to Deployment Zone Alpha or Zone Beta. --- Task Workers: Transport the Workers to Deployment Zone Beta. --- - -do - local HQ = GROUP:FindByName( "HQ", "Bravo HQ" ) - - local CommandCenter = COMMANDCENTER:New( HQ, "Bravo" ) - - local Scoring = SCORING:New( "Cargo Group Transport Demonstration" ) - - local Mission = MISSION - :New( CommandCenter, "Transport", "High", "Transport the team from Deploy Zone 1 to Deploy Zone 2", coalition.side.BLUE ) - :AddScoring( Scoring ) - - -- Allocate the Transport, which is an APC in the field. - local APC = SET_GROUP:New():FilterPrefixes( "Transport" ):FilterStart() - - -- We will setup the transportation for Engineers. - - -- Here we define the "cargo set", which is a collection of cargo objects. - -- The cargo set will be the input for the cargo transportation task. - -- So a transportation object is handling a cargo set, which is automatically refreshed when new cargo is added/deleted. - local EngineersCargoSet = SET_CARGO:New():FilterTypes( "Engineers" ):FilterStart() - - -- Now we add cargo into the battle scene. - local EngineersGroup = GROUP:FindByName( "Engineers" ) - - -- CARGO_GROUP can be used to setup cargo with a GROUP object underneath. - -- We name this group Engineers. - -- Note that the name of the cargo is "Engineers". - -- The cargoset "EngineersCargoSet" will embed all defined cargo of type Engineers (prefix) into its set. - local EngineersCargoGroup = CARGO_GROUP:New( EngineersGroup, "Engineers", "Radar Team", 500 ):RespawnOnDestroyed( true ) - - - -- We setup the task to transport engineers. - EngineersCargoTransportTask = TASK_CARGO_TRANSPORT:New( Mission, APC, "Transport Engineers", EngineersCargoSet ) - - -- We setup to deploy workers in the deploy zone 1 and 2 (the player can choose). - EngineersCargoTransportTask:AddDeployZone( ZONE_POLYGON:New( "Deploy Zone Alpha", GROUP:FindByName("DeployZone Alpha") ) ) - EngineersCargoTransportTask:AddDeployZone( ZONE_POLYGON:New( "Deploy Zone Beta", GROUP:FindByName("DeployZone Beta") ) ) - - - -- Here we define the "cargo set", which is a collection of cargo objects. - -- The cargo set will be the input for the cargo transportation task. - -- So a transportation object is handling a cargo set, which is automatically refreshed when new cargo is added/deleted. - local WorkersCargoSet = SET_CARGO:New():FilterTypes( "Workers" ):FilterStart() - - local WorkersGroup = GROUP:FindByName( "Workers" ) - - -- CARGO_GROUP can be used to setup cargo with a GROUP object underneath. - -- We name this group Engineers. - -- Note that the name of the cargo is "Workers". - -- The cargoset "WorkersCargoSet" will embed all defined cargo of type Workers (prefix) into its set. - local WorkersCargoGroup = CARGO_GROUP:New( WorkersGroup, "Workers", "Mechanics", 500 ):RespawnOnDestroyed( true ) - - - -- We setup the task to transport workers. - WorkersCargoTransportTask = TASK_CARGO_TRANSPORT:New( Mission, APC, "Transport Workers", WorkersCargoSet ) - - -- We setup to deploy workers in the deploy zone 1. - WorkersCargoTransportTask:AddDeployZone( ZONE_POLYGON:New( "Deploy Zone Beta", GROUP:FindByName("DeployZone Beta") ) ) - -end - +--- +-- Name: TSK-CGO-100 - Ground - APC Test +-- Author: FlightControl +-- Date Created: 12 Apr 2017 +-- +-- This mission demonstrates the transport of a cargo group using an APC. +-- +-- There is: +-- - 1 APC. +-- - 2 Transport Tasks - Transport Workers and Transport Engineers. +-- - 2 Cargo - Workers and Engineers. +-- - 2 Deployment Zones - Alpha and Beta. +-- +-- Task Engineers: Transport the Engineers to Deployment Zone Alpha or Zone Beta. +-- Task Workers: Transport the Workers to Deployment Zone Beta. +-- + +do + local HQ = GROUP:FindByName( "HQ", "Bravo HQ" ) + + local CommandCenter = COMMANDCENTER:New( HQ, "Bravo" ) + + local Scoring = SCORING:New( "Cargo Group Transport Demonstration" ) + + local Mission = MISSION + :New( CommandCenter, "Transport", "High", "Transport the team from Deploy Zone 1 to Deploy Zone 2", coalition.side.BLUE ) + :AddScoring( Scoring ) + + -- Allocate the Transport, which is an APC in the field. + local APC = SET_GROUP:New():FilterPrefixes( "Transport" ):FilterStart() + + -- We will setup the transportation for Engineers. + + -- Here we define the "cargo set", which is a collection of cargo objects. + -- The cargo set will be the input for the cargo transportation task. + -- So a transportation object is handling a cargo set, which is automatically refreshed when new cargo is added/deleted. + local EngineersCargoSet = SET_CARGO:New():FilterTypes( "Engineers" ):FilterStart() + + -- Now we add cargo into the battle scene. + local EngineersGroup = GROUP:FindByName( "Engineers" ) + + -- CARGO_GROUP can be used to setup cargo with a GROUP object underneath. + -- We name this group Engineers. + -- Note that the name of the cargo is "Engineers". + -- The cargoset "EngineersCargoSet" will embed all defined cargo of type Engineers (prefix) into its set. + local EngineersCargoGroup = CARGO_GROUP:New( EngineersGroup, "Engineers", "Radar Team", 500 ):RespawnOnDestroyed( true ) + + + -- We setup the task to transport engineers. + EngineersCargoTransportTask = TASK_CARGO_TRANSPORT:New( Mission, APC, "Transport Engineers", EngineersCargoSet ) + + -- We setup to deploy workers in the deploy zone 1 and 2 (the player can choose). + EngineersCargoTransportTask:AddDeployZone( ZONE_POLYGON:New( "Deploy Zone Alpha", GROUP:FindByName("DeployZone Alpha") ) ) + EngineersCargoTransportTask:AddDeployZone( ZONE_POLYGON:New( "Deploy Zone Beta", GROUP:FindByName("DeployZone Beta") ) ) + + + -- Here we define the "cargo set", which is a collection of cargo objects. + -- The cargo set will be the input for the cargo transportation task. + -- So a transportation object is handling a cargo set, which is automatically refreshed when new cargo is added/deleted. + local WorkersCargoSet = SET_CARGO:New():FilterTypes( "Workers" ):FilterStart() + + local WorkersGroup = GROUP:FindByName( "Workers" ) + + -- CARGO_GROUP can be used to setup cargo with a GROUP object underneath. + -- We name this group Engineers. + -- Note that the name of the cargo is "Workers". + -- The cargoset "WorkersCargoSet" will embed all defined cargo of type Workers (prefix) into its set. + local WorkersCargoGroup = CARGO_GROUP:New( WorkersGroup, "Workers", "Mechanics", 500 ):RespawnOnDestroyed( true ) + + + -- We setup the task to transport workers. + WorkersCargoTransportTask = TASK_CARGO_TRANSPORT:New( Mission, APC, "Transport Workers", WorkersCargoSet ) + + -- We setup to deploy workers in the deploy zone 1. + WorkersCargoTransportTask:AddDeployZone( ZONE_POLYGON:New( "Deploy Zone Beta", GROUP:FindByName("DeployZone Beta") ) ) + +end + diff --git a/TSK - Task Modelling/CGO - Cargo Transportation/TSK-CGO-010 - Ground - Respawn on CargoGroup Destroyed/TSK-CGO-010 - Ground - Respawn on CargoGroup Destroyed.miz b/TSK - Task Modelling/CGO - Cargo Transportation/TSK-CGO-010 - Ground - Respawn on CargoGroup Destroyed/TSK-CGO-010 - Ground - Respawn on CargoGroup Destroyed.miz index d358773729..6a9f66d40c 100644 Binary files a/TSK - Task Modelling/CGO - Cargo Transportation/TSK-CGO-010 - Ground - Respawn on CargoGroup Destroyed/TSK-CGO-010 - Ground - Respawn on CargoGroup Destroyed.miz and b/TSK - Task Modelling/CGO - Cargo Transportation/TSK-CGO-010 - Ground - Respawn on CargoGroup Destroyed/TSK-CGO-010 - Ground - Respawn on CargoGroup Destroyed.miz differ diff --git a/TSK - Task Modelling/CGO - Cargo Transportation/TSK-CGO-100 - Ground - 1 APC - 2 Tasks - 2 Cargo - 2 Zones/TSK-CGO-100 - Ground - 1 APC - 2 Tasks - 2 Cargo - 2 Zones.lua b/TSK - Task Modelling/CGO - Cargo Transportation/TSK-CGO-100 - Ground - 1 APC - 2 Tasks - 2 Cargo - 2 Zones/TSK-CGO-100 - Ground - 1 APC - 2 Tasks - 2 Cargo - 2 Zones.lua index 48f81cb6a7..f047f0de98 100644 --- a/TSK - Task Modelling/CGO - Cargo Transportation/TSK-CGO-100 - Ground - 1 APC - 2 Tasks - 2 Cargo - 2 Zones/TSK-CGO-100 - Ground - 1 APC - 2 Tasks - 2 Cargo - 2 Zones.lua +++ b/TSK - Task Modelling/CGO - Cargo Transportation/TSK-CGO-100 - Ground - 1 APC - 2 Tasks - 2 Cargo - 2 Zones/TSK-CGO-100 - Ground - 1 APC - 2 Tasks - 2 Cargo - 2 Zones.lua @@ -1,78 +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. --- --- There is: --- - 1 APC. --- - 2 Transport Tasks - Transport Workers and Transport Engineers. --- - 2 Cargo - Workers and Engineers. --- - 2 Deployment Zones - Alpha and Beta. --- --- Task Engineers: Transport the Engineers to Deployment Zone Alpha or Zone Beta. --- Task Workers: Transport the Workers to Deployment Zone Beta. --- - -do - local HQ = GROUP:FindByName( "HQ", "Bravo HQ" ) - - local CommandCenter = COMMANDCENTER:New( HQ, "Bravo" ) - - local Scoring = SCORING:New( "Cargo Group Transport Demonstration" ) - - local Mission = MISSION - :New( CommandCenter, "Transport", "High", "Transport the team from Deploy Zone 1 to Deploy Zone 2", coalition.side.BLUE ) - :AddScoring( Scoring ) - - -- Allocate the Transport, which is an APC in the field. - local APC = SET_GROUP:New():FilterPrefixes( "Transport" ):FilterStart() - - -- We will setup the transportation for Engineers. - - -- Here we define the "cargo set", which is a collection of cargo objects. - -- The cargo set will be the input for the cargo transportation task. - -- So a transportation object is handling a cargo set, which is automatically refreshed when new cargo is added/deleted. - local EngineersCargoSet = SET_CARGO:New():FilterTypes( "Engineers" ):FilterStart() - - -- Now we add cargo into the battle scene. - local EngineersGroup = GROUP:FindByName( "Engineers" ) - - -- CARGO_GROUP can be used to setup cargo with a GROUP object underneath. - -- We name this group Engineers. - -- Note that the name of the cargo is "Engineers". - -- The cargoset "EngineersCargoSet" will embed all defined cargo of type Engineers (prefix) into its set. - local EngineersCargoGroup = CARGO_GROUP:New( EngineersGroup, "Engineers", "Radar Team", 500 ) - - - -- We setup the task to transport engineers. - EngineersCargoTransportTask = TASK_CARGO_TRANSPORT:New( Mission, APC, "Transport Engineers", EngineersCargoSet ) - - -- We setup to deploy workers in the deploy zone 1 and 2 (the player can choose). - EngineersCargoTransportTask:AddDeployZone( ZONE_POLYGON:New( "Deploy Zone Alpha", GROUP:FindByName("DeployZone Alpha") ) ) - EngineersCargoTransportTask:AddDeployZone( ZONE_POLYGON:New( "Deploy Zone Beta", GROUP:FindByName("DeployZone Beta") ) ) - - - -- Here we define the "cargo set", which is a collection of cargo objects. - -- The cargo set will be the input for the cargo transportation task. - -- So a transportation object is handling a cargo set, which is automatically refreshed when new cargo is added/deleted. - local WorkersCargoSet = SET_CARGO:New():FilterTypes( "Workers" ):FilterStart() - - local WorkersGroup = GROUP:FindByName( "Workers" ) - - -- CARGO_GROUP can be used to setup cargo with a GROUP object underneath. - -- We name this group Engineers. - -- Note that the name of the cargo is "Workers". - -- The cargoset "WorkersCargoSet" will embed all defined cargo of type Workers (prefix) into its set. - local WorkersCargoGroup = CARGO_GROUP:New( WorkersGroup, "Workers", "Mechanics", 500 ) - - - -- We setup the task to transport workers. - WorkersCargoTransportTask = TASK_CARGO_TRANSPORT:New( Mission, APC, "Transport Workers", WorkersCargoSet ) - - -- We setup to deploy workers in the deploy zone 1. - WorkersCargoTransportTask:AddDeployZone( ZONE_POLYGON:New( "Deploy Zone Beta", GROUP:FindByName("DeployZone Beta") ) ) - -end - +--- +-- Name: TSK-CGO-100 - Ground - APC Test +-- Author: FlightControl +-- Date Created: 12 Apr 2017 +-- +-- This mission demonstrates the transport of a cargo group using an APC. +-- + +do + local HQ = GROUP:FindByName( "HQ", "Bravo HQ" ) + + local CommandCenter = COMMANDCENTER:New( HQ, "Bravo" ) + + local Scoring = SCORING:New( "Cargo Group Transport Demonstration" ) + + local Mission = MISSION + :New( CommandCenter, "Transport", "High", "Transport the team from Deploy Zone 1 to Deploy Zone 2", coalition.side.BLUE ) + :AddScoring( Scoring ) + + -- Allocate the Transport, which is an APC in the field. + local APC = SET_GROUP:New():FilterPrefixes( "Transport" ):FilterStart() + + -- We will setup the transportation for Engineers. + + -- Here we define the "cargo set", which is a collection of cargo objects. + -- The cargo set will be the input for the cargo transportation task. + -- So a transportation object is handling a cargo set, which is automatically refreshed when new cargo is added/deleted. + local EngineersCargoSet = SET_CARGO:New():FilterTypes( "Engineers" ):FilterStart() + + -- Now we add cargo into the battle scene. + local EngineersGroup = GROUP:FindByName( "Engineers" ) + + -- CARGO_GROUP can be used to setup cargo with a GROUP object underneath. + -- We name this group Engineers. + -- Note that the name of the cargo is "Engineers". + -- The cargoset "EngineersCargoSet" will embed all defined cargo of type Engineers (prefix) into its set. + local EngineersCargoGroup = CARGO_GROUP:New( EngineersGroup, "Engineers", "Radar Team", 500 ) + + + -- We setup the task to transport engineers. + EngineersCargoTransportTask = TASK_CARGO_TRANSPORT:New( Mission, APC, "Transport Engineers", EngineersCargoSet ) + + -- We setup to deploy workers in the deploy zone 1 and 2 (the player can choose). + EngineersCargoTransportTask:AddDeployZone( ZONE_POLYGON:New( "Deploy Zone Alpha", GROUP:FindByName("DeployZone Alpha") ) ) + EngineersCargoTransportTask:AddDeployZone( ZONE_POLYGON:New( "Deploy Zone Beta", GROUP:FindByName("DeployZone Beta") ) ) + + + -- Here we define the "cargo set", which is a collection of cargo objects. + -- The cargo set will be the input for the cargo transportation task. + -- So a transportation object is handling a cargo set, which is automatically refreshed when new cargo is added/deleted. + local WorkersCargoSet = SET_CARGO:New():FilterTypes( "Workers" ):FilterStart() + + local WorkersGroup = GROUP:FindByName( "Workers" ) + + -- CARGO_GROUP can be used to setup cargo with a GROUP object underneath. + -- We name this group Engineers. + -- Note that the name of the cargo is "Workers". + -- The cargoset "WorkersCargoSet" will embed all defined cargo of type Workers (prefix) into its set. + local WorkersCargoGroup = CARGO_GROUP:New( WorkersGroup, "Workers", "Mechanics", 500 ) + + + -- We setup the task to transport workers. + WorkersCargoTransportTask = TASK_CARGO_TRANSPORT:New( Mission, APC, "Transport Workers", WorkersCargoSet ) + + -- We setup to deploy workers in the deploy zone 1. + WorkersCargoTransportTask:AddDeployZone( ZONE_POLYGON:New( "Deploy Zone Beta", GROUP:FindByName("DeployZone Beta") ) ) + +end + diff --git a/TSK - Task Modelling/CGO - Cargo Transportation/TSK-CGO-100 - Ground - 1 APC - 2 Tasks - 2 Cargo - 2 Zones/TSK-CGO-100 - Ground - 1 APC - 2 Tasks - 2 Cargo - 2 Zones.miz b/TSK - Task Modelling/CGO - Cargo Transportation/TSK-CGO-100 - Ground - 1 APC - 2 Tasks - 2 Cargo - 2 Zones/TSK-CGO-100 - Ground - 1 APC - 2 Tasks - 2 Cargo - 2 Zones.miz index 946721a88f..fec3e117d3 100644 Binary files a/TSK - Task Modelling/CGO - Cargo Transportation/TSK-CGO-100 - Ground - 1 APC - 2 Tasks - 2 Cargo - 2 Zones/TSK-CGO-100 - Ground - 1 APC - 2 Tasks - 2 Cargo - 2 Zones.miz and b/TSK - Task Modelling/CGO - Cargo Transportation/TSK-CGO-100 - Ground - 1 APC - 2 Tasks - 2 Cargo - 2 Zones/TSK-CGO-100 - Ground - 1 APC - 2 Tasks - 2 Cargo - 2 Zones.miz differ diff --git a/TSK - Task Modelling/CGO - Cargo Transportation/TSK-CGO-500 - Helo - 1 Helo - 1 Task - 1 Cargo - 1 Zone/TSK-CGO-500 - Helo - 1 Helo - 1 Task - 1 Cargo - 1 Zone.lua b/TSK - Task Modelling/CGO - Cargo Transportation/TSK-CGO-500 - Helo - 1 Helo - 1 Task - 1 Cargo - 1 Zone/TSK-CGO-500 - Helo - 1 Helo - 1 Task - 1 Cargo - 1 Zone.lua index f739d22fad..91d37f1c5c 100644 --- a/TSK - Task Modelling/CGO - Cargo Transportation/TSK-CGO-500 - Helo - 1 Helo - 1 Task - 1 Cargo - 1 Zone/TSK-CGO-500 - Helo - 1 Helo - 1 Task - 1 Cargo - 1 Zone.lua +++ b/TSK - Task Modelling/CGO - Cargo Transportation/TSK-CGO-500 - Helo - 1 Helo - 1 Task - 1 Cargo - 1 Zone/TSK-CGO-500 - Helo - 1 Helo - 1 Task - 1 Cargo - 1 Zone.lua @@ -1,55 +1,55 @@ ---- --- Name: TSK-CGO-502 - Helo - 1 Helo - 1 Task - 2 Cargo - 1 Zone --- Author: FlightControl --- Date Created: 12 Mar 2018 --- --- This mission demonstrates the transport of a cargo group using an Helicopter. --- --- There is: --- - 1 Helicopter. --- - 1 Transport Task - Transport Workers. --- - 1 Cargo - Workers. --- - 1 Deployment Zone - Alpha. --- --- Task Workers: Transport the Workers to Deployment Zone Alpha. --- - -do - local HQ = GROUP:FindByName( "HQ", "Bravo HQ" ) - - local CommandCenter = COMMANDCENTER:New( HQ, "Bravo" ) - - local Scoring = SCORING:New( "Cargo Group Transport Demonstration" ) - - local Mission = MISSION - :New( CommandCenter, "Transport", "High", "Transport the team from Deploy Zone 1 to Deploy Zone 2", coalition.side.BLUE ) - :AddScoring( Scoring ) - - -- Allocate the Transport, which is an APC in the field. - local APC = SET_GROUP:New():FilterPrefixes( "Transport" ):FilterStart() - - -- We will setup the transportation for Engineers. - - -- Here we define the "cargo set", which is a collection of cargo objects. - -- The cargo set will be the input for the cargo transportation task. - -- So a transportation object is handling a cargo set, which is automatically refreshed when new cargo is added/deleted. - local EngineersCargoSet = SET_CARGO:New():FilterTypes( "Engineers" ):FilterStart() - - -- Now we add cargo into the battle scene. - local EngineersGroup = GROUP:FindByName( "Engineers" ) - - -- CARGO_GROUP can be used to setup cargo with a GROUP object underneath. - -- We name this group Engineers. - -- Note that the name of the cargo is "Engineers". - -- The cargoset "EngineersCargoSet" will embed all defined cargo of type Engineers (prefix) into its set. - local EngineersCargoGroup = CARGO_GROUP:New( EngineersGroup, "Engineers", "Radar Team", 500 ) - - -- We setup the task to transport engineers. - EngineersCargoTransportTask = TASK_CARGO_TRANSPORT:New( Mission, APC, "Transport Engineers", EngineersCargoSet ) - - -- We setup to deploy workers in the deploy zone 1 and 2 (the player can choose). - EngineersCargoTransportTask:AddDeployZone( ZONE_POLYGON:New( "Deploy Zone Beta", GROUP:FindByName("DeployZone Beta") ) ) - - -end - +--- +-- Name: TSK-CGO-502 - Helo - 1 Helo - 1 Task - 2 Cargo - 1 Zone +-- Author: FlightControl +-- Date Created: 12 Mar 2018 +-- +-- This mission demonstrates the transport of a cargo group using an Helicopter. +-- +-- There is: +-- - 1 Helicopter. +-- - 1 Transport Task - Transport Workers. +-- - 1 Cargo - Workers. +-- - 1 Deployment Zone - Alpha. +-- +-- Task Workers: Transport the Workers to Deployment Zone Alpha. +-- + +do + local HQ = GROUP:FindByName( "HQ", "Bravo HQ" ) + + local CommandCenter = COMMANDCENTER:New( HQ, "Bravo" ) + + local Scoring = SCORING:New( "Cargo Group Transport Demonstration" ) + + local Mission = MISSION + :New( CommandCenter, "Transport", "High", "Transport the team from Deploy Zone 1 to Deploy Zone 2", coalition.side.BLUE ) + :AddScoring( Scoring ) + + -- Allocate the Transport, which is an APC in the field. + local APC = SET_GROUP:New():FilterPrefixes( "Transport" ):FilterStart() + + -- We will setup the transportation for Engineers. + + -- Here we define the "cargo set", which is a collection of cargo objects. + -- The cargo set will be the input for the cargo transportation task. + -- So a transportation object is handling a cargo set, which is automatically refreshed when new cargo is added/deleted. + local EngineersCargoSet = SET_CARGO:New():FilterTypes( "Engineers" ):FilterStart() + + -- Now we add cargo into the battle scene. + local EngineersGroup = GROUP:FindByName( "Engineers" ) + + -- CARGO_GROUP can be used to setup cargo with a GROUP object underneath. + -- We name this group Engineers. + -- Note that the name of the cargo is "Engineers". + -- The cargoset "EngineersCargoSet" will embed all defined cargo of type Engineers (prefix) into its set. + local EngineersCargoGroup = CARGO_GROUP:New( EngineersGroup, "Engineers", "Radar Team", 500 ) + + -- We setup the task to transport engineers. + EngineersCargoTransportTask = TASK_CARGO_TRANSPORT:New( Mission, APC, "Transport Engineers", EngineersCargoSet ) + + -- We setup to deploy workers in the deploy zone 1 and 2 (the player can choose). + EngineersCargoTransportTask:AddDeployZone( ZONE_POLYGON:New( "Deploy Zone Beta", GROUP:FindByName("DeployZone Beta") ) ) + + +end + diff --git a/TSK - Task Modelling/CGO - Cargo Transportation/TSK-CGO-500 - Helo - 1 Helo - 1 Task - 1 Cargo - 1 Zone/TSK-CGO-500 - Helo - 1 Helo - 1 Task - 1 Cargo - 1 Zone.miz b/TSK - Task Modelling/CGO - Cargo Transportation/TSK-CGO-500 - Helo - 1 Helo - 1 Task - 1 Cargo - 1 Zone/TSK-CGO-500 - Helo - 1 Helo - 1 Task - 1 Cargo - 1 Zone.miz index 0c94ca4ef8..7689b74d2d 100644 Binary files a/TSK - Task Modelling/CGO - Cargo Transportation/TSK-CGO-500 - Helo - 1 Helo - 1 Task - 1 Cargo - 1 Zone/TSK-CGO-500 - Helo - 1 Helo - 1 Task - 1 Cargo - 1 Zone.miz and b/TSK - Task Modelling/CGO - Cargo Transportation/TSK-CGO-500 - Helo - 1 Helo - 1 Task - 1 Cargo - 1 Zone/TSK-CGO-500 - Helo - 1 Helo - 1 Task - 1 Cargo - 1 Zone.miz differ diff --git a/TSK - Task Modelling/CGO - Cargo Transportation/TSK-CGO-501 - Helo - 1 Helo - 1 Task - 1 Cargo - 2 Zones/TSK-CGO-501 - Helo - 1 Helo - 1 Task - 1 Cargo - 2 Zones.lua b/TSK - Task Modelling/CGO - Cargo Transportation/TSK-CGO-501 - Helo - 1 Helo - 1 Task - 1 Cargo - 2 Zones/TSK-CGO-501 - Helo - 1 Helo - 1 Task - 1 Cargo - 2 Zones.lua index 01b08e9881..0cd0fa47c6 100644 --- a/TSK - Task Modelling/CGO - Cargo Transportation/TSK-CGO-501 - Helo - 1 Helo - 1 Task - 1 Cargo - 2 Zones/TSK-CGO-501 - Helo - 1 Helo - 1 Task - 1 Cargo - 2 Zones.lua +++ b/TSK - Task Modelling/CGO - Cargo Transportation/TSK-CGO-501 - Helo - 1 Helo - 1 Task - 1 Cargo - 2 Zones/TSK-CGO-501 - Helo - 1 Helo - 1 Task - 1 Cargo - 2 Zones.lua @@ -1,56 +1,56 @@ ---- --- Name: TSK-CGO-502 - Helo - 1 Helo - 1 Task - 2 Cargo - 1 Zone --- Author: FlightControl --- Date Created: 12 Mar 2018 --- --- This mission demonstrates the transport of a cargo group using an Helicopter. --- --- There is: --- - 1 Helicopter. --- - 1 Transport Task - Transport Workers. --- - 1 Cargo - Workers. --- - 1 Deployment Zone - Alpha. --- --- Task Workers: Transport the Workers to Deployment Zone Alpha. --- - -do - local HQ = GROUP:FindByName( "HQ", "Bravo HQ" ) - - local CommandCenter = COMMANDCENTER:New( HQ, "Bravo" ) - - local Scoring = SCORING:New( "Cargo Group Transport Demonstration" ) - - local Mission = MISSION - :New( CommandCenter, "Transport", "High", "Transport the team from Deploy Zone 1 to Deploy Zone 2", coalition.side.BLUE ) - :AddScoring( Scoring ) - - -- Allocate the Transport, which is an APC in the field. - local APC = SET_GROUP:New():FilterPrefixes( "Transport" ):FilterStart() - - -- We will setup the transportation for Engineers. - - -- Here we define the "cargo set", which is a collection of cargo objects. - -- The cargo set will be the input for the cargo transportation task. - -- So a transportation object is handling a cargo set, which is automatically refreshed when new cargo is added/deleted. - local EngineersCargoSet = SET_CARGO:New():FilterTypes( "Engineers" ):FilterStart() - - -- Now we add cargo into the battle scene. - local EngineersGroup = GROUP:FindByName( "Engineers" ) - - -- CARGO_GROUP can be used to setup cargo with a GROUP object underneath. - -- We name this group Engineers. - -- Note that the name of the cargo is "Engineers". - -- The cargoset "EngineersCargoSet" will embed all defined cargo of type Engineers (prefix) into its set. - local EngineersCargoGroup = CARGO_GROUP:New( EngineersGroup, "Engineers", "Radar Team", 500 ) - - -- We setup the task to transport engineers. - EngineersCargoTransportTask = TASK_CARGO_TRANSPORT:New( Mission, APC, "Transport Engineers", EngineersCargoSet ) - - -- We setup to deploy workers in the deploy zone 1 and 2 (the player can choose). - EngineersCargoTransportTask:AddDeployZone( ZONE_POLYGON:New( "Deploy Zone Alpha", GROUP:FindByName("DeployZone Alpha") ) ) - EngineersCargoTransportTask:AddDeployZone( ZONE_POLYGON:New( "Deploy Zone Beta", GROUP:FindByName("DeployZone Beta") ) ) - - -end - +--- +-- Name: TSK-CGO-502 - Helo - 1 Helo - 1 Task - 2 Cargo - 1 Zone +-- Author: FlightControl +-- Date Created: 12 Mar 2018 +-- +-- This mission demonstrates the transport of a cargo group using an Helicopter. +-- +-- There is: +-- - 1 Helicopter. +-- - 1 Transport Task - Transport Workers. +-- - 1 Cargo - Workers. +-- - 1 Deployment Zone - Alpha. +-- +-- Task Workers: Transport the Workers to Deployment Zone Alpha. +-- + +do + local HQ = GROUP:FindByName( "HQ", "Bravo HQ" ) + + local CommandCenter = COMMANDCENTER:New( HQ, "Bravo" ) + + local Scoring = SCORING:New( "Cargo Group Transport Demonstration" ) + + local Mission = MISSION + :New( CommandCenter, "Transport", "High", "Transport the team from Deploy Zone 1 to Deploy Zone 2", coalition.side.BLUE ) + :AddScoring( Scoring ) + + -- Allocate the Transport, which is an APC in the field. + local APC = SET_GROUP:New():FilterPrefixes( "Transport" ):FilterStart() + + -- We will setup the transportation for Engineers. + + -- Here we define the "cargo set", which is a collection of cargo objects. + -- The cargo set will be the input for the cargo transportation task. + -- So a transportation object is handling a cargo set, which is automatically refreshed when new cargo is added/deleted. + local EngineersCargoSet = SET_CARGO:New():FilterTypes( "Engineers" ):FilterStart() + + -- Now we add cargo into the battle scene. + local EngineersGroup = GROUP:FindByName( "Engineers" ) + + -- CARGO_GROUP can be used to setup cargo with a GROUP object underneath. + -- We name this group Engineers. + -- Note that the name of the cargo is "Engineers". + -- The cargoset "EngineersCargoSet" will embed all defined cargo of type Engineers (prefix) into its set. + local EngineersCargoGroup = CARGO_GROUP:New( EngineersGroup, "Engineers", "Radar Team", 500 ) + + -- We setup the task to transport engineers. + EngineersCargoTransportTask = TASK_CARGO_TRANSPORT:New( Mission, APC, "Transport Engineers", EngineersCargoSet ) + + -- We setup to deploy workers in the deploy zone 1 and 2 (the player can choose). + EngineersCargoTransportTask:AddDeployZone( ZONE_POLYGON:New( "Deploy Zone Alpha", GROUP:FindByName("DeployZone Alpha") ) ) + EngineersCargoTransportTask:AddDeployZone( ZONE_POLYGON:New( "Deploy Zone Beta", GROUP:FindByName("DeployZone Beta") ) ) + + +end + diff --git a/TSK - Task Modelling/CGO - Cargo Transportation/TSK-CGO-501 - Helo - 1 Helo - 1 Task - 1 Cargo - 2 Zones/TSK-CGO-501 - Helo - 1 Helo - 1 Task - 1 Cargo - 2 Zones.miz b/TSK - Task Modelling/CGO - Cargo Transportation/TSK-CGO-501 - Helo - 1 Helo - 1 Task - 1 Cargo - 2 Zones/TSK-CGO-501 - Helo - 1 Helo - 1 Task - 1 Cargo - 2 Zones.miz index 975e99a998..a210520363 100644 Binary files a/TSK - Task Modelling/CGO - Cargo Transportation/TSK-CGO-501 - Helo - 1 Helo - 1 Task - 1 Cargo - 2 Zones/TSK-CGO-501 - Helo - 1 Helo - 1 Task - 1 Cargo - 2 Zones.miz and b/TSK - Task Modelling/CGO - Cargo Transportation/TSK-CGO-501 - Helo - 1 Helo - 1 Task - 1 Cargo - 2 Zones/TSK-CGO-501 - Helo - 1 Helo - 1 Task - 1 Cargo - 2 Zones.miz differ diff --git a/TSK - Task Modelling/CGO - Cargo Transportation/TSK-CGO-502 - Helo - 1 Helo - 1 Task - 2 Cargo - 1 Zone/TSK-CGO-502 - Helo - 1 Helo - 1 Task - 2 Cargo - 1 Zone.lua b/TSK - Task Modelling/CGO - Cargo Transportation/TSK-CGO-502 - Helo - 1 Helo - 1 Task - 2 Cargo - 1 Zone/TSK-CGO-502 - Helo - 1 Helo - 1 Task - 2 Cargo - 1 Zone.lua index d2bb0f8919..531084008d 100644 --- a/TSK - Task Modelling/CGO - Cargo Transportation/TSK-CGO-502 - Helo - 1 Helo - 1 Task - 2 Cargo - 1 Zone/TSK-CGO-502 - Helo - 1 Helo - 1 Task - 2 Cargo - 1 Zone.lua +++ b/TSK - Task Modelling/CGO - Cargo Transportation/TSK-CGO-502 - Helo - 1 Helo - 1 Task - 2 Cargo - 1 Zone/TSK-CGO-502 - Helo - 1 Helo - 1 Task - 2 Cargo - 1 Zone.lua @@ -1,64 +1,64 @@ ---- --- Name: TSK-CGO-502 - Helo - 1 Helo - 1 Task - 2 Cargo - 1 Zone --- Author: FlightControl --- Date Created: 12 Mar 2018 --- --- This mission demonstrates the transport of a cargo group using an Helicopter. --- --- There is: --- - 1 Helicopter. --- - 1 Transport Task - Transport Workers. --- - 1 Cargo - Workers. --- - 1 Deployment Zone - Alpha. --- --- Task Workers: Transport the Workers to Deployment Zone Alpha. --- - -do - local HQ = GROUP:FindByName( "HQ", "Bravo HQ" ) - - local CommandCenter = COMMANDCENTER:New( HQ, "Bravo" ) - - local Scoring = SCORING:New( "Cargo Group Transport Demonstration" ) - - local Mission = MISSION - :New( CommandCenter, "Transport", "High", "Transport the team from Deploy Zone 1 to Deploy Zone 2", coalition.side.BLUE ) - :AddScoring( Scoring ) - - -- Allocate the Transport, which is an APC in the field. - local APC = SET_GROUP:New():FilterPrefixes( "Transport" ):FilterStart() - - -- We will setup the transportation for Engineers. - - -- Here we define the "cargo set", which is a collection of cargo objects. - -- The cargo set will be the input for the cargo transportation task. - -- So a transportation object is handling a cargo set, which is automatically refreshed when new cargo is added/deleted. - local EngineersCargoSet = SET_CARGO:New():FilterTypes( "Engineers" ):FilterStart() - - -- Now we add cargo into the battle scene. - local EngineersGroup = GROUP:FindByName( "Engineers" ) - - -- CARGO_GROUP can be used to setup cargo with a GROUP object underneath. - -- We name this group Engineers. - -- Note that the name of the cargo is "Engineers". - -- The cargoset "EngineersCargoSet" will embed all defined cargo of type Engineers (prefix) into its set. - local EngineersCargoGroup = CARGO_GROUP:New( EngineersGroup, "Engineers", "Radar Team", 500 ) - - local WorkersGroup = GROUP:FindByName( "Workers" ) - - -- CARGO_GROUP can be used to setup cargo with a GROUP object underneath. - -- We name this group Engineers. - -- Note that the name of the cargo is "Workers". - -- The cargoset "WorkersCargoSet" will embed all defined cargo of type Workers (prefix) into its set. - local WorkersCargoGroup = CARGO_GROUP:New( WorkersGroup, "Engineers", "Workers", 500 ) - - - -- We setup the task to transport engineers. - EngineersCargoTransportTask = TASK_CARGO_TRANSPORT:New( Mission, APC, "Transport Engineers", EngineersCargoSet ) - - -- We setup to deploy workers in the deploy zone 1 and 2 (the player can choose). - EngineersCargoTransportTask:AddDeployZone( ZONE_POLYGON:New( "Deploy Zone Alpha", GROUP:FindByName("DeployZone Alpha") ) ) - - -end - +--- +-- Name: TSK-CGO-502 - Helo - 1 Helo - 1 Task - 2 Cargo - 1 Zone +-- Author: FlightControl +-- Date Created: 12 Mar 2018 +-- +-- This mission demonstrates the transport of a cargo group using an Helicopter. +-- +-- There is: +-- - 1 Helicopter. +-- - 1 Transport Task - Transport Workers. +-- - 1 Cargo - Workers. +-- - 1 Deployment Zone - Alpha. +-- +-- Task Workers: Transport the Workers to Deployment Zone Alpha. +-- + +do + local HQ = GROUP:FindByName( "HQ", "Bravo HQ" ) + + local CommandCenter = COMMANDCENTER:New( HQ, "Bravo" ) + + local Scoring = SCORING:New( "Cargo Group Transport Demonstration" ) + + local Mission = MISSION + :New( CommandCenter, "Transport", "High", "Transport the team from Deploy Zone 1 to Deploy Zone 2", coalition.side.BLUE ) + :AddScoring( Scoring ) + + -- Allocate the Transport, which is an APC in the field. + local APC = SET_GROUP:New():FilterPrefixes( "Transport" ):FilterStart() + + -- We will setup the transportation for Engineers. + + -- Here we define the "cargo set", which is a collection of cargo objects. + -- The cargo set will be the input for the cargo transportation task. + -- So a transportation object is handling a cargo set, which is automatically refreshed when new cargo is added/deleted. + local EngineersCargoSet = SET_CARGO:New():FilterTypes( "Engineers" ):FilterStart() + + -- Now we add cargo into the battle scene. + local EngineersGroup = GROUP:FindByName( "Engineers" ) + + -- CARGO_GROUP can be used to setup cargo with a GROUP object underneath. + -- We name this group Engineers. + -- Note that the name of the cargo is "Engineers". + -- The cargoset "EngineersCargoSet" will embed all defined cargo of type Engineers (prefix) into its set. + local EngineersCargoGroup = CARGO_GROUP:New( EngineersGroup, "Engineers", "Radar Team", 500 ) + + local WorkersGroup = GROUP:FindByName( "Workers" ) + + -- CARGO_GROUP can be used to setup cargo with a GROUP object underneath. + -- We name this group Engineers. + -- Note that the name of the cargo is "Workers". + -- The cargoset "WorkersCargoSet" will embed all defined cargo of type Workers (prefix) into its set. + local WorkersCargoGroup = CARGO_GROUP:New( WorkersGroup, "Engineers", "Workers", 500 ) + + + -- We setup the task to transport engineers. + EngineersCargoTransportTask = TASK_CARGO_TRANSPORT:New( Mission, APC, "Transport Engineers", EngineersCargoSet ) + + -- We setup to deploy workers in the deploy zone 1 and 2 (the player can choose). + EngineersCargoTransportTask:AddDeployZone( ZONE_POLYGON:New( "Deploy Zone Alpha", GROUP:FindByName("DeployZone Alpha") ) ) + + +end + diff --git a/TSK - Task Modelling/CGO - Cargo Transportation/TSK-CGO-502 - Helo - 1 Helo - 1 Task - 2 Cargo - 1 Zone/TSK-CGO-502 - Helo - 1 Helo - 1 Task - 2 Cargo - 1 Zone.miz b/TSK - Task Modelling/CGO - Cargo Transportation/TSK-CGO-502 - Helo - 1 Helo - 1 Task - 2 Cargo - 1 Zone/TSK-CGO-502 - Helo - 1 Helo - 1 Task - 2 Cargo - 1 Zone.miz index c9952a74ca..5746dccda3 100644 Binary files a/TSK - Task Modelling/CGO - Cargo Transportation/TSK-CGO-502 - Helo - 1 Helo - 1 Task - 2 Cargo - 1 Zone/TSK-CGO-502 - Helo - 1 Helo - 1 Task - 2 Cargo - 1 Zone.miz and b/TSK - Task Modelling/CGO - Cargo Transportation/TSK-CGO-502 - Helo - 1 Helo - 1 Task - 2 Cargo - 1 Zone/TSK-CGO-502 - Helo - 1 Helo - 1 Task - 2 Cargo - 1 Zone.miz differ diff --git a/TSK - Task Modelling/CGO - Cargo Transportation/TSK-CGO-503 - Helo - 1 Helo - 1 Task - 2 Cargo - 2 Zones/TSK-CGO-503 - Helo - 1 Helo - 1 Task - 2 Cargo - 2 Zones.lua b/TSK - Task Modelling/CGO - Cargo Transportation/TSK-CGO-503 - Helo - 1 Helo - 1 Task - 2 Cargo - 2 Zones/TSK-CGO-503 - Helo - 1 Helo - 1 Task - 2 Cargo - 2 Zones.lua index 04d4edf580..dbebfac53f 100644 --- a/TSK - Task Modelling/CGO - Cargo Transportation/TSK-CGO-503 - Helo - 1 Helo - 1 Task - 2 Cargo - 2 Zones/TSK-CGO-503 - Helo - 1 Helo - 1 Task - 2 Cargo - 2 Zones.lua +++ b/TSK - Task Modelling/CGO - Cargo Transportation/TSK-CGO-503 - Helo - 1 Helo - 1 Task - 2 Cargo - 2 Zones/TSK-CGO-503 - Helo - 1 Helo - 1 Task - 2 Cargo - 2 Zones.lua @@ -1,66 +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 ) - - - 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") ) ) - EngineersCargoTransportTask:AddDeployZone( ZONE_POLYGON:New( "Deploy Zone Beta", GROUP:FindByName("DeployZone Beta") ) ) - - - -end - +--- +-- Name: TSK-CGO-503 - Helo - 1 Helo - 1 Task - 2 Cargo - 2 Zones +-- Author: FlightControl +-- Date Created: 12 Mar 2018 +-- +-- This mission demonstrates the transport of a cargo group using an Helicopter. +-- +-- There is: +-- - 1 Helicopter. +-- - 1 Transport Task - Transport Workers. +-- - 1 Cargo - Workers. +-- - 1 Deployment Zone - Alpha. +-- +-- Task Workers: Transport the Workers to Deployment Zone Alpha. +-- + +do + local HQ = GROUP:FindByName( "HQ", "Bravo HQ" ) + + local CommandCenter = COMMANDCENTER:New( HQ, "Bravo" ) + + local Scoring = SCORING:New( "Cargo Group Transport Demonstration" ) + + local Mission = MISSION + :New( CommandCenter, "Transport", "High", "Transport the team from Deploy Zone 1 to Deploy Zone 2", coalition.side.BLUE ) + :AddScoring( Scoring ) + + -- Allocate the Transport, which is an APC in the field. + local APC = SET_GROUP:New():FilterPrefixes( "Transport" ):FilterStart() + + -- We will setup the transportation for Engineers. + + -- Here we define the "cargo set", which is a collection of cargo objects. + -- The cargo set will be the input for the cargo transportation task. + -- So a transportation object is handling a cargo set, which is automatically refreshed when new cargo is added/deleted. + local EngineersCargoSet = SET_CARGO:New():FilterTypes( "Engineers" ):FilterStart() + + -- Now we add cargo into the battle scene. + local EngineersGroup = GROUP:FindByName( "Engineers" ) + + -- CARGO_GROUP can be used to setup cargo with a GROUP object underneath. + -- We name this group Engineers. + -- Note that the name of the cargo is "Engineers". + -- The cargoset "EngineersCargoSet" will embed all defined cargo of type Engineers (prefix) into its set. + local EngineersCargoGroup = CARGO_GROUP:New( EngineersGroup, "Engineers", "Radar Team", 500 ) + + + -- We setup the task to transport engineers. + EngineersCargoTransportTask = TASK_CARGO_TRANSPORT:New( Mission, APC, "Transport Engineers", EngineersCargoSet ) + + -- We setup to deploy workers in the deploy zone 1 and 2 (the player can choose). + EngineersCargoTransportTask:AddDeployZone( ZONE_POLYGON:New( "Deploy Zone Alpha", GROUP:FindByName("DeployZone Alpha") ) ) + EngineersCargoTransportTask:AddDeployZone( ZONE_POLYGON:New( "Deploy Zone Beta", GROUP:FindByName("DeployZone Beta") ) ) + + + local WorkersGroup = GROUP:FindByName( "Workers" ) + + -- CARGO_GROUP can be used to setup cargo with a GROUP object underneath. + -- We name this group Engineers. + -- Note that the name of the cargo is "Workers". + -- The cargoset "WorkersCargoSet" will embed all defined cargo of type Workers (prefix) into its set. + local WorkersCargoGroup = CARGO_GROUP:New( WorkersGroup, "Engineers", "Workers", 500 ) + +end + diff --git a/TSK - Task Modelling/CGO - Cargo Transportation/TSK-CGO-503 - Helo - 1 Helo - 1 Task - 2 Cargo - 2 Zones/TSK-CGO-503 - Helo - 1 Helo - 1 Task - 2 Cargo - 2 Zones.miz b/TSK - Task Modelling/CGO - Cargo Transportation/TSK-CGO-503 - Helo - 1 Helo - 1 Task - 2 Cargo - 2 Zones/TSK-CGO-503 - Helo - 1 Helo - 1 Task - 2 Cargo - 2 Zones.miz index b5da7cd576..ee1f0255ce 100644 Binary files a/TSK - Task Modelling/CGO - Cargo Transportation/TSK-CGO-503 - Helo - 1 Helo - 1 Task - 2 Cargo - 2 Zones/TSK-CGO-503 - Helo - 1 Helo - 1 Task - 2 Cargo - 2 Zones.miz and b/TSK - Task Modelling/CGO - Cargo Transportation/TSK-CGO-503 - Helo - 1 Helo - 1 Task - 2 Cargo - 2 Zones/TSK-CGO-503 - Helo - 1 Helo - 1 Task - 2 Cargo - 2 Zones.miz differ diff --git a/TSK - Task Modelling/CGO - Cargo Transportation/TSK-CGO-510 - Helo - 1 Helo - 2 Task - 2 Cargo - 2 Zones/TSK-CGO-510 - Helo - 1 Helo - 2 Task - 2 Cargo - 2 Zones.lua b/TSK - Task Modelling/CGO - Cargo Transportation/TSK-CGO-510 - Helo - 1 Helo - 2 Task - 2 Cargo - 2 Zones/TSK-CGO-510 - Helo - 1 Helo - 2 Task - 2 Cargo - 2 Zones.lua index c9c142dcba..56ed2616a3 100644 --- a/TSK - Task Modelling/CGO - Cargo Transportation/TSK-CGO-510 - Helo - 1 Helo - 2 Task - 2 Cargo - 2 Zones/TSK-CGO-510 - Helo - 1 Helo - 2 Task - 2 Cargo - 2 Zones.lua +++ b/TSK - Task Modelling/CGO - Cargo Transportation/TSK-CGO-510 - Helo - 1 Helo - 2 Task - 2 Cargo - 2 Zones/TSK-CGO-510 - Helo - 1 Helo - 2 Task - 2 Cargo - 2 Zones.lua @@ -1,77 +1,77 @@ ---- --- Name: TSK-CGO-510 - Helo - 1 Helo - 2 Task - 2 Cargo - 2 Zones --- Author: FlightControl --- Date Created: 12 Mar 2018 --- --- This mission demonstrates the transport of a cargo group using an Helicopter. --- --- There is: --- - 1 Helicopter. --- - 2 Transport Tasks - Transport Workers and Transport Engineers. --- - 2 Cargo - Workers and Engineers. --- - 2 Deployment Zones - Alpha and Beta. --- --- Task Engineers: Transport the Engineers to Deployment Zone Alpha or Zone Beta. --- Task Workers: Transport the Workers to Deployment Zone Beta. - -do - local HQ = GROUP:FindByName( "HQ", "Bravo HQ" ) - - local CommandCenter = COMMANDCENTER:New( HQ, "Bravo" ) - - local Scoring = SCORING:New( "Cargo Group Transport Demonstration" ) - - local Mission = MISSION - :New( CommandCenter, "Transport", "High", "Transport the team from Deploy Zone 1 to Deploy Zone 2", coalition.side.BLUE ) - :AddScoring( Scoring ) - - -- Allocate the Transport, which is an APC in the field. - local APC = SET_GROUP:New():FilterPrefixes( "Transport" ):FilterStart() - - -- We will setup the transportation for Engineers. - - -- Here we define the "cargo set", which is a collection of cargo objects. - -- The cargo set will be the input for the cargo transportation task. - -- So a transportation object is handling a cargo set, which is automatically refreshed when new cargo is added/deleted. - local EngineersCargoSet = SET_CARGO:New():FilterTypes( "Engineers" ):FilterStart() - - -- Now we add cargo into the battle scene. - local EngineersGroup = GROUP:FindByName( "Engineers" ) - - -- CARGO_GROUP can be used to setup cargo with a GROUP object underneath. - -- We name this group Engineers. - -- Note that the name of the cargo is "Engineers". - -- The cargoset "EngineersCargoSet" will embed all defined cargo of type Engineers (prefix) into its set. - local EngineersCargoGroup = CARGO_GROUP:New( EngineersGroup, "Engineers", "Radar Team", 500 ) - - - -- We setup the task to transport engineers. - EngineersCargoTransportTask = TASK_CARGO_TRANSPORT:New( Mission, APC, "Transport Engineers", EngineersCargoSet ) - - -- We setup to deploy workers in the deploy zone 1 and 2 (the player can choose). - EngineersCargoTransportTask:AddDeployZone( ZONE_POLYGON:New( "Deploy Zone Alpha", GROUP:FindByName("DeployZone Alpha") ) ) - EngineersCargoTransportTask:AddDeployZone( ZONE_POLYGON:New( "Deploy Zone Beta", GROUP:FindByName("DeployZone Beta") ) ) - - - -- Here we define the "cargo set", which is a collection of cargo objects. - -- The cargo set will be the input for the cargo transportation task. - -- So a transportation object is handling a cargo set, which is automatically refreshed when new cargo is added/deleted. - local WorkersCargoSet = SET_CARGO:New():FilterTypes( "Workers" ):FilterStart() - - local WorkersGroup = GROUP:FindByName( "Workers" ) - - -- CARGO_GROUP can be used to setup cargo with a GROUP object underneath. - -- We name this group Engineers. - -- Note that the name of the cargo is "Workers". - -- The cargoset "WorkersCargoSet" will embed all defined cargo of type Workers (prefix) into its set. - local WorkersCargoGroup = CARGO_GROUP:New( WorkersGroup, "Workers", "Mechanics", 500 ) - - - -- We setup the task to transport workers. - WorkersCargoTransportTask = TASK_CARGO_TRANSPORT:New( Mission, APC, "Transport Workers", WorkersCargoSet ) - - -- We setup to deploy workers in the deploy zone 1. - WorkersCargoTransportTask:AddDeployZone( ZONE_POLYGON:New( "Deploy Zone Beta", GROUP:FindByName("DeployZone Beta") ) ) - -end - +--- +-- Name: TSK-CGO-510 - Helo - 1 Helo - 2 Task - 2 Cargo - 2 Zones +-- Author: FlightControl +-- Date Created: 12 Mar 2018 +-- +-- This mission demonstrates the transport of a cargo group using an Helicopter. +-- +-- There is: +-- - 1 Helicopter. +-- - 2 Transport Tasks - Transport Workers and Transport Engineers. +-- - 2 Cargo - Workers and Engineers. +-- - 2 Deployment Zones - Alpha and Beta. +-- +-- Task Engineers: Transport the Engineers to Deployment Zone Alpha or Zone Beta. +-- Task Workers: Transport the Workers to Deployment Zone Beta. + +do + local HQ = GROUP:FindByName( "HQ", "Bravo HQ" ) + + local CommandCenter = COMMANDCENTER:New( HQ, "Bravo" ) + + local Scoring = SCORING:New( "Cargo Group Transport Demonstration" ) + + local Mission = MISSION + :New( CommandCenter, "Transport", "High", "Transport the team from Deploy Zone 1 to Deploy Zone 2", coalition.side.BLUE ) + :AddScoring( Scoring ) + + -- Allocate the Transport, which is an APC in the field. + local APC = SET_GROUP:New():FilterPrefixes( "Transport" ):FilterStart() + + -- We will setup the transportation for Engineers. + + -- Here we define the "cargo set", which is a collection of cargo objects. + -- The cargo set will be the input for the cargo transportation task. + -- So a transportation object is handling a cargo set, which is automatically refreshed when new cargo is added/deleted. + local EngineersCargoSet = SET_CARGO:New():FilterTypes( "Engineers" ):FilterStart() + + -- Now we add cargo into the battle scene. + local EngineersGroup = GROUP:FindByName( "Engineers" ) + + -- CARGO_GROUP can be used to setup cargo with a GROUP object underneath. + -- We name this group Engineers. + -- Note that the name of the cargo is "Engineers". + -- The cargoset "EngineersCargoSet" will embed all defined cargo of type Engineers (prefix) into its set. + local EngineersCargoGroup = CARGO_GROUP:New( EngineersGroup, "Engineers", "Radar Team", 500 ) + + + -- We setup the task to transport engineers. + EngineersCargoTransportTask = TASK_CARGO_TRANSPORT:New( Mission, APC, "Transport Engineers", EngineersCargoSet ) + + -- We setup to deploy workers in the deploy zone 1 and 2 (the player can choose). + EngineersCargoTransportTask:AddDeployZone( ZONE_POLYGON:New( "Deploy Zone Alpha", GROUP:FindByName("DeployZone Alpha") ) ) + EngineersCargoTransportTask:AddDeployZone( ZONE_POLYGON:New( "Deploy Zone Beta", GROUP:FindByName("DeployZone Beta") ) ) + + + -- Here we define the "cargo set", which is a collection of cargo objects. + -- The cargo set will be the input for the cargo transportation task. + -- So a transportation object is handling a cargo set, which is automatically refreshed when new cargo is added/deleted. + local WorkersCargoSet = SET_CARGO:New():FilterTypes( "Workers" ):FilterStart() + + local WorkersGroup = GROUP:FindByName( "Workers" ) + + -- CARGO_GROUP can be used to setup cargo with a GROUP object underneath. + -- We name this group Engineers. + -- Note that the name of the cargo is "Workers". + -- The cargoset "WorkersCargoSet" will embed all defined cargo of type Workers (prefix) into its set. + local WorkersCargoGroup = CARGO_GROUP:New( WorkersGroup, "Workers", "Mechanics", 500 ) + + + -- We setup the task to transport workers. + WorkersCargoTransportTask = TASK_CARGO_TRANSPORT:New( Mission, APC, "Transport Workers", WorkersCargoSet ) + + -- We setup to deploy workers in the deploy zone 1. + WorkersCargoTransportTask:AddDeployZone( ZONE_POLYGON:New( "Deploy Zone Beta", GROUP:FindByName("DeployZone Beta") ) ) + +end + diff --git a/TSK - Task Modelling/CGO - Cargo Transportation/TSK-CGO-510 - Helo - 1 Helo - 2 Task - 2 Cargo - 2 Zones/TSK-CGO-510 - Helo - 1 Helo - 2 Task - 2 Cargo - 2 Zones.miz b/TSK - Task Modelling/CGO - Cargo Transportation/TSK-CGO-510 - Helo - 1 Helo - 2 Task - 2 Cargo - 2 Zones/TSK-CGO-510 - Helo - 1 Helo - 2 Task - 2 Cargo - 2 Zones.miz index 7eff777de0..22feaba7b2 100644 Binary files a/TSK - Task Modelling/CGO - Cargo Transportation/TSK-CGO-510 - Helo - 1 Helo - 2 Task - 2 Cargo - 2 Zones/TSK-CGO-510 - Helo - 1 Helo - 2 Task - 2 Cargo - 2 Zones.miz and b/TSK - Task Modelling/CGO - Cargo Transportation/TSK-CGO-510 - Helo - 1 Helo - 2 Task - 2 Cargo - 2 Zones/TSK-CGO-510 - Helo - 1 Helo - 2 Task - 2 Cargo - 2 Zones.miz differ diff --git a/WHS - Warehouse/Caucasus/WHS-010 - Self Request/WHS-010 - Self Request.lua b/WHS - Warehouse/Caucasus/WHS-010 - Self Request/WHS-010 - Self Request.lua index 9c782b4651..78416f6d99 100644 --- a/WHS - Warehouse/Caucasus/WHS-010 - Self Request/WHS-010 - Self Request.lua +++ b/WHS - Warehouse/Caucasus/WHS-010 - Self Request/WHS-010 - Self Request.lua @@ -1,39 +1,39 @@ ------------------- --- Self Request -- ------------------- --- 1. Two groups of infantry are spawned in the Batumi spawn zone. --- 2. After ~10 seconds they are put back into the warehouse stock. --- 3. After some time they are spawned again. --- 4. And so on and so forth... - --- Create a WAREHOUSE object. -local warehouseBatumi=WAREHOUSE:New(STATIC:FindByName("Warehouse Batumi"), "Batumi") - --- Start warehouse Batumi. -warehouseBatumi:Start() - --- Add one infantry asset. -warehouseBatumi:AddAsset(GROUP:FindByName("Infantry Platoon Alpha"), 4) - --- Add self request for one infantry at Batumi. -warehouseBatumi:AddRequest(warehouseBatumi, WAREHOUSE.Descriptor.ATTRIBUTE, WAREHOUSE.Attribute.GROUND_INFANTRY, 2) - ---- Self request event. Triggered once the assets are spawned in the spawn zone or at the airbase. -function warehouseBatumi:OnAfterSelfRequest(From, Event, To, groupset, request) - local groupset=groupset --Core.Set#SET_GROUP - - -- Loop over all groups spawned from that request. - for _,group in pairs(groupset:GetSet()) do - local group=group --Wrapper.Group#GROUP - - -- Gree smoke on spawned group. - --group:SmokeGreen() - - -- Put asset back to stock after 10 seconds. - warehouseBatumi:__AddAsset(10, group) - end - - -- Add new self request after 20 seconds. - warehouseBatumi:__AddRequest(20, warehouseBatumi, WAREHOUSE.Descriptor.ATTRIBUTE, WAREHOUSE.Attribute.GROUND_INFANTRY, 2) - -end +------------------ +-- Self Request -- +------------------ +-- 1. Two groups of infantry are spawned in the Batumi spawn zone. +-- 2. After ~10 seconds they are put back into the warehouse stock. +-- 3. After some time they are spawned again. +-- 4. And so on and so forth... + +-- Create a WAREHOUSE object. +local warehouseBatumi=WAREHOUSE:New(STATIC:FindByName("Warehouse Batumi"), "Batumi") + +-- Start warehouse Batumi. +warehouseBatumi:Start() + +-- Add one infantry asset. +warehouseBatumi:AddAsset(GROUP:FindByName("Infantry Platoon Alpha"), 4) + +-- Add self request for one infantry at Batumi. +warehouseBatumi:AddRequest(warehouseBatumi, WAREHOUSE.Descriptor.ATTRIBUTE, WAREHOUSE.Attribute.GROUND_INFANTRY, 2) + +--- Self request event. Triggered once the assets are spawned in the spawn zone or at the airbase. +function warehouseBatumi:OnAfterSelfRequest(From, Event, To, groupset, request) + local groupset=groupset --Core.Set#SET_GROUP + + -- Loop over all groups spawned from that request. + for _,group in pairs(groupset:GetSet()) do + local group=group --Wrapper.Group#GROUP + + -- Gree smoke on spawned group. + --group:SmokeGreen() + + -- Put asset back to stock after 10 seconds. + warehouseBatumi:__AddAsset(10, group) + end + + -- Add new self request after 20 seconds. + warehouseBatumi:__AddRequest(20, warehouseBatumi, WAREHOUSE.Descriptor.ATTRIBUTE, WAREHOUSE.Attribute.GROUND_INFANTRY, 2) + +end diff --git a/WHS - Warehouse/Caucasus/WHS-010 - Self Request/WHS-010 - Self Request.miz b/WHS - Warehouse/Caucasus/WHS-010 - Self Request/WHS-010 - Self Request.miz index a1448ebb9b..dac926221b 100644 Binary files a/WHS - Warehouse/Caucasus/WHS-010 - Self Request/WHS-010 - Self Request.miz and b/WHS - Warehouse/Caucasus/WHS-010 - Self Request/WHS-010 - Self Request.miz differ diff --git a/WHS - Warehouse/Caucasus/WHS-020 - Self Propelled Ground Troops/WHS-020 - Self Propelled Ground Troops.lua b/WHS - Warehouse/Caucasus/WHS-020 - Self Propelled Ground Troops/WHS-020 - Self Propelled Ground Troops.lua index 95c44de753..1091fbe4fa 100644 --- a/WHS - Warehouse/Caucasus/WHS-020 - Self Propelled Ground Troops/WHS-020 - Self Propelled Ground Troops.lua +++ b/WHS - Warehouse/Caucasus/WHS-020 - Self Propelled Ground Troops/WHS-020 - Self Propelled Ground Troops.lua @@ -1,30 +1,30 @@ ----------------------------------- --- Self Propelled Ground Troops -- ----------------------------------- --- 1. Ground troops - APCs and infantry - are transferred from Batumi to FARP Berlin. --- 2. Warehouse Berlin is empty initially. But a request from Batumi is made for APCs. This cannot be processed and is held in the queue. --- 3. Once the assets arrive at Berlin, the request can be processed and some APCs are send back to Batumi. - --- Create WAREHOUSE objects. -local warehouseBatumi=WAREHOUSE:New(STATIC:FindByName("Warehouse Batumi"), "Batumi") -local warehouseBerlin=WAREHOUSE:New(STATIC:FindByName("Warehouse Berlin"), "Berlin") - --- Set spawn zone for warehouse Batumi. -warehouseBatumi:SetSpawnZone(ZONE:New("Warehouse Batumi Spawn Zone")) - --- Start Warehouse at Batumi. -warehouseBatumi:Start() - --- Add 20 infantry groups and 10 APCs as assets to Batumi warehouse stock. -warehouseBatumi:AddAsset("Infantry Platoon Alpha", 20) -warehouseBatumi:AddAsset("TPz Fuchs", 10) - --- Start Warehouse Berlin. -warehouseBerlin:Start() - --- Warehouse Berlin requests ten infantry groups and five APCs from warehouse Batumi -warehouseBatumi:AddRequest(warehouseBerlin, WAREHOUSE.Descriptor.ATTRIBUTE, WAREHOUSE.Attribute.GROUND_INFANTRY, 10) -warehouseBatumi:AddRequest(warehouseBerlin, WAREHOUSE.Descriptor.ATTRIBUTE, WAREHOUSE.Attribute.GROUND_APC, 5) - --- Request from Batumi for two APCs. Initially these are not in stock. When they become available, the request is executed. -warehouseBerlin:AddRequest(warehouseBatumi, WAREHOUSE.Descriptor.ATTRIBUTE, WAREHOUSE.Attribute.GROUND_APC, 2) +---------------------------------- +-- Self Propelled Ground Troops -- +---------------------------------- +-- 1. Ground troops - APCs and infantry - are transferred from Batumi to FARP Berlin. +-- 2. Warehouse Berlin is empty initially. But a request from Batumi is made for APCs. This cannot be processed and is held in the queue. +-- 3. Once the assets arrive at Berlin, the request can be processed and some APCs are send back to Batumi. + +-- Create WAREHOUSE objects. +local warehouseBatumi=WAREHOUSE:New(STATIC:FindByName("Warehouse Batumi"), "Batumi") +local warehouseBerlin=WAREHOUSE:New(STATIC:FindByName("Warehouse Berlin"), "Berlin") + +-- Set spawn zone for warehouse Batumi. +warehouseBatumi:SetSpawnZone(ZONE:New("Warehouse Batumi Spawn Zone")) + +-- Start Warehouse at Batumi. +warehouseBatumi:Start() + +-- Add 20 infantry groups and 10 APCs as assets to Batumi warehouse stock. +warehouseBatumi:AddAsset("Infantry Platoon Alpha", 20) +warehouseBatumi:AddAsset("TPz Fuchs", 10) + +-- Start Warehouse Berlin. +warehouseBerlin:Start() + +-- Warehouse Berlin requests ten infantry groups and five APCs from warehouse Batumi +warehouseBatumi:AddRequest(warehouseBerlin, WAREHOUSE.Descriptor.ATTRIBUTE, WAREHOUSE.Attribute.GROUND_INFANTRY, 10) +warehouseBatumi:AddRequest(warehouseBerlin, WAREHOUSE.Descriptor.ATTRIBUTE, WAREHOUSE.Attribute.GROUND_APC, 5) + +-- Request from Batumi for two APCs. Initially these are not in stock. When they become available, the request is executed. +warehouseBerlin:AddRequest(warehouseBatumi, WAREHOUSE.Descriptor.ATTRIBUTE, WAREHOUSE.Attribute.GROUND_APC, 2) diff --git a/WHS - Warehouse/Caucasus/WHS-020 - Self Propelled Ground Troops/WHS-020 - Self Propelled Ground Troops.miz b/WHS - Warehouse/Caucasus/WHS-020 - Self Propelled Ground Troops/WHS-020 - Self Propelled Ground Troops.miz index 7258a4d20f..872f318ecd 100644 Binary files a/WHS - Warehouse/Caucasus/WHS-020 - Self Propelled Ground Troops/WHS-020 - Self Propelled Ground Troops.miz and b/WHS - Warehouse/Caucasus/WHS-020 - Self Propelled Ground Troops/WHS-020 - Self Propelled Ground Troops.miz differ diff --git a/WHS - Warehouse/Caucasus/WHS-030 - Self Propelled Airborne/WHS-030 - Self Propelled Airborne.lua b/WHS - Warehouse/Caucasus/WHS-030 - Self Propelled Airborne/WHS-030 - Self Propelled Airborne.lua index ce0a6a1365..721d1b642c 100644 --- a/WHS - Warehouse/Caucasus/WHS-030 - Self Propelled Airborne/WHS-030 - Self Propelled Airborne.lua +++ b/WHS - Warehouse/Caucasus/WHS-030 - Self Propelled Airborne/WHS-030 - Self Propelled Airborne.lua @@ -1,29 +1,29 @@ ------------------------------------- --- Self Propelled Airborne Assets -- ------------------------------------- --- 1. Kutaisi requests two Yak-52 with high (10) priority from Senaki. --- 2. Kobuleti requests half Yak-52 with low (70) priority and gets the remaining half of the rest. --- 3. FARP London requests 1/3 of all available Hueys from Senaki. - --- Create WAREHOUSE objects. -local warehouseSenaki = WAREHOUSE:New(STATIC:FindByName("Warehouse Senaki"), "Senaki") -local warehouseKutaisi = WAREHOUSE:New(STATIC:FindByName("Warehouse Kutaisi"), "Kutaisi") -local warehouseKobuleti = WAREHOUSE:New(STATIC:FindByName("Warehouse Kobuleti"), "Kobuleti") -local warehouseLondon = WAREHOUSE:New(STATIC:FindByName("Warehouse London"), "London") - --- Start warehouses -warehouseSenaki:Start() -warehouseKutaisi:Start() -warehouseKobuleti:Start() -warehouseLondon:Start() - --- Add assets to Senaki warehouse -warehouseSenaki:AddAsset("Yak-52", 10) -warehouseSenaki:AddAsset("Huey", 6) - --- Kusaisi requests 3 Yak-52 form Senaki while Kobuleti wants all the rest. -warehouseSenaki:AddRequest(warehouseKutaisi, WAREHOUSE.Descriptor.GROUPNAME, "Yak-52", 1, nil, nil, 10) -warehouseSenaki:AddRequest(warehouseKobuleti, WAREHOUSE.Descriptor.GROUPNAME, "Yak-52", WAREHOUSE.Quantity.HALF, nil, nil, 70) - --- FARP London wants 1/3 of the six available Hueys. -warehouseSenaki:AddRequest(warehouseLondon, WAREHOUSE.Descriptor.GROUPNAME, "Huey", WAREHOUSE.Quantity.THIRD) +------------------------------------ +-- Self Propelled Airborne Assets -- +------------------------------------ +-- 1. Kutaisi requests two Yak-52 with high (10) priority from Senaki. +-- 2. Kobuleti requests half Yak-52 with low (70) priority and gets the remaining half of the rest. +-- 3. FARP London requests 1/3 of all available Hueys from Senaki. + +-- Create WAREHOUSE objects. +local warehouseSenaki = WAREHOUSE:New(STATIC:FindByName("Warehouse Senaki"), "Senaki") +local warehouseKutaisi = WAREHOUSE:New(STATIC:FindByName("Warehouse Kutaisi"), "Kutaisi") +local warehouseKobuleti = WAREHOUSE:New(STATIC:FindByName("Warehouse Kobuleti"), "Kobuleti") +local warehouseLondon = WAREHOUSE:New(STATIC:FindByName("Warehouse London"), "London") + +-- Start warehouses +warehouseSenaki:Start() +warehouseKutaisi:Start() +warehouseKobuleti:Start() +warehouseLondon:Start() + +-- Add assets to Senaki warehouse +warehouseSenaki:AddAsset("Yak-52", 10) +warehouseSenaki:AddAsset("Huey", 6) + +-- Kusaisi requests 3 Yak-52 form Senaki while Kobuleti wants all the rest. +warehouseSenaki:AddRequest(warehouseKutaisi, WAREHOUSE.Descriptor.GROUPNAME, "Yak-52", 1, nil, nil, 10) +warehouseSenaki:AddRequest(warehouseKobuleti, WAREHOUSE.Descriptor.GROUPNAME, "Yak-52", WAREHOUSE.Quantity.HALF, nil, nil, 70) + +-- FARP London wants 1/3 of the six available Hueys. +warehouseSenaki:AddRequest(warehouseLondon, WAREHOUSE.Descriptor.GROUPNAME, "Huey", WAREHOUSE.Quantity.THIRD) diff --git a/WHS - Warehouse/Caucasus/WHS-030 - Self Propelled Airborne/WHS-030 - Self Propelled Airborne.miz b/WHS - Warehouse/Caucasus/WHS-030 - Self Propelled Airborne/WHS-030 - Self Propelled Airborne.miz index 7bb6ec2d2e..e56f38ad4a 100644 Binary files a/WHS - Warehouse/Caucasus/WHS-030 - Self Propelled Airborne/WHS-030 - Self Propelled Airborne.miz and b/WHS - Warehouse/Caucasus/WHS-030 - Self Propelled Airborne/WHS-030 - Self Propelled Airborne.miz differ diff --git a/WHS - Warehouse/Caucasus/WHS-160 - Resupply/WHS-016 - Resupply.lua b/WHS - Warehouse/Caucasus/WHS-160 - Resupply/WHS-016 - Resupply.lua index eba0be3666..9cd4f5c05a 100644 --- a/WHS - Warehouse/Caucasus/WHS-160 - Resupply/WHS-016 - Resupply.lua +++ b/WHS - Warehouse/Caucasus/WHS-160 - Resupply/WHS-016 - Resupply.lua @@ -1,104 +1,103 @@ ------------------------ --- Test 17: Resupply -- ------------------------ --- Warehouse at FARP Berlin is located at the front line and sends infantry groups to the battle zone. --- Whenever a group dies, a new group is send from the warehouse to the battle zone. --- Additionally, for each dead group, Berlin requests resupply from Batumi. - --- Display mission time every 30 seconds. -SCHEDULER:New(nil, UTILS.DisplayMissionTime, {5}, 30, 30) - -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- - --- Define Warehouses. -local warehouse={} - --- Blue warehouses -warehouse.Senaki = WAREHOUSE:New(STATIC:FindByName("Warehouse Senaki"), "Senaki") --Functional.Warehouse#WAREHOUSE -warehouse.Batumi = WAREHOUSE:New(STATIC:FindByName("Warehouse Batumi"), "Batumi") --Functional.Warehouse#WAREHOUSE -warehouse.Kobuleti = WAREHOUSE:New(STATIC:FindByName("Warehouse Kobuleti"), "Kobuleti") --Functional.Warehouse#WAREHOUSE -warehouse.Kutaisi = WAREHOUSE:New(STATIC:FindByName("Warehouse Kutaisi"), "Kutaisi") --Functional.Warehouse#WAREHOUSE -warehouse.Berlin = WAREHOUSE:New(STATIC:FindByName("Warehouse Berlin"), "Berlin") --Functional.Warehouse#WAREHOUSE -warehouse.London = WAREHOUSE:New(STATIC:FindByName("Warehouse London"), "London") --Functional.Warehouse#WAREHOUSE -warehouse.Stennis = WAREHOUSE:New(STATIC:FindByName("Warehouse Stennis"), "Stennis") --Functional.Warehouse#WAREHOUSE -warehouse.Pampa = WAREHOUSE:New(STATIC:FindByName("Warehouse Pampa"), "Pampa") --Functional.Warehouse#WAREHOUSE -warehouse.Pearth = WAREHOUSE:New(STATIC:FindByName("Warehouse Pearth"), "Pearth") --Functional.Warehouse#WAREHOUSE --- Red warehouse -warehouse.Sukhumi = WAREHOUSE:New(STATIC:FindByName("Warehouse Sukhumi"), "Sukhumi") --Functional.Warehouse#WAREHOUSE -warehouse.Gudauta = WAREHOUSE:New(STATIC:FindByName("Warehouse Gudauta"), "Gudauta") --Functional.Warehouse#WAREHOUSE -warehouse.Sochi = WAREHOUSE:New(STATIC:FindByName("Warehouse Sochi"), "Sochi") --Functional.Warehouse#WAREHOUSE - --- Fine tune warehouses if necessary. -warehouse.Batumi:SetSpawnZone(ZONE:New("Warehouse Batumi Spawn Zone")) -warehouse.Senaki:SetSpawnZone(ZONE:New("Warehouse Senaki Spawn Zone")) -warehouse.Kobuleti:SetSpawnZone(ZONE_POLYGON:New("Warehouse Kobuleti Spawn Zone", GROUP:FindByName("Warehouse Kobuleti Spawn Zone"))) - - --- Creat explosion at an object. -local function Explosion(object, power) - power=power or 1000 - if object and object:IsAlive() then - object:GetCoordinate():Explosion(power) - end -end - -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- - --- Start warehouses. -warehouse.Batumi:Start() -warehouse.Berlin:Start() - --- Front line warehouse. -warehouse.Berlin:AddAsset("Infantry Platoon Alpha", 6) - --- Resupply warehouse. -warehouse.Batumi:AddAsset("Infantry Platoon Alpha", 50) - --- Battle zone near FARP Berlin. This is where the action is! -local BattleZone=ZONE:New("Virtual Battle Zone") - --- Send infantry groups to the battle zone. Two groups every ~60 seconds. -for i=1,2 do - local time=(i-1)*60+10 - warehouse.Berlin:__AddRequest(time, warehouse.Berlin, WAREHOUSE.Descriptor.ATTRIBUTE, WAREHOUSE.Attribute.GROUND_INFANTRY, 2, nil, nil, nil, "To Battle Zone") -end - --- Take care of the spawned units. -function warehouse.Berlin:OnAfterSelfRequest(From,Event,To,groupset,request) - local groupset=groupset --Core.Set#SET_GROUP - local request=request --Functional.Warehouse#WAREHOUSE.Pendingitem - - -- Get assignment of this request. - local assignment=warehouse.Berlin:GetAssignment(request) - - if assignment=="To Battle Zone" then - - for _,group in pairs(groupset:GetSet()) do - local group=group --Wrapper.Group#GROUP - - -- Route group to Battle zone. - local ToCoord=BattleZone:GetRandomCoordinate() - group:RouteGroundOnRoad(ToCoord, group:GetSpeedMax()*0.8) - - -- After 3-5 minutes we create an explosion to destroy the group. - SCHEDULER:New(nil, Explosion, {group, 50}, math.random(180, 300)) - end - - end - -end - --- An asset has died ==> request resupply for it. -function warehouse.Berlin:OnAfterAssetDead(From, Event, To, asset, request) - local asset=asset --Functional.Warehouse#WAREHOUSE.Assetitem - local request=request --Functional.Warehouse#WAREHOUSE.Pendingitem - - -- Get assignment. - local assignment=warehouse.Berlin:GetAssignment(request) - - -- Request resupply for dead asset from Batumi. - warehouse.Batumi:AddRequest(warehouse.Berlin, WAREHOUSE.Descriptor.ATTRIBUTE, asset.attribute, 1, nil, nil, nil, "Resupply") - - -- Send asset to Battle zone either now or when they arrive. - warehouse.Berlin:AddRequest(warehouse.Berlin, WAREHOUSE.Descriptor.ATTRIBUTE, asset.attribute, 1, nil, nil, nil, assignment) -end +----------------------- +-- Test 17: Resupply -- +----------------------- +-- Warehouse at FARP Berlin is located at the front line and sends infantry groups to the battle zone. +-- Whenever a group dies, a new group is send from the warehouse to the battle zone. +-- Additionally, for each dead group, Berlin requests resupply from Batumi. + +-- Display mission time every 30 seconds. +SCHEDULER:New(nil, UTILS.DisplayMissionTime, {5}, 30, 30) + +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + +-- Define Warehouses. +local warehouse={} + +-- Blue warehouses +warehouse.Senaki = WAREHOUSE:New(STATIC:FindByName("Warehouse Senaki"), "Senaki") --Functional.Warehouse#WAREHOUSE +warehouse.Batumi = WAREHOUSE:New(STATIC:FindByName("Warehouse Batumi"), "Batumi") --Functional.Warehouse#WAREHOUSE +warehouse.Kobuleti = WAREHOUSE:New(STATIC:FindByName("Warehouse Kobuleti"), "Kobuleti") --Functional.Warehouse#WAREHOUSE +warehouse.Kutaisi = WAREHOUSE:New(STATIC:FindByName("Warehouse Kutaisi"), "Kutaisi") --Functional.Warehouse#WAREHOUSE +warehouse.Berlin = WAREHOUSE:New(STATIC:FindByName("Warehouse Berlin"), "Berlin") --Functional.Warehouse#WAREHOUSE +warehouse.London = WAREHOUSE:New(STATIC:FindByName("Warehouse London"), "London") --Functional.Warehouse#WAREHOUSE +warehouse.Stennis = WAREHOUSE:New(STATIC:FindByName("Warehouse Stennis"), "Stennis") --Functional.Warehouse#WAREHOUSE +warehouse.Pampa = WAREHOUSE:New(STATIC:FindByName("Warehouse Pampa"), "Pampa") --Functional.Warehouse#WAREHOUSE +warehouse.Pearth = WAREHOUSE:New(STATIC:FindByName("Warehouse Pearth"), "Pearth") --Functional.Warehouse#WAREHOUSE +-- Red warehouse +warehouse.Sukhumi = WAREHOUSE:New(STATIC:FindByName("Warehouse Sukhumi"), "Sukhumi") --Functional.Warehouse#WAREHOUSE +warehouse.Gudauta = WAREHOUSE:New(STATIC:FindByName("Warehouse Gudauta"), "Gudauta") --Functional.Warehouse#WAREHOUSE +warehouse.Sochi = WAREHOUSE:New(STATIC:FindByName("Warehouse Sochi"), "Sochi") --Functional.Warehouse#WAREHOUSE + +-- Fine tune warehouses if necessary. +warehouse.Batumi:SetSpawnZone(ZONE:New("Warehouse Batumi Spawn Zone")) +warehouse.Senaki:SetSpawnZone(ZONE:New("Warehouse Senaki Spawn Zone")) +warehouse.Kobuleti:SetSpawnZone(ZONE_POLYGON:New("Warehouse Kobuleti Spawn Zone", GROUP:FindByName("Warehouse Kobuleti Spawn Zone"))) + + +-- Creat explosion at an object. +local function Explosion(object, power) + power=power or 1000 + if object and object:IsAlive() then + object:GetCoordinate():Explosion(power) + end +end + + +-- Start warehouses. +warehouse.Batumi:Start() +warehouse.Berlin:Start() + +-- Front line warehouse. +warehouse.Berlin:AddAsset("Infantry Platoon Alpha", 6) + +-- Resupply warehouse. +warehouse.Batumi:AddAsset("Infantry Platoon Alpha", 50) + +-- Battle zone near FARP Berlin. This is where the action is! +local BattleZone=ZONE:New("Virtual Battle Zone") + +-- Send infantry groups to the battle zone. Two groups every ~60 seconds. +for i=1,2 do + local time=(i-1)*60+10 + warehouse.Berlin:__AddRequest(time, warehouse.Berlin, WAREHOUSE.Descriptor.ATTRIBUTE, WAREHOUSE.Attribute.GROUND_INFANTRY, 2, nil, nil, nil, "To Battle Zone") +end + +-- Take care of the spawned units. +function warehouse.Berlin:OnAfterSelfRequest(From,Event,To,groupset,request) + local groupset=groupset --Core.Set#SET_GROUP + local request=request --Functional.Warehouse#WAREHOUSE.Pendingitem + + -- Get assignment of this request. + local assignment=warehouse.Berlin:GetAssignment(request) + + if assignment=="To Battle Zone" then + + for _,group in pairs(groupset:GetSet()) do + local group=group --Wrapper.Group#GROUP + + -- Route group to Battle zone. + local ToCoord=BattleZone:GetRandomCoordinate() + group:RouteGroundOnRoad(ToCoord, group:GetSpeedMax()*80) + + -- After 3-5 minutes we create an explosion to destroy the group. + SCHEDULER:New(nil, Explosion, {group, 50}, math.random(180, 300)) + end + + end + +end + +-- An asset has died ==> request resupply for it. +function warehouse.Berlin:OnAfterAssetDead(From, Event, To, asset, request) + local asset=asset --Functional.Warehouse#WAREHOUSE.Assetitem + local request=request --Functional.Warehouse#WAREHOUSE.Pendingitem + + -- Get assignment. + local assignment=warehouse.Berlin:GetAssignment(request) + + -- Request resupply for dead asset from Batumi. + warehouse.Batumi:AddRequest(warehouse.Berlin, WAREHOUSE.Descriptor.ATTRIBUTE, asset.attribute, nil, nil, nil, nil, "Resupply") + + -- Send asset to Battle zone either now or when they arrive. + warehouse.Berlin:AddRequest(warehouse.Berlin, WAREHOUSE.Descriptor.ATTRIBUTE, asset.attribute, 1, nil, nil, nil, assignment) +end diff --git a/WHS - Warehouse/Caucasus/WHS-160 - Resupply/WHS-160 - Resupply.miz b/WHS - Warehouse/Caucasus/WHS-160 - Resupply/WHS-160 - Resupply.miz index af537814dd..dde101ae31 100644 Binary files a/WHS - Warehouse/Caucasus/WHS-160 - Resupply/WHS-160 - Resupply.miz and b/WHS - Warehouse/Caucasus/WHS-160 - Resupply/WHS-160 - Resupply.miz differ diff --git a/WHS - Warehouse/Caucasus/WHS-170 - Resupply/WHS-016 - Resupply.lua b/WHS - Warehouse/Caucasus/WHS-170 - Resupply/WHS-016 - Resupply.lua new file mode 100644 index 0000000000..9cd4f5c05a --- /dev/null +++ b/WHS - Warehouse/Caucasus/WHS-170 - Resupply/WHS-016 - Resupply.lua @@ -0,0 +1,103 @@ +----------------------- +-- Test 17: Resupply -- +----------------------- +-- Warehouse at FARP Berlin is located at the front line and sends infantry groups to the battle zone. +-- Whenever a group dies, a new group is send from the warehouse to the battle zone. +-- Additionally, for each dead group, Berlin requests resupply from Batumi. + +-- Display mission time every 30 seconds. +SCHEDULER:New(nil, UTILS.DisplayMissionTime, {5}, 30, 30) + +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + +-- Define Warehouses. +local warehouse={} + +-- Blue warehouses +warehouse.Senaki = WAREHOUSE:New(STATIC:FindByName("Warehouse Senaki"), "Senaki") --Functional.Warehouse#WAREHOUSE +warehouse.Batumi = WAREHOUSE:New(STATIC:FindByName("Warehouse Batumi"), "Batumi") --Functional.Warehouse#WAREHOUSE +warehouse.Kobuleti = WAREHOUSE:New(STATIC:FindByName("Warehouse Kobuleti"), "Kobuleti") --Functional.Warehouse#WAREHOUSE +warehouse.Kutaisi = WAREHOUSE:New(STATIC:FindByName("Warehouse Kutaisi"), "Kutaisi") --Functional.Warehouse#WAREHOUSE +warehouse.Berlin = WAREHOUSE:New(STATIC:FindByName("Warehouse Berlin"), "Berlin") --Functional.Warehouse#WAREHOUSE +warehouse.London = WAREHOUSE:New(STATIC:FindByName("Warehouse London"), "London") --Functional.Warehouse#WAREHOUSE +warehouse.Stennis = WAREHOUSE:New(STATIC:FindByName("Warehouse Stennis"), "Stennis") --Functional.Warehouse#WAREHOUSE +warehouse.Pampa = WAREHOUSE:New(STATIC:FindByName("Warehouse Pampa"), "Pampa") --Functional.Warehouse#WAREHOUSE +warehouse.Pearth = WAREHOUSE:New(STATIC:FindByName("Warehouse Pearth"), "Pearth") --Functional.Warehouse#WAREHOUSE +-- Red warehouse +warehouse.Sukhumi = WAREHOUSE:New(STATIC:FindByName("Warehouse Sukhumi"), "Sukhumi") --Functional.Warehouse#WAREHOUSE +warehouse.Gudauta = WAREHOUSE:New(STATIC:FindByName("Warehouse Gudauta"), "Gudauta") --Functional.Warehouse#WAREHOUSE +warehouse.Sochi = WAREHOUSE:New(STATIC:FindByName("Warehouse Sochi"), "Sochi") --Functional.Warehouse#WAREHOUSE + +-- Fine tune warehouses if necessary. +warehouse.Batumi:SetSpawnZone(ZONE:New("Warehouse Batumi Spawn Zone")) +warehouse.Senaki:SetSpawnZone(ZONE:New("Warehouse Senaki Spawn Zone")) +warehouse.Kobuleti:SetSpawnZone(ZONE_POLYGON:New("Warehouse Kobuleti Spawn Zone", GROUP:FindByName("Warehouse Kobuleti Spawn Zone"))) + + +-- Creat explosion at an object. +local function Explosion(object, power) + power=power or 1000 + if object and object:IsAlive() then + object:GetCoordinate():Explosion(power) + end +end + + +-- Start warehouses. +warehouse.Batumi:Start() +warehouse.Berlin:Start() + +-- Front line warehouse. +warehouse.Berlin:AddAsset("Infantry Platoon Alpha", 6) + +-- Resupply warehouse. +warehouse.Batumi:AddAsset("Infantry Platoon Alpha", 50) + +-- Battle zone near FARP Berlin. This is where the action is! +local BattleZone=ZONE:New("Virtual Battle Zone") + +-- Send infantry groups to the battle zone. Two groups every ~60 seconds. +for i=1,2 do + local time=(i-1)*60+10 + warehouse.Berlin:__AddRequest(time, warehouse.Berlin, WAREHOUSE.Descriptor.ATTRIBUTE, WAREHOUSE.Attribute.GROUND_INFANTRY, 2, nil, nil, nil, "To Battle Zone") +end + +-- Take care of the spawned units. +function warehouse.Berlin:OnAfterSelfRequest(From,Event,To,groupset,request) + local groupset=groupset --Core.Set#SET_GROUP + local request=request --Functional.Warehouse#WAREHOUSE.Pendingitem + + -- Get assignment of this request. + local assignment=warehouse.Berlin:GetAssignment(request) + + if assignment=="To Battle Zone" then + + for _,group in pairs(groupset:GetSet()) do + local group=group --Wrapper.Group#GROUP + + -- Route group to Battle zone. + local ToCoord=BattleZone:GetRandomCoordinate() + group:RouteGroundOnRoad(ToCoord, group:GetSpeedMax()*80) + + -- After 3-5 minutes we create an explosion to destroy the group. + SCHEDULER:New(nil, Explosion, {group, 50}, math.random(180, 300)) + end + + end + +end + +-- An asset has died ==> request resupply for it. +function warehouse.Berlin:OnAfterAssetDead(From, Event, To, asset, request) + local asset=asset --Functional.Warehouse#WAREHOUSE.Assetitem + local request=request --Functional.Warehouse#WAREHOUSE.Pendingitem + + -- Get assignment. + local assignment=warehouse.Berlin:GetAssignment(request) + + -- Request resupply for dead asset from Batumi. + warehouse.Batumi:AddRequest(warehouse.Berlin, WAREHOUSE.Descriptor.ATTRIBUTE, asset.attribute, nil, nil, nil, nil, "Resupply") + + -- Send asset to Battle zone either now or when they arrive. + warehouse.Berlin:AddRequest(warehouse.Berlin, WAREHOUSE.Descriptor.ATTRIBUTE, asset.attribute, 1, nil, nil, nil, assignment) +end diff --git a/WHS - Warehouse/Caucasus/WHS-170 - Resupply/WHS-170 - Resupply.miz b/WHS - Warehouse/Caucasus/WHS-170 - Resupply/WHS-170 - Resupply.miz index e1c097b4c1..460b03f9d8 100644 Binary files a/WHS - Warehouse/Caucasus/WHS-170 - Resupply/WHS-170 - Resupply.miz and b/WHS - Warehouse/Caucasus/WHS-170 - Resupply/WHS-170 - Resupply.miz differ diff --git a/ZON - Zones/ZON-100 - Normal Zone/ZON-100 - Normal Zone.lua b/ZON - Zones/ZON-100 - Normal Zone/ZON-100 - Normal Zone.lua index 82baa19771..bb721f8ad9 100644 --- a/ZON - Zones/ZON-100 - Normal Zone/ZON-100 - Normal Zone.lua +++ b/ZON - Zones/ZON-100 - Normal Zone/ZON-100 - Normal Zone.lua @@ -1,32 +1,32 @@ ---- --- Name: ZON-100 - Normal Zone --- Author: FlightControl --- Date Created: 21 Feb 2017 --- --- # Situation: --- --- A ZONE has been defined, which boundaries are smoking. --- A vehicle is driving through the zone perimeters. --- When the vehicle is driving in the zone, a red smoke is fired from the vehicle location. --- --- # Test cases: --- --- 1. Observe the zone perimeter smoke. --- 2. Observe the vehicle smoking a red smoke when driving through the zone. - - -GroupInside = GROUP:FindByName( "Test Inside Polygon" ) -GroupOutside = GROUP:FindByName( "Test Outside Polygon" ) - -ZoneA = ZONE:New( "Zone A" ) -ZoneA:SmokeZone( SMOKECOLOR.White, 90 ) - -Messager = SCHEDULER:New( nil, - function() - GroupInside:MessageToAll( ( GroupInside:IsCompletelyInZone( ZoneA ) ) and "Inside Zone A" or "Outside Zone A", 1 ) - if GroupInside:IsCompletelyInZone( ZoneA ) then - GroupInside:GetUnit(1):SmokeRed() - end - end, - {}, 0, 1 ) - +--- +-- Name: ZON-100 - Normal Zone +-- Author: FlightControl +-- Date Created: 21 Feb 2017 +-- +-- # Situation: +-- +-- A ZONE has been defined, which boundaries are smoking. +-- A vehicle is driving through the zone perimeters. +-- When the vehicle is driving in the zone, a red smoke is fired from the vehicle location. +-- +-- # Test cases: +-- +-- 1. Observe the zone perimeter smoke. +-- 2. Observe the vehicle smoking a red smoke when driving through the zone. + + +GroupInside = GROUP:FindByName( "Test Inside Polygon" ) +GroupOutside = GROUP:FindByName( "Test Outside Polygon" ) + +ZoneA = ZONE:New( "Zone A" ) +ZoneA:SmokeZone( SMOKECOLOR.White, 90 ) + +Messager = SCHEDULER:New( nil, + function() + GroupInside:MessageToAll( ( GroupInside:IsCompletelyInZone( ZoneA ) ) and "Inside Zone A" or "Outside Zone A", 1 ) + if GroupInside:IsCompletelyInZone( ZoneA ) then + GroupInside:GetUnit(1):SmokeRed() + end + end, + {}, 0, 1 ) + diff --git a/ZON - Zones/ZON-100 - Normal Zone/ZON-100 - Normal Zone.miz b/ZON - Zones/ZON-100 - Normal Zone/ZON-100 - Normal Zone.miz index 507adf17d1..6a716e199c 100644 Binary files a/ZON - Zones/ZON-100 - Normal Zone/ZON-100 - Normal Zone.miz and b/ZON - Zones/ZON-100 - Normal Zone/ZON-100 - Normal Zone.miz differ diff --git a/ZON - Zones/ZON-101 - Normal Zone - Random Point/ZON-101 - Normal Zone - Random Point.lua b/ZON - Zones/ZON-101 - Normal Zone - Random Point/ZON-101 - Normal Zone - Random Point.lua index 60f255fcda..75b2776c9c 100644 --- a/ZON - Zones/ZON-101 - Normal Zone - Random Point/ZON-101 - Normal Zone - Random Point.lua +++ b/ZON - Zones/ZON-101 - Normal Zone - Random Point/ZON-101 - Normal Zone - Random Point.lua @@ -1,43 +1,43 @@ ---- --- Name: ZON-101 - Normal Zone - Random Point --- Author: FlightControl --- Date Created: 18 Feb 2017 --- --- # Situation: --- --- Three zones are defined. --- 15 points are smoked in each zone. --- The first 15 points are blue smoked using the GetRandomVec2() API. --- The second 15 points are orange smoked using the GetRandomPointVec2() API. --- The third 15 points are red smoked using the GetRandomPointVec3() API. --- Note: The zones perimeters are also smoked in white, so you can observe the random point placement. --- Note: At each zone an vehicle is placed, so you can view the smoking in external view. --- --- # Test cases: --- --- 1. Observe smoking of Blue smoke in Zone 1. --- 2. Observe smoking of Orange smoke in Zone 2. --- 3. Observe smoking of Red smoke in Zone 3. - -Zone1 = ZONE:New( "Zone 1" ) -Zone2 = ZONE:New( "Zone 2" ) -Zone3 = ZONE:New( "Zone 3" ) - -Zone1:SmokeZone( SMOKECOLOR.White, 18 ) -Zone2:SmokeZone( SMOKECOLOR.White, 18 ) -Zone3:SmokeZone( SMOKECOLOR.White, 18 ) - -for i = 1, 15 do - -- Zone 1 - local Vec2 = Zone1:GetRandomVec2() - local PointVec2 = POINT_VEC2:NewFromVec2( Vec2 ) - PointVec2:SmokeBlue() - - -- Zone 2 - local PointVec2 = Zone2:GetRandomPointVec2() - PointVec2:SmokeOrange() - - -- Zone 3 - local PointVec3 = Zone3:GetRandomPointVec3() - PointVec3:SmokeRed() -end +--- +-- Name: ZON-101 - Normal Zone - Random Point +-- Author: FlightControl +-- Date Created: 18 Feb 2017 +-- +-- # Situation: +-- +-- Three zones are defined. +-- 15 points are smoked in each zone. +-- The first 15 points are blue smoked using the GetRandomVec2() API. +-- The second 15 points are orange smoked using the GetRandomPointVec2() API. +-- The third 15 points are red smoked using the GetRandomPointVec3() API. +-- Note: The zones perimeters are also smoked in white, so you can observe the random point placement. +-- Note: At each zone an vehicle is placed, so you can view the smoking in external view. +-- +-- # Test cases: +-- +-- 1. Observe smoking of Blue smoke in Zone 1. +-- 2. Observe smoking of Orange smoke in Zone 2. +-- 3. Observe smoking of Red smoke in Zone 3. + +Zone1 = ZONE:New( "Zone 1" ) +Zone2 = ZONE:New( "Zone 2" ) +Zone3 = ZONE:New( "Zone 3" ) + +Zone1:SmokeZone( SMOKECOLOR.White, 18 ) +Zone2:SmokeZone( SMOKECOLOR.White, 18 ) +Zone3:SmokeZone( SMOKECOLOR.White, 18 ) + +for i = 1, 15 do + -- Zone 1 + local Vec2 = Zone1:GetRandomVec2() + local PointVec2 = POINT_VEC2:NewFromVec2( Vec2 ) + PointVec2:SmokeBlue() + + -- Zone 2 + local PointVec2 = Zone2:GetRandomPointVec2() + PointVec2:SmokeOrange() + + -- Zone 3 + local PointVec3 = Zone3:GetRandomPointVec3() + PointVec3:SmokeRed() +end diff --git a/ZON - Zones/ZON-101 - Normal Zone - Random Point/ZON-101 - Normal Zone - Random Point.miz b/ZON - Zones/ZON-101 - Normal Zone - Random Point/ZON-101 - Normal Zone - Random Point.miz index 52271d61c7..7c78700126 100644 Binary files a/ZON - Zones/ZON-101 - Normal Zone - Random Point/ZON-101 - Normal Zone - Random Point.miz and b/ZON - Zones/ZON-101 - Normal Zone - Random Point/ZON-101 - Normal Zone - Random Point.miz differ diff --git a/ZON - Zones/ZON-102 - Normal Zone Boundary/ZON-102 - Normal Zone Boundary.lua b/ZON - Zones/ZON-102 - Normal Zone Boundary/ZON-102 - Normal Zone Boundary.lua index 361f2a7f91..24ce852035 100644 --- a/ZON - Zones/ZON-102 - Normal Zone Boundary/ZON-102 - Normal Zone Boundary.lua +++ b/ZON - Zones/ZON-102 - Normal Zone Boundary/ZON-102 - Normal Zone Boundary.lua @@ -1,32 +1,32 @@ ---- --- Name: ZON-100 - Normal Zone --- Author: FlightControl --- Date Created: 21 Feb 2017 --- --- # Situation: --- --- A ZONE has been defined, which boundaries are smoking. --- A vehicle is driving through the zone perimeters. --- When the vehicle is driving in the zone, a red smoke is fired from the vehicle location. --- --- # Test cases: --- --- 1. Observe the zone perimeter smoke. --- 2. Observe the vehicle smoking a red smoke when driving through the zone. - - -GroupInside = GROUP:FindByName( "Test Inside Polygon" ) -GroupOutside = GROUP:FindByName( "Test Outside Polygon" ) - -ZoneA = ZONE:New( "Zone A" ) -ZoneA:BoundZone( 90 ) - -Messager = SCHEDULER:New( nil, - function() - GroupInside:MessageToAll( ( GroupInside:IsCompletelyInZone( ZoneA ) ) and "Inside Zone A" or "Outside Zone A", 1 ) - if GroupInside:IsCompletelyInZone( ZoneA ) then - GroupInside:GetUnit(1):SmokeRed() - end - end, - {}, 0, 1 ) - +--- +-- Name: ZON-100 - Normal Zone +-- Author: FlightControl +-- Date Created: 21 Feb 2017 +-- +-- # Situation: +-- +-- A ZONE has been defined, which boundaries are smoking. +-- A vehicle is driving through the zone perimeters. +-- When the vehicle is driving in the zone, a red smoke is fired from the vehicle location. +-- +-- # Test cases: +-- +-- 1. Observe the zone perimeter smoke. +-- 2. Observe the vehicle smoking a red smoke when driving through the zone. + + +GroupInside = GROUP:FindByName( "Test Inside Polygon" ) +GroupOutside = GROUP:FindByName( "Test Outside Polygon" ) + +ZoneA = ZONE:New( "Zone A" ) +ZoneA:BoundZone( 90 ) + +Messager = SCHEDULER:New( nil, + function() + GroupInside:MessageToAll( ( GroupInside:IsCompletelyInZone( ZoneA ) ) and "Inside Zone A" or "Outside Zone A", 1 ) + if GroupInside:IsCompletelyInZone( ZoneA ) then + GroupInside:GetUnit(1):SmokeRed() + end + end, + {}, 0, 1 ) + diff --git a/ZON - Zones/ZON-102 - Normal Zone Boundary/ZON-102 - Normal Zone Boundary.miz b/ZON - Zones/ZON-102 - Normal Zone Boundary/ZON-102 - Normal Zone Boundary.miz index 47f0aaa76d..8f118d6647 100644 Binary files a/ZON - Zones/ZON-102 - Normal Zone Boundary/ZON-102 - Normal Zone Boundary.miz and b/ZON - Zones/ZON-102 - Normal Zone Boundary/ZON-102 - Normal Zone Boundary.miz differ diff --git a/ZON - Zones/ZON-103 - Test if GROUP object is in ZONE/SET-102 - Test SET_GROUP object against ZONE.lua b/ZON - Zones/ZON-103 - Test if GROUP object is in ZONE/SET-102 - Test SET_GROUP object against ZONE.lua new file mode 100644 index 0000000000..db60dc57a0 --- /dev/null +++ b/ZON - Zones/ZON-103 - Test if GROUP object is in ZONE/SET-102 - Test SET_GROUP object against ZONE.lua @@ -0,0 +1,34 @@ +--- +-- Name: SET-102 - Test SET_GROUP object against ZONE +-- Author: FlightControl +-- Date Created: 31 Mar 2017 +-- +-- # Situation: +-- +-- A ZONE has been defined, and the SET_GROUP object is checked against the zone. +-- +-- # Test cases: +-- +-- 1. Observe the zone perimeter, and place the SET_GROUP object in or out of the zone. +-- 2. Observe the results of the functions. + + +SetGroupObject = SET_GROUP:New():FilterCoalitions("blue"):FilterPrefixes("Group Object"):FilterStart() + +Zone = ZONE:New( "Zone" ) + +SetGroupObject:ForEachGroupCompletelyInZone( Zone, + function( GroupObject ) + GroupObject:E( { GroupObject:GetName(), "I am completely in Zone" } ) + end ) + +SetGroupObject:ForEachGroupPartlyInZone( Zone, + function( GroupObject ) + GroupObject:E( { GroupObject:GetName(), "I am partially in Zone" } ) + end ) + +SetGroupObject:ForEachGroupNotInZone( Zone, + function( GroupObject ) + GroupObject:E( { GroupObject:GetName(), "I am not in Zone" } ) + end ) + diff --git a/ZON - Zones/ZON-103 - Test if GROUP object is in ZONE/ZON-103 - Test if GROUP object is in ZONE.lua b/ZON - Zones/ZON-103 - Test if GROUP object is in ZONE/ZON-103 - Test if GROUP object is in ZONE.lua index 1a893154b1..8271df5e89 100644 --- a/ZON - Zones/ZON-103 - Test if GROUP object is in ZONE/ZON-103 - Test if GROUP object is in ZONE.lua +++ b/ZON - Zones/ZON-103 - Test if GROUP object is in ZONE/ZON-103 - Test if GROUP object is in ZONE.lua @@ -1,24 +1,24 @@ ---- --- Name: ZON-103 - Test if GROUP object is in ZONE --- Author: FlightControl --- Date Created: 31 Mar 2017 --- --- # Situation: --- --- A ZONE has been defined, and it is checked if a GROUP object is within the zone. --- --- # Test cases: --- --- 1. Observe the zone perimeter, and place the GROUP object in or out of the zone. --- 2. Observe the results of the functions. - - -GroupObject = GROUP:FindByName( "Group Object" ) - -Zone = ZONE:New( "Zone" ) - - -Zone:E( { "Group is completely in Zone:", GroupObject:IsCompletelyInZone( Zone ) } ) -Zone:E( { "Group is partially in Zone:", GroupObject:IsPartlyInZone( Zone ) } ) -Zone:E( { "Group is not in Zone:", GroupObject:IsNotInZone( Zone ) } ) - +--- +-- Name: ZON-103 - Test if GROUP object is in ZONE +-- Author: FlightControl +-- Date Created: 31 Mar 2017 +-- +-- # Situation: +-- +-- A ZONE has been defined, and it is checked if a GROUP object is within the zone. +-- +-- # Test cases: +-- +-- 1. Observe the zone perimeter, and place the GROUP object in or out of the zone. +-- 2. Observe the results of the functions. + + +GroupObject = GROUP:FindByName( "Group Object" ) + +Zone = ZONE:New( "Zone" ) + + +Zone:E( { "Group is completely in Zone:", GroupObject:IsCompletelyInZone( Zone ) } ) +Zone:E( { "Group is partially in Zone:", GroupObject:IsPartlyInZone( Zone ) } ) +Zone:E( { "Group is not in Zone:", GroupObject:IsNotInZone( Zone ) } ) + diff --git a/ZON - Zones/ZON-103 - Test if GROUP object is in ZONE/ZON-103 - Test if GROUP object is in ZONE.miz b/ZON - Zones/ZON-103 - Test if GROUP object is in ZONE/ZON-103 - Test if GROUP object is in ZONE.miz index 5cf50996be..7c48d1fc5b 100644 Binary files a/ZON - Zones/ZON-103 - Test if GROUP object is in ZONE/ZON-103 - Test if GROUP object is in ZONE.miz and b/ZON - Zones/ZON-103 - Test if GROUP object is in ZONE/ZON-103 - Test if GROUP object is in ZONE.miz differ diff --git a/ZON - Zones/ZON-110 - ZONE declared in ME/ZON-110 - ZONE declared in ME.lua b/ZON - Zones/ZON-110 - ZONE declared in ME/ZON-110 - ZONE declared in ME.lua index eabb547448..38ada22993 100644 --- a/ZON - Zones/ZON-110 - ZONE declared in ME/ZON-110 - ZONE declared in ME.lua +++ b/ZON - Zones/ZON-110 - ZONE declared in ME/ZON-110 - ZONE declared in ME.lua @@ -1,34 +1,34 @@ ---- --- Name: ZON-110 - ZONE declared in ME --- Author: FlightControl --- Date Created: 21 May 2018 --- --- # Situation: --- --- A ZONE has been defined using the Mission Editor, which boundaries are smoking. --- A vehicle is driving through the zone perimeters. --- When the vehicle is driving in the zone, a red smoke is fired from the vehicle location. --- --- # Test cases: --- --- 1. Observe the zone perimeter smoke. --- 2. Observe the vehicle smoking a red smoke when driving through the zone. - - -GroupInside = GROUP:FindByName( "Test Inside" ) -GroupOutside = GROUP:FindByName( "Test Outside" ) - --- Now I can find the zone instead of doing ZONE:New, because the ZONE object is already in MOOSE. ---ZoneA = ZONE:New( "Zone A" ) -ZoneA = ZONE:FindByName( "Zone A" ) -ZoneA:SmokeZone( SMOKECOLOR.White, 30 ) - -Messager = SCHEDULER:New( nil, - function() - GroupInside:MessageToAll( ( GroupInside:IsCompletelyInZone( ZoneA ) ) and "Inside Zone A" or "Outside Zone A", 1 ) - if GroupInside:IsCompletelyInZone( ZoneA ) then - GroupInside:GetUnit(1):SmokeRed() - end - end, - {}, 0, 1 ) - +--- +-- Name: ZON-110 - ZONE declared in ME +-- Author: FlightControl +-- Date Created: 21 May 2018 +-- +-- # Situation: +-- +-- A ZONE has been defined using the Mission Editor, which boundaries are smoking. +-- A vehicle is driving through the zone perimeters. +-- When the vehicle is driving in the zone, a red smoke is fired from the vehicle location. +-- +-- # Test cases: +-- +-- 1. Observe the zone perimeter smoke. +-- 2. Observe the vehicle smoking a red smoke when driving through the zone. + + +GroupInside = GROUP:FindByName( "Test Inside" ) +GroupOutside = GROUP:FindByName( "Test Outside" ) + +-- Now I can find the zone instead of doing ZONE:New, because the ZONE object is already in MOOSE. +--ZoneA = ZONE:New( "Zone A" ) +ZoneA = ZONE:FindByName( "Zone A" ) +ZoneA:SmokeZone( SMOKECOLOR.White, 30 ) + +Messager = SCHEDULER:New( nil, + function() + GroupInside:MessageToAll( ( GroupInside:IsCompletelyInZone( ZoneA ) ) and "Inside Zone A" or "Outside Zone A", 1 ) + if GroupInside:IsCompletelyInZone( ZoneA ) then + GroupInside:GetUnit(1):SmokeRed() + end + end, + {}, 0, 1 ) + diff --git a/ZON - Zones/ZON-110 - ZONE declared in ME/ZON-110 - ZONE declared in ME.miz b/ZON - Zones/ZON-110 - ZONE declared in ME/ZON-110 - ZONE declared in ME.miz index 163fcc8a59..2ce6191f7b 100644 Binary files a/ZON - Zones/ZON-110 - ZONE declared in ME/ZON-110 - ZONE declared in ME.miz and b/ZON - Zones/ZON-110 - ZONE declared in ME/ZON-110 - ZONE declared in ME.miz differ diff --git a/ZON - Zones/ZON-190 - Return SCENERY objects in Zone/ZON-190 - Return SCENERY objects in Zone.lua b/ZON - Zones/ZON-190 - Return SCENERY objects in Zone/ZON-190 - Return SCENERY objects in Zone.lua index 3455efb90e..8503cd1d2d 100644 --- a/ZON - Zones/ZON-190 - Return SCENERY objects in Zone/ZON-190 - Return SCENERY objects in Zone.lua +++ b/ZON - Zones/ZON-190 - Return SCENERY objects in Zone/ZON-190 - Return SCENERY objects in Zone.lua @@ -1,22 +1,22 @@ ---- --- Name: ZON-190 - Return SCENERY objects in Zone --- Author: FlightControl --- Date Created: 08 Oct 2017 --- --- # Situation: --- --- # Test cases: --- - - -Zone = ZONE:New( "Zone" ) - - -Zone:Scan( Object.Category.SCENERY ) - -for SceneryTypeName, SceneryData in pairs( Zone:GetScannedScenery() ) do - for SceneryName, SceneryObject in pairs( SceneryData ) do - local SceneryObject = SceneryObject -- Wrapper.Scenery#SCENERY - MESSAGE:NewType( "Scenery: " .. SceneryObject:GetTypeName() .. ", Coord LL DMS: " .. SceneryObject:GetCoordinate():ToStringLLDMS(), MESSAGE.Type.Information ):ToAll() - end +--- +-- Name: ZON-190 - Return SCENERY objects in Zone +-- Author: FlightControl +-- Date Created: 08 Oct 2017 +-- +-- # Situation: +-- +-- # Test cases: +-- + + +Zone = ZONE:New( "Zone" ) + + +Zone:Scan( Object.Category.SCENERY ) + +for SceneryTypeName, SceneryData in pairs( Zone:GetScannedScenery() ) do + for SceneryName, SceneryObject in pairs( SceneryData ) do + local SceneryObject = SceneryObject -- Wrapper.Scenery#SCENERY + MESSAGE:NewType( "Scenery: " .. SceneryObject:GetTypeName() .. ", Coord LL DMS: " .. SceneryObject:GetCoordinate():ToStringLLDMS(), MESSAGE.Type.Information ):ToAll() + end end \ No newline at end of file diff --git a/ZON - Zones/ZON-190 - Return SCENERY objects in Zone/ZON-190 - Return SCENERY objects in Zone.miz b/ZON - Zones/ZON-190 - Return SCENERY objects in Zone/ZON-190 - Return SCENERY objects in Zone.miz index fa0b2b3359..d58ffe9711 100644 Binary files a/ZON - Zones/ZON-190 - Return SCENERY objects in Zone/ZON-190 - Return SCENERY objects in Zone.miz and b/ZON - Zones/ZON-190 - Return SCENERY objects in Zone/ZON-190 - Return SCENERY objects in Zone.miz differ diff --git a/ZON - Zones/ZON-200 - Group Zone/ZON-200 - Group Zone.lua b/ZON - Zones/ZON-200 - Group Zone/ZON-200 - Group Zone.lua index c59865b094..e107a17b12 100644 --- a/ZON - Zones/ZON-200 - Group Zone/ZON-200 - Group Zone.lua +++ b/ZON - Zones/ZON-200 - Group Zone/ZON-200 - Group Zone.lua @@ -1,36 +1,36 @@ ---- --- Name: ZON-200 - Group Zone --- Author: FlightControl --- Date Created: 21 Feb 2017 --- --- # Situation: --- --- A ZONE_GROUP has been defined, which boundaries are smoking. --- A vehicle is driving through the zone perimeters. --- When the vehicle is driving in the zone, a red smoke is fired from the vehicle location. --- --- # Test cases: --- --- 1. Observe the zone perimeter smoke. --- 2. Observe the vehicle smoking a red smoke when driving through the zone. - -GroupInside = GROUP:FindByName( "Test Inside Polygon" ) -GroupOutside = GROUP:FindByName( "Test Outside Polygon" ) - -Tank = GROUP:FindByName( "Tank" ) -ZoneA = ZONE_GROUP:New( "Zone A", Tank, 100 ) - -Messager = SCHEDULER:New( nil, - function() - GroupInside:MessageToAll( ( GroupInside:IsCompletelyInZone( ZoneA ) ) and "Inside Zone A" or "Outside Zone A", 1 ) - if GroupInside:IsCompletelyInZone( ZoneA ) then - GroupInside:GetUnit(1):SmokeRed() - end - end, - {}, 0, 1 ) - -TankZoneColoring = SCHEDULER:New( nil, - function() - ZoneA:FlareZone( FLARECOLOR.White, 90, 60 ) - end, +--- +-- Name: ZON-200 - Group Zone +-- Author: FlightControl +-- Date Created: 21 Feb 2017 +-- +-- # Situation: +-- +-- A ZONE_GROUP has been defined, which boundaries are smoking. +-- A vehicle is driving through the zone perimeters. +-- When the vehicle is driving in the zone, a red smoke is fired from the vehicle location. +-- +-- # Test cases: +-- +-- 1. Observe the zone perimeter smoke. +-- 2. Observe the vehicle smoking a red smoke when driving through the zone. + +GroupInside = GROUP:FindByName( "Test Inside Polygon" ) +GroupOutside = GROUP:FindByName( "Test Outside Polygon" ) + +Tank = GROUP:FindByName( "Tank" ) +ZoneA = ZONE_GROUP:New( "Zone A", Tank, 100 ) + +Messager = SCHEDULER:New( nil, + function() + GroupInside:MessageToAll( ( GroupInside:IsCompletelyInZone( ZoneA ) ) and "Inside Zone A" or "Outside Zone A", 1 ) + if GroupInside:IsCompletelyInZone( ZoneA ) then + GroupInside:GetUnit(1):SmokeRed() + end + end, + {}, 0, 1 ) + +TankZoneColoring = SCHEDULER:New( nil, + function() + ZoneA:FlareZone( FLARECOLOR.White, 90, 60 ) + end, {}, 0, 5 ) \ No newline at end of file diff --git a/ZON - Zones/ZON-200 - Group Zone/ZON-200 - Group Zone.miz b/ZON - Zones/ZON-200 - Group Zone/ZON-200 - Group Zone.miz index 20ac2cfff2..e7f2e3ea60 100644 Binary files a/ZON - Zones/ZON-200 - Group Zone/ZON-200 - Group Zone.miz and b/ZON - Zones/ZON-200 - Group Zone/ZON-200 - Group Zone.miz differ diff --git a/ZON - Zones/ZON-201 - Group Zone - Random Point/ZON-201 - Group Zone - Random Point.lua b/ZON - Zones/ZON-201 - Group Zone - Random Point/ZON-201 - Group Zone - Random Point.lua index 38d0736890..3c0234bf18 100644 --- a/ZON - Zones/ZON-201 - Group Zone - Random Point/ZON-201 - Group Zone - Random Point.lua +++ b/ZON - Zones/ZON-201 - Group Zone - Random Point/ZON-201 - Group Zone - Random Point.lua @@ -1,43 +1,43 @@ ---- --- Name: ZON-201 - Group Zone - Random Point --- Author: FlightControl --- Date Created: 18 Feb 2017 --- --- # Situation: --- --- Three zones are defined. --- 15 points are smoked in each zone. --- The first 15 points are blue smoked using the GetRandomVec2() API. --- The second 15 points are orange smoked using the GetRandomPointVec2() API. --- The third 15 points are red smoked using the GetRandomPointVec3() API. --- Note: The zones perimeters are also smoked in white, so you can observe the random point placement. --- Note: At each zone an vehicle is placed, so you can view the smoking in external view. --- --- # Test cases: --- --- 1. Observe smoking of Blue smoke in Zone 1. --- 2. Observe smoking of Orange smoke in Zone 2. --- 3. Observe smoking of Red smoke in Zone 3. - -Zone1 = ZONE_GROUP:New( "Zone 1", GROUP:FindByName( "Zone 1" ), 300 ) -Zone2 = ZONE_GROUP:New( "Zone 2", GROUP:FindByName( "Zone 2" ), 300 ) -Zone3 = ZONE_GROUP:New( "Zone 3", GROUP:FindByName( "Zone 3" ), 300 ) - -Zone1:SmokeZone( SMOKECOLOR.White, 18 ) -Zone2:SmokeZone( SMOKECOLOR.White, 18 ) -Zone3:SmokeZone( SMOKECOLOR.White, 18 ) - -for i = 1, 15 do - -- Zone 1 - local Vec2 = Zone1:GetRandomVec2() - local PointVec2 = POINT_VEC2:NewFromVec2( Vec2 ) - PointVec2:SmokeBlue() - - -- Zone 2 - local PointVec2 = Zone2:GetRandomPointVec2() - PointVec2:SmokeOrange() - - -- Zone 3 - local PointVec3 = Zone3:GetRandomPointVec3() - PointVec3:SmokeRed() -end +--- +-- Name: ZON-201 - Group Zone - Random Point +-- Author: FlightControl +-- Date Created: 18 Feb 2017 +-- +-- # Situation: +-- +-- Three zones are defined. +-- 15 points are smoked in each zone. +-- The first 15 points are blue smoked using the GetRandomVec2() API. +-- The second 15 points are orange smoked using the GetRandomPointVec2() API. +-- The third 15 points are red smoked using the GetRandomPointVec3() API. +-- Note: The zones perimeters are also smoked in white, so you can observe the random point placement. +-- Note: At each zone an vehicle is placed, so you can view the smoking in external view. +-- +-- # Test cases: +-- +-- 1. Observe smoking of Blue smoke in Zone 1. +-- 2. Observe smoking of Orange smoke in Zone 2. +-- 3. Observe smoking of Red smoke in Zone 3. + +Zone1 = ZONE_GROUP:New( "Zone 1", GROUP:FindByName( "Zone 1" ), 300 ) +Zone2 = ZONE_GROUP:New( "Zone 2", GROUP:FindByName( "Zone 2" ), 300 ) +Zone3 = ZONE_GROUP:New( "Zone 3", GROUP:FindByName( "Zone 3" ), 300 ) + +Zone1:SmokeZone( SMOKECOLOR.White, 18 ) +Zone2:SmokeZone( SMOKECOLOR.White, 18 ) +Zone3:SmokeZone( SMOKECOLOR.White, 18 ) + +for i = 1, 15 do + -- Zone 1 + local Vec2 = Zone1:GetRandomVec2() + local PointVec2 = POINT_VEC2:NewFromVec2( Vec2 ) + PointVec2:SmokeBlue() + + -- Zone 2 + local PointVec2 = Zone2:GetRandomPointVec2() + PointVec2:SmokeOrange() + + -- Zone 3 + local PointVec3 = Zone3:GetRandomPointVec3() + PointVec3:SmokeRed() +end diff --git a/ZON - Zones/ZON-201 - Group Zone - Random Point/ZON-201 - Group Zone - Random Point.miz b/ZON - Zones/ZON-201 - Group Zone - Random Point/ZON-201 - Group Zone - Random Point.miz index d8abf2c77f..2fbc8c4709 100644 Binary files a/ZON - Zones/ZON-201 - Group Zone - Random Point/ZON-201 - Group Zone - Random Point.miz and b/ZON - Zones/ZON-201 - Group Zone - Random Point/ZON-201 - Group Zone - Random Point.miz differ diff --git a/ZON - Zones/ZON-300 - Unit Zone/ZON-300 - Unit Zone.lua b/ZON - Zones/ZON-300 - Unit Zone/ZON-300 - Unit Zone.lua index e27334e356..50cb61a369 100644 --- a/ZON - Zones/ZON-300 - Unit Zone/ZON-300 - Unit Zone.lua +++ b/ZON - Zones/ZON-300 - Unit Zone/ZON-300 - Unit Zone.lua @@ -1,36 +1,36 @@ ---- --- Name: ZON-300 - Unit Zone --- Author: FlightControl --- Date Created: 21 Feb 2017 --- --- # Situation: --- --- A ZONE_UNIT has been defined, which boundaries are smoking. --- A vehicle is driving through the zone perimeters. --- When the vehicle is driving in the zone, a red smoke is fired from the vehicle location. --- --- # Test cases: --- --- 1. Observe the zone perimeter smoke. --- 2. Observe the vehicle smoking a red smoke when driving through the zone. - -GroupInside = GROUP:FindByName( "Test Inside Polygon" ) -GroupOutside = GROUP:FindByName( "Test Outside Polygon" ) - -Tank = UNIT:FindByName( "Tank" ) -ZoneA = ZONE_UNIT:New( "Zone A", Tank, 100 ) - -Messager = SCHEDULER:New( nil, - function() - GroupInside:MessageToAll( ( GroupInside:IsCompletelyInZone( ZoneA ) ) and "Inside Zone A" or "Outside Zone A", 1 ) - if GroupInside:IsCompletelyInZone( ZoneA ) then - GroupInside:GetUnit(1):SmokeRed() - end - end, - {}, 0, 1 ) - -TankZoneColoring = SCHEDULER:New( nil, - function() - ZoneA:FlareZone( FLARECOLOR.White, 90, 60 ) - end, +--- +-- Name: ZON-300 - Unit Zone +-- Author: FlightControl +-- Date Created: 21 Feb 2017 +-- +-- # Situation: +-- +-- A ZONE_UNIT has been defined, which boundaries are smoking. +-- A vehicle is driving through the zone perimeters. +-- When the vehicle is driving in the zone, a red smoke is fired from the vehicle location. +-- +-- # Test cases: +-- +-- 1. Observe the zone perimeter smoke. +-- 2. Observe the vehicle smoking a red smoke when driving through the zone. + +GroupInside = GROUP:FindByName( "Test Inside Polygon" ) +GroupOutside = GROUP:FindByName( "Test Outside Polygon" ) + +Tank = UNIT:FindByName( "Tank" ) +ZoneA = ZONE_UNIT:New( "Zone A", Tank, 100 ) + +Messager = SCHEDULER:New( nil, + function() + GroupInside:MessageToAll( ( GroupInside:IsCompletelyInZone( ZoneA ) ) and "Inside Zone A" or "Outside Zone A", 1 ) + if GroupInside:IsCompletelyInZone( ZoneA ) then + GroupInside:GetUnit(1):SmokeRed() + end + end, + {}, 0, 1 ) + +TankZoneColoring = SCHEDULER:New( nil, + function() + ZoneA:FlareZone( FLARECOLOR.White, 90, 60 ) + end, {}, 0, 5 ) \ No newline at end of file diff --git a/ZON - Zones/ZON-300 - Unit Zone/ZON-300 - Unit Zone.miz b/ZON - Zones/ZON-300 - Unit Zone/ZON-300 - Unit Zone.miz index 784e1714ad..6a980ba8d6 100644 Binary files a/ZON - Zones/ZON-300 - Unit Zone/ZON-300 - Unit Zone.miz and b/ZON - Zones/ZON-300 - Unit Zone/ZON-300 - Unit Zone.miz differ diff --git a/ZON - Zones/ZON-301 - Unit Zone - Random Point/ZON-301 - Unit Zone - Random Point.lua b/ZON - Zones/ZON-301 - Unit Zone - Random Point/ZON-301 - Unit Zone - Random Point.lua index db53722a8c..8209c3db65 100644 --- a/ZON - Zones/ZON-301 - Unit Zone - Random Point/ZON-301 - Unit Zone - Random Point.lua +++ b/ZON - Zones/ZON-301 - Unit Zone - Random Point/ZON-301 - Unit Zone - Random Point.lua @@ -1,43 +1,43 @@ ---- --- Name: ZON-301 - Unit Zone - Random Point --- Author: FlightControl --- Date Created: 18 Feb 2017 --- --- # Situation: --- --- Three zones are defined. --- 15 points are smoked in each zone. --- The first 15 points are blue smoked using the GetRandomVec2() API. --- The second 15 points are orange smoked using the GetRandomPointVec2() API. --- The third 15 points are red smoked using the GetRandomPointVec3() API. --- Note: The zones perimeters are also smoked in white, so you can observe the random point placement. --- Note: At each zone an vehicle is placed, so you can view the smoking in external view. --- --- # Test cases: --- --- 1. Observe smoking of Blue smoke in Zone 1. --- 2. Observe smoking of Orange smoke in Zone 2. --- 3. Observe smoking of Red smoke in Zone 3. - -Zone1 = ZONE_UNIT:New( "Zone 1", UNIT:FindByName( "Zone 1" ), 300 ) -Zone2 = ZONE_UNIT:New( "Zone 2", UNIT:FindByName( "Zone 2" ), 300 ) -Zone3 = ZONE_UNIT:New( "Zone 3", UNIT:FindByName( "Zone 3" ), 300 ) - -Zone1:SmokeZone( SMOKECOLOR.White, 18 ) -Zone2:SmokeZone( SMOKECOLOR.White, 18 ) -Zone3:SmokeZone( SMOKECOLOR.White, 18 ) - -for i = 1, 15 do - -- Zone 1 - local Vec2 = Zone1:GetRandomVec2() - local PointVec2 = POINT_VEC2:NewFromVec2( Vec2 ) - PointVec2:SmokeBlue() - - -- Zone 2 - local PointVec2 = Zone2:GetRandomPointVec2() - PointVec2:SmokeOrange() - - -- Zone 3 - local PointVec3 = Zone3:GetRandomPointVec3() - PointVec3:SmokeRed() -end +--- +-- Name: ZON-301 - Unit Zone - Random Point +-- Author: FlightControl +-- Date Created: 18 Feb 2017 +-- +-- # Situation: +-- +-- Three zones are defined. +-- 15 points are smoked in each zone. +-- The first 15 points are blue smoked using the GetRandomVec2() API. +-- The second 15 points are orange smoked using the GetRandomPointVec2() API. +-- The third 15 points are red smoked using the GetRandomPointVec3() API. +-- Note: The zones perimeters are also smoked in white, so you can observe the random point placement. +-- Note: At each zone an vehicle is placed, so you can view the smoking in external view. +-- +-- # Test cases: +-- +-- 1. Observe smoking of Blue smoke in Zone 1. +-- 2. Observe smoking of Orange smoke in Zone 2. +-- 3. Observe smoking of Red smoke in Zone 3. + +Zone1 = ZONE_UNIT:New( "Zone 1", UNIT:FindByName( "Zone 1" ), 300 ) +Zone2 = ZONE_UNIT:New( "Zone 2", UNIT:FindByName( "Zone 2" ), 300 ) +Zone3 = ZONE_UNIT:New( "Zone 3", UNIT:FindByName( "Zone 3" ), 300 ) + +Zone1:SmokeZone( SMOKECOLOR.White, 18 ) +Zone2:SmokeZone( SMOKECOLOR.White, 18 ) +Zone3:SmokeZone( SMOKECOLOR.White, 18 ) + +for i = 1, 15 do + -- Zone 1 + local Vec2 = Zone1:GetRandomVec2() + local PointVec2 = POINT_VEC2:NewFromVec2( Vec2 ) + PointVec2:SmokeBlue() + + -- Zone 2 + local PointVec2 = Zone2:GetRandomPointVec2() + PointVec2:SmokeOrange() + + -- Zone 3 + local PointVec3 = Zone3:GetRandomPointVec3() + PointVec3:SmokeRed() +end diff --git a/ZON - Zones/ZON-301 - Unit Zone - Random Point/ZON-301 - Unit Zone - Random Point.miz b/ZON - Zones/ZON-301 - Unit Zone - Random Point/ZON-301 - Unit Zone - Random Point.miz index 8afc41e339..5e5b1e7285 100644 Binary files a/ZON - Zones/ZON-301 - Unit Zone - Random Point/ZON-301 - Unit Zone - Random Point.miz and b/ZON - Zones/ZON-301 - Unit Zone - Random Point/ZON-301 - Unit Zone - Random Point.miz differ diff --git a/ZON - Zones/ZON-400 - Radius Zone/ZON-400 - Radius Zone.lua b/ZON - Zones/ZON-400 - Radius Zone/ZON-400 - Radius Zone.lua index c73a6360ea..db873d162e 100644 --- a/ZON - Zones/ZON-400 - Radius Zone/ZON-400 - Radius Zone.lua +++ b/ZON - Zones/ZON-400 - Radius Zone/ZON-400 - Radius Zone.lua @@ -1,32 +1,32 @@ ---- --- Name: ZON-400 - Radius Zone --- Author: FlightControl --- Date Created: 21 Feb 2017 --- --- # Situation: --- --- A ZONE_RADIUS has been defined, which boundaries are smoking. --- A vehicle is driving through the zone perimeters. --- When the vehicle is driving in the zone, a red smoke is fired from the vehicle location. --- --- # Test cases: --- --- 1. Observe the polygon perimeter smoke. --- 2. Observe the vehicle smoking a red smoke when driving through the zone. - -GroupInside = GROUP:FindByName( "Test Inside Polygon" ) -GroupOutside = GROUP:FindByName( "Test Outside Polygon" ) - -House = STATIC:FindByName( "House" ) -ZoneA = ZONE_RADIUS:New( "Zone A", House:GetVec2(), 300 ) -ZoneA:SmokeZone( SMOKECOLOR.White, 90 ) - -Messager = SCHEDULER:New( nil, - function() - GroupInside:MessageToAll( ( GroupInside:IsCompletelyInZone( ZoneA ) ) and "Inside Zone A" or "Outside Zone A", 1 ) - if GroupInside:IsCompletelyInZone( ZoneA ) then - GroupInside:GetUnit(1):SmokeRed() - end - end, - {}, 0, 1 ) - +--- +-- Name: ZON-400 - Radius Zone +-- Author: FlightControl +-- Date Created: 21 Feb 2017 +-- +-- # Situation: +-- +-- A ZONE_RADIUS has been defined, which boundaries are smoking. +-- A vehicle is driving through the zone perimeters. +-- When the vehicle is driving in the zone, a red smoke is fired from the vehicle location. +-- +-- # Test cases: +-- +-- 1. Observe the polygon perimeter smoke. +-- 2. Observe the vehicle smoking a red smoke when driving through the zone. + +GroupInside = GROUP:FindByName( "Test Inside Polygon" ) +GroupOutside = GROUP:FindByName( "Test Outside Polygon" ) + +House = STATIC:FindByName( "House" ) +ZoneA = ZONE_RADIUS:New( "Zone A", House:GetVec2(), 300 ) +ZoneA:SmokeZone( SMOKECOLOR.White, 90 ) + +Messager = SCHEDULER:New( nil, + function() + GroupInside:MessageToAll( ( GroupInside:IsCompletelyInZone( ZoneA ) ) and "Inside Zone A" or "Outside Zone A", 1 ) + if GroupInside:IsCompletelyInZone( ZoneA ) then + GroupInside:GetUnit(1):SmokeRed() + end + end, + {}, 0, 1 ) + diff --git a/ZON - Zones/ZON-400 - Radius Zone/ZON-400 - Radius Zone.miz b/ZON - Zones/ZON-400 - Radius Zone/ZON-400 - Radius Zone.miz index 425775afb6..842d6ce459 100644 Binary files a/ZON - Zones/ZON-400 - Radius Zone/ZON-400 - Radius Zone.miz and b/ZON - Zones/ZON-400 - Radius Zone/ZON-400 - Radius Zone.miz differ diff --git a/ZON - Zones/ZON-401 - Radius Zone - Random Point/ZON-401 - Radius Zone - Random Point.lua b/ZON - Zones/ZON-401 - Radius Zone - Random Point/ZON-401 - Radius Zone - Random Point.lua index b3d5112673..1c5f012e2c 100644 --- a/ZON - Zones/ZON-401 - Radius Zone - Random Point/ZON-401 - Radius Zone - Random Point.lua +++ b/ZON - Zones/ZON-401 - Radius Zone - Random Point/ZON-401 - Radius Zone - Random Point.lua @@ -1,48 +1,48 @@ ---- --- Name: ZON-401 - Radius Zone - Random Point --- Author: FlightControl --- Date Created: 18 Feb 2017 --- --- # Situation: --- --- Three zones are defined. --- 15 points are smoked in each zone. --- The first 15 points are blue smoked using the GetRandomVec2() API. --- The second 15 points are orange smoked using the GetRandomPointVec2() API. --- The third 15 points are red smoked using the GetRandomPointVec3() API. --- Note: The zones perimeters are also smoked in white, so you can observe the random point placement. --- Note: At each zone an vehicle is placed, so you can view the smoking in external view. --- --- # Test cases: --- --- 1. Observe smoking of Blue smoke in Zone 1. --- 2. Observe smoking of Orange smoke in Zone 2. --- 3. Observe smoking of Red smoke in Zone 3. - -Unit1 = UNIT:FindByName( "Zone 1" ) -Unit2 = UNIT:FindByName( "Zone 2" ) -Unit3 = UNIT:FindByName( "Zone 3" ) - - -Zone1 = ZONE_RADIUS:New( "Zone 1", Unit1:GetVec2(), 300 ) -Zone2 = ZONE_RADIUS:New( "Zone 2", Unit2:GetVec2(), 300 ) -Zone3 = ZONE_RADIUS:New( "Zone 3", Unit3:GetVec2(), 300 ) - -Zone1:SmokeZone( SMOKECOLOR.White, 18 ) -Zone2:SmokeZone( SMOKECOLOR.White, 18 ) -Zone3:SmokeZone( SMOKECOLOR.White, 18 ) - -for i = 1, 15 do - -- Zone 1 - local Vec2 = Zone1:GetRandomVec2() - local PointVec2 = POINT_VEC2:NewFromVec2( Vec2 ) - PointVec2:SmokeBlue() - - -- Zone 2 - local PointVec2 = Zone2:GetRandomPointVec2() - PointVec2:SmokeOrange() - - -- Zone 3 - local PointVec3 = Zone3:GetRandomPointVec3() - PointVec3:SmokeRed() -end +--- +-- Name: ZON-401 - Radius Zone - Random Point +-- Author: FlightControl +-- Date Created: 18 Feb 2017 +-- +-- # Situation: +-- +-- Three zones are defined. +-- 15 points are smoked in each zone. +-- The first 15 points are blue smoked using the GetRandomVec2() API. +-- The second 15 points are orange smoked using the GetRandomPointVec2() API. +-- The third 15 points are red smoked using the GetRandomPointVec3() API. +-- Note: The zones perimeters are also smoked in white, so you can observe the random point placement. +-- Note: At each zone an vehicle is placed, so you can view the smoking in external view. +-- +-- # Test cases: +-- +-- 1. Observe smoking of Blue smoke in Zone 1. +-- 2. Observe smoking of Orange smoke in Zone 2. +-- 3. Observe smoking of Red smoke in Zone 3. + +Unit1 = UNIT:FindByName( "Zone 1" ) +Unit2 = UNIT:FindByName( "Zone 2" ) +Unit3 = UNIT:FindByName( "Zone 3" ) + + +Zone1 = ZONE_RADIUS:New( "Zone 1", Unit1:GetVec2(), 300 ) +Zone2 = ZONE_RADIUS:New( "Zone 2", Unit2:GetVec2(), 300 ) +Zone3 = ZONE_RADIUS:New( "Zone 3", Unit3:GetVec2(), 300 ) + +Zone1:SmokeZone( SMOKECOLOR.White, 18 ) +Zone2:SmokeZone( SMOKECOLOR.White, 18 ) +Zone3:SmokeZone( SMOKECOLOR.White, 18 ) + +for i = 1, 15 do + -- Zone 1 + local Vec2 = Zone1:GetRandomVec2() + local PointVec2 = POINT_VEC2:NewFromVec2( Vec2 ) + PointVec2:SmokeBlue() + + -- Zone 2 + local PointVec2 = Zone2:GetRandomPointVec2() + PointVec2:SmokeOrange() + + -- Zone 3 + local PointVec3 = Zone3:GetRandomPointVec3() + PointVec3:SmokeRed() +end diff --git a/ZON - Zones/ZON-401 - Radius Zone - Random Point/ZON-401 - Radius Zone - Random Point.miz b/ZON - Zones/ZON-401 - Radius Zone - Random Point/ZON-401 - Radius Zone - Random Point.miz index 6b66c6f840..dd0f89cbb3 100644 Binary files a/ZON - Zones/ZON-401 - Radius Zone - Random Point/ZON-401 - Radius Zone - Random Point.miz and b/ZON - Zones/ZON-401 - Radius Zone - Random Point/ZON-401 - Radius Zone - Random Point.miz differ diff --git a/ZON - Zones/ZON-500 - Polygon Zone/ZON-500 - Polygon Zone.lua b/ZON - Zones/ZON-500 - Polygon Zone/ZON-500 - Polygon Zone.lua index b5201c1f01..cdebfff78f 100644 --- a/ZON - Zones/ZON-500 - Polygon Zone/ZON-500 - Polygon Zone.lua +++ b/ZON - Zones/ZON-500 - Polygon Zone/ZON-500 - Polygon Zone.lua @@ -1,33 +1,33 @@ ---- --- Name: ZON-500 - Polygon Zone --- Author: FlightControl --- Date Created: 18 Feb 2017 --- --- # Situation: --- --- A ZONE_POLYGON has been defined, which boundaries are smoking. --- A vehicle is driving through the zone perimeters. --- When the vehicle is driving in the zone, a red smoke is fired from the vehicle location. --- --- # Test cases: --- --- 1. Observe the polygon perimeter smoke. --- 2. Observe the vehicle smoking a red smoke when driving through the zone. - -GroupInside = GROUP:FindByName( "Test Inside Polygon" ) -GroupOutside = GROUP:FindByName( "Test Outside Polygon" ) - -GroupPolygon = GROUP:FindByName( "Polygon A" ) - -PolygonZone = ZONE_POLYGON:New( "Polygon A", GroupPolygon ) -PolygonZone:SmokeZone( SMOKECOLOR.White, 20 ) - -Messager = SCHEDULER:New( nil, - function() - GroupInside:MessageToAll( ( GroupInside:IsCompletelyInZone( PolygonZone ) ) and "Inside Polygon A" or "Outside Polygon A", 1 ) - if GroupInside:IsCompletelyInZone( PolygonZone ) then - GroupInside:GetUnit(1):SmokeRed() - end - end, - {}, 0, 1 ) - +--- +-- Name: ZON-500 - Polygon Zone +-- Author: FlightControl +-- Date Created: 18 Feb 2017 +-- +-- # Situation: +-- +-- A ZONE_POLYGON has been defined, which boundaries are smoking. +-- A vehicle is driving through the zone perimeters. +-- When the vehicle is driving in the zone, a red smoke is fired from the vehicle location. +-- +-- # Test cases: +-- +-- 1. Observe the polygon perimeter smoke. +-- 2. Observe the vehicle smoking a red smoke when driving through the zone. + +GroupInside = GROUP:FindByName( "Test Inside Polygon" ) +GroupOutside = GROUP:FindByName( "Test Outside Polygon" ) + +GroupPolygon = GROUP:FindByName( "Polygon A" ) + +PolygonZone = ZONE_POLYGON:New( "Polygon A", GroupPolygon ) +PolygonZone:SmokeZone( SMOKECOLOR.White, 20 ) + +Messager = SCHEDULER:New( nil, + function() + GroupInside:MessageToAll( ( GroupInside:IsCompletelyInZone( PolygonZone ) ) and "Inside Polygon A" or "Outside Polygon A", 1 ) + if GroupInside:IsCompletelyInZone( PolygonZone ) then + GroupInside:GetUnit(1):SmokeRed() + end + end, + {}, 0, 1 ) + diff --git a/ZON - Zones/ZON-500 - Polygon Zone/ZON-500 - Polygon Zone.miz b/ZON - Zones/ZON-500 - Polygon Zone/ZON-500 - Polygon Zone.miz index d7461cedac..6673550983 100644 Binary files a/ZON - Zones/ZON-500 - Polygon Zone/ZON-500 - Polygon Zone.miz and b/ZON - Zones/ZON-500 - Polygon Zone/ZON-500 - Polygon Zone.miz differ diff --git a/ZON - Zones/ZON-501 - Polygon Zone - Random Point/ZON-501 - Polygon Zone - Random Point.lua b/ZON - Zones/ZON-501 - Polygon Zone - Random Point/ZON-501 - Polygon Zone - Random Point.lua index 545c7d9b6c..85cd66947d 100644 --- a/ZON - Zones/ZON-501 - Polygon Zone - Random Point/ZON-501 - Polygon Zone - Random Point.lua +++ b/ZON - Zones/ZON-501 - Polygon Zone - Random Point/ZON-501 - Polygon Zone - Random Point.lua @@ -1,43 +1,43 @@ ---- --- Name: ZON-501 - Polygon Zone - Random Point --- Author: FlightControl --- Date Created: 18 Feb 2017 --- --- # Situation: --- --- Three zones are defined. --- 15 points are smoked in each zone. --- The first 15 points are blue smoked using the GetRandomVec2() API. --- The second 15 points are orange smoked using the GetRandomPointVec2() API. --- The third 15 points are red smoked using the GetRandomPointVec3() API. --- Note: The zones perimeters are also smoked in white, so you can observe the random point placement. --- Note: At each zone an vehicle is placed, so you can view the smoking in external view. --- --- # Test cases: --- --- 1. Observe smoking of Blue smoke in Zone 1. --- 2. Observe smoking of Orange smoke in Zone 2. --- 3. Observe smoking of Red smoke in Zone 3. - -Zone1 = ZONE_POLYGON:New( "Zone 1", GROUP:FindByName( "Zone 1" ) ) -Zone2 = ZONE_POLYGON:New( "Zone 2", GROUP:FindByName( "Zone 2" ) ) -Zone3 = ZONE_POLYGON:New( "Zone 3", GROUP:FindByName( "Zone 3" ) ) - -Zone1:SmokeZone( SMOKECOLOR.White, 4 ) -Zone2:SmokeZone( SMOKECOLOR.White, 4 ) -Zone3:SmokeZone( SMOKECOLOR.White, 4 ) - -for i = 1, 15 do - -- Zone 1 - local Vec2 = Zone1:GetRandomVec2() - local PointVec2 = POINT_VEC2:NewFromVec2( Vec2 ) - PointVec2:SmokeBlue() - - -- Zone 2 - local PointVec2 = Zone2:GetRandomPointVec2() - PointVec2:SmokeOrange() - - -- Zone 3 - local PointVec3 = Zone3:GetRandomPointVec3() - PointVec3:SmokeRed() -end +--- +-- Name: ZON-501 - Polygon Zone - Random Point +-- Author: FlightControl +-- Date Created: 18 Feb 2017 +-- +-- # Situation: +-- +-- Three zones are defined. +-- 15 points are smoked in each zone. +-- The first 15 points are blue smoked using the GetRandomVec2() API. +-- The second 15 points are orange smoked using the GetRandomPointVec2() API. +-- The third 15 points are red smoked using the GetRandomPointVec3() API. +-- Note: The zones perimeters are also smoked in white, so you can observe the random point placement. +-- Note: At each zone an vehicle is placed, so you can view the smoking in external view. +-- +-- # Test cases: +-- +-- 1. Observe smoking of Blue smoke in Zone 1. +-- 2. Observe smoking of Orange smoke in Zone 2. +-- 3. Observe smoking of Red smoke in Zone 3. + +Zone1 = ZONE_POLYGON:New( "Zone 1", GROUP:FindByName( "Zone 1" ) ) +Zone2 = ZONE_POLYGON:New( "Zone 2", GROUP:FindByName( "Zone 2" ) ) +Zone3 = ZONE_POLYGON:New( "Zone 3", GROUP:FindByName( "Zone 3" ) ) + +Zone1:SmokeZone( SMOKECOLOR.White, 4 ) +Zone2:SmokeZone( SMOKECOLOR.White, 4 ) +Zone3:SmokeZone( SMOKECOLOR.White, 4 ) + +for i = 1, 15 do + -- Zone 1 + local Vec2 = Zone1:GetRandomVec2() + local PointVec2 = POINT_VEC2:NewFromVec2( Vec2 ) + PointVec2:SmokeBlue() + + -- Zone 2 + local PointVec2 = Zone2:GetRandomPointVec2() + PointVec2:SmokeOrange() + + -- Zone 3 + local PointVec3 = Zone3:GetRandomPointVec3() + PointVec3:SmokeRed() +end diff --git a/ZON - Zones/ZON-501 - Polygon Zone - Random Point/ZON-501 - Polygon Zone - Random Point.miz b/ZON - Zones/ZON-501 - Polygon Zone - Random Point/ZON-501 - Polygon Zone - Random Point.miz index 77c4a953fb..4dcac3fcc3 100644 Binary files a/ZON - Zones/ZON-501 - Polygon Zone - Random Point/ZON-501 - Polygon Zone - Random Point.miz and b/ZON - Zones/ZON-501 - Polygon Zone - Random Point/ZON-501 - Polygon Zone - Random Point.miz differ diff --git a/ZON - Zones/ZON-502 - Polygon Zone Boundary/ZON-502 - Polygon Zone Boundary.lua b/ZON - Zones/ZON-502 - Polygon Zone Boundary/ZON-502 - Polygon Zone Boundary.lua index c3075153ce..b0ae658d57 100644 --- a/ZON - Zones/ZON-502 - Polygon Zone Boundary/ZON-502 - Polygon Zone Boundary.lua +++ b/ZON - Zones/ZON-502 - Polygon Zone Boundary/ZON-502 - Polygon Zone Boundary.lua @@ -1,33 +1,33 @@ ---- --- Name: ZON-502 - Polygon Zone Boundary --- Author: FlightControl --- Date Created: 18 Feb 2017 --- --- # Situation: --- --- A ZONE_POLYGON has been defined, which boundaries are tires. --- A vehicle is driving through the zone perimeters. --- When the vehicle is driving in the zone, a red smoke is fired from the vehicle location. --- --- # Test cases: --- --- 1. Observe the polygon perimeter smoke. --- 2. Observe the vehicle smoking a red smoke when driving through the zone. - -GroupInside = GROUP:FindByName( "Test Inside Polygon" ) -GroupOutside = GROUP:FindByName( "Test Outside Polygon" ) - -GroupPolygon = GROUP:FindByName( "Polygon A" ) - -PolygonZone = ZONE_POLYGON:New( "Polygon A", GroupPolygon ) -PolygonZone:BoundZone() - -Messager = SCHEDULER:New( nil, - function() - GroupInside:MessageToAll( ( GroupInside:IsCompletelyInZone( PolygonZone ) ) and "Inside Polygon A" or "Outside Polygon A", 1 ) - if GroupInside:IsCompletelyInZone( PolygonZone ) then - GroupInside:GetUnit(1):SmokeRed() - end - end, - {}, 0, 1 ) - +--- +-- Name: ZON-502 - Polygon Zone Boundary +-- Author: FlightControl +-- Date Created: 18 Feb 2017 +-- +-- # Situation: +-- +-- A ZONE_POLYGON has been defined, which boundaries are tires. +-- A vehicle is driving through the zone perimeters. +-- When the vehicle is driving in the zone, a red smoke is fired from the vehicle location. +-- +-- # Test cases: +-- +-- 1. Observe the polygon perimeter smoke. +-- 2. Observe the vehicle smoking a red smoke when driving through the zone. + +GroupInside = GROUP:FindByName( "Test Inside Polygon" ) +GroupOutside = GROUP:FindByName( "Test Outside Polygon" ) + +GroupPolygon = GROUP:FindByName( "Polygon A" ) + +PolygonZone = ZONE_POLYGON:New( "Polygon A", GroupPolygon ) +PolygonZone:BoundZone() + +Messager = SCHEDULER:New( nil, + function() + GroupInside:MessageToAll( ( GroupInside:IsCompletelyInZone( PolygonZone ) ) and "Inside Polygon A" or "Outside Polygon A", 1 ) + if GroupInside:IsCompletelyInZone( PolygonZone ) then + GroupInside:GetUnit(1):SmokeRed() + end + end, + {}, 0, 1 ) + diff --git a/ZON - Zones/ZON-502 - Polygon Zone Boundary/ZON-502 - Polygon Zone Boundary.miz b/ZON - Zones/ZON-502 - Polygon Zone Boundary/ZON-502 - Polygon Zone Boundary.miz index 97544e8bff..81fac4f04c 100644 Binary files a/ZON - Zones/ZON-502 - Polygon Zone Boundary/ZON-502 - Polygon Zone Boundary.miz and b/ZON - Zones/ZON-502 - Polygon Zone Boundary/ZON-502 - Polygon Zone Boundary.miz differ diff --git a/ZON - Zones/ZON-510 - ZONE_POLYGON declared in ME/ZON-510 - ZONE_POLYGON declared in ME.lua b/ZON - Zones/ZON-510 - ZONE_POLYGON declared in ME/ZON-510 - ZONE_POLYGON declared in ME.lua index f81020e71f..a4be2633af 100644 --- a/ZON - Zones/ZON-510 - ZONE_POLYGON declared in ME/ZON-510 - ZONE_POLYGON declared in ME.lua +++ b/ZON - Zones/ZON-510 - ZONE_POLYGON declared in ME/ZON-510 - ZONE_POLYGON declared in ME.lua @@ -1,32 +1,32 @@ ---- --- Name: ZON-510 - ZONE_POLYGON declared in ME --- Author: FlightControl --- Date Created: 21 May 2018 --- --- # Situation: --- --- A ZONE_POLYGON has been defined, within the mission editor using ~ZONE_POLYGON in the group name. --- Its boundaries are smoking. --- A vehicle is driving through the zone perimeters. --- When the vehicle is driving in the zone, a red smoke is fired from the vehicle location. --- --- # Test cases: --- --- 1. Observe the polygon perimeter smoke. --- 2. Observe the vehicle smoking a red smoke when driving through the zone. - -GroupInside = GROUP:FindByName( "Test Inside Polygon" ) -GroupOutside = GROUP:FindByName( "Test Outside Polygon" ) - -PolygonZone = ZONE_POLYGON:FindByName( "Polygon A" ) -PolygonZone:SmokeZone( SMOKECOLOR.White, 10 ) - -Messager = SCHEDULER:New( nil, - function() - GroupInside:MessageToAll( ( GroupInside:IsCompletelyInZone( PolygonZone ) ) and "Inside Polygon A" or "Outside Polygon A", 1 ) - if GroupInside:IsCompletelyInZone( PolygonZone ) then - GroupInside:GetUnit(1):SmokeRed() - end - end, - {}, 0, 1 ) - +--- +-- Name: ZON-510 - ZONE_POLYGON declared in ME +-- Author: FlightControl +-- Date Created: 21 May 2018 +-- +-- # Situation: +-- +-- A ZONE_POLYGON has been defined, within the mission editor using ~ZONE_POLYGON in the group name. +-- Its boundaries are smoking. +-- A vehicle is driving through the zone perimeters. +-- When the vehicle is driving in the zone, a red smoke is fired from the vehicle location. +-- +-- # Test cases: +-- +-- 1. Observe the polygon perimeter smoke. +-- 2. Observe the vehicle smoking a red smoke when driving through the zone. + +GroupInside = GROUP:FindByName( "Test Inside Polygon" ) +GroupOutside = GROUP:FindByName( "Test Outside Polygon" ) + +PolygonZone = ZONE_POLYGON:FindByName( "Polygon A" ) +PolygonZone:SmokeZone( SMOKECOLOR.White, 10 ) + +Messager = SCHEDULER:New( nil, + function() + GroupInside:MessageToAll( ( GroupInside:IsCompletelyInZone( PolygonZone ) ) and "Inside Polygon A" or "Outside Polygon A", 1 ) + if GroupInside:IsCompletelyInZone( PolygonZone ) then + GroupInside:GetUnit(1):SmokeRed() + end + end, + {}, 0, 1 ) + diff --git a/ZON - Zones/ZON-510 - ZONE_POLYGON declared in ME/ZON-510 - ZONE_POLYGON declared in ME.miz b/ZON - Zones/ZON-510 - ZONE_POLYGON declared in ME/ZON-510 - ZONE_POLYGON declared in ME.miz index 25b38742a0..78a0717aec 100644 Binary files a/ZON - Zones/ZON-510 - ZONE_POLYGON declared in ME/ZON-510 - ZONE_POLYGON declared in ME.miz and b/ZON - Zones/ZON-510 - ZONE_POLYGON declared in ME/ZON-510 - ZONE_POLYGON declared in ME.miz differ diff --git a/ZON - Zones/ZON-520 - Draw Zones and Shapes/ZON-520 - Draw Zones and Shapes.lua b/ZON - Zones/ZON-520 - Draw Zones and Shapes/ZON-520 - Draw Zones and Shapes.lua index 5da1f240b5..79e1c1777f 100644 --- a/ZON - Zones/ZON-520 - Draw Zones and Shapes/ZON-520 - Draw Zones and Shapes.lua +++ b/ZON - Zones/ZON-520 - Draw Zones and Shapes/ZON-520 - Draw Zones and Shapes.lua @@ -1,58 +1,58 @@ ---- --- This demo mission illustrates how to draw zones (circular and polygon) defined in the Mission Editor on the F10 map. --- --- Furthermore, it shows how to create circles, rectangles, lines, arrows and text at arbitrary coordinates on the F10 map. ---- - --- Circular zone defined in the ME. -local circzone=ZONE:New("Circular Zone") - --- Draw the zone on the F10 map. Colors are taken from the ME settings. -circzone:DrawZone() - - --- Quad-point zone defined in the ME. -local quadzone=ZONE:New("Quad Zone") --Core.Zone#ZONE_POLYGON_BASE - --- Draw the zone on the F10 map. Colors are taken from the ME settings. -quadzone:DrawZone() - --- After 600 seconds, the drawing is removed. -quadzone:UndrawZone(500) - - --- Polygon zone defined by waypoints of the group "Rotary-1". This surrounds a lake near Poti. -local polyzone=ZONE_POLYGON:NewFromGroupName("Rotary-1") - --- Draw the zone. Line color is green, fill color is turquoise with 50% alpha. Line type is dashed. -polyzone:DrawZone(-1, {0,1,0}, 1.0, {0,1,1}, 0.5, 2) - - --- Get coordinates of some airbases of the map. -local coordBatumi=AIRBASE:FindByName("Batumi"):GetCoordinate() -local coordKobuleti=AIRBASE:FindByName("Kobuleti"):GetCoordinate() -local coordGudauta=AIRBASE:FindByName(AIRBASE.Caucasus.Gudauta):GetCoordinate() -local coordKrymsk=AIRBASE:FindByName(AIRBASE.Caucasus.Krymsk):GetCoordinate() -local coordBeslan=AIRBASE:FindByName(AIRBASE.Caucasus.Beslan):GetCoordinate() -local coordNalchik=AIRBASE:FindByName(AIRBASE.Caucasus.Nalchik):GetCoordinate() -local coordMinVody=AIRBASE:FindByName(AIRBASE.Caucasus.Mineralnye_Vody):GetCoordinate() -local coordMozdok=AIRBASE:FindByName(AIRBASE.Caucasus.Mozdok):GetCoordinate() - - --- Draw a circle with 15 km radius around Krymsk Airbase. -coordKrymsk:CircleToAll(15000) - --- Draw a rectancle. First corner is Gudauta. Opposite corner is 30000 meters in heading 135 degrees. -coordGudauta:RectToAll(coordGudauta:Translate(30000, 135)) - --- Draw a quad-point shape. Corners are defined by the airbases. -coordBeslan:QuadToAll(coordNalchik, coordMinVody, coordMozdok, nil, {1,0,1}, nil, {0,1,0}, 0.8, 4) - --- Draw a blue line from Mozdok to Krymsk. -coordMozdok:LineToAll(coordKrymsk, nil, {0,0,1}) - --- Draw a green arrow from Batumi to a ship group called "Naval-1". This arrow is only visible to the blue coalition. -coordBatumi:ArrowToAll(GROUP:FindByName("Naval-1"):GetCoordinate(), 2, {0,1,0}) - --- Write text "Target Warehouse" at position of a static warehouse. +--- +-- This demo mission illustrates how to draw zones (circular and polygon) defined in the Mission Editor on the F10 map. +-- +-- Furthermore, it shows how to create cicles, rectangled, lines, arrows and text at arbitrary coordinates on the F10 map. +--- + +-- Circular zone defined in the ME. +local circzone=ZONE:New("Circular Zone") + +-- Draw the zone on the F10 map. Colors are taken from the ME settings. +circzone:DrawZone() + + +-- Quad-point zone defined in the ME. +local quadzone=ZONE:New("Quad Zone") --Core.Zone#ZONE_POLYGON_BASE + +-- Draw the zone on the F10 map. Colors are taken from the ME settings. +quadzone:DrawZone() + +-- After 600 seconds, the drawing is removed. +quadzone:UndrawZone(500) + + +-- Polygon zone defined by waypoints of the group "Rotary-1". This surrounds a lake near Poti. +local polyzone=ZONE_POLYGON:NewFromGroupName("Rotary-1") + +-- Draw the zone. Line color is green, fill color is turquoise with 50% alpha. Line type is dashed. +polyzone:DrawZone(-1, {0,1,0}, 1.0, {0,1,1}, 0.5, 2) + + +-- Get coordinates of some airbases of the map. +local coordBatumi=AIRBASE:FindByName("Batumi"):GetCoordinate() +local coordKobuleti=AIRBASE:FindByName("Kobuleti"):GetCoordinate() +local coordGudauta=AIRBASE:FindByName(AIRBASE.Caucasus.Gudauta):GetCoordinate() +local coordKrymsk=AIRBASE:FindByName(AIRBASE.Caucasus.Krymsk):GetCoordinate() +local coordBeslan=AIRBASE:FindByName(AIRBASE.Caucasus.Beslan):GetCoordinate() +local coordNalchik=AIRBASE:FindByName(AIRBASE.Caucasus.Nalchik):GetCoordinate() +local coordMinVody=AIRBASE:FindByName(AIRBASE.Caucasus.Mineralnye_Vody):GetCoordinate() +local coordMozdok=AIRBASE:FindByName(AIRBASE.Caucasus.Mozdok):GetCoordinate() + + +-- Draw a circle with 15 km radius around Krymsk Airbase. +coordKrymsk:CircleToAll(15000) + +-- Draw a rectancle. First corner is Gudauta. Opposite corner is 30000 meters in heading 135 degrees. +coordGudauta:RectToAll(coordGudauta:Translate(30000, 135)) + +-- Draw a quad-point shape. Corners are defined by the airbases. +coordBeslan:QuadToAll(coordNalchik, coordMinVody, coordMozdok, nil, {1,0,1}, nil, {0,1,0}, 0.8, 4) + +-- Draw a blue line from Mozdok to Krymsk. +coordMozdok:LineToAll(coordKrymsk, nil, {0,0,1}) + +-- Draw a green arrow from Batumi to a ship group called "Naval-1". This arrow is only visible to the blue coalition. +coordBatumi:ArrowToAll(GROUP:FindByName("Naval-1"):GetCoordinate(), 2, {0,1,0}) + +-- Write text "Target Warehouse" at position of a static warehouse. STATIC:FindByName("Static Warehouse-1"):GetCoordinate():TextToAll("Target Warehouse") \ No newline at end of file diff --git a/ZON - Zones/ZON-520 - Draw Zones and Shapes/ZON-520 - Draw Zones and Shapes.miz b/ZON - Zones/ZON-520 - Draw Zones and Shapes/ZON-520 - Draw Zones and Shapes.miz index ad2cbfcce6..b6b094478b 100644 Binary files a/ZON - Zones/ZON-520 - Draw Zones and Shapes/ZON-520 - Draw Zones and Shapes.miz and b/ZON - Zones/ZON-520 - Draw Zones and Shapes/ZON-520 - Draw Zones and Shapes.miz differ