Updated Moose.lua

This commit is contained in:
funkyfranky 2022-10-14 16:49:26 +00:00
parent 492c97dbae
commit 2c98595cb2
125 changed files with 6060 additions and 387 deletions

View File

@ -0,0 +1,3 @@
local PlanesClientSet = SET_CLIENT:New():FilterCategories( "plane" ):FilterStart()
local AirbasePolice = AIRBASEPOLICE_CAUCASUS:New( PlanesClientSet )

View File

@ -0,0 +1,3 @@
local PlanesClientSet = SET_CLIENT:New():FilterCategories( "plane" ):FilterStart()
local AirbasePolice = AIRBASEPOLICE_NEVADA:New( PlanesClientSet )

View File

@ -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

View File

@ -1,24 +1,24 @@
---
-- Name: AIC-APC-001 - Troops Relocate APC
-- Author: FlightControl
-- Date Created: 07 Apr 2018
--
-- Demonstration of troops relocation when carrier is destroyed...
-- Carrier will relocate to the rescue carrier.
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 )
end
end
---
-- Name: AIC-APC-001 - Troops Relocate APC
-- Author: FlightControl
-- Date Created: 07 Apr 2018
--
-- Demonstration of troops relocation when carrier is destroyed...
-- Carrier will relocate to the rescue carrier.
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 )
end
end

View File

@ -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

View File

@ -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 )

View File

@ -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 )

View File

@ -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 )

View File

@ -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")

View File

@ -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")

View File

@ -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" )

View File

@ -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" )

View File

@ -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" )

View File

@ -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.

View File

@ -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" )

View File

@ -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 )

View File

@ -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()

View File

@ -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 )

View File

@ -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 )

View File

@ -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 )

View File

@ -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 )

View File

@ -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 )

View File

@ -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 )

View File

@ -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 )

View File

@ -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()

View File

@ -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()

View File

@ -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.

View File

@ -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.

View File

@ -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" ) ) )

View File

@ -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 )

View File

@ -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.

View File

@ -0,0 +1,244 @@
--- Mission crated by Marginal
--- Wiht Moase API, Aufraag CLASS
--- Preparped for github by Wingthor
--- 2020-12-15
-----------------------------------------------
--MOOSE SETTINGS, MARKERS and CLEANUP AIRBASE--
-----------------------------------------------
-- If you require a MOOSE settings menu, comment out the line below
--_SETTINGS:SetPlayerMenuOff()
-- If you do not want markers on the F10 Map, comment out the line below
AUFTRAG:SetEnableMarkers()
-- Cleanup a airbase runway after AI crashes or stops on the runway and wont taxi clear
-- Lookup airbase name in moose.lua
--CleanUpAirports = CLEANUP_AIRBASE:New( AIRBASE.Caucasus.Kutaisi )
--Tracing
--BASE:TraceOnOff( true )
--BASE:TracelLevel( 3 )
--BASE:TraceAll( true )
----------------
--SEAD Evasion--
----------------
-- Defends the Russian SA installations from SEAD attacks.
-- Add SAM groups to the list
SEAD_RU_SAM_Defenses = SEAD:New( {'SAM-SA-10' , 'SAM-SA-15A', 'EWR A' } )
------------------------------------------
--BOMBING - GROUP, UNIT or STATIC object--
------------------------------------------
--In ME:
--create a/c group(s)
--no waypoints reqd
--takeoff from parking cold or hot, runway, or in the air
--check weapons loadout / F15E or B1B GBU31 or 38 JDAM / GBU 31(V)3/B JDAM bunker busters
--for delayed ground starts from ramp cold: check uncontrolled / triggered actions - perform command: start
--for delayed air starts: check late activation
-- @param Core.Point#COORDINATE Target Target coordinate. Can also be specified as a GROUP, UNIT or STATIC object.
-- @param #number Altitude Engage altitude in feet. Default 25000 ft.
--4 x GBU31(V)3/B bunker busters
local Target1=STATIC:FindByName("Static Fuel Tank A")
local bomber1=FLIGHTGROUP:New("BOMBER A")
local missionBOMB1=AUFTRAG:NewBOMBING(Target1, 13000)
missionBOMB1:SetTime(60*10, 60*55)
missionBOMB1:SetWeaponExpend(AI.Task.WeaponExpend.ALL)
missionBOMB1:SetPriority(10)
bomber1:AddMission(missionBOMB1)
--4 x GBU31(V)3/B bunker busters
local Target1=STATIC:FindByName("Static Ammunition Depot B")
local bomber2=FLIGHTGROUP:New("BOMBER B")
local missionBOMB2=AUFTRAG:NewBOMBING(Target1, 13000)
missionBOMB2:SetTime(60*10, 60*55)
missionBOMB2:SetWeaponExpend(AI.Task.WeaponExpend.ALL)
missionBOMB2:SetPriority(10)
bomber2:AddMission(missionBOMB2)
-- 2 target strike example
--local Target1=STATIC:FindByName("Static Fuel Tank B")
--local Target2=STATIC:FindByName("Static Ammunition Depot B")
-- local bomber2=FLIGHTGROUP:New("BOMBER B")
-- local mission1=AUFTRAG:NewBOMBING(Target1, nil)
-- mission1:SetWeaponExpend(AI.Task.WeaponExpend.ALL)
-- mission1:SetPriority(10)
-- local mission2=AUFTRAG:NewBOMBING(Target2, nil)
-- mission2:SetWeaponExpend(AI.Task.WeaponExpend.HALF)
-- mission2:SetPriority(20)
-- bomber2:AddMission(mission1)
-- bomber2:AddMission(mission2)
------------------------------------------
--BOMBING - GROUP, UNIT or STATIC object--
------------------------------------------
--In ME:
--create a/c group(s)
--no waypoints reqd
--takeoff from parking cold or hot, runway, or in the air
--check weapons loadout / F15E or B1B GBU31 or 38 JDAM / GBU 31(V)3/B JDAM bunker busters
--for delayed ground starts from ramp cold: check uncontrolled / triggered actions - perform command: start
--for delayed air starts: check late activation
-- @param Core.Point#COORDINATE Target Target coordinate. Can also be specified as a GROUP, UNIT or STATIC object.
-- @param #number Altitude Engage altitude in feet. Default 25000 ft.
--4 x GBU31(V)3/B bunker busters
local Target1=STATIC:FindByName("Static Fuel Tank A")
local bomber1=FLIGHTGROUP:New("BOMBER A")
local missionBOMB1=AUFTRAG:NewBOMBING(Target1, 13000)
missionBOMB1:SetTime(60*10, 60*55)
missionBOMB1:SetWeaponExpend(AI.Task.WeaponExpend.ALL)
missionBOMB1:SetPriority(10)
bomber1:AddMission(missionBOMB1)
--4 x GBU31(V)3/B bunker busters
local Target1=STATIC:FindByName("Static Ammunition Depot B")
local bomber2=FLIGHTGROUP:New("BOMBER B")
local missionBOMB2=AUFTRAG:NewBOMBING(Target1, 13000)
missionBOMB2:SetTime(60*10, 60*55)
missionBOMB2:SetWeaponExpend(AI.Task.WeaponExpend.ALL)
missionBOMB2:SetPriority(10)
bomber2:AddMission(missionBOMB2)
-- 2 target strike example
--local Target1=STATIC:FindByName("Static Fuel Tank B")
--local Target2=STATIC:FindByName("Static Ammunition Depot B")
-- local bomber2=FLIGHTGROUP:New("BOMBER B")
-- local mission1=AUFTRAG:NewBOMBING(Target1, nil)
-- mission1:SetWeaponExpend(AI.Task.WeaponExpend.ALL)
-- mission1:SetPriority(10)
-- local mission2=AUFTRAG:NewBOMBING(Target2, nil)
-- mission2:SetWeaponExpend(AI.Task.WeaponExpend.HALF)
-- mission2:SetPriority(20)
-- bomber2:AddMission(mission1)
-- bomber2:AddMission(mission2)
----------------------------------
--STRIKE - BOMBING on Coordinate--
----------------------------------
--In ME:
--create a/c group(s) good for F15E
--no waypoints reqd
--takeoff from parking cold or hot, runway, or in the air
--check weapons loadout / GBU31 or 38 JDAM bridges
-- / GBU 31(V)3/B JDAM bunker busters command centers and fortified ammo dumps
-- / Mk82s for airport fuel and ammo dumps
-- / CBUs dont work well, wind drifts them off target
--for delayed ground starts from ramp cold: check uncontrolled / triggered actions - perform command: start
--for delayed air starts: check late activation
-- @param Core.Point#COORDINATE Target The target coordinate. Can also be given as a GROUP, UNIT or STATIC object.
-- AUFTRAG:NewSTRIKE(Target, 16000) -- 16000 is engage altitude, higher altitude works well
-- @param #number Altitude Engage altitude in feet. Default 2000 ft.
-- default altitude 2000 ft
local Target=ZONE:New("Zone Strike A"):GetCoordinate()
local missionSTRIKE1=AUFTRAG:NewSTRIKE(Target, 6000)
local strike1=FLIGHTGROUP:New("STRIKE A")
missionSTRIKE1:SetTime(60*10, 60*55)
strike1:AddMission(missionSTRIKE1)
local Target=ZONE:New("Zone Strike B"):GetCoordinate()
local missionSTRIKE2=AUFTRAG:NewSTRIKE(Target, 6000)
local strike2=FLIGHTGROUP:New("STRIKE B")
missionSTRIKE2:SetTime(60*10, 60*55)
strike2:AddMission(missionSTRIKE2)
local Target=ZONE:New("Zone Strike C"):GetCoordinate()
local missionSTRIKE3=AUFTRAG:NewSTRIKE(Target, nil)
local strike3=FLIGHTGROUP:New("STRIKE C")
missionSTRIKE3:SetTime(60*10, 60*55)
strike3:AddMission(missionSTRIKE3)
local Target=ZONE:New("Zone Strike D"):GetCoordinate()
local missionSTRIKE4=AUFTRAG:NewSTRIKE(Target, nil)
local strike4=FLIGHTGROUP:New("STRIKE D")
missionSTRIKE4:SetTime(60*10, 60*55)
strike4:AddMission(missionSTRIKE4)
local Target=ZONE:New("Zone Strike E"):GetCoordinate()
local missionSTRIKE5=AUFTRAG:NewSTRIKE(Target, 500)
local strike5=FLIGHTGROUP:New("STRIKE E")
missionSTRIKE5:SetTime(60*10, 60*55)
strike5:AddMission(missionSTRIKE5)
local Target=ZONE:New("Zone Strike F"):GetCoordinate()
local missionSTRIKE6=AUFTRAG:NewSTRIKE(Target, 500)
local strike6=FLIGHTGROUP:New("STRIKE F")
missionSTRIKE6:SetTime(60*10, 60*55)
strike6:AddMission(missionSTRIKE6)
--create zones in ME
-- Common zones
local Zone={}
Zone.Alpha = ZONE:New("Zone Alpha") --Core.Zone#ZONE --1st SEAD zone
Zone.Bravo = ZONE:New("Zone Bravo") --Core.Zone#ZONE --2nd SEAD zone
--Zone.Charlie = ZONE:New("Zone Charlie") --Core.Zone#ZONE --not used
--Zone.Delta = ZONE:New("Zone Delta") --Core.Zone#ZONE --not used
-- Set of all zones defined in the ME
local AllZones=SET_ZONE:New():FilterOnce()
---------------
--CAS as SEAD--
---------------
--In ME:
--create SEAD a/c groups
--no waypoints reqd but sometimes useful offsetting from departing airport, make it a short leg
--takeoff from parking cold or hot, runway, or in the air
--check weapons loadout
--for delayed ground starts from ramp cold: check uncontrolled / triggered actions - perform command: start
--for delayed air starts: check late activation
--advanced waypoint actions--
--start enroute task--SEAD
--(Optional)Set option reaction to threat=horizontal AAA fire evade
--Reapers do better with an airstart and altitude of 8000 feet
-- AUFTRAG:NewCAS(ZoneCAS, Altitude, Speed, Coordinate, Heading, Leg, TargetTypes)
-- @param Core.Zone#ZONE_RADIUS ZoneCAS Circular CAS zone. Detected targets in this zone will be engaged.
-- @param #number Altitude Altitude at which to orbit. Default is 10,000 ft.
-- @param #number Speed Orbit speed in knots. Default 350 KIAS.
-- @param Core.Point#COORDINATE Coordinate Where to orbit. Default is the center of the CAS zone.
-- @param #number Heading Heading of race-track pattern in degrees. If not specified, a simple circular orbit is performed.
-- @param #number Leg Length of race-track in NM. If not specified, a simple circular orbit is performed.
-- @param #table TargetTypes (Optional) Table of target types. Default {"Helicopters", "Ground Units", "Light armed ships"}.
--make sure your allow for travel time to target area
--50/50 HARMs AGM 88C IR MAVs AGM65Fs
local cas1=FLIGHTGROUP:New("SEAD A")
local missionSEAD1=AUFTRAG:NewCAS(Zone.Alpha, 15000, nil, nil, nil, nil, nil)
missionSEAD1:SetTime(60, 60*40)
cas1:AddMission(missionSEAD1)
--50/50 HARMs AGM 88C IR MAVs AGM65Fs
local cas2=FLIGHTGROUP:New("SEAD B")
local missionSEAD2=AUFTRAG:NewCAS(Zone.Alpha, 15000, nil, nil, nil, nil, nil)
missionSEAD2:SetTime(60*2, 60*41)
cas2:AddMission(missionSEAD2)
--50/50 HARMs AGM 88C IR MAVs AGM65Fs
local cas3=FLIGHTGROUP:New("SEAD C")
local missionSEAD3=AUFTRAG:NewCAS(Zone.Bravo, 15000, nil, nil, nil, nil, nil)
missionSEAD3:SetTime(60*3, 60*42)
cas3:AddMission(missionSEAD3)

View File

@ -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 )

View File

@ -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 )

View File

@ -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" )

View File

@ -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" )

View File

@ -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

View File

@ -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)

View File

@ -0,0 +1,126 @@
---
-- Name: GRP-550 - Shows how to make an AI bomb ground targets, both static and scenery.
-- Author: Wingthor
-- Date Created: 22 Aug 2020
--
-- Mission illustrates how to make an air GROUP make a bomb run by script.
-- One template group is placed on map by DCS's Mission Editor.
-- Template is set to TASK "Ground Attack", and given proper ordnance in Mission Editor
-- One function handles both attack by give targets coordinates as arguments
-- This also shows how to do a delayed function call using BASE:ScheduleOnce function
-- Mission also feature a helper function which will return a random waypoint between Airbase and Target.
--
-- Join the Game Master to observe the reaction of the ground units.
--
-- Blue is attacking.
BASE:TraceOnOff(true)
BASE:TraceAll(true)
--- Help functions ---------------------------------------
--- This function will make a random waypoint between to coordiantes.
--- @param Core.Point#COORDINATE
--- @param Core.Point#COORDINATE
function MakeMiddleWaypoint (TargetCoordinate, InitCoordinate)
BASE:F({TargetCoordinate,InitCoordinate})
--- If we can not solve this function throw noting back so we dont' break anything.
if TargetCoordinate == nil or InitCoordinate == nil then return nil end
--- @type TargetCoordinate Core.Point#COORDINATE
--- @type InitCoordinate Core.Point#COORDINATE
local _TargetCoordinate = TargetCoordinate
local _InitCoordinate = InitCoordinate
local Distance = TargetCoordinate:Get3DDistance(InitCoordinate)
if Distance < 30000 then
return nil -- To close for us
elseif Distance > 70000 then
Distance = 70000
else
Distance = math.random(30000,70000)
end -- This is max distance from target we want our Waypoint
local Direction = _TargetCoordinate:GetAngleDegrees(_TargetCoordinate:GetDirectionVec3(_InitCoordinate))
if Direction > 0 and Direction <=90 then -- North East
return _TargetCoordinate:Translate(Distance, math.random(1,90))
elseif Direction > 90 and Direction <= 180 then -- South East
return _TargetCoordinate:Translate(Distance, math.random(91,180))
elseif Direction > 180 and Direction <= 270 then -- South West then
return _TargetCoordinate:Translate(Distance,math.random(181,270))
elseif Direction > 270 and Direction <= 360 then -- South West then then
return _TargetCoordinate:Translate(Distance,math.random(271,360))
else
BASE:E("--- Something wrong in function MakeMiddleWaypoint ---")
return nil
end
end
--- @param #string
--- @param --Core.Point#COORDINATE
--- @param #string AIRBASE
--- @param #string
function PinpointStrike(Group,Target,Base,TargetDescription)
BASE:F({Group,Target,Base})
-- In case all args is not passed.
if Group == nil or Target == nil or Base == nil then return nil end
-- Make a default description
if TargetDescription == nil then
TargetDescription = "Bomb Target"
end
-- Make a Random heading from the target which will server as an IP
local heading = math.random(90,180)
-- Get targets vevtors
local targetVec = Target:GetVec2()
-- Make a Spawn counter
if SpawnCounter == nil then
SpawnCounter = 0
else
SpawnCounter = SpawnCounter + 1
end
-- Spawn the bomber and return a GROUP object
local SpawnBomber = SPAWN:NewWithAlias( Group, "Bomber" .. "_" .. tostring(SpawnCounter) )
:OnSpawnGroup(function (Moosegroup)
local message = MESSAGE:New("Launching the Pinpointstrike",40,"Order:",true):ToBlue()
end,{})
---@type GROUP
local bomber = SpawnBomber:SpawnAtAirbase(AIRBASE:FindByName( Base ), SPAWN.Takeoff.Cold)
local task = bomber:TaskBombing(targetVec,false,"All",nil,heading,10000) -- WeaponType find this...
local homebasecoords = AIRBASE:FindByName(Base):GetCoordinate() --Core.Point#COORDINATE
--- Make a waypoint table
local waypoints = {}
--- Get coordinate for Home Base
local homecoords = AIRBASE:FindByName(Base):GetCoordinate():SetAltitude(8000):Translate(10 * 10000,300)
--- Make an ingrespoint for the bomber
local IngressPoint = MakeMiddleWaypoint( Target, homebasecoords) --Core.Point#COORDINATE
if IngressPoint == nil then -- Its important to handle the edge cases so we don't break anything. Better throw somwthing to log.
BASE:E("--- Error in PinpointStrike target is too close to base ---" )
return nil
end
-- Set the coordinate altitude
IngressPoint:SetAltitude(8000)
-- Add coordiantes to table and make Waypoints
waypoints[1] = homebasecoords:WaypointAirTakeOffParking()
waypoints[2] = IngressPoint:WaypointAirTurningPoint(nil,950,{task},TargetDescription)
waypoints[3] = homecoords:WaypointAirTurningPoint()
waypoints[4] = homebasecoords:WaypointAirLanding()
-- Push the waypoint table the bomber
bomber:Route(waypoints)
end
-- local targetCoords = ZONE:New("Blue Bridge"):GetCoordinate() --Core.Point#COORDINATE
local CommandCenterCoords = STATIC:FindByName("SAM ControlCenter",false):GetCoordinate()
-- I have added a small zone over a scenery object in order to grab the coordiantes.
local SceneryTargetCoordiate = ZONE:New("SceneryTarget"):GetCoordinate()
BASE:ScheduleOnce(5,PinpointStrike,"Bloue Owl 1-1",CommandCenterCoords,AIRBASE.Caucasus.Sukhumi_Babushara,"Bomb Command Center")
BASE:ScheduleOnce(10,PinpointStrike,"Bloue Owl 1-1",SceneryTargetCoordiate,AIRBASE.Caucasus.Sukhumi_Babushara,"Bomb Commanders House")

View File

@ -0,0 +1,146 @@
_SETTINGS:SetPlayerMenuOff()
local AmmoDumpEast = STATIC:FindByName("EastAmmoDump")
local AmmoDumpEastCOORD = AmmoDumpEast:GetCoordinate()
local AmmoDumpEastHeight = AmmoDumpEastCOORD:GetLandHeight()
local AmmoDumpWest = STATIC:FindByName("WestAmmoDump")
local AmmoDumpWestCOORD = AmmoDumpWest:GetCoordinate()
local AmmoDumpWestHeight = AmmoDumpWestCOORD:GetLandHeight()
local AmmoDumpSouth = STATIC:FindByName("SouthAmmoDump")
local AmmoDumpSouthCOORD = AmmoDumpSouth:GetCoordinate()
local AmmoDumpSouthHeight = AmmoDumpSouthCOORD:GetLandHeight()
local AmmoDumpNorth = STATIC:FindByName("NorthAmmoDump")
local AmmoDumpNorthCOORD = AmmoDumpNorth:GetCoordinate()
local AmmoDumpNorthHeight = AmmoDumpNorthCOORD:GetLandHeight()
--local AllZones=SET_ZONE:New():FilterOnce()--]]
local Target_1 = ZONE:New("Bridge32")
local T1COORD = Target_1:GetCoordinate()
local T1Height = T1COORD:GetLandHeight()
local Target_2 = ZONE:New("Bridge33")
local T2COORD = Target_2:GetCoordinate()
local T2Height = T2COORD:GetLandHeight()
local Target_3 = ZONE:New("HardenedHanger33")
local T3COORD = Target_3:GetCoordinate()
local T3Height = T3COORD:GetLandHeight()
local Target_4 = ZONE:New("HardenedHanger34")
local T4COORD = Target_4:GetCoordinate()
local T4Height = T4COORD:GetLandHeight()
local function TARGET1(T1LLDMS)
local T1LLDMS = T1COORD:ToStringLLDMS()
local coordN1 = string.sub(T1LLDMS,9,10)
local coordN2 = string.sub(T1LLDMS,13,20)
local coordE1 = string.sub(T1LLDMS,26,27)
local coordE2 = string.sub(T1LLDMS,30,37)
local Heightft = UTILS.MetersToFeet(T1Height)
local T1Heightft = UTILS.Round(Heightft)
MESSAGE:New("Bridge 32".."\n".. ("N"..coordN1.."'"..coordN2.."\n".."E"..coordE1.."'"..coordE2.."\n".."ALT "..T1Heightft.." ft"), 50):ToAll()
return T1LLDMS
end
local function TARGET2(T2LLDMS)
local T2LLDMS = T2COORD:ToStringLLDMS()
local coordN1 = string.sub(T2LLDMS,9,10)
local coordN2 = string.sub(T2LLDMS,13,20)
local coordE1 = string.sub(T2LLDMS,26,27)
local coordE2 = string.sub(T2LLDMS,30,37)
local Heightft = UTILS.MetersToFeet(T2Height)
local T2Heightft = UTILS.Round(Heightft)
MESSAGE:New("Bridge 33".."\n".. ("N"..coordN1.."'"..coordN2.."\n".."E"..coordE1.."'"..coordE2.."\n".."ALT "..T2Heightft.." ft"), 50):ToAll()
return T2LLDMS
end
local function TARGET3(T3LLDMS)
local T3LLDMS = T3COORD:ToStringLLDMS()
local coordN1 = string.sub(T3LLDMS,9,10)
local coordN2 = string.sub(T3LLDMS,13,20)
local coordE1 = string.sub(T3LLDMS,26,27)
local coordE2 = string.sub(T3LLDMS,30,37)
local Heightft = UTILS.MetersToFeet(T3Height)
local T3Heightft = UTILS.Round(Heightft)
MESSAGE:New("HardenedHanger 33".."\n".. ("N"..coordN1.."'"..coordN2.."\n".."E"..coordE1.."'"..coordE2.."\n".."ALT "..T3Heightft.." ft"), 50):ToAll()
return T3LLDMS
end
local function TARGET4(T4LLDMS)
local T4LLDMS = T4COORD:ToStringLLDMS()
local coordN1 = string.sub(T4LLDMS,9,10)
local coordN2 = string.sub(T4LLDMS,13,20)
local coordE1 = string.sub(T4LLDMS,26,27)
local coordE2 = string.sub(T4LLDMS,30,37)
local Heightft = UTILS.MetersToFeet(T4Height)
local T4Heightft = UTILS.Round(Heightft)
MESSAGE:New("HardenedHanger 34".."\n".. ("N"..coordN1.."'"..coordN2.."\n".."E"..coordE1.."'"..coordE2.."\n".."ALT "..T4Heightft.." ft"), 50):ToAll()
return T4LLDMS
end
local function TARGET5(T1LLDMS)
local T1LLDMS = AmmoDumpEastCOORD:ToStringLLDMS()
local coordN1 = string.sub(T1LLDMS,9,10)
local coordN2 = string.sub(T1LLDMS,13,20)
local coordE1 = string.sub(T1LLDMS,26,27)
local coordE2 = string.sub(T1LLDMS,30,37)
local Heightft = UTILS.MetersToFeet(AmmoDumpEastHeight)
local T1Heightft = UTILS.Round(Heightft)
MESSAGE:New("EastAmmoDump".."\n".. ("N"..coordN1.."'"..coordN2.."\n".."E"..coordE1.."'"..coordE2.."\n".."ALT "..T1Heightft.." ft"), 50):ToAll()
return T1LLDMS
end
local function TARGET6(T2LLDMS)
local T2LLDMS = AmmoDumpWestCOORD:ToStringLLDMS()
local coordN1 = string.sub(T2LLDMS,9,10)
local coordN2 = string.sub(T2LLDMS,13,20)
local coordE1 = string.sub(T2LLDMS,26,27)
local coordE2 = string.sub(T2LLDMS,30,37)
local Heightft = UTILS.MetersToFeet(AmmoDumpWestHeight)
local T2Heightft = UTILS.Round(Heightft)
MESSAGE:New("WestAmmoDump".."\n".. ("N"..coordN1.."'"..coordN2.."\n".."E"..coordE1.."'"..coordE2.."\n".."ALT "..T2Heightft.." ft"), 50):ToAll()
return T2LLDMS
end
local function TARGET7(T3LLDMS)
local T3LLDMS = AmmoDumpSouthCOORD:ToStringLLDMS()
local coordN1 = string.sub(T3LLDMS,9,10)
local coordN2 = string.sub(T3LLDMS,13,20)
local coordE1 = string.sub(T3LLDMS,26,27)
local coordE2 = string.sub(T3LLDMS,30,37)
local Heightft = UTILS.MetersToFeet(AmmoDumpSouthHeight)
local T3Heightft = UTILS.Round(Heightft)
MESSAGE:New("SouthAmmoDump".."\n".. ("N"..coordN1.."'"..coordN2.."\n".."E"..coordE1.."'"..coordE2.."\n".."ALT "..T3Heightft.." ft"), 50):ToAll()
return T3LLDMS
end
local function TARGET8(T4LLDMS)
local T4LLDMS = AmmoDumpNorthCOORD:ToStringLLDMS()
local coordN1 = string.sub(T4LLDMS,9,10)
local coordN2 = string.sub(T4LLDMS,13,20)
local coordE1 = string.sub(T4LLDMS,26,27)
local coordE2 = string.sub(T4LLDMS,30,37)
local Heightft = UTILS.MetersToFeet(AmmoDumpNorthHeight)
local T4Heightft = UTILS.Round(Heightft)
MESSAGE:New("NorthAmmoDump".."\n".. ("N"..coordN1.."'"..coordN2.."\n".."E"..coordE1.."'"..coordE2.."\n".."ALT "..T4Heightft.." ft"), 50):ToAll()
return T4LLDMS
end
TopMenu1 = MENU_MISSION:New( "TARGETCOORDS" )
BridgeMenu = MENU_MISSION:New( "BRIDGE",TopMenu1 )
AmmoMenu = MENU_MISSION:New( "AMMO DUMP",TopMenu1 )
ShelterMenu = MENU_MISSION:New( "HARDENED SHELTER",TopMenu1 )
Menu1 = MENU_MISSION_COMMAND:New("Bridge 32",BridgeMenu, TARGET1)
Menu2 = MENU_MISSION_COMMAND:New("Bridge 33", BridgeMenu, TARGET2)
Menu3 = MENU_MISSION_COMMAND:New("HardenedHanger 33", ShelterMenu, TARGET3)
Menu4 = MENU_MISSION_COMMAND:New("HardenedHanger 34", ShelterMenu, TARGET4)
Menu5 = MENU_MISSION_COMMAND:New("AmmoDumpEast", AmmoMenu, TARGET5)
Menu6 = MENU_MISSION_COMMAND:New("AmmoDumpWest", AmmoMenu, TARGET6)
Menu7 = MENU_MISSION_COMMAND:New("AmmoDumpSouth", AmmoMenu, TARGET7)
Menu8 = MENU_MISSION_COMMAND:New("AmmoDumpNorth", AmmoMenu, TARGET8)

View File

@ -0,0 +1,150 @@
-- This code pulls the Coordinates for JDAM use, and using the Menu format loads them in game using message system.
-- Mission created by Saint185
-- 2020-11-21
_SETTINGS:SetPlayerMenuOff()
local AmmoDumpEast = STATIC:FindByName("EastAmmoDump")--Finds the static called EastAmmoDump from the Mission Editor
local AmmoDumpEastCOORD = AmmoDumpEast:GetCoordinate()--contains the LLDMS coordinates for JDAM
local AmmoDumpEastHeight = AmmoDumpEastCOORD:GetLandHeight()--gets the land height Bridge 32 from T1COORD
local AmmoDumpWest = STATIC:FindByName("WestAmmoDump")
local AmmoDumpWestCOORD = AmmoDumpWest:GetCoordinate()
local AmmoDumpWestHeight = AmmoDumpWestCOORD:GetLandHeight()
local AmmoDumpSouth = STATIC:FindByName("SouthAmmoDump")
local AmmoDumpSouthCOORD = AmmoDumpSouth:GetCoordinate()
local AmmoDumpSouthHeight = AmmoDumpSouthCOORD:GetLandHeight()
local AmmoDumpNorth = STATIC:FindByName("NorthAmmoDump")
local AmmoDumpNorthCOORD = AmmoDumpNorth:GetCoordinate()
local AmmoDumpNorthHeight = AmmoDumpNorthCOORD:GetLandHeight()
local Target_1 = ZONE:New("Bridge32")--Zone assigned to Bridge 32 in ME
local T1COORD = Target_1:GetCoordinate()--contains the LLDMS coordinates for JDAM
local T1Height = T1COORD:GetLandHeight()--gets the land height Bridge 32 from T1COORD
local Target_2 = ZONE:New("Bridge33")
local T2COORD = Target_2:GetCoordinate()
local T2Height = T2COORD:GetLandHeight()
local Target_3 = ZONE:New("HardenedHanger33")
local T3COORD = Target_3:GetCoordinate()
local T3Height = T3COORD:GetLandHeight()
local Target_4 = ZONE:New("HardenedHanger34")
local T4COORD = Target_4:GetCoordinate()
local T4Height = T4COORD:GetLandHeight()
-- Gets LLDMS coord from Target 1(Bridge32p) using T1COORD:ToStringLLDMS() then assigns sections of the string to coordXy
local function TARGET1(T1LLDMS)
local T1LLDMS = T1COORD:ToStringLLDMS()
local coordN1 = string.sub(T1LLDMS,9,10)--extracts a block of text from String T4LLDMS starting at location 9 ending at location 10
local coordN2 = string.sub(T1LLDMS,13,20)--extracts a block of text from String T4LLDMS starting at location 13 ending at location 20
local coordE1 = string.sub(T1LLDMS,26,27)--extracts a block of text from String T4LLDMS starting at location 26 ending at location 27
local coordE2 = string.sub(T1LLDMS,30,37)--extracts a block of text from String T4LLDMS starting at location 30 ending at location 37
local Heightft = UTILS.MetersToFeet(T1Height)--coverts height in meters to feet
local T1Heightft = UTILS.Round(Heightft)-- rounds the value to a whole number
MESSAGE:New("Bridge 32".."\n".. ("N"..coordN1.."'"..coordN2.."\n".."E"..coordE1.."'"..coordE2.."\n".."ALT "..T1Heightft.." ft"), 50):ToAll()
return T1LLDMS--returns the argument for function TARGET1
end
local function TARGET2(T2LLDMS)
local T2LLDMS = T2COORD:ToStringLLDMS()
local coordN1 = string.sub(T2LLDMS,9,10)
local coordN2 = string.sub(T2LLDMS,13,20)
local coordE1 = string.sub(T2LLDMS,26,27)
local coordE2 = string.sub(T2LLDMS,30,37)
local Heightft = UTILS.MetersToFeet(T2Height)
local T2Heightft = UTILS.Round(Heightft)
MESSAGE:New("Bridge 33".."\n".. ("N"..coordN1.."'"..coordN2.."\n".."E"..coordE1.."'"..coordE2.."\n".."ALT "..T2Heightft.." ft"), 50):ToAll()
return T2LLDMS
end
local function TARGET3(T3LLDMS)
local T3LLDMS = T3COORD:ToStringLLDMS()
local coordN1 = string.sub(T3LLDMS,9,10)
local coordN2 = string.sub(T3LLDMS,13,20)
local coordE1 = string.sub(T3LLDMS,26,27)
local coordE2 = string.sub(T3LLDMS,30,37)
local Heightft = UTILS.MetersToFeet(T3Height)
local T3Heightft = UTILS.Round(Heightft)
MESSAGE:New("HardenedHanger 33".."\n".. ("N"..coordN1.."'"..coordN2.."\n".."E"..coordE1.."'"..coordE2.."\n".."ALT "..T3Heightft.." ft"), 50):ToAll()
return T3LLDMS
end
local function TARGET4(T4LLDMS)
local T4LLDMS = T4COORD:ToStringLLDMS()
local coordN1 = string.sub(T4LLDMS,9,10)
local coordN2 = string.sub(T4LLDMS,13,20)
local coordE1 = string.sub(T4LLDMS,26,27)
local coordE2 = string.sub(T4LLDMS,30,37)
local Heightft = UTILS.MetersToFeet(T4Height)
local T4Heightft = UTILS.Round(Heightft)
MESSAGE:New("HardenedHanger 34".."\n".. ("N"..coordN1.."'"..coordN2.."\n".."E"..coordE1.."'"..coordE2.."\n".."ALT "..T4Heightft.." ft"), 50):ToAll()
return T4LLDMS
end
local function TARGET5(T1LLDMS)
local T1LLDMS = AmmoDumpEastCOORD:ToStringLLDMS()
local coordN1 = string.sub(T1LLDMS,9,10)
local coordN2 = string.sub(T1LLDMS,13,20)
local coordE1 = string.sub(T1LLDMS,26,27)
local coordE2 = string.sub(T1LLDMS,30,37)
local Heightft = UTILS.MetersToFeet(AmmoDumpEastHeight)
local T1Heightft = UTILS.Round(Heightft)
MESSAGE:New("EastAmmoDump".."\n".. ("N"..coordN1.."'"..coordN2.."\n".."E"..coordE1.."'"..coordE2.."\n".."ALT "..T1Heightft.." ft"), 50):ToAll()
return T1LLDMS
end
local function TARGET6(T2LLDMS)
local T2LLDMS = AmmoDumpWestCOORD:ToStringLLDMS()
local coordN1 = string.sub(T2LLDMS,9,10)
local coordN2 = string.sub(T2LLDMS,13,20)
local coordE1 = string.sub(T2LLDMS,26,27)
local coordE2 = string.sub(T2LLDMS,30,37)
local Heightft = UTILS.MetersToFeet(AmmoDumpWestHeight)
local T2Heightft = UTILS.Round(Heightft)
MESSAGE:New("WestAmmoDump".."\n".. ("N"..coordN1.."'"..coordN2.."\n".."E"..coordE1.."'"..coordE2.."\n".."ALT "..T2Heightft.." ft"), 50):ToAll()
return T2LLDMS
end
local function TARGET7(T3LLDMS)
local T3LLDMS = AmmoDumpSouthCOORD:ToStringLLDMS()
local coordN1 = string.sub(T3LLDMS,9,10)
local coordN2 = string.sub(T3LLDMS,13,20)
local coordE1 = string.sub(T3LLDMS,26,27)
local coordE2 = string.sub(T3LLDMS,30,37)
local Heightft = UTILS.MetersToFeet(AmmoDumpSouthHeight)
local T3Heightft = UTILS.Round(Heightft)
MESSAGE:New("SouthAmmoDump".."\n".. ("N"..coordN1.."'"..coordN2.."\n".."E"..coordE1.."'"..coordE2.."\n".."ALT "..T3Heightft.." ft"), 50):ToAll()
return T3LLDMS
end
local function TARGET8(T4LLDMS)
local T4LLDMS = AmmoDumpNorthCOORD:ToStringLLDMS()
local coordN1 = string.sub(T4LLDMS,9,10)--extracts text from String T4LLDMS at location 9 to 10
local coordN2 = string.sub(T4LLDMS,13,20)--extracts text from String T4LLDMS at location 13 to 20
local coordE1 = string.sub(T4LLDMS,26,27)--extracts text from String T4LLDMS at location 26 to 27
local coordE2 = string.sub(T4LLDMS,30,37)--extracts text from String T4LLDMS at location 30 to 37
local Heightft = UTILS.MetersToFeet(AmmoDumpNorthHeight)--coverts height in meters to feet
local T4Heightft = UTILS.Round(Heightft)-- rounds the value to a whole number
MESSAGE:New("NorthAmmoDump".."\n".. ("N"..coordN1.."'"..coordN2.."\n".."E"..coordE1.."'"..coordE2.."\n".."ALT "..T4Heightft.." ft"), 50):ToAll()
return T4LLDMS
end
--Coordinates Menu
Level1 = MENU_MISSION:New( "TARGETCOORDS" )--Top level Menu all targets are assigned to this master menu
Level2_1 = MENU_MISSION:New( "BRIDGE",Level1 )--Level 2 Contains Target groups
Level2_2 = MENU_MISSION:New( "AMMO DUMP",Level1 )
Level2_3 = MENU_MISSION:New( "HARDENED SHELTER",Level1 )
Menu1 = MENU_MISSION_COMMAND:New("Bridge 32",Level2_1, TARGET1)--Level 3 contains Target group coordinates
Menu2 = MENU_MISSION_COMMAND:New("Bridge 33", Level2_1, TARGET2)
Menu3 = MENU_MISSION_COMMAND:New("HardenedHanger 33", Level2_3, TARGET3)--text displayed HardenedHanger 33, select Menu position, function to call(local function TARGET3(T3LLDMS))
Menu4 = MENU_MISSION_COMMAND:New("HardenedHanger 34", Level2_3, TARGET4)
Menu5 = MENU_MISSION_COMMAND:New("AmmoDumpEast", Level2_2, TARGET5)
Menu6 = MENU_MISSION_COMMAND:New("AmmoDumpWest", Level2_2, TARGET6)
Menu7 = MENU_MISSION_COMMAND:New("AmmoDumpSouth", Level2_2, TARGET7)
Menu8 = MENU_MISSION_COMMAND:New("AmmoDumpNorth", Level2_2, TARGET8)

View File

@ -0,0 +1,146 @@
_SETTINGS:SetPlayerMenuOff()
local AmmoDumpEast = STATIC:FindByName("EastAmmoDump")
local AmmoDumpEastCOORD = AmmoDumpEast:GetCoordinate()
local AmmoDumpEastHeight = AmmoDumpEastCOORD:GetLandHeight()
local AmmoDumpWest = STATIC:FindByName("WestAmmoDump")
local AmmoDumpWestCOORD = AmmoDumpWest:GetCoordinate()
local AmmoDumpWestHeight = AmmoDumpWestCOORD:GetLandHeight()
local AmmoDumpSouth = STATIC:FindByName("SouthAmmoDump")
local AmmoDumpSouthCOORD = AmmoDumpSouth:GetCoordinate()
local AmmoDumpSouthHeight = AmmoDumpSouthCOORD:GetLandHeight()
local AmmoDumpNorth = STATIC:FindByName("NorthAmmoDump")
local AmmoDumpNorthCOORD = AmmoDumpNorth:GetCoordinate()
local AmmoDumpNorthHeight = AmmoDumpNorthCOORD:GetLandHeight()
--local AllZones=SET_ZONE:New():FilterOnce()--]]
local Target_1 = ZONE:New("Bridge32")
local T1COORD = Target_1:GetCoordinate()
local T1Height = T1COORD:GetLandHeight()
local Target_2 = ZONE:New("Bridge33")
local T2COORD = Target_2:GetCoordinate()
local T2Height = T2COORD:GetLandHeight()
local Target_3 = ZONE:New("HardenedHanger33")
local T3COORD = Target_3:GetCoordinate()
local T3Height = T3COORD:GetLandHeight()
local Target_4 = ZONE:New("HardenedHanger34")
local T4COORD = Target_4:GetCoordinate()
local T4Height = T4COORD:GetLandHeight()
local function TARGET1(T1LLDMS)
local T1LLDMS = T1COORD:ToStringLLDMS()
local coordN1 = string.sub(T1LLDMS,9,10)
local coordN2 = string.sub(T1LLDMS,13,20)
local coordE1 = string.sub(T1LLDMS,26,27)
local coordE2 = string.sub(T1LLDMS,30,37)
local Heightft = UTILS.MetersToFeet(T1Height)
local T1Heightft = UTILS.Round(Heightft)
MESSAGE:New("Bridge 32".."\n".. ("N"..coordN1.."'"..coordN2.."\n".."E"..coordE1.."'"..coordE2.."\n".."ALT "..T1Heightft.." ft"), 50):ToAll()
return T1LLDMS
end
local function TARGET2(T2LLDMS)
local T2LLDMS = T2COORD:ToStringLLDMS()
local coordN1 = string.sub(T2LLDMS,9,10)
local coordN2 = string.sub(T2LLDMS,13,20)
local coordE1 = string.sub(T2LLDMS,26,27)
local coordE2 = string.sub(T2LLDMS,30,37)
local Heightft = UTILS.MetersToFeet(T2Height)
local T2Heightft = UTILS.Round(Heightft)
MESSAGE:New("Bridge 33".."\n".. ("N"..coordN1.."'"..coordN2.."\n".."E"..coordE1.."'"..coordE2.."\n".."ALT "..T2Heightft.." ft"), 50):ToAll()
return T2LLDMS
end
local function TARGET3(T3LLDMS)
local T3LLDMS = T3COORD:ToStringLLDMS()
local coordN1 = string.sub(T3LLDMS,9,10)
local coordN2 = string.sub(T3LLDMS,13,20)
local coordE1 = string.sub(T3LLDMS,26,27)
local coordE2 = string.sub(T3LLDMS,30,37)
local Heightft = UTILS.MetersToFeet(T3Height)
local T3Heightft = UTILS.Round(Heightft)
MESSAGE:New("HardenedHanger 33".."\n".. ("N"..coordN1.."'"..coordN2.."\n".."E"..coordE1.."'"..coordE2.."\n".."ALT "..T3Heightft.." ft"), 50):ToAll()
return T3LLDMS
end
local function TARGET4(T4LLDMS)
local T4LLDMS = T4COORD:ToStringLLDMS()
local coordN1 = string.sub(T4LLDMS,9,10)
local coordN2 = string.sub(T4LLDMS,13,20)
local coordE1 = string.sub(T4LLDMS,26,27)
local coordE2 = string.sub(T4LLDMS,30,37)
local Heightft = UTILS.MetersToFeet(T4Height)
local T4Heightft = UTILS.Round(Heightft)
MESSAGE:New("HardenedHanger 34".."\n".. ("N"..coordN1.."'"..coordN2.."\n".."E"..coordE1.."'"..coordE2.."\n".."ALT "..T4Heightft.." ft"), 50):ToAll()
return T4LLDMS
end
local function TARGET5(T1LLDMS)
local T1LLDMS = AmmoDumpEastCOORD:ToStringLLDMS()
local coordN1 = string.sub(T1LLDMS,9,10)
local coordN2 = string.sub(T1LLDMS,13,20)
local coordE1 = string.sub(T1LLDMS,26,27)
local coordE2 = string.sub(T1LLDMS,30,37)
local Heightft = UTILS.MetersToFeet(AmmoDumpEastHeight)
local T1Heightft = UTILS.Round(Heightft)
MESSAGE:New("EastAmmoDump".."\n".. ("N"..coordN1.."'"..coordN2.."\n".."E"..coordE1.."'"..coordE2.."\n".."ALT "..T1Heightft.." ft"), 50):ToAll()
return T1LLDMS
end
local function TARGET6(T2LLDMS)
local T2LLDMS = AmmoDumpWestCOORD:ToStringLLDMS()
local coordN1 = string.sub(T2LLDMS,9,10)
local coordN2 = string.sub(T2LLDMS,13,20)
local coordE1 = string.sub(T2LLDMS,26,27)
local coordE2 = string.sub(T2LLDMS,30,37)
local Heightft = UTILS.MetersToFeet(AmmoDumpWestHeight)
local T2Heightft = UTILS.Round(Heightft)
MESSAGE:New("WestAmmoDump".."\n".. ("N"..coordN1.."'"..coordN2.."\n".."E"..coordE1.."'"..coordE2.."\n".."ALT "..T2Heightft.." ft"), 50):ToAll()
return T2LLDMS
end
local function TARGET7(T3LLDMS)
local T3LLDMS = AmmoDumpSouthCOORD:ToStringLLDMS()
local coordN1 = string.sub(T3LLDMS,9,10)
local coordN2 = string.sub(T3LLDMS,13,20)
local coordE1 = string.sub(T3LLDMS,26,27)
local coordE2 = string.sub(T3LLDMS,30,37)
local Heightft = UTILS.MetersToFeet(AmmoDumpSouthHeight)
local T3Heightft = UTILS.Round(Heightft)
MESSAGE:New("SouthAmmoDump".."\n".. ("N"..coordN1.."'"..coordN2.."\n".."E"..coordE1.."'"..coordE2.."\n".."ALT "..T3Heightft.." ft"), 50):ToAll()
return T3LLDMS
end
local function TARGET8(T4LLDMS)
local T4LLDMS = AmmoDumpNorthCOORD:ToStringLLDMS()
local coordN1 = string.sub(T4LLDMS,9,10)
local coordN2 = string.sub(T4LLDMS,13,20)
local coordE1 = string.sub(T4LLDMS,26,27)
local coordE2 = string.sub(T4LLDMS,30,37)
local Heightft = UTILS.MetersToFeet(AmmoDumpNorthHeight)
local T4Heightft = UTILS.Round(Heightft)
MESSAGE:New("NorthAmmoDump".."\n".. ("N"..coordN1.."'"..coordN2.."\n".."E"..coordE1.."'"..coordE2.."\n".."ALT "..T4Heightft.." ft"), 50):ToAll()
return T4LLDMS
end
TopMenu1 = MENU_MISSION:New( "TARGETCOORDS" )
BridgeMenu = MENU_MISSION:New( "BRIDGE",TopMenu1 )
AmmoMenu = MENU_MISSION:New( "AMMO DUMP",TopMenu1 )
ShelterMenu = MENU_MISSION:New( "HARDENED SHELTER",TopMenu1 )
Menu1 = MENU_MISSION_COMMAND:New("Bridge 32",BridgeMenu, TARGET1)
Menu2 = MENU_MISSION_COMMAND:New("Bridge 33", BridgeMenu, TARGET2)
Menu3 = MENU_MISSION_COMMAND:New("HardenedHanger 33", ShelterMenu, TARGET3)
Menu4 = MENU_MISSION_COMMAND:New("HardenedHanger 34", ShelterMenu, TARGET4)
Menu5 = MENU_MISSION_COMMAND:New("AmmoDumpEast", AmmoMenu, TARGET5)
Menu6 = MENU_MISSION_COMMAND:New("AmmoDumpWest", AmmoMenu, TARGET6)
Menu7 = MENU_MISSION_COMMAND:New("AmmoDumpSouth", AmmoMenu, TARGET7)
Menu8 = MENU_MISSION_COMMAND:New("AmmoDumpNorth", AmmoMenu, TARGET8)

View File

@ -0,0 +1,150 @@
-- This code pulls the Coordinates for JDAM use, and using the Menu format loads them in game using message system.
-- Mission created by Saint185
-- 2020-11-21
_SETTINGS:SetPlayerMenuOff()
local AmmoDumpEast = STATIC:FindByName("EastAmmoDump")--Finds the static called EastAmmoDump from the Mission Editor
local AmmoDumpEastCOORD = AmmoDumpEast:GetCoordinate()--contains the LLDMS coordinates for JDAM
local AmmoDumpEastHeight = AmmoDumpEastCOORD:GetLandHeight()--gets the land height Bridge 32 from T1COORD
local AmmoDumpWest = STATIC:FindByName("WestAmmoDump")
local AmmoDumpWestCOORD = AmmoDumpWest:GetCoordinate()
local AmmoDumpWestHeight = AmmoDumpWestCOORD:GetLandHeight()
local AmmoDumpSouth = STATIC:FindByName("SouthAmmoDump")
local AmmoDumpSouthCOORD = AmmoDumpSouth:GetCoordinate()
local AmmoDumpSouthHeight = AmmoDumpSouthCOORD:GetLandHeight()
local AmmoDumpNorth = STATIC:FindByName("NorthAmmoDump")
local AmmoDumpNorthCOORD = AmmoDumpNorth:GetCoordinate()
local AmmoDumpNorthHeight = AmmoDumpNorthCOORD:GetLandHeight()
local Target_1 = ZONE:New("Bridge32")--Zone assigned to Bridge 32 in ME
local T1COORD = Target_1:GetCoordinate()--contains the LLDMS coordinates for JDAM
local T1Height = T1COORD:GetLandHeight()--gets the land height Bridge 32 from T1COORD
local Target_2 = ZONE:New("Bridge33")
local T2COORD = Target_2:GetCoordinate()
local T2Height = T2COORD:GetLandHeight()
local Target_3 = ZONE:New("HardenedHanger33")
local T3COORD = Target_3:GetCoordinate()
local T3Height = T3COORD:GetLandHeight()
local Target_4 = ZONE:New("HardenedHanger34")
local T4COORD = Target_4:GetCoordinate()
local T4Height = T4COORD:GetLandHeight()
-- Gets LLDMS coord from Target 1(Bridge32p) using T1COORD:ToStringLLDMS() then assigns sections of the string to coordXy
local function TARGET1(T1LLDMS)
local T1LLDMS = T1COORD:ToStringLLDMS()
local coordN1 = string.sub(T1LLDMS,9,10)--extracts a block of text from String T4LLDMS starting at location 9 ending at location 10
local coordN2 = string.sub(T1LLDMS,13,20)--extracts a block of text from String T4LLDMS starting at location 13 ending at location 20
local coordE1 = string.sub(T1LLDMS,26,27)--extracts a block of text from String T4LLDMS starting at location 26 ending at location 27
local coordE2 = string.sub(T1LLDMS,30,37)--extracts a block of text from String T4LLDMS starting at location 30 ending at location 37
local Heightft = UTILS.MetersToFeet(T1Height)--coverts height in meters to feet
local T1Heightft = UTILS.Round(Heightft)-- rounds the value to a whole number
MESSAGE:New("Bridge 32".."\n".. ("N"..coordN1.."'"..coordN2.."\n".."E"..coordE1.."'"..coordE2.."\n".."ALT "..T1Heightft.." ft"), 50):ToAll()
return T1LLDMS--returns the argument for function TARGET1
end
local function TARGET2(T2LLDMS)
local T2LLDMS = T2COORD:ToStringLLDMS()
local coordN1 = string.sub(T2LLDMS,9,10)
local coordN2 = string.sub(T2LLDMS,13,20)
local coordE1 = string.sub(T2LLDMS,26,27)
local coordE2 = string.sub(T2LLDMS,30,37)
local Heightft = UTILS.MetersToFeet(T2Height)
local T2Heightft = UTILS.Round(Heightft)
MESSAGE:New("Bridge 33".."\n".. ("N"..coordN1.."'"..coordN2.."\n".."E"..coordE1.."'"..coordE2.."\n".."ALT "..T2Heightft.." ft"), 50):ToAll()
return T2LLDMS
end
local function TARGET3(T3LLDMS)
local T3LLDMS = T3COORD:ToStringLLDMS()
local coordN1 = string.sub(T3LLDMS,9,10)
local coordN2 = string.sub(T3LLDMS,13,20)
local coordE1 = string.sub(T3LLDMS,26,27)
local coordE2 = string.sub(T3LLDMS,30,37)
local Heightft = UTILS.MetersToFeet(T3Height)
local T3Heightft = UTILS.Round(Heightft)
MESSAGE:New("HardenedHanger 33".."\n".. ("N"..coordN1.."'"..coordN2.."\n".."E"..coordE1.."'"..coordE2.."\n".."ALT "..T3Heightft.." ft"), 50):ToAll()
return T3LLDMS
end
local function TARGET4(T4LLDMS)
local T4LLDMS = T4COORD:ToStringLLDMS()
local coordN1 = string.sub(T4LLDMS,9,10)
local coordN2 = string.sub(T4LLDMS,13,20)
local coordE1 = string.sub(T4LLDMS,26,27)
local coordE2 = string.sub(T4LLDMS,30,37)
local Heightft = UTILS.MetersToFeet(T4Height)
local T4Heightft = UTILS.Round(Heightft)
MESSAGE:New("HardenedHanger 34".."\n".. ("N"..coordN1.."'"..coordN2.."\n".."E"..coordE1.."'"..coordE2.."\n".."ALT "..T4Heightft.." ft"), 50):ToAll()
return T4LLDMS
end
local function TARGET5(T1LLDMS)
local T1LLDMS = AmmoDumpEastCOORD:ToStringLLDMS()
local coordN1 = string.sub(T1LLDMS,9,10)
local coordN2 = string.sub(T1LLDMS,13,20)
local coordE1 = string.sub(T1LLDMS,26,27)
local coordE2 = string.sub(T1LLDMS,30,37)
local Heightft = UTILS.MetersToFeet(AmmoDumpEastHeight)
local T1Heightft = UTILS.Round(Heightft)
MESSAGE:New("EastAmmoDump".."\n".. ("N"..coordN1.."'"..coordN2.."\n".."E"..coordE1.."'"..coordE2.."\n".."ALT "..T1Heightft.." ft"), 50):ToAll()
return T1LLDMS
end
local function TARGET6(T2LLDMS)
local T2LLDMS = AmmoDumpWestCOORD:ToStringLLDMS()
local coordN1 = string.sub(T2LLDMS,9,10)
local coordN2 = string.sub(T2LLDMS,13,20)
local coordE1 = string.sub(T2LLDMS,26,27)
local coordE2 = string.sub(T2LLDMS,30,37)
local Heightft = UTILS.MetersToFeet(AmmoDumpWestHeight)
local T2Heightft = UTILS.Round(Heightft)
MESSAGE:New("WestAmmoDump".."\n".. ("N"..coordN1.."'"..coordN2.."\n".."E"..coordE1.."'"..coordE2.."\n".."ALT "..T2Heightft.." ft"), 50):ToAll()
return T2LLDMS
end
local function TARGET7(T3LLDMS)
local T3LLDMS = AmmoDumpSouthCOORD:ToStringLLDMS()
local coordN1 = string.sub(T3LLDMS,9,10)
local coordN2 = string.sub(T3LLDMS,13,20)
local coordE1 = string.sub(T3LLDMS,26,27)
local coordE2 = string.sub(T3LLDMS,30,37)
local Heightft = UTILS.MetersToFeet(AmmoDumpSouthHeight)
local T3Heightft = UTILS.Round(Heightft)
MESSAGE:New("SouthAmmoDump".."\n".. ("N"..coordN1.."'"..coordN2.."\n".."E"..coordE1.."'"..coordE2.."\n".."ALT "..T3Heightft.." ft"), 50):ToAll()
return T3LLDMS
end
local function TARGET8(T4LLDMS)
local T4LLDMS = AmmoDumpNorthCOORD:ToStringLLDMS()
local coordN1 = string.sub(T4LLDMS,9,10)--extracts text from String T4LLDMS at location 9 to 10
local coordN2 = string.sub(T4LLDMS,13,20)--extracts text from String T4LLDMS at location 13 to 20
local coordE1 = string.sub(T4LLDMS,26,27)--extracts text from String T4LLDMS at location 26 to 27
local coordE2 = string.sub(T4LLDMS,30,37)--extracts text from String T4LLDMS at location 30 to 37
local Heightft = UTILS.MetersToFeet(AmmoDumpNorthHeight)--coverts height in meters to feet
local T4Heightft = UTILS.Round(Heightft)-- rounds the value to a whole number
MESSAGE:New("NorthAmmoDump".."\n".. ("N"..coordN1.."'"..coordN2.."\n".."E"..coordE1.."'"..coordE2.."\n".."ALT "..T4Heightft.." ft"), 50):ToAll()
return T4LLDMS
end
--Coordinates Menu
Level1 = MENU_MISSION:New( "TARGETCOORDS" )--Top level Menu all targets are assigned to this master menu
Level2_1 = MENU_MISSION:New( "BRIDGE",Level1 )--Level 2 Contains Target groups
Level2_2 = MENU_MISSION:New( "AMMO DUMP",Level1 )
Level2_3 = MENU_MISSION:New( "HARDENED SHELTER",Level1 )
Menu1 = MENU_MISSION_COMMAND:New("Bridge 32",Level2_1, TARGET1)--Level 3 contains Target group coordinates
Menu2 = MENU_MISSION_COMMAND:New("Bridge 33", Level2_1, TARGET2)
Menu3 = MENU_MISSION_COMMAND:New("HardenedHanger 33", Level2_3, TARGET3)--text displayed HardenedHanger 33, select Menu position, function to call(local function TARGET3(T3LLDMS))
Menu4 = MENU_MISSION_COMMAND:New("HardenedHanger 34", Level2_3, TARGET4)
Menu5 = MENU_MISSION_COMMAND:New("AmmoDumpEast", Level2_2, TARGET5)
Menu6 = MENU_MISSION_COMMAND:New("AmmoDumpWest", Level2_2, TARGET6)
Menu7 = MENU_MISSION_COMMAND:New("AmmoDumpSouth", Level2_2, TARGET7)
Menu8 = MENU_MISSION_COMMAND:New("AmmoDumpNorth", Level2_2, TARGET8)

View File

@ -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)

View File

@ -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)

View File

@ -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)..

View File

@ -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()

View File

@ -1,26 +1,26 @@
---
-- HELO: Zone to Airbase from FARP
--
-- Huey group stationed at Farp Berlin picks up cargo in Zone Kobuleti X and delivers them
-- to Kobuleti airbase.
--
-- Note that the deploy zone is a ZONE_AIRBASE object!
---
-- Pickup and deploy zones.
local zonePickup=ZONE:New("Zone Kobuleti X"):DrawZone()
local zoneDeploy=ZONE_AIRBASE:New(AIRBASE.Caucasus.Kobuleti):DrawZone()
-- Cargo set.
local infantryset=SET_GROUP:New():FilterPrefixes("Infantry Platoon Alpha-1"):FilterOnce()
infantryset:Activate()
-- Cargo transport assignment.
local opstransport=OPSTRANSPORT:New(infantryset, zonePickup, zoneDeploy)
-- Huey Carrier.
local hueyAlpha1=FLIGHTGROUP:New("UH-1H Alpha-1")
hueyAlpha1:Activate()
-- Cargo transport assignment to the Huey group.
---
-- HELO: Zone To Airbase from FARP
--
-- Huey group stationed at Farp Berlin picks up cargo in Zone Kobuleti X and delivers them
-- to Kobuleti airbase.
--
-- Note that the deploy zone is a ZONE_AIRBASE object!
---
-- Pickup and deploy zones.
local zonePickup=ZONE:New("Zone Kobuleti X"):DrawZone()
local zoneDeploy=ZONE_AIRBASE:New(AIRBASE.Caucasus.Kobuleti):DrawZone()
-- Cargo set.
local infantryset=SET_GROUP:New():FilterPrefixes("Infantry Platoon Alpha-1"):FilterOnce()
infantryset:Activate()
-- Cargo transport assignment.
local opstransport=OPSTRANSPORT:New(infantryset, zonePickup, zoneDeploy)
-- Huey Carrier.
local hueyAlpha1=FLIGHTGROUP:New("UH-1H Alpha-1")
hueyAlpha1:Activate()
-- Cargo transport assignment to first Huey group.
hueyAlpha1:AddOpsTransport(opstransport)

View File

@ -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)

View File

@ -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 ) } )

View File

@ -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
)

View File

@ -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
)

View File

@ -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())

View File

@ -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 )

View File

@ -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 )

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