New Mission added.

This commit is contained in:
iTracerFacer 2024-12-01 22:43:34 -06:00
parent 3d388919cb
commit 6e971cd85b
7 changed files with 1784 additions and 0 deletions

View File

@ -0,0 +1,139 @@
--[[ Battle for Rayak Valley - Moose Script
Author: F9tth-TracerFacer
]]
local ENABLE_SAMS = true -- used for testing purposes. Set to true to enable SAMs, false to disable.
local TAC_DISPLAY = false -- Set to false to disable Tacview display for AI flights (default = false)
-- How many red/blue aircraft are in the air by default.
local RedA2ADefaultOverhead = 1.5
local RedDefaultCAP = 1
local BlueA2ADefaultOverhead = 1.5
local BlueDefaultCAP = 1
-- Create the main mission menu.
missionMenu = MENU_MISSION:New("Mission Menu")
--Build Command Center and Mission for Blue
US_CC = COMMANDCENTER:New( GROUP:FindByName( "BLUEHQ" ), "USA HQ" )
US_Mission = MISSION:New( US_CC, "Battle for Rayak Valley", "Primary", "Clear the front lines of enemy activity.", coalition.side.BLUE)
US_Score = SCORING:New( "Battle for Rayak Valley - Blue" )
US_Mission:AddScoring( US_Score )
US_Mission:Start()
US_Score:SetMessagesHit(false)
US_Score:SetMessagesDestroy(false)
US_Score:SetMessagesScore(false)
--Build Command Center and Mission Red
RU_CC = COMMANDCENTER:New( GROUP:FindByName( "REDHQ" ), "Russia HQ" )
RU_Mission = MISSION:New (RU_CC, "Battle for Rayak Valley", "Primary", "Destroy U.S. and NATO forces.", coalition.side.RED)
RU_Score = SCORING:New("Battle for Rayak Valley - Red")
RU_Mission:AddScoring( RU_Score)
RU_Mission:Start()
RU_Score:SetMessagesHit(false)
RU_Score:SetMessagesDestroy(false)
RU_Score:SetMessagesScore(false)
------------------------------------------------------------------------------------------------------------------------------------------------------
-- Setup Air Dispatchers for RED and BLUE
------------------------------------------------------------------------------------------------------------------------------------------------------
BLUEBorderZone = ZONE_POLYGON:New( "BLUE BORDER", GROUP:FindByName( "BLUE BORDER" ) )
BLUEA2ADispatcher = AI_A2A_GCICAP:NewWithBorder( { "BLUE EWR" }, { "FIGHTER SWEEP BLUE" }, 'BLUE BORDER', 'BLUE BORDER', BlueDefaultCAP, 10000, 50000, 75000, 100)
BLUEA2ADispatcher:SetDefaultLandingAtRunway()
BLUEA2ADispatcher:SetDefaultTakeoffInAir()
BLUEA2ADispatcher:SetTacticalDisplay(TAC_DISPLAY)
BLUEA2ADispatcher:SetDefaultFuelThreshold( 0.20 )
BLUEA2ADispatcher:SetRefreshTimeInterval( 300 )
BLUEA2ADispatcher:SetDefaultOverhead(BlueA2ADefaultOverhead)
BLUEA2ADispatcher:SetDisengageRadius( 100000 )
BLUEA2ADispatcher:SetEngageRadius( 50000 )
BLUEA2ADispatcher:SetGciRadius( 75000 )
CCCPBorderZone = ZONE_POLYGON:New( "RED BORDER", GROUP:FindByName( "RED BORDER" ) )
RedA2ADispatcher = AI_A2A_GCICAP:NewWithBorder( { "RED EWR" }, { "FIGHTER SWEEP RED" }, "RED BORDER", "RED BORDER", RedDefaultCAP, 10000, 50000, 75000, 100)
RedA2ADispatcher:SetDefaultLandingAtRunway()
RedA2ADispatcher:SetDefaultTakeoffInAir()
RedA2ADispatcher:SetTacticalDisplay(TAC_DISPLAY)
RedA2ADispatcher:SetDefaultFuelThreshold( 0.20 )
RedA2ADispatcher:SetRefreshTimeInterval( 300 )
RedA2ADispatcher:SetDefaultOverhead(RedA2ADefaultOverhead)
RedA2ADispatcher:SetDisengageRadius( 100000 )
RedA2ADispatcher:SetEngageRadius( 50000 )
RedA2ADispatcher:SetGciRadius( 75000 )
------------------------------------------------------------------------------------------------------------------------------------------------------
-- Setup SAM Systems
------------------------------------------------------------------------------------------------------------------------------------------------------
local RED_AA_ZONES = {
ZONE:New("Red-SAM-Zone-1"),
ZONE:New("Red-SAM-Zone-2"),
ZONE:New("Red-SAM-Zone-3"),
ZONE:New("Red-SAM-Zone-4"),
ZONE:New("Red-SAM-Zone-5"),
ZONE:New("Red-SAM-Zone-6"),
ZONE:New("Red-SAM-Zone-7"),
ZONE:New("Red-SAM-Zone-8"),
ZONE:New("Red-SAM-Zone-9"),
ZONE:New("Red-SAM-Zone-10"),
ZONE:New("Red-SAM-Zone-11"),
ZONE:New("Red-SAM-Zone-12"),
ZONE:New("Red-SAM-Zone-13"),
ZONE:New("Red-SAM-Zone-14"),
ZONE:New("Red-SAM-Zone-15"),
ZONE:New("Red-SAM-Zone-16"),
ZONE:New("Red-SAM-Zone-17"),
ZONE:New("Red-SAM-Zone-18"),
ZONE:New("Red-SAM-Zone-19"),
ZONE:New("Red-SAM-Zone-20"),
ZONE:New("Red-SAM-Zone-21")
}
-- Schedule RED AA spawns using the calculated frequencies
-- Must allow enough room for an entire group to spawn. If the group only has 1 unit and you put 5, 5 will spawn,
-- but if the group has 5 units, and you put 5, only 1 will spawn..if you only put 4, it will never spawn.
-- If you put 10, 2 of them will spawn, etc etc.
if ENABLE_SAMS then
RED_SA08 = SPAWN:New("RED SAM SA08")
:InitRandomizeZones(RED_AA_ZONES)
:InitLimit(8, 8)
:SpawnScheduled(1800, 0.5)
-- There are 18 units in this group. Need space for each one in the numbers. So if I want 3 SA10s i'm just rounding up to 60.
RED_SA10 = SPAWN:New("RED SAM SA10")
:InitRandomizeZones(RED_AA_ZONES)
:InitLimit(60, 60)
:SpawnScheduled(1800, 0.5)
-- There are 12 units in this group. Need space for each one in the numbers. So if I want 4 SA11s i'm just rounding up to 48
RED_SA11 = SPAWN:New("RED SAM SA11")
:InitRandomizeZones(RED_AA_ZONES)
:InitLimit(36, 36)
:SpawnScheduled(1800, 0.5)
-- There are 11 units in this group. Need space for each one in the numbers. So if I want 4 SA11s i'm just rounding up to 44
RED_SA06 = SPAWN:New("RED SAM SA6")
:InitRandomizeZones(RED_AA_ZONES)
:InitLimit(33, 33)
:SpawnScheduled(1800, 0.5)
RED_SA02 = SPAWN:New("RED SAM SA2")
:InitRandomizeZones(RED_AA_ZONES)
:InitLimit(60, 60)
:SpawnScheduled(1800, 0.5)
RED_EWR = SPAWN:New("RED EWR")
:InitRandomizeZones(RED_AA_ZONES)
:InitLimit(10, 10)
:SpawnScheduled(1800, 0.5)
end

View File

@ -0,0 +1,441 @@
--[ MOOSE CTLD v1.0]
--[ Created by: F99th-TracerFacer
--[ Date: Nov2024
local pointsAwardedTroopsDeployed = 1
local pointsAwardedTroopsExtracted = 1
local pointsAwardedTroopsPickedup = 1
local pointsAwardedTroopsRTB = 1
local pointsAwardedCrateDropped = 1
local pointsAwardedCrateBuilt = 1
local pointsAwardedCrateRepair = 1
local msgTime = 10
-- Setup CTLD for Red and Blue Coalitions
local red_helos = SET_GROUP:New():FilterCoalitions("red"):FilterCategoryHelicopter():FilterStart()
local red_ctld = CTLD:New(coalition.side.RED)
red_ctld.SetOwnSetPilotGroups(red_helos)
local blue_helos = SET_GROUP:New():FilterCoalitions("blue"):FilterCategoryHelicopter():FilterStart()
local blue_ctld = CTLD:New(coalition.side.BLUE)
blue_ctld.SetOwnSetPilotGroups(blue_helos)
red_ctld.useprefix = false -- (DO NOT SWITCH THIS OFF UNLESS YOU KNOW WHAT YOU ARE DOING!) Adjust **before** starting CTLD. If set to false, *all* choppers of the coalition side will be enabled for CTLD.
red_ctld.CrateDistance = 50 -- List and Load crates in this radius only.
red_ctld.PackDistance = 50 -- Pack crates in this radius only
red_ctld.dropcratesanywhere = true -- Option to allow crates to be dropped anywhere.
red_ctld.dropAsCargoCrate = false -- Parachuted herc cargo is not unpacked automatically but placed as crate to be unpacked. Needs a cargo with the same name defined like the cargo that was dropped.
red_ctld.maximumHoverHeight = 15 -- Hover max this high to load.
red_ctld.minimumHoverHeight = 4 -- Hover min this low to load.
red_ctld.forcehoverload = false -- Crates (not: troops) can **only** be loaded while hovering.
red_ctld.hoverautoloading = true -- Crates in CrateDistance in a LOAD zone will be loaded automatically if space allows.
red_ctld.smokedistance = 10000 -- Smoke or flares can be request for zones this far away (in meters).
red_ctld.movetroopstowpzone = true -- Troops and vehicles will move to the nearest MOVE zone...
red_ctld.movetroopsdistance = 5000 -- .. but only if this far away (in meters)
red_ctld.suppressmessages = false -- Set to true if you want to script your own messages.
red_ctld.repairtime = 300 -- Number of seconds it takes to repair a unit.
red_ctld.buildtime = 300 -- Number of seconds it takes to build a unit. Set to zero or nil to build instantly.
red_ctld.cratecountry = country.id.GERMANY -- ID of crates. Will default to country.id.RUSSIA for RED coalition setups.
red_ctld.allowcratepickupagain = true -- allow re-pickup crates that were dropped.
red_ctld.enableslingload = true -- allow cargos to be slingloaded - might not work for all cargo types
red_ctld.pilotmustopendoors = true -- force opening of doors
red_ctld.SmokeColor = SMOKECOLOR.Red -- default color to use when dropping smoke from heli
red_ctld.FlareColor = FLARECOLOR.Red -- color to use when flaring from heli
red_ctld.basetype = "ammo_cargo" -- default shape of the cargo container
red_ctld.droppedbeacontimeout = 600 -- dropped beacon lasts 10 minutes
red_ctld.usesubcats = false -- use sub-category names for crates, adds an extra menu layer in "Get Crates", useful if you have > 10 crate types.
red_ctld.placeCratesAhead = true -- place crates straight ahead of the helicopter, in a random way. If true, crates are more neatly sorted.
red_ctld.nobuildinloadzones = true -- forbid players to build stuff in LOAD zones if set to `true`
red_ctld.movecratesbeforebuild = false -- crates must be moved once before they can be build. Set to false for direct builds.
red_ctld.surfacetypes = {land.SurfaceType.LAND,land.SurfaceType.ROAD,land.SurfaceType.RUNWAY,land.SurfaceType.SHALLOW_WATER} -- surfaces for loading back objects.
red_ctld.nobuildmenu = false -- if set to true effectively enforces to have engineers build/repair stuff for you.
red_ctld.RadioSound = "beaconsilent.ogg" -- -- this sound will be hearable if you tune in the beacon frequency. Add the sound file to your miz.
red_ctld.RadioSoundFC3 = "beaconsilent.ogg" -- this sound will be hearable by FC3 users (actually all UHF radios); change to something like "beaconsilent.ogg" and add the sound file to your miz if you don't want to annoy FC3 pilots.
red_ctld.enableChinookGCLoading = true -- this will effectively suppress the crate load and drop for CTLD_CARGO.Enum.STATIc types for CTLD for the Chinook
red_ctld.TroopUnloadDistGround = 5 -- If hovering, spawn dropped troops this far away in meters from the helo
red_ctld.TroopUnloadDistHover = 1.5 -- If grounded, spawn dropped troops this far away in meters from the helo
red_ctld.TroopUnloadDistGroundHerc = 25 -- On the ground, unload troops this far behind the Hercules
red_ctld.TroopUnloadDistGroundHook = 15 -- On the ground, unload troops this far behind the Chinook
red_ctld.EngineerSearch = 2000 -- Search radius for engineers.
blue_ctld.useprefix = false -- (DO NOT SWITCH THIS OFF UNLESS YOU KNOW WHAT YOU ARE DOING!) Adjust **before** starting CTLD. If set to false, *all* choppers of the coalition side will be enabled for CTLD.
blue_ctld.CrateDistance = 50 -- List and Load crates in this radius only.
blue_ctld.PackDistance = 50 -- Pack crates in this radius only
blue_ctld.dropcratesanywhere = true -- Option to allow crates to be dropped anywhere.
blue_ctld.dropAsCargoCrate = false -- Parachuted herc cargo is not unpacked automatically but placed as crate to be unpacked. Needs a cargo with the same name defined like the cargo that was dropped.
blue_ctld.maximumHoverHeight = 15 -- Hover max this high to load.
blue_ctld.minimumHoverHeight = 4 -- Hover min this low to load.
blue_ctld.forcehoverload = false -- Crates (not: troops) can **only** be loaded while hovering.
blue_ctld.hoverautoloading = true -- Crates in CrateDistance in a LOAD zone will be loaded automatically if space allows.
blue_ctld.smokedistance = 10000 -- Smoke or flares can be request for zones this far away (in meters).
blue_ctld.movetroopstowpzone = true -- Troops and vehicles will move to the nearest MOVE zone...
blue_ctld.movetroopsdistance = 5000 -- .. but only if this far away (in meters)
blue_ctld.suppressmessages = false -- Set to true if you want to script your own messages.
blue_ctld.repairtime = 120 -- Number of seconds it takes to repair a unit.
blue_ctld.buildtime = 120 -- Number of seconds it takes to build a unit. Set to zero or nil to build instantly.
blue_ctld.cratecountry = country.id.GERMANY -- ID of crates. Will default to country.id.RUSSIA for RED coalition setups.
blue_ctld.allowcratepickupagain = true -- allow re-pickup crates that were dropped.
blue_ctld.enableslingload = true -- allow cargos to be slingloaded - might not work for all cargo types
blue_ctld.pilotmustopendoors = true -- force opening of doors
blue_ctld.SmokeColor = SMOKECOLOR.Blue -- default color to use when dropping smoke from heli
blue_ctld.FlareColor = FLARECOLOR.Blue -- color to use when flaring from heli
blue_ctld.basetype = "ammo_cargo" -- default shape of the cargo container
blue_ctld.droppedbeacontimeout = 600 -- dropped beacon lasts 10 minutes
blue_ctld.usesubcats = false -- use sub-category names for crates, adds an extra menu layer in "Get Crates", useful if you have > 10 crate types.
blue_ctld.placeCratesAhead = true -- place crates straight ahead of the helicopter, in a random way. If true, crates are more neatly sorted.
blue_ctld.nobuildinloadzones = true -- forbid players to build stuff in LOAD zones if set to `true`
blue_ctld.movecratesbeforebuild = false -- crates must be moved once before they can be build. Set to false for direct builds.
blue_ctld.surfacetypes = {land.SurfaceType.LAND,land.SurfaceType.ROAD,land.SurfaceType.RUNWAY,land.SurfaceType.SHALLOW_WATER} -- surfaces for loading back objects.
blue_ctld.nobuildmenu = false -- if set to true effectively enforces to have engineers build/repair stuff for you.
blue_ctld.RadioSound = "beacon.ogg" -- -- this sound will be hearable if you tune in the beacon frequency. Add the sound file to your miz.
blue_ctld.RadioSoundFC3 = "beacon.ogg" -- this sound will be hearable by FC3 users (actually all UHF radios); change to something like "beaconsilent.ogg" and add the sound file to your miz if you don't want to annoy FC3 pilots.
blue_ctld.enableChinookGCLoading = true -- this will effectively suppress the crate load and drop for CTLD_CARGO.Enum.STATIc types for CTLD for the Chinook
blue_ctld.TroopUnloadDistGround = 5 -- If hovering, spawn dropped troops this far away in meters from the helo
blue_ctld.TroopUnloadDistHover = 1.5 -- If grounded, spawn dropped troops this far away in meters from the helo
blue_ctld.TroopUnloadDistGroundHerc = 25 -- On the ground, unload troops this far behind the Hercules
blue_ctld.TroopUnloadDistGroundHook = 15 -- On the ground, unload troops this far behind the Chinook
blue_ctld.EngineerSearch = 2000 -- Search radius for engineers.
--[[]
-- Default unit type capabilities are:
["SA342Mistral"] = {type="SA342Mistral", crates=false, troops=true, cratelimit = 0, trooplimit = 4, length = 12, cargoweightlimit = 400},
["SA342L"] = {type="SA342L", crates=false, troops=true, cratelimit = 0, trooplimit = 2, length = 12, cargoweightlimit = 400},
["SA342M"] = {type="SA342M", crates=false, troops=true, cratelimit = 0, trooplimit = 4, length = 12, cargoweightlimit = 400},
["SA342Minigun"] = {type="SA342Minigun", crates=false, troops=true, cratelimit = 0, trooplimit = 2, length = 12, cargoweightlimit = 400},
["UH-1H"] = {type="UH-1H", crates=true, troops=true, cratelimit = 1, trooplimit = 8, length = 15, cargoweightlimit = 700},
["Mi-8MT"] = {type="Mi-8MT", crates=true, troops=true, cratelimit = 2, trooplimit = 12, length = 15, cargoweightlimit = 3000},
["Mi-8MTV2"] = {type="Mi-8MTV2", crates=true, troops=true, cratelimit = 2, trooplimit = 12, length = 15, cargoweightlimit = 3000},
["Ka-50"] = {type="Ka-50", crates=false, troops=false, cratelimit = 0, trooplimit = 0, length = 15, cargoweightlimit = 0},
["Mi-24P"] = {type="Mi-24P", crates=true, troops=true, cratelimit = 2, trooplimit = 8, length = 18, cargoweightlimit = 700},
["Mi-24V"] = {type="Mi-24V", crates=true, troops=true, cratelimit = 2, trooplimit = 8, length = 18, cargoweightlimit = 700},
["Hercules"] = {type="Hercules", crates=true, troops=true, cratelimit = 7, trooplimit = 64, length = 25, cargoweightlimit = 19000},
["UH-60L"] = {type="UH-60L", crates=true, troops=true, cratelimit = 2, trooplimit = 20, length = 16, cargoweightlimit = 3500},
["AH-64D_BLK_II"] = {type="AH-64D_BLK_II", crates=false, troops=true, cratelimit = 0, trooplimit = 2, length = 17, cargoweightlimit = 200},
["MH-60R"] = {type="MH-60R", crates=true, troops=true, cratelimit = 2, trooplimit = 20, length = 16, cargoweightlimit = 3500}, -- 4t cargo, 20 (unsec) seats
["SH-60B"] = {type="SH-60B", crates=true, troops=true, cratelimit = 2, trooplimit = 20, length = 16, cargoweightlimit = 3500}, -- 4t cargo, 20 (unsec) seats
["Bronco-OV-10A"] = {type="Bronco-OV-10A", crates= false, troops=true, cratelimit = 0, trooplimit = 5, length = 13, cargoweightlimit = 1450},
["Bronco-OV-10A"] = {type="Bronco-OV-10A", crates= false, troops=true, cratelimit = 0, trooplimit = 5, length = 13, cargoweightlimit = 1450},
["OH-6A"] = {type="OH-6A", crates=false, troops=true, cratelimit = 0, trooplimit = 4, length = 7, cargoweightlimit = 550},
["OH58D"] = {type="OH58D", crates=false, troops=false, cratelimit = 0, trooplimit = 0, length = 14, cargoweightlimit = 400},
["CH-47Fbl1"] = {type="CH-47Fbl1", crates=true, troops=true, cratelimit = 4, trooplimit = 31, length = 20, cargoweightlimit = 8000},
--]]
-- Start the CTLD Instances
red_ctld:Start(5)
blue_ctld:Start(5)
-- Add Anti Tank Teams
red_ctld:AddTroopsCargo("Anti-Tank Team Small (3)",{"Red-ATS"}, CTLD_CARGO.Enum.TROOPS, 3, 80)
red_ctld:AddTroopsCargo("Anti-Tank Team Medium (10)",{"Red-ATM"}, CTLD_CARGO.Enum.TROOPS, 10, 80)
blue_ctld:AddTroopsCargo("Anti-Tank Team Small (3)",{"Blue-ATS"}, CTLD_CARGO.Enum.TROOPS, 3, 80)
blue_ctld:AddTroopsCargo("Anti-Tank Team Medium (10)",{"Blue-ATM"}, CTLD_CARGO.Enum.TROOPS, 10, 80)
-- Add Mortar Teams
red_ctld:AddTroopsCargo("Mortar Team (3)",{"Red-MTS"}, CTLD_CARGO.Enum.TROOPS, 3, 80)
red_ctld:AddTroopsCargo("Mortar Team (10)",{"Red-MTM"}, CTLD_CARGO.Enum.TROOPS, 10, 80)
blue_ctld:AddTroopsCargo("Mortar Team (3)",{"Blue-MTS"}, CTLD_CARGO.Enum.TROOPS, 3, 80)
blue_ctld:AddTroopsCargo("Mortar Team (10)",{"Blue-MTM"}, CTLD_CARGO.Enum.TROOPS, 10, 80)
-- Add Anti Air Teams
red_ctld:AddTroopsCargo("Anti-Air (4)",{"Red-AA"},CTLD_CARGO.Enum.TROOPS, 4, 80, 10)
blue_ctld:AddTroopsCargo("Anti-Air(4)",{"Blue-AA"},CTLD_CARGO.Enum.TROOPS, 4, 80, 10)
-- Add Engineers
--red_ctld:AddTroopsCargo("Engineer Team (3)",{"Red-Eng"},CTLD_CARGO.Enum.ENGINEERS, 3, 80)
--blue_ctld:AddTroopsCargo("Engineer Team (3)",{"Blue-Eng"},CTLD_CARGO.Enum.ENGINEERS, 3, 80)
-- Add Ammo Trucks
red_ctld:AddCratesCargo("Ammo Truck",{"Red-Ammo"},CTLD_CARGO.Enum.VEHICLE, 2, 500, 10)
blue_ctld:AddCratesCargo("Ammo Truck",{"Blue-Ammo"},CTLD_CARGO.Enum.VEHICLE, 2, 500, 10)
-- Add JTACs
--red_ctld:AddCratesCargo("JTAC",{"Red-JTAC"},CTLD_CARGO.Enum.VEHICLE, 1, 2775, 10) -- no soup for you commie bitches!
blue_ctld:AddCratesCargo("JTAC",{"FAC GROUND"},CTLD_CARGO.Enum.VEHICLE, 1, 500, 10)
-- Add HUMVEE
-- blue_ctld:AddCratesCargo("HUMVEE",{"Blue-HUMVEE"},CTLD_CARGO.Enum.VEHICLE, 1, 500, 25)
-- Add Tanks
red_ctld:AddCratesCargo("T-90",{"Red-T90"},CTLD_CARGO.Enum.VEHICLE, 1, 8500, 25)
blue_ctld:AddCratesCargo("M1A2",{"Blue-M1A2"},CTLD_CARGO.Enum.VEHICLE, 1, 8500, 25)
-- Add FOBs
red_ctld:AddCratesCargo("Forward Ops Base",{"Red-FOB"},CTLD_CARGO.Enum.FOB, 4, 500, 3)
blue_ctld:AddCratesCargo("Forward Ops Base",{"Blue-FOB"},CTLD_CARGO.Enum.FOB, 4, 500, 3)
-- AA Crates
red_ctld:AddCratesCargo("SA-8",{"SA8"},CTLD_CARGO.Enum.CRATE, 4, 500, 10)
red_ctld:AddCratesCargo("SA-6",{"SA6"},CTLD_CARGO.Enum.CRATE, 4, 500, 10)
red_ctld:AddCratesCargo("SA-10",{"SA10"},CTLD_CARGO.Enum.CRATE, 6, 500, 10)
blue_ctld:AddCratesCargo("Linebacker",{"LINEBACKER"},CTLD_CARGO.Enum.CRATE, 2, 500, 5)
blue_ctld:AddCratesCargo("Hawk Site",{"HAWK"},CTLD_CARGO.Enum.CRATE, 4, 500, 4)
blue_ctld:AddCratesCargo("Patriot Site",{"PATRIOT"},CTLD_CARGO.Enum.CRATE, 12, 500, 4)
-- Add 6 Red Load Zones that are active but have no beacon.
red_ctld:AddCTLDZone("RedLoadZone1", CTLD.CargoZoneType.LOAD, SMOKECOLOR.Red, true, false)
red_ctld:AddCTLDZone("RedLoadZone2", CTLD.CargoZoneType.LOAD, SMOKECOLOR.Red, true, false)
red_ctld:AddCTLDZone("RedLoadZone3", CTLD.CargoZoneType.LOAD, SMOKECOLOR.Red, true, false)
red_ctld:AddCTLDZone("RedLoadZone4", CTLD.CargoZoneType.LOAD, SMOKECOLOR.Red, true, false)
red_ctld:AddCTLDZone("RedLoadZone5", CTLD.CargoZoneType.LOAD, SMOKECOLOR.Red, true, false)
red_ctld:AddCTLDZone("RedLoadZone6", CTLD.CargoZoneType.LOAD, SMOKECOLOR.Red, true, false)
-- Add 6 Blue Load Zones that are active but have no beacon.
blue_ctld:AddCTLDZone("BlueLoadZone1", CTLD.CargoZoneType.LOAD, SMOKECOLOR.Blue, true, false)
blue_ctld:AddCTLDZone("BlueLoadZone2", CTLD.CargoZoneType.LOAD, SMOKECOLOR.Blue, true, false)
blue_ctld:AddCTLDZone("BlueLoadZone3", CTLD.CargoZoneType.LOAD, SMOKECOLOR.Blue, true, false)
blue_ctld:AddCTLDZone("BlueLoadZone4", CTLD.CargoZoneType.LOAD, SMOKECOLOR.Blue, true, false)
blue_ctld:AddCTLDZone("BlueLoadZone5", CTLD.CargoZoneType.LOAD, SMOKECOLOR.Blue, true, false)
blue_ctld:AddCTLDZone("BlueLoadZone6", CTLD.CargoZoneType.LOAD, SMOKECOLOR.Blue, true, false)
blue_ctld:AddCTLDZone("BlueLoadZone7", CTLD.CargoZoneType.LOAD, SMOKECOLOR.Blue, true, false)
blue_ctld:AddCTLDZone("BlueLoadZone8", CTLD.CargoZoneType.LOAD, SMOKECOLOR.Blue, true, false)
blue_ctld:AddCTLDZone("BlueLoadZone9", CTLD.CargoZoneType.LOAD, SMOKECOLOR.Blue, true, false)
blue_ctld:AddCTLDZone("BlueLoadZone10", CTLD.CargoZoneType.LOAD, SMOKECOLOR.Blue, true, false)
------------------------------------------------------------------------------------------------------------------------------------------------------------------
-- DO NOT EDIT BELOW THIS LINE
------------------------------------------------------------------------------------------------------------------------------------------------------------------
function blue_ctld:OnAfterTroopsDeployed(From,Event,To,Group,Unit,Troops)
if Unit then
local PlayerName = Unit:GetPlayerName()
local vname = Troops:GetName()
local points = pointsAwardedTroopsDeployed
MESSAGE:New("Pilot " .. PlayerName .. " has deployed " .. vname .. " to the field!", msgTime, "[ Mission Info ]", false):ToBlue()
USERSOUND:New("combatAudio5.ogg"):ToCoalition(coalition.side.BLUE)
US_Score:_AddPlayerFromUnit( Unit )
US_Score:AddGoalScore(Unit, "CTLD", string.format("Pilot %s has been awarded %d points for deploying troops!", PlayerName, points), points)
end
end
function blue_ctld:OnAfterTroopsExtracted(From,Event,To,Group,Unit,Cargo)
if Unit then
local PlayerName = Unit:GetPlayerName()
local vname = Cargo:GetName()
local points = pointsAwardedTroopsExtracted
MESSAGE:New("Pilot " .. PlayerName .. " has extracted " .. vname .. " from the field!", msgTime, "[ Mission Info ]", false):ToBlue()
USERSOUND:New("getToTheChoppa.ogg"):ToCoalition(coalition.side.BLUE)
US_Score:_AddPlayerFromUnit( Unit )
US_Score:AddGoalScore(Unit, "CTLD", string.format("Pilot %s has been awarded %d points for extracting troops!", PlayerName, points), points)
end
end
function blue_ctld:OnAfterTroopsPickedUp(From,Event,To,Group,Unit,Cargo)
if Unit then
local PlayerName = Unit:GetPlayerName()
local vname = Cargo:GetName()
local points = pointsAwardedTroopsPickedup
MESSAGE:New("Pilot " .. PlayerName .. " has picked up " .. vname .. " from a supply base!", msgTime, "[ Mission Info ]", false):ToBlue()
USERSOUND:New("JoinTheArmy.ogg"):ToCoalition(coalition.side.BLUE)
US_Score:_AddPlayerFromUnit( Unit )
US_Score:AddGoalScore(Unit, "CTLD", string.format("Pilot %s has been awarded %d points for picking up troops!", PlayerName, points), points)
end
end
function blue_ctld:OnAfterTroopsRTB(From,Event,To,Group,Unit)
if Unit then
local PlayerName = Unit:GetPlayerName()
local points = pointsAwardedTroopsRTB
MESSAGE:New("Pilot " .. PlayerName .. " returned troops to home base!", msgTime, "[ Mission Info ]", false):ToBlue()
USERSOUND:New("cheering.ogg"):ToCoalition(coalition.side.BLUE)
US_Score:_AddPlayerFromUnit( Unit )
US_Score:AddGoalScore(Unit, "CTLD", string.format("Pilot %s has been awarded %d points for returning troops!", PlayerName, points), points)
end
end
-- Scoring and messaging
function blue_ctld:OnAfterCratesDropped(From, Event, To, Group, Unit, Cargotable)
if Unit then
local points = pointsAwardedCrateDropped
local PlayerName = Unit:GetPlayerName()
US_Score:_AddPlayerFromUnit( Unit )
US_Score:AddGoalScore(Unit, "CTLD", string.format("Pilot %s has been awarded %d points for transporting cargo crates!", PlayerName, points), points)
end
end
function blue_ctld:OnAfterCratesBuild(From, Event, To, Group, Unit, Vehicle)
if Unit then
local points = pointsAwardedCrateBuilt
local PlayerName = Unit:GetPlayerName()
local vname = Vehicle:GetName()
USERSOUND:New("construction.ogg"):ToCoalition(coalition.side.BLUE)
MESSAGE:New("Pilot " .. PlayerName .. " has deployed " .. vname .. " to the field!", msgTime, "[ Mission Info ]", false):ToBlue()
US_Score:_AddPlayerFromUnit(Unit)
US_Score:AddGoalScore(Unit, "CTLD", string.format("Pilot %s has been awarded %d points for the construction of Units!", PlayerName, points), points)
-- Debugging information
env.info("DEBUG: OnAfterCratesBuild called for Unit: " .. PlayerName .. ", Vehicle: " .. vname)
-- Is this a FOB being built? If so add a Load Zone around the deployed crate.
env.info("CRATEBUILD: Is this a fob?: " .. vname, false)
if string.match(vname, "FOB", 1, true) then
env.info("CRATEBUILD: Yes, this is a FOB, building: " .. vname, false)
local Coord = Vehicle:GetCoordinate():GetVec2()
local mCoord = Vehicle:GetCoordinate()
local zonename = "FOB-" .. math.random(1, 10000)
local fobzone = ZONE_RADIUS:New(zonename, Coord, 1000)
local fobmarker = MARKER:New(mCoord, "FORWARD OPERATING BASE:\nBUILT BY: " .. PlayerName .. "\n\nTransport Helos may pick up troops and equipment from this location."):ReadOnly():ToCoalition(coalition.side.BLUE)
fobzone:DrawZone(2, {.25, .63, .79}, 1, {0, 0, 0}, 0.25, 2, true)
blue_ctld:AddCTLDZone(zonename, CTLD.CargoZoneType.LOAD, SMOKECOLOR.Blue, true, true)
MESSAGE:New("Pilot " .. PlayerName .. " has created a new loading zone for troops and equipment! See your F10 Map for marker!", msgTime, "[ Mission Info ]", false):ToBlue()
else
env.info("CRATEBUILD: No! Not a FOB: " .. vname, false)
end
end
end
function blue_ctld:OnBeforeCratesRepaired(From, Event, To, Group, Unit, Vehicle)
if Unit then
local points = pointsAwardedCrateRepair
local GroupCategory = Group:GetCategoryName()
local PlayerName = Unit:GetPlayerName()
MESSAGE:New("Pilot " .. PlayerName .. " has started repairs on " .. GroupCategory .. "! Nice Job!", msgTime, "[ Mission Info ]", false):ToBlue()
end
end
function blue_ctld:OnAfterCratesRepaired(From, Event, To, Group, Unit, Vehicle)
if Unit then
local points = pointsAwardedCrateRepair
local PlayerName = Unit:GetPlayerName()
USERSOUND:New("repair.ogg"):ToCoalition(coalition.side.BLUE)
MESSAGE:New("Pilot " .. PlayerName .. " has conducted repears on " .. Vehicle "! Nice Job!", msgTime, "[ Mission Info ]", false):ToRed()
US_Score:_AddPlayerFromUnit( Unit )
US_Score:AddGoalScore(Unit, "CTLD", string.format("Pilot %s has been awarded %d points for the repair of Units!", PlayerName, points), points)
end
end
------------------------------------------------------------------------------------------------------------------------------------------------------------
-- Red CTLD Functions
------------------------------------------------------------------------------------------------------------------------------------------------------------
function red_ctld:OnAfterTroopsDeployed(From,Event,To,Group,Unit,Troops)
if Unit then
local PlayerName = Unit:GetPlayerName()
local vname = Troops:GetName()
local points = pointsAwardedTroopsDeployed
MESSAGE:New("Pilot " .. PlayerName .. " has deployed " .. vname .. " to the field!", msgTime, "[ Mission Info ]", false):ToRed()
USERSOUND:New("combatAudio5.ogg"):ToCoalition(coalition.side.RED)
US_Score:_AddPlayerFromUnit( Unit )
US_Score:AddGoalScore(Unit, "CTLD", string.format("Pilot %s has been awarded %d points for deploying troops!", PlayerName, points), points)
end
end
function red_ctld:OnAfterTroopsExtracted(From,Event,To,Group,Unit,Cargo)
if Unit then
local PlayerName = Unit:GetPlayerName()
local vname = Cargo:GetName()
local points = pointsAwardedTroopsExtracted
MESSAGE:New("Pilot " .. PlayerName .. " has extracted " .. vname .. " from the field!", msgTime, "[ Mission Info ]", false):ToRed()
USERSOUND:New("getToTheChoppa.ogg"):ToCoalition(coalition.side.RED)
US_Score:_AddPlayerFromUnit( Unit )
US_Score:AddGoalScore(Unit, "CTLD", string.format("Pilot %s has been awarded %d points for extracting troops!", PlayerName, points), points)
end
end
function red_ctld:OnAfterTroopsPickedUp(From,Event,To,Group,Unit,Cargo)
if Unit then
local PlayerName = Unit:GetPlayerName()
local vname = Cargo:GetName()
local points = pointsAwardedTroopsPickedup
MESSAGE:New("Pilot " .. PlayerName .. " has picked up " .. vname .. " from a supply base!", msgTime, "[ Mission Info ]", false):ToRed()
USERSOUND:New("JoinTheArmy.ogg"):ToCoalition(coalition.side.RED)
US_Score:_AddPlayerFromUnit( Unit )
US_Score:AddGoalScore(Unit, "CTLD", string.format("Pilot %s has been awarded %d points for picking up troops!", PlayerName, points), points)
end
end
function red_ctld:OnAfterTroopsRTB(From,Event,To,Group,Unit)
if Unit then
local PlayerName = Unit:GetPlayerName()
local points = pointsAwardedTroopsRTB
MESSAGE:New("Pilot " .. PlayerName .. " returned troops to home base!", msgTime, "[ Mission Info ]", false):ToRed()
USERSOUND:New("cheering.ogg"):ToCoalition(coalition.side.RED)
US_Score:_AddPlayerFromUnit( Unit )
US_Score:AddGoalScore(Unit, "CTLD", string.format("Pilot %s has been awarded %d points for returning troops!", PlayerName, points), points)
end
end
-- Scoring and messaging
function red_ctld:OnAfterCratesDropped(From, Event, To, Group, Unit, Cargotable)
if Unit then
local points = pointsAwardedCrateDropped
local PlayerName = Unit:GetPlayerName()
US_Score:_AddPlayerFromUnit( Unit )
US_Score:AddGoalScore(Unit, "CTLD", string.format("Pilot %s has been awarded %d points for transporting cargo crates!", PlayerName, points), points)
end
end
function red_ctld:OnAfterCratesBuild(From, Event, To, Group, Unit, Vehicle)
if Unit then
local points = pointsAwardedCrateBuilt
local PlayerName = Unit:GetPlayerName()
local vname = Vehicle:GetName()
USERSOUND:New("construction.ogg"):ToCoalition(coalition.side.RED)
MESSAGE:New("Pilot " .. PlayerName .. " has deployed " .. vname .. " to the field!", msgTime, "[ Mission Info ]", false):ToRed()
US_Score:_AddPlayerFromUnit( Unit )
US_Score:AddGoalScore(Unit, "CTLD", string.format("Pilot %s has been awarded %d points for the construction of Units!", PlayerName, points), points)
-- Debugging information
env.info("DEBUG: OnAfterCratesBuild called for Unit: " .. PlayerName .. ", Vehicle: " .. vname)
-- Is this a FOB being built? If so add a Load Zone around the deployed crate.
env.info("CRATEBUILD: Is this a fob?: " .. vname,false)
if string.match(vname,"FOB",1,true) then
env.info("CRATEBUILD: Yes, this is a FOB, building: " .. vname,false)
local Coord = Vehicle:GetCoordinate():GetVec2()
local mCoord = Vehicle:GetCoordinate()
local zonename = "FOB-" .. math.random(1,10000)
local fobzone = ZONE_RADIUS:New(zonename,Coord,1000)
local fobmarker = MARKER:New(mCoord, "FORWARD OPERATING BASE:\nBUILT BY: " .. PlayerName .. "\n\nTransport Helos may pick up troops and equipment from this location."):ReadOnly():ToCoalition(coalition.side.RED)
fobzone:DrawZone(2,{.25,.63,.79},1,{0,0,0},0.25,2,true)
red_ctld:AddCTLDZone(zonename,CTLD.CargoZoneType.LOAD,SMOKECOLOR.Red,true,true)
MESSAGE:New("Pilot " .. PlayerName .. " has created a new loading zone for troops and equipment! See your F10 Map for marker!", msgTime, "[ Mission Info ]", false):ToRed()
else
env.info("CRATEBUILD: No! Not a FOB: " .. vname,false)
end
end
end
function red_ctld:OnBeforeCratesRepaired(From, Event, To, Group, Unit, Vehicle)
if Unit then
local points = pointsAwardedCrateRepair
local GroupCategory = Group:GetCategoryName()
local PlayerName = Unit:GetPlayerName()
MESSAGE:New("Pilot " .. PlayerName .. " has started repairs on " .. GroupCategory .. "! Nice Job!", msgTime, "[ Mission Info ]", false):ToRed()
end
end
function red_ctld:OnAfterCratesRepaired(From, Event, To, Group, Unit, Vehicle)
if Unit then
local points = pointsAwardedCrateRepair
local PlayerName = Unit:GetPlayerName()
USERSOUND:New("repair.ogg"):ToCoalition(coalition.side.RED)
MESSAGE:New("Pilot " .. PlayerName .. " has conducted repears on " .. Vehicle "! Nice Job!", msgTime, "[ Mission Info ]", false):ToRed()
US_Score:_AddPlayerFromUnit( Unit )
US_Score:AddGoalScore(Unit, "CTLD", string.format("Pilot %s has been awarded %d points for the repair of Units!", PlayerName, points), points)
end
end

View File

@ -0,0 +1,20 @@
-- Define the drone using the MOOSE SPAWN class
Blue_Drone = SPAWN:New("FAC DRONE")
:InitLimit(1, 99)
:InitRepeatOnLanding()
:SpawnScheduled(1, 0.5)
-- Define FAC Set
BlueFACSet = SET_GROUP:New():FilterPrefixes("FAC"):FilterStart()
BlueDetectionSet = DETECTION_AREAS:New(BlueFACSet, 5000)
BlueAttackSet = SET_GROUP:New():FilterCoalitions("blue"):FilterStart()
BlueDesignator = DESIGNATE:New(US_CC, BlueDetectionSet, BlueAttackSet)
BlueDesignator:SetAutoLase(false)
BlueDesignator:SetThreatLevelPrioritization(true)
BlueDesignator:GenerateLaserCodes(true)

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,145 @@
--Ops - Office of Military Intelligence.
--
--Main Features:
---Detect and track contacts consistently
---Detect and track clusters of contacts consistently
---Once detected and still alive, planes will be tracked 10 minutes, helicopters 20 minutes, ships and trains 1 hour, ground units 2 hours
-- Docs: https://flightcontrol-master.github.io/MOOSE_DOCS_DEVELOP/Documentation/Ops.Intel.html
-- Setup Detection Group
local msgTime = 6
Blue_Intel_Message_Setting = false
Blue_Intel_Sound_Setting = false
Blue_Intel_DetectionGroup = SET_GROUP:New()
Blue_Intel_DetectionGroup:FilterCoalitions("blue"):FilterActive(true):FilterStart()
-- Setup the INTEL
Blue_Intel = INTEL:New(Blue_Intel_DetectionGroup, "blue", "CIA")
Blue_Intel:SetClusterAnalysis(true, true)
Blue_Intel:SetClusterRadius(5)
Blue_Intel:SetVerbosity(2)
Blue_Intel:__Start(10)
-- On After New Contact
function Blue_Intel:OnAfterNewContact(From, Event, To, Contact)
local text = string.format("NEW contact %s detected by %s", Contact.groupname, Contact.recce or "unknown")
if (Blue_Intel_Message_Setting == true) then
MESSAGE:New(text, msgTime, "CIA"):ToBlue()
if (Blue_Intel_Sound_Setting == true) then
USERSOUND:New("morsecode.ogg"):ToCoalition(coalition.side.BLUE)
end
end
end
-- On After New Cluster
function Blue_Intel:OnAfterNewCluster(From, Event, To, Cluster)
local text = string.format("NEW cluster #%d of size %d", Cluster.index, Cluster.size)
if (Blue_Intel_Message_Setting == true) then
MESSAGE:New(text, msgTime,"CIA"):ToBlue()
if (Blue_Intel_Sound_Setting == true) then
USERSOUND:New("morsecode.ogg"):ToCoalition(coalition.side.BLUE)
end
end
end
function Blue_IntelMessageSettingOn()
if (Blue_Intel_Message_Setting == true) then
MESSAGE:New("Setting INTEL messages to ON", msgTime,"CIA"):ToBlue()
Blue_Intel_Message_Setting = true
end
end
function Blue_IntelMessageSettingOff()
if (Blue_Intel_Message_Setting == true) then
MESSAGE:New("Setting INTEL messages to OFF", msgTime,"CIA"):ToBlue()
Blue_Intel_Message_Setting = false
end
end
function Blue_IntelSoundSettingOff()
MESSAGE:New("Disabling morse code sound", msgTime, "CIA"):ToBlue()
Blue_Intel_Sound_Setting = false
end
function Blue_IntelSoundSettingOn()
MESSAGE:New("Enabling morse code sound", msgTime, "CIA"):ToBlue()
Blue_Intel_Sound_Setting = true
end
local INTELMenu = MENU_COALITION:New(coalition.side.BLUE,"INTEL HQ", missionMenu)
MENU_COALITION_COMMAND:New(coalition.side.BLUE, "Display Messages (ON)", INTELMenu, Blue_IntelMessageSettingOn)
MENU_COALITION_COMMAND:New(coalition.side.BLUE, "Display Messages (OFF)", INTELMenu, Blue_IntelMessageSettingOff)
MENU_COALITION_COMMAND:New(coalition.side.BLUE, "Disable Morse Code Sound", INTELMenu, Blue_IntelSoundSettingOff)
MENU_COALITION_COMMAND:New(coalition.side.BLUE, "Enable Morse Code Sound", INTELMenu, Blue_IntelSoundSettingOn)
Red_Intel_Message_Setting = false
Red_Intel_Sound_Setting = true
Red_Intel_DetectionGroup = SET_GROUP:New()
--Red_Intel_DetectionGroup:FilterPrefixes( { "RED EWR", "RED RECON" } )
Red_Intel_DetectionGroup:FilterCoalitions("red"):FilterActive(true):FilterStart()
-- Setup the INTEL
Red_Intel = INTEL:New(Red_Intel_DetectionGroup, "red", "KGB")
Red_Intel:SetClusterAnalysis(true, true)
Red_Intel:SetClusterRadius(5)
Red_Intel:SetVerbosity(2)
Red_Intel:__Start(10)
-- On After New Contact
function Red_Intel:OnAfterNewContact(From, Event, To, Contact)
local text = string.format("NEW contact %s detected by %s", Contact.groupname, Contact.recce or "unknown")
if (Red_Intel_Message_Setting == true) then
MESSAGE:New(text, msgTime, "KGB"):ToRed()
USERSOUND:New("morsecode.ogg"):ToCoalition(coalition.side.RED)
end
end
-- On After New Cluster
function Red_Intel:OnAfterNewCluster(From, Event, To, Cluster)
local text = string.format("NEW cluster #%d of size %d", Cluster.index, Cluster.size)
if (Red_Intel_Message_Setting == true) then
MESSAGE:New(text, msgTime,"KGB"):ToRed()
USERSOUND:New("morsecode.ogg"):ToCoalition(coalition.side.RED)
end
end
function Red_IntelMessageSettingOn()
if (Red_Intel_Message_Setting == true) then
MESSAGE:New("Setting INTEL messages to ON", msgTime,"KGB"):ToRed()
USERSOUND:New("morsecode.ogg"):ToCoalition(coalition.side.RED)
Red_Intel_Message_Setting = true
end
end
function Red_IntelMessageSettingOff()
if (Red_Intel_Message_Setting == true) then
MESSAGE:New("Setting INTEL messages to OFF", msgTime,"KGB"):ToRed()
Red_Intel_Message_Setting = false
end
end
function Red_IntelSoundSettingOff()
MESSAGE:New("Disabling morse code sound", msgTime, "KGB"):ToRed()
Red_Intel_Sound_Setting = false
end
function Red_IntelSoundSettingOn()
MESSAGE:New("Enabling morse code sound", msgTime, "KGB"):ToRed()
Red_Intel_Sound_Setting = true
end
-- Create the "INTEL HQ" submenu under "Tanker & Other Settings"
local RedINTELMenu = MENU_COALITION:New(coalition.side.RED, "INTEL HQ", missionMenu)
-- Add menu items to the "INTEL HQ" submenu
MENU_COALITION_COMMAND:New(coalition.side.RED, "Display Messages (ON)", RedINTELMenu, Red_IntelMessageSettingOn)
MENU_COALITION_COMMAND:New(coalition.side.RED, "Display Messages (OFF)", RedINTELMenu, Red_IntelMessageSettingOff)
MENU_COALITION_COMMAND:New(coalition.side.RED, "Disable Morse Code Sound", RedINTELMenu, Red_IntelSoundSettingOff)
MENU_COALITION_COMMAND:New(coalition.side.RED, "Enable Morse Code Sound", RedINTELMenu, Red_IntelSoundSettingOn)

Binary file not shown.