Updated Moose.lua

This commit is contained in:
funkyfranky
2022-10-11 19:30:16 +00:00
parent 192d4710a2
commit 9f91de26ca
982 changed files with 22665 additions and 22625 deletions
@@ -1,77 +1,77 @@
---
-- BRIGADE: Patrol Mission
--
-- The brigade is stationed at Senaki. It consists of multiple platoons
-- of different unit types and capabilities.
--
-- The brigade gets an assignment to patrol a nearby zone for 30 minutes.
-- All enemies will be engaged.
--
-- Once the mission is over, the assigned assets will return to the
-- brigade spawn zone.
--
-- The mission is repeated five times.
---
-- The zone to patrol.
local zoneCapture=ZONE:New("Capture Me")
-- TPz Fuchs platoon.
local platoonAPC=PLATOON:New("TPz Fuchs Template", 5, "TPz Fuchs")
platoonAPC:AddMissionCapability({AUFTRAG.Type.PATROLZONE}, 40)
-- Paladin platoon
local platoonARTY=PLATOON:New("M109 Paladin Template", 5, "M109 Paladin")
platoonARTY:AddMissionCapability({AUFTRAG.Type.ARTY}, 70)
platoonARTY:AddWeaponRange(UTILS.KiloMetersToNM(0.5), UTILS.KiloMetersToNM(20))
-- MLRS platoon.
local platoonMLRS=PLATOON:New("MLRS M270 Template", 5, "MLRS M270")
platoonMLRS:AddMissionCapability({AUFTRAG.Type.ARTY}, 80)
platoonMLRS:AddWeaponRange(UTILS.KiloMetersToNM(10), UTILS.KiloMetersToNM(32))
-- M939 Truck platoon. Can provide ammo in DCS.
local platoonM939=PLATOON:New("M939 Heavy", 5, "M939 Heavy Truck")
platoonM939:AddMissionCapability({AUFTRAG.Type.AMMOSUPPLY}, 70)
-- Create a Brigade
local brigade=BRIGADE:New("Warehouse Senaki", "Brigade Senaki")
-- Set spawn zone.
brigade:SetSpawnZone(ZONE:New("Warehouse Senaki Spawn Zone"))
-- Add platoons.
brigade:AddPlatoon(platoonAPC)
brigade:AddPlatoon(platoonARTY)
brigade:AddPlatoon(platoonMLRS)
-- Start brigade.
brigade:Start()
-- Mission to patrol the zone. Two asset groups will be assigned to patrol the zone for 20 min.
local missionPatrol=AUFTRAG:NewPATROLZONE(zoneCapture)
-- Mission is cancelled 30 min after execution, i.e. when the first group patrols the zone.
missionPatrol:SetDuration(30*60)
-- Mission is repeated 5 times.
missionPatrol:SetRepeat(5)
-- Enemies are automatically engaged.
missionPatrol:SetEngageDetected()
-- At least to asset groups are required to carry out the mission.
missionPatrol:SetRequiredAssets(2)
-- Add mission to brigade.
brigade:AddMission(missionPatrol)
--- Function called each time a group from the brigade is send on a mission.
function brigade:OnAfterArmyOnMission(From, Event, To, Armygroup, Mission)
local armygroup=Armygroup --Ops.ArmyGroup#ARMYGROUP
local mission=Mission --Ops.Auftrag#AUFTRAG
-- Info text.
local text=string.format("Armygroup %s on Mission %s [%s]", armygroup:GetName(), mission:GetName(), mission:GetType())
MESSAGE:New(text, 60):ToAll()
env.info(text)
---
-- BRIGADE: Patrol Mission
--
-- The brigade is stationed at Senaki. It consists of multiple platoons
-- of different unit types and capabilities.
--
-- The brigade gets an assignment to patrol a nearby zone for 30 minutes.
-- All enemies will be engaged.
--
-- Once the mission is over, the assigned assets will return to the
-- brigade spawn zone.
--
-- The mission is repeated five times.
---
-- The zone to patrol.
local zoneCapture=ZONE:New("Capture Me")
-- TPz Fuchs platoon.
local platoonAPC=PLATOON:New("TPz Fuchs Template", 5, "TPz Fuchs")
platoonAPC:AddMissionCapability({AUFTRAG.Type.PATROLZONE}, 40)
-- Paladin platoon
local platoonARTY=PLATOON:New("M109 Paladin Template", 5, "M109 Paladin")
platoonARTY:AddMissionCapability({AUFTRAG.Type.ARTY}, 70)
platoonARTY:AddWeaponRange(UTILS.KiloMetersToNM(0.5), UTILS.KiloMetersToNM(20))
-- MLRS platoon.
local platoonMLRS=PLATOON:New("MLRS M270 Template", 5, "MLRS M270")
platoonMLRS:AddMissionCapability({AUFTRAG.Type.ARTY}, 80)
platoonMLRS:AddWeaponRange(UTILS.KiloMetersToNM(10), UTILS.KiloMetersToNM(32))
-- M939 Truck platoon. Can provide ammo in DCS.
local platoonM939=PLATOON:New("M939 Heavy", 5, "M939 Heavy Truck")
platoonM939:AddMissionCapability({AUFTRAG.Type.AMMOSUPPLY}, 70)
-- Create a Brigade
local brigade=BRIGADE:New("Warehouse Senaki", "Brigade Senaki")
-- Set spawn zone.
brigade:SetSpawnZone(ZONE:New("Warehouse Senaki Spawn Zone"))
-- Add platoons.
brigade:AddPlatoon(platoonAPC)
brigade:AddPlatoon(platoonARTY)
brigade:AddPlatoon(platoonMLRS)
-- Start brigade.
brigade:Start()
-- Mission to patrol the zone. Two asset groups will be assigned to patrol the zone for 20 min.
local missionPatrol=AUFTRAG:NewPATROLZONE(zoneCapture)
-- Mission is cancelled 30 min after execution, i.e. when the first group patrols the zone.
missionPatrol:SetDuration(30*60)
-- Mission is repeated 5 times.
missionPatrol:SetRepeat(5)
-- Enemies are automatically engaged.
missionPatrol:SetEngageDetected()
-- At least to asset groups are required to carry out the mission.
missionPatrol:SetRequiredAssets(2)
-- Add mission to brigade.
brigade:AddMission(missionPatrol)
--- Function called each time a group from the brigade is send on a mission.
function brigade:OnAfterArmyOnMission(From, Event, To, Armygroup, Mission)
local armygroup=Armygroup --Ops.ArmyGroup#ARMYGROUP
local mission=Mission --Ops.Auftrag#AUFTRAG
-- Info text.
local text=string.format("Armygroup %s on Mission %s [%s]", armygroup:GetName(), mission:GetName(), mission:GetType())
MESSAGE:New(text, 60):ToAll()
env.info(text)
end
@@ -1,106 +1,106 @@
---
-- BRIGADE: Arty Mission
--
-- The brigade is stationed at Senaki. It consists of multiple platoons
-- of different unit types and capabilities.
--
-- The brigade gets an assignment to shell a nearby zone.
-- Intel has even provided us the coordinates of an enemy group in the zone.
-- This will be the target.
--
-- The mission is repeated ten times if the group has not been completely destroyed.
--
-- NOTE that specifying the weapon range of the platoon units is important.
-- Unfortunately, that information cannot be retrieved via scripting.
-- The groups will automatically move in range before the fire at point task is executed.
--
-- As an additional feature, some arty groups are spawned beforehand on a "do nothing" mission.
-- Each platoon automatically has the capability to do this mission type. It does not need to be added.
-- These assets will be preferred when the best assets for the ARTY mission are selected.
-- For the ARTY mission, the do NOTHING mission is paused. After the ARTY mission is done,
-- the assets will resume the NOTHING mission.
---
-- The zone to patrol.
local zoneCapture=ZONE:New("Capture Me"):DrawZone()
-- Set spawn zone of Senaki warehouse.
local zoneSenakiSpawn=ZONE:New("Warehouse Senaki Spawn Zone"):DrawZone()
-- Zone where arty assets should "relax" until they get an assignment.
local zoneArtyAlpha=ZONE:New("Arty Alpha"):DrawZone()
-- Paladin platoon
local platoonARTY=PLATOON:New("M109 Paladin Template", 4, "M109 Paladin")
platoonARTY:AddMissionCapability({AUFTRAG.Type.ARTY}, 90)
platoonARTY:AddWeaponRange(UTILS.KiloMetersToNM(0.5), UTILS.KiloMetersToNM(20))
-- MLRS platoon.
local platoonMLRS=PLATOON:New("MLRS M270 Template", 4, "MLRS M270")
platoonMLRS:AddMissionCapability({AUFTRAG.Type.ARTY}, 80)
platoonMLRS:AddWeaponRange(UTILS.KiloMetersToNM(10), UTILS.KiloMetersToNM(32))
-- Leopard Tank platoon.
local platoonTANK=PLATOON:New("Leopard-2A6M Template", 6, "Leopard-2A6M")
platoonTANK:AddMissionCapability({AUFTRAG.Type.PATROLZONE, AUFTRAG.Type.GROUNDATTACK}, 90)
platoonTANK:AddMissionCapability({AUFTRAG.Type.ARTY}, 30)
platoonTANK:AddWeaponRange(0.1, 1.8)
-- Create a Brigade
local brigade=BRIGADE:New("Warehouse Senaki", "Brigade Senaki")
-- Set spawn zone.
brigade:SetSpawnZone(zoneSenakiSpawn)
-- Add platoons.
brigade:AddPlatoon(platoonARTY)
brigade:AddPlatoon(platoonMLRS)
brigade:AddPlatoon(platoonTANK)
-- Start brigade.
brigade:Start()
---
-- Missions
---
-- Mission to do nothing. Assets will be spawned and got to a random point inside the given zone.
local missionNothing=AUFTRAG:NewNOTHING(zoneArtyAlpha)
missionNothing:SetRequiredAssets(5)
missionNothing:SetFormation(ENUMS.Formation.Vehicle.OffRoad)
missionNothing:SetRequiredAttribute(GROUP.Attribute.GROUND_ARTILLERY)
-- We could also require a certain property (DCS attribute), e.g. only rocket launchers. See https://wiki.hoggitworld.com/view/DCS_enum_attributes
--missionNothing:SetRequiredProperty({"MLRS"})
-- ARTY mission to fire 12 shots at the coordinates of a red group. Radius is 200 meters.
-- NOTE that MLRS have only 12 rockets. They will be out-of-ammo and return after the first engagement.
local missionArty=AUFTRAG:NewARTY(GROUP:FindByName("Ru Smerch-1"), 12, 200)
missionArty:SetFormation(ENUMS.Formation.Vehicle.OffRoad)
-- Set number of required assets. At least one and up to six if available.
-- The five assets on the do NOTHING mission should be selected and one additional asset is spawned.
missionArty:SetRequiredAssets(1, 6)
-- Start time is 5 min after staring the script. This allows the assets of the "nothing" missions to be spawned.
missionArty:SetTime(5*60)
-- Set time interval before mission result is evaluated. Default is 8 min for arty missions but we shorten it to 2 min here.
missionArty:SetEvaluationTime(2*60)
-- Mission will be repeated up to 10 times if it fails.
missionArty:SetRepeatOnFailure(10)
-- Add mission to brigade.
brigade:AddMission(missionNothing)
brigade:AddMission(missionArty)
--- Function called each time a group from the brigade is send on a mission.
function brigade:OnAfterArmyOnMission(From, Event, To, Armygroup, Mission)
local armygroup=Armygroup --Ops.ArmyGroup#ARMYGROUP
local mission=Mission --Ops.Auftrag#AUFTRAG
-- Info text.
local text=string.format("Armygroup %s on Mission %s [%s]", armygroup:GetName(), mission:GetName(), mission:GetType())
MESSAGE:New(text, 60):ToAll()
env.info(text)
end
---
-- BRIGADE: Arty Mission
--
-- The brigade is stationed at Senaki. It consists of multiple platoons
-- of different unit types and capabilities.
--
-- The brigade gets an assignment to shell a nearby zone.
-- Intel has even provided us the coordinates of an enemy group in the zone.
-- This will be the target.
--
-- The mission is repeated ten times if the group has not been completely destroyed.
--
-- NOTE that specifying the weapon range of the platoon units is important.
-- Unfortunately, that information cannot be retrieved via scripting.
-- The groups will automatically move in range before the fire at point task is executed.
--
-- As an additional feature, some arty groups are spawned beforehand on a "do nothing" mission.
-- Each platoon automatically has the capability to do this mission type. It does not need to be added.
-- These assets will be preferred when the best assets for the ARTY mission are selected.
-- For the ARTY mission, the do NOTHING mission is paused. After the ARTY mission is done,
-- the assets will resume the NOTHING mission.
---
-- The zone to patrol.
local zoneCapture=ZONE:New("Capture Me"):DrawZone()
-- Set spawn zone of Senaki warehouse.
local zoneSenakiSpawn=ZONE:New("Warehouse Senaki Spawn Zone"):DrawZone()
-- Zone where arty assets should "relax" until they get an assignment.
local zoneArtyAlpha=ZONE:New("Arty Alpha"):DrawZone()
-- Paladin platoon
local platoonARTY=PLATOON:New("M109 Paladin Template", 4, "M109 Paladin")
platoonARTY:AddMissionCapability({AUFTRAG.Type.ARTY}, 90)
platoonARTY:AddWeaponRange(UTILS.KiloMetersToNM(0.5), UTILS.KiloMetersToNM(20))
-- MLRS platoon.
local platoonMLRS=PLATOON:New("MLRS M270 Template", 4, "MLRS M270")
platoonMLRS:AddMissionCapability({AUFTRAG.Type.ARTY}, 80)
platoonMLRS:AddWeaponRange(UTILS.KiloMetersToNM(10), UTILS.KiloMetersToNM(32))
-- Leopard Tank platoon.
local platoonTANK=PLATOON:New("Leopard-2A6M Template", 6, "Leopard-2A6M")
platoonTANK:AddMissionCapability({AUFTRAG.Type.PATROLZONE, AUFTRAG.Type.GROUNDATTACK}, 90)
platoonTANK:AddMissionCapability({AUFTRAG.Type.ARTY}, 30)
platoonTANK:AddWeaponRange(0.1, 1.8)
-- Create a Brigade
local brigade=BRIGADE:New("Warehouse Senaki", "Brigade Senaki")
-- Set spawn zone.
brigade:SetSpawnZone(zoneSenakiSpawn)
-- Add platoons.
brigade:AddPlatoon(platoonARTY)
brigade:AddPlatoon(platoonMLRS)
brigade:AddPlatoon(platoonTANK)
-- Start brigade.
brigade:Start()
---
-- Missions
---
-- Mission to do nothing. Assets will be spawned and got to a random point inside the given zone.
local missionNothing=AUFTRAG:NewNOTHING(zoneArtyAlpha)
missionNothing:SetRequiredAssets(5)
missionNothing:SetFormation(ENUMS.Formation.Vehicle.OffRoad)
missionNothing:SetRequiredAttribute(GROUP.Attribute.GROUND_ARTILLERY)
-- We could also require a certain property (DCS attribute), e.g. only rocket launchers. See https://wiki.hoggitworld.com/view/DCS_enum_attributes
--missionNothing:SetRequiredProperty({"MLRS"})
-- ARTY mission to fire 12 shots at the coordinates of a red group. Radius is 200 meters.
-- NOTE that MLRS have only 12 rockets. They will be out-of-ammo and return after the first engagement.
local missionArty=AUFTRAG:NewARTY(GROUP:FindByName("Ru Smerch-1"), 12, 200)
missionArty:SetFormation(ENUMS.Formation.Vehicle.OffRoad)
-- Set number of required assets. At least one and up to six if available.
-- The five assets on the do NOTHING mission should be selected and one additional asset is spawned.
missionArty:SetRequiredAssets(1, 6)
-- Start time is 5 min after staring the script. This allows the assets of the "nothing" missions to be spawned.
missionArty:SetTime(5*60)
-- Set time interval before mission result is evaluated. Default is 8 min for arty missions but we shorten it to 2 min here.
missionArty:SetEvaluationTime(2*60)
-- Mission will be repeated up to 10 times if it fails.
missionArty:SetRepeatOnFailure(10)
-- Add mission to brigade.
brigade:AddMission(missionNothing)
brigade:AddMission(missionArty)
--- Function called each time a group from the brigade is send on a mission.
function brigade:OnAfterArmyOnMission(From, Event, To, Armygroup, Mission)
local armygroup=Armygroup --Ops.ArmyGroup#ARMYGROUP
local mission=Mission --Ops.Auftrag#AUFTRAG
-- Info text.
local text=string.format("Armygroup %s on Mission %s [%s]", armygroup:GetName(), mission:GetName(), mission:GetType())
MESSAGE:New(text, 60):ToAll()
env.info(text)
end
@@ -1,139 +1,139 @@
---
-- BRIGADE: SAM+EWR
--
-- Beslan sets up a two SAM sites and one EWR.
-- The assets are teleported to the zones where they should operate.
--
-- A blue airwing launches missions to bomb the runway of Beslan.
-- They chances to be successful are rather slim but they will keep trying.
--
-- We also setup a red detection (INTEL) and add the spawned red groups.
-- Intel will print messages when new contacts are detected and lost.
---
-- Zones where SAMs should be located.
local zoneSAMalpha=ZONE:New("Beslan SAM Alpha"):DrawZone()
local zoneSAMbravo=ZONE:New("Beslan SAM Bravo"):DrawZone()
local zoneEWRalpha=ZONE:New("Beslan EWR Alpha"):DrawZone()
-- Spawn zone for brigade.
local zoneSpawnBeslan=ZONE:New("Warehouse Beslan Spawn Zone"):DrawZone()
-- Platoon of SA-10.
local platoonSA10=PLATOON:New("SA-10 Template", 1, "Platoon SA-10")
platoonSA10:AddMissionCapability({AUFTRAG.Type.AIRDEFENSE}, 50)
-- Platoon of SA-11.
local platoonSA11=PLATOON:New("SA-11 Template", 1, "Platoon SA-11")
platoonSA11:AddMissionCapability({AUFTRAG.Type.AIRDEFENSE}, 80)
-- Platoon of SA-11.
local platoonEWR=PLATOON:New("EWR 1L13 Template", 2, "Platoon EWR 1L13")
platoonEWR:AddMissionCapability({AUFTRAG.Type.EWR}, 80)
-- Define the brigade.
local brigade=BRIGADE:New("Warehouse Beslan", "Brigade Beslan")
-- Set spawn zone.
brigade:SetSpawnZone(zoneSpawnBeslan)
-- Add platoons to the brigade.
brigade:AddPlatoon(platoonSA10)
brigade:AddPlatoon(platoonSA11)
brigade:AddPlatoon(platoonEWR)
-- Start brigade.
brigade:Start()
-- Red intel.
local redintel=INTEL:New(nil, coalition.side.RED)
redintel:Start()
--- Function called when a new contact is detected.
function redintel:OnAfterNewContact(From, Event, To, Contact)
-- Contact details.
local group=redintel:GetContactGroup(Contact)
local name=redintel:GetContactName(Contact)
local coord=redintel:GetContactCoordinate(Contact)
local typename=redintel:GetContactTypeName(Contact)
local threatlevel=redintel:GetContactThreatlevel(Contact)
-- Infol message.
local text=string.format("Detected new contact group %s: Type=%s, Threatlevel=%d, ", name, typename, threatlevel)
MESSAGE:New(text, 600):ToAll()
env.info(text)
end
--- Function called when a contact cannot be detected any more.
function redintel:OnAfterLostContact(From, Event, To, Contact)
-- Infol message.
local text=string.format("Lost contact group %s", redintel:GetContactName(Contact))
MESSAGE:New(text, 600):ToAll()
env.info(text)
end
--- Function called each time an army group is send on a mission.
function brigade:OnAfterArmyOnMission(From, Event, To, ArmyGroup, Mission)
local armygroup=ArmyGroup --Ops.ArmyGroup#ARMYGROUP
local mission=Mission --Ops.Auftrag#AUFTRAG
-- Info message.
local text=string.format("Armygroup %s on %s mission \"%s\"", armygroup:GetName(), mission:GetType(), mission:GetName())
MESSAGE:New(text, 360):ToAll()
env.info(text)
-- Add group to intel detection set.
redintel:AddAgent(ArmyGroup)
end
-- Create airdefense mission for SAM zone alpha.
local missionSAMalpha=AUFTRAG:NewAIRDEFENSE(zoneSAMalpha)
missionSAMalpha:SetTeleport()
-- Create airdefense mission for SAM zone bravo.
local missionSAMbravo=AUFTRAG:NewAIRDEFENSE(zoneSAMbravo)
missionSAMbravo:SetTeleport()
-- Create EWR mission for EWR zone alpha. Immobile assets are teleported.
local missionEWRalpha=AUFTRAG:NewEWR(zoneEWRalpha)
-- Assign mission to brigade.
brigade:AddMission(missionSAMalpha)
brigade:AddMission(missionSAMbravo)
brigade:AddMission(missionEWRalpha)
---
-- Airwing at Kutaisi
---
-- Create a squadron.
local squad1stF16=SQUADRON:New("F-16CM Template", 12, "1st F-16 Wing")
squad1stF16:SetGrouping(2)
squad1stF16:AddMissionCapability({AUFTRAG.Type.BOMBING, AUFTRAG.Type.BOMBRUNWAY}, 80)
-- Create airwing.
local airwingKutaisi=AIRWING:New("Warehouse Kutaisi", "Airwing Kutaisi")
-- Assets take of "in air" and are despawned near the airbase.
airwingKutaisi:SetTakeoffAir()
airwingKutaisi:SetDespawnAfterHolding()
-- Add squadron.
airwingKutaisi:AddSquadron(squad1stF16)
-- Add payloads for bombing missions. Amount is unlimited.
airwingKutaisi:NewPayload("F-16CM Payload AIM-120C*2, AIM-9X*2, AGM-65K*2, FUEL*2, TGP", -1 , {AUFTRAG.Type.BOMBING, AUFTRAG.Type.BOMBRUNWAY}, 70)
airwingKutaisi:NewPayload("F-16CM Payload AIM-120*2, AIM-9X*2, MK-82AIR*4, FUEL*2, TGP", -1 , {AUFTRAG.Type.BOMBING, AUFTRAG.Type.BOMBRUNWAY}, 80)
-- Start airwing.
airwingKutaisi:Start()
-- Create mission to bomb runway at Beslan.
local missionBombBeslan=AUFTRAG:NewBOMBRUNWAY(AIRBASE.Caucasus.Beslan, 20000)
missionBombBeslan:SetRequiredAssets(1, 3)
missionBombBeslan:SetRepeatOnFailure(4)
-- Add mission to airwing.
airwingKutaisi:AddMission(missionBombBeslan)
---
-- BRIGADE: SAM+EWR
--
-- Beslan sets up a two SAM sites and one EWR.
-- The assets are teleported to the zones where they should operate.
--
-- A blue airwing launches missions to bomb the runway of Beslan.
-- They chances to be successful are rather slim but they will keep trying.
--
-- We also setup a red detection (INTEL) and add the spawned red groups.
-- Intel will print messages when new contacts are detected and lost.
---
-- Zones where SAMs should be located.
local zoneSAMalpha=ZONE:New("Beslan SAM Alpha"):DrawZone()
local zoneSAMbravo=ZONE:New("Beslan SAM Bravo"):DrawZone()
local zoneEWRalpha=ZONE:New("Beslan EWR Alpha"):DrawZone()
-- Spawn zone for brigade.
local zoneSpawnBeslan=ZONE:New("Warehouse Beslan Spawn Zone"):DrawZone()
-- Platoon of SA-10.
local platoonSA10=PLATOON:New("SA-10 Template", 1, "Platoon SA-10")
platoonSA10:AddMissionCapability({AUFTRAG.Type.AIRDEFENSE}, 50)
-- Platoon of SA-11.
local platoonSA11=PLATOON:New("SA-11 Template", 1, "Platoon SA-11")
platoonSA11:AddMissionCapability({AUFTRAG.Type.AIRDEFENSE}, 80)
-- Platoon of SA-11.
local platoonEWR=PLATOON:New("EWR 1L13 Template", 2, "Platoon EWR 1L13")
platoonEWR:AddMissionCapability({AUFTRAG.Type.EWR}, 80)
-- Define the brigade.
local brigade=BRIGADE:New("Warehouse Beslan", "Brigade Beslan")
-- Set spawn zone.
brigade:SetSpawnZone(zoneSpawnBeslan)
-- Add platoons to the brigade.
brigade:AddPlatoon(platoonSA10)
brigade:AddPlatoon(platoonSA11)
brigade:AddPlatoon(platoonEWR)
-- Start brigade.
brigade:Start()
-- Red intel.
local redintel=INTEL:New(nil, coalition.side.RED)
redintel:Start()
--- Function called when a new contact is detected.
function redintel:OnAfterNewContact(From, Event, To, Contact)
-- Contact details.
local group=redintel:GetContactGroup(Contact)
local name=redintel:GetContactName(Contact)
local coord=redintel:GetContactCoordinate(Contact)
local typename=redintel:GetContactTypeName(Contact)
local threatlevel=redintel:GetContactThreatlevel(Contact)
-- Infol message.
local text=string.format("Detected new contact group %s: Type=%s, Threatlevel=%d, ", name, typename, threatlevel)
MESSAGE:New(text, 600):ToAll()
env.info(text)
end
--- Function called when a contact cannot be detected any more.
function redintel:OnAfterLostContact(From, Event, To, Contact)
-- Infol message.
local text=string.format("Lost contact group %s", redintel:GetContactName(Contact))
MESSAGE:New(text, 600):ToAll()
env.info(text)
end
--- Function called each time an army group is send on a mission.
function brigade:OnAfterArmyOnMission(From, Event, To, ArmyGroup, Mission)
local armygroup=ArmyGroup --Ops.ArmyGroup#ARMYGROUP
local mission=Mission --Ops.Auftrag#AUFTRAG
-- Info message.
local text=string.format("Armygroup %s on %s mission \"%s\"", armygroup:GetName(), mission:GetType(), mission:GetName())
MESSAGE:New(text, 360):ToAll()
env.info(text)
-- Add group to intel detection set.
redintel:AddAgent(ArmyGroup)
end
-- Create airdefense mission for SAM zone alpha.
local missionSAMalpha=AUFTRAG:NewAIRDEFENSE(zoneSAMalpha)
missionSAMalpha:SetTeleport()
-- Create airdefense mission for SAM zone bravo.
local missionSAMbravo=AUFTRAG:NewAIRDEFENSE(zoneSAMbravo)
missionSAMbravo:SetTeleport()
-- Create EWR mission for EWR zone alpha. Immobile assets are teleported.
local missionEWRalpha=AUFTRAG:NewEWR(zoneEWRalpha)
-- Assign mission to brigade.
brigade:AddMission(missionSAMalpha)
brigade:AddMission(missionSAMbravo)
brigade:AddMission(missionEWRalpha)
---
-- Airwing at Kutaisi
---
-- Create a squadron.
local squad1stF16=SQUADRON:New("F-16CM Template", 12, "1st F-16 Wing")
squad1stF16:SetGrouping(2)
squad1stF16:AddMissionCapability({AUFTRAG.Type.BOMBING, AUFTRAG.Type.BOMBRUNWAY}, 80)
-- Create airwing.
local airwingKutaisi=AIRWING:New("Warehouse Kutaisi", "Airwing Kutaisi")
-- Assets take of "in air" and are despawned near the airbase.
airwingKutaisi:SetTakeoffAir()
airwingKutaisi:SetDespawnAfterHolding()
-- Add squadron.
airwingKutaisi:AddSquadron(squad1stF16)
-- Add payloads for bombing missions. Amount is unlimited.
airwingKutaisi:NewPayload("F-16CM Payload AIM-120C*2, AIM-9X*2, AGM-65K*2, FUEL*2, TGP", -1 , {AUFTRAG.Type.BOMBING, AUFTRAG.Type.BOMBRUNWAY}, 70)
airwingKutaisi:NewPayload("F-16CM Payload AIM-120*2, AIM-9X*2, MK-82AIR*4, FUEL*2, TGP", -1 , {AUFTRAG.Type.BOMBING, AUFTRAG.Type.BOMBRUNWAY}, 80)
-- Start airwing.
airwingKutaisi:Start()
-- Create mission to bomb runway at Beslan.
local missionBombBeslan=AUFTRAG:NewBOMBRUNWAY(AIRBASE.Caucasus.Beslan, 20000)
missionBombBeslan:SetRequiredAssets(1, 3)
missionBombBeslan:SetRepeatOnFailure(4)
-- Add mission to airwing.
airwingKutaisi:AddMission(missionBombBeslan)