Updated Insurgentsandtorm

This commit is contained in:
iTracerFacer 2024-11-16 13:07:56 -06:00
parent 9ce92421e6
commit a14979ed2d
25 changed files with 1611 additions and 135 deletions

0
.metadata/.lock Normal file
View File

View File

@ -0,0 +1,2 @@
eclipse.preferences.version=1
version=1

View File

@ -0,0 +1,2 @@
eclipse.preferences.version=1
org.eclipse.debug.ui.PREF_LAUNCH_PERSPECTIVES=<?xml version\="1.0" encoding\="UTF-8" standalone\="no"?>\r\n<launchPerspectives/>\r\n

View File

@ -0,0 +1,5 @@
eclipse.preferences.version=1
sourceHoverBackgroundColor=255,255,225
sourceHoverBackgroundColor.SystemDefault=true
useAnnotationsPrefPage=true
useQuickDiffPrefPage=true

View File

@ -0,0 +1,5 @@
PROBLEMS_FILTERS_MIGRATE=true
eclipse.preferences.version=1
platformState=1645898269583
quickStart=false
tipsAndTricks=true

View File

@ -0,0 +1,2 @@
eclipse.preferences.version=1
showIntro=false

View File

@ -0,0 +1,2 @@
//org.eclipse.ui.commands/state/org.eclipse.ui.navigator.resources.nested.changeProjectPresentation/org.eclipse.ui.commands.radioState=false
eclipse.preferences.version=1

View File

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<section name="Workbench">
<section name="org.eclipse.dltk.internal.ui.scriptview.ScriptExplorerPart">
<item value="1" key="layout"/>
<item value="true" key="group_libraries"/>
<item value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;&#x0D;&#x0A;&lt;scriptExplorer group_libraries=&quot;1&quot; isWindowWorkingSet=&quot;false&quot; layout=&quot;1&quot; linkWithEditor=&quot;0&quot; rootMode=&quot;1&quot; workingSetName=&quot;&quot;&gt;&#x0D;&#x0A;&lt;customFilters userDefinedPatternsEnabled=&quot;false&quot;&gt;&#x0D;&#x0A;&lt;xmlDefinedFilters&gt;&#x0D;&#x0A;&lt;child filterId=&quot;org.eclipse.dltk.ui.ScriptExplorer.NonScriptProjectsFilter&quot; isEnabled=&quot;false&quot;/&gt;&#x0D;&#x0A;&lt;child filterId=&quot;org.eclipse.dltk.internal.ui.PackageExplorer.EmptyInnerPackageFilter&quot; isEnabled=&quot;true&quot;/&gt;&#x0D;&#x0A;&lt;child filterId=&quot;org.eclipse.dltk.internal.ui.PackageExplorer.DotFilesFilter&quot; isEnabled=&quot;true&quot;/&gt;&#x0D;&#x0A;&lt;child filterId=&quot;org.eclipse.dltk.ui.ScriptExplorer.PackageDeclarationFilter&quot; isEnabled=&quot;true&quot;/&gt;&#x0D;&#x0A;&lt;child filterId=&quot;org.eclipse.dltk.internal.ui.PackageExplorer.EmptyPackageFilter&quot; isEnabled=&quot;false&quot;/&gt;&#x0D;&#x0A;&lt;child filterId=&quot;org.eclipse.dltk.ui.ScriptExplorer.NonScriptElementFilter&quot; isEnabled=&quot;false&quot;/&gt;&#x0D;&#x0A;&lt;child filterId=&quot;org.eclipse.dltk.internal.ui.PackageExplorer.ContainMembersFilter&quot; isEnabled=&quot;false&quot;/&gt;&#x0D;&#x0A;&lt;child filterId=&quot;org.eclipse.dltk.ui.ScriptExplorer.SyntheticMembersFilter&quot; isEnabled=&quot;true&quot;/&gt;&#x0D;&#x0A;&lt;child filterId=&quot;org.eclipse.dltk.ui.ScriptExplorer.FieldsFilter&quot; isEnabled=&quot;false&quot;/&gt;&#x0D;&#x0A;&lt;child filterId=&quot;org.eclipse.dltk.ui.ScriptExplorer.ClosedProjectsFilter&quot; isEnabled=&quot;false&quot;/&gt;&#x0D;&#x0A;&lt;child filterId=&quot;org.eclipse.dltk.ui.ScriptExplorer.SMFileFilter&quot; isEnabled=&quot;false&quot;/&gt;&#x0D;&#x0A;&lt;child filterId=&quot;org.eclipse.dltk.ui.ScriptExplorer.ImportDeclarationFilter&quot; isEnabled=&quot;true&quot;/&gt;&#x0D;&#x0A;&lt;child filterId=&quot;org.eclipse.dltk.ui.ScriptExplorer.NonSharedProjectsFilter&quot; isEnabled=&quot;false&quot;/&gt;&#x0D;&#x0A;&lt;child filterId=&quot;org.eclipse.dltk.ui.ScriptExplorer.LibraryFilter&quot; isEnabled=&quot;false&quot;/&gt;&#x0D;&#x0A;&lt;child filterId=&quot;org.eclipse.dltk.ui.ScriptExplorer.ContainedLibraryFilter&quot; isEnabled=&quot;false&quot;/&gt;&#x0D;&#x0A;&lt;/xmlDefinedFilters&gt;&#x0D;&#x0A;&lt;/customFilters&gt;&#x0D;&#x0A;&lt;/scriptExplorer&gt;" key="memento"/>
<item value="1" key="rootMode"/>
<item value="false" key="linkWithEditor"/>
</section>
</section>

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,3 @@
<?xml version="1.0" encoding="UTF-8"?>
<section name="Workbench">
</section>

View File

@ -0,0 +1,15 @@
<?xml version="1.0" encoding="UTF-8"?>
<section name="Workbench">
<section name="org.eclipse.ui.internal.QuickAccess">
<item value="-1" key="dialogHeight"/>
<item value="-1" key="dialogWidth"/>
<list key="textEntries">
</list>
<list key="orderedElements">
</list>
<list key="orderedProviders">
</list>
<list key="textArray">
</list>
</section>
</section>

View File

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<workingSetManager>
<workingSet aggregate="true" factoryID="org.eclipse.ui.internal.WorkingSetFactory" id="1731777082128_0" label="Window Working Set" name="Aggregate for window 1731777082127"/>
</workingSetManager>

3
.metadata/version.ini Normal file
View File

@ -0,0 +1,3 @@
#Sat Nov 16 11:11:18 CST 2024
org.eclipse.core.runtime=2
org.eclipse.platform=4.8.0.v20180308-0630

View File

@ -25,7 +25,7 @@ red_ctld.hoverautoloading = true -- Crates in CrateDistance in a LOAD zone will
red_ctld.smokedistance = 10000 -- Smoke or flares can be request for zones this far away (in meters). 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.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.movetroopsdistance = 5000 -- .. but only if this far away (in meters)
red_ctld.suppressmessages = true -- Set to true if you want to script your own messages. 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.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.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.cratecountry = country.id.GERMANY -- ID of crates. Will default to country.id.RUSSIA for RED coalition setups.
@ -63,7 +63,7 @@ blue_ctld.hoverautoloading = true -- Crates in CrateDistance in a LOAD zone will
blue_ctld.smokedistance = 10000 -- Smoke or flares can be request for zones this far away (in meters). 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.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.movetroopsdistance = 5000 -- .. but only if this far away (in meters)
blue_ctld.suppressmessages = true -- Set to true if you want to script your own messages. blue_ctld.suppressmessages = false -- Set to true if you want to script your own messages.
blue_ctld.repairtime = 300 -- Number of seconds it takes to repair a unit. blue_ctld.repairtime = 300 -- Number of seconds it takes to repair a unit.
blue_ctld.buildtime = 300 -- Number of seconds it takes to build a unit. Set to zero or nil to build instantly. blue_ctld.buildtime = 300 -- 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.cratecountry = country.id.GERMANY -- ID of crates. Will default to country.id.RUSSIA for RED coalition setups.
@ -114,8 +114,8 @@ blue_ctld.EngineerSearch = 2000 -- Search radius for engineers.
--]] --]]
-- Custom Capabilities -- Custom Capabilities
blue_ctld:SetUnitCapabilities("UH-1H", true, true, 1, 10, 15, 4000) blue_ctld:SetUnitCapabilities("UH-1H", true, true, 1, 10, 15, 6000)
red_ctld:SetUnitCapabilities("UH-1H", true, true, 1, 10, 15, 4000) red_ctld:SetUnitCapabilities("UH-1H", true, true, 1, 10, 15, 6000)

View File

@ -1,6 +1,7 @@
local TAC_DISPLAY = true -- Set to false to disable Tacview display for AI flights (default = false)
--Build Command Center and Mission for Blue --Build Command Center and Mission for Blue
US_CC = COMMANDCENTER:New( GROUP:FindByName( "BLUEHQ" ), "USA HQ" ) US_CC = COMMANDCENTER:New( GROUP:FindByName( "BLUEHQ" ), "USA HQ" )
US_Mission = MISSION:New( US_CC, "Insurgent Sandstorm", "Primary", "Clear the front lines of enemy activity.", coalition.side.BLUE) US_Mission = MISSION:New( US_CC, "Insurgent Sandstorm", "Primary", "Clear the front lines of enemy activity.", coalition.side.BLUE)
US_Score = SCORING:New( "Insurgent Sandstorm - Blue" ) US_Score = SCORING:New( "Insurgent Sandstorm - Blue" )
@ -22,8 +23,8 @@ RU_Score:SetMessagesScore(false)
-- How many red/blue aircraft are in the air by default. -- How many red/blue aircraft are in the air by default.
local RedA2ADefaultOverhead = 2 local RedA2ADefaultOverhead = 1.5
local BlueA2ADefaultOverhead = 2 local BlueA2ADefaultOverhead = 1
PlayerClients = SET_PLAYER:New():FilterStart() PlayerClients = SET_PLAYER:New():FilterStart()
@ -92,37 +93,28 @@ local RED_AA_ZONES = {
} }
--[[]
-- Schedule RED AA spawns using the calculated frequencies -- Schedule RED AA spawns using the calculated frequencies
RED_SA08 = SPAWN:New("SA08") RED_SA08 = SPAWN:New("RED EWR SA08")
:InitRandomizeZones(RED_AA_ZONES) :InitRandomizeZones(RED_AA_ZONES)
:InitLimit(5, 5) :InitLimit(5, 5)
:SpawnScheduled(1, 0.5) :SpawnScheduled(1, 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. -- 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-AA-SA10-1") RED_SA10 = SPAWN:New("RED EWR AA-SA10-1")
:InitRandomizeZones(RED_AA_ZONES) :InitRandomizeZones(RED_AA_ZONES)
:InitLimit(60, 60) :InitLimit(60, 60)
:SpawnScheduled(1, 0.5) :SpawnScheduled(1, 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 -- 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-AA-SA112-1") RED_SA11 = SPAWN:New("RED EWR AA SA112-1")
:InitRandomizeZones(RED_AA_ZONES) :InitRandomizeZones(RED_AA_ZONES)
:InitLimit(48, 48) :InitLimit(48, 48)
:SpawnScheduled(1, 0.5) :SpawnScheduled(1, 0.5)
-- Setup AI A2A Dispatchers -- Setup AI A2A Dispatchers
--Red --Red
--]]
CCCPBorderZone = ZONE_POLYGON:New( "RED BORDER", GROUP:FindByName( "RED BORDER" ) )
RedA2ADispatcher = AI_A2A_GCICAP:New( { "RED EWR" }, { "FIGHTER SWEEP RED" }, { "RED BORDER" }, CCCPBorderZone )
RedA2ADispatcher:SetDefaultLandingAtEngineShutdown()
RedA2ADispatcher:SetDefaultTakeoffFromParkingHot()
RedA2ADispatcher:SetBorderZone( CCCPBorderZone )
RedA2ADispatcher:SetTacticalDisplay(false)
RedA2ADispatcher:SetDefaultFuelThreshold( 0.20 )
RedA2ADispatcher:SetRefreshTimeInterval( 300 )
RedA2ADispatcher:SetDefaultOverhead(RedA2ADefaultOverhead)
--Blue --Blue
BLUEBorderZone = ZONE_POLYGON:New( "BLUE BORDER", GROUP:FindByName( "BLUE BORDER" ) ) BLUEBorderZone = ZONE_POLYGON:New( "BLUE BORDER", GROUP:FindByName( "BLUE BORDER" ) )
@ -130,33 +122,47 @@ BLUEA2ADispatcher = AI_A2A_GCICAP:New( { "BLUE EWR" }, { "FIGHTER SWEEP BLUE" },
BLUEA2ADispatcher:SetDefaultLandingAtEngineShutdown() BLUEA2ADispatcher:SetDefaultLandingAtEngineShutdown()
BLUEA2ADispatcher:SetDefaultTakeoffFromParkingHot() BLUEA2ADispatcher:SetDefaultTakeoffFromParkingHot()
BLUEA2ADispatcher:SetBorderZone( BLUEBorderZone ) BLUEA2ADispatcher:SetBorderZone( BLUEBorderZone )
BLUEA2ADispatcher:SetTacticalDisplay(false) BLUEA2ADispatcher:SetTacticalDisplay(TAC_DISPLAY)
BLUEA2ADispatcher:SetDefaultFuelThreshold( 0.20 ) BLUEA2ADispatcher:SetDefaultFuelThreshold( 0.20 )
BLUEA2ADispatcher:SetRefreshTimeInterval( 300 ) BLUEA2ADispatcher:SetRefreshTimeInterval( 300 )
BLUEA2ADispatcher:SetDefaultOverhead(BlueA2ADefaultOverhead) BLUEA2ADispatcher:SetDefaultOverhead(BlueA2ADefaultOverhead)
--Red CCCPBorderZone = ZONE_POLYGON:New( "RED BORDER", GROUP:FindByName( "RED BORDER" ) )
DwyerBorderZone = ZONE_POLYGON:New( "DwyerBorderZone", GROUP:FindByName( "DwyerBorderZone" ) ) RedA2ADispatcher = AI_A2A_GCICAP:New( { "RED EWR" }, { "FIGHTER SWEEP RED" }, { "RED BORDER" }, CCCPBorderZone )
DwyerBorderZone = AI_A2A_GCICAP:New( { "RED EWR" }, { "DwyerBorderCAP" }, { "DwyerBorderZone" }, DwyerBorderZone ) RedA2ADispatcher:SetDefaultLandingAtEngineShutdown()
DwyerBorderZone:SetDefaultLandingAtEngineShutdown() RedA2ADispatcher:SetDefaultTakeoffFromParkingHot()
DwyerBorderZone:SetDefaultTakeoffFromParkingHot() RedA2ADispatcher:SetBorderZone( CCCPBorderZone )
DwyerBorderZone:SetBorderZone( BLUEBorderZone ) RedA2ADispatcher:SetTacticalDisplay(TAC_DISPLAY)
DwyerBorderZone:SetTacticalDisplay(false) RedA2ADispatcher:SetDefaultFuelThreshold( 0.20 )
DwyerBorderZone:SetDefaultFuelThreshold( 0.20 ) RedA2ADispatcher:SetRefreshTimeInterval( 300 )
DwyerBorderZone:SetRefreshTimeInterval( 300 ) RedA2ADispatcher:SetDefaultOverhead(RedA2ADefaultOverhead)
DwyerBorderZone:SetDefaultOverhead(BlueA2ADefaultOverhead)
DwyerBorderZone = ZONE_POLYGON:New( "DwyerBorderZone", GROUP:FindByName( "DwyerBorderZone" ) )
DwyerDispatcher = AI_A2A_GCICAP:New( { "RED EWR" }, { "DwyerBorderCAP" }, { "DwyerBorderZone" }, DwyerBorderZone )
DwyerDispatcher:SetDefaultLandingAtEngineShutdown()
DwyerDispatcher:SetDefaultTakeoffFromParkingHot()
DwyerDispatcher:SetBorderZone( DwyerBorderZone )
DwyerDispatcher:SetTacticalDisplay(TAC_DISPLAY)
DwyerDispatcher:SetDefaultFuelThreshold( 0.20 )
DwyerDispatcher:SetRefreshTimeInterval( 300 )
DwyerDispatcher:SetDefaultOverhead(BlueA2ADefaultOverhead)
--Red
BostZone = ZONE_POLYGON:New( "BostBorderZone", GROUP:FindByName( "BostBorderZone" ) ) BostZone = ZONE_POLYGON:New( "BostBorderZone", GROUP:FindByName( "BostBorderZone" ) )
BostZone = AI_A2A_GCICAP:New( { "RED EWR" }, { "BostBorderCAP" }, { "BostBorderZone" }, BostBorderZone ) BostDispatcher = AI_A2A_GCICAP:New( { "RED EWR" }, { "BostBorderCAP" }, { "BostBorderZone" }, BostZone )
BostZone:SetDefaultLandingAtEngineShutdown() BostDispatcher:SetDefaultLandingAtEngineShutdown()
BostZone:SetDefaultTakeoffFromParkingHot() BostDispatcher:SetDefaultTakeoffFromParkingHot()
BostZone:SetBorderZone( BLUEBorderZone ) BostDispatcher:SetBorderZone(BostZone)
BostZone:SetTacticalDisplay(false) BostDispatcher:SetTacticalDisplay(TAC_DISPLAY)
BostZone:SetDefaultFuelThreshold( 0.20 ) BostDispatcher:SetDefaultFuelThreshold( 0.20 )
BostZone:SetRefreshTimeInterval( 300 ) BostDispatcher:SetRefreshTimeInterval( 300 )
BostZone:SetDefaultOverhead(BlueA2ADefaultOverhead) BostDispatcher:SetDefaultOverhead(BlueA2ADefaultOverhead)
Blue_Drone = SPAWN:New("BLUE DRONE") Blue_Drone = SPAWN:New("BLUE DRONE")
:InitLimit(1, 25) :InitLimit(1, 25)
:SpawnScheduled(600, 0.5) :SpawnScheduled(600, 0.5)

View File

@ -1,109 +1,73 @@
-- Debugging flag -- Define the event handler class for Red AWACS
local DEBUG = true RedAwacsEventHandler = EVENTHANDLER:New()
-- Define AWACS and its escorts -- Handle the Birth event for Red AWACS
local awacsGroupName = "BLUE EWR AWACS" function RedAwacsEventHandler:OnEventBirth(EventData)
local escortGroup1Name = "BlueAWACS_Escort_Group1" if EventData.IniDCSGroupName == "RED EWR AWACS" then
MESSAGE:New("AWACS has spawned!", 15):ToRed()
-- Configuration parameters end
local patrolAltMin = 5000
local patrolAltMax = 8000
local escortFollowDistance = 1000
local respawnCheckInterval = 10
local maxEscortSpawns = 10 -- maximum number of escort spawns - might take this out.
-- Function to print debug messages if DEBUG is enabled
local function DebugMessage(message)
if DEBUG and message then
env.info("[AWACS DEBUG] " .. tostring(message))
end
end end
-- Function to send a message to all players -- Handle the Dead event for Red AWACS
local function Announce(message, soundFile) function RedAwacsEventHandler:OnEventDead(EventData)
if message then if EventData.IniDCSGroupName == "RED EWR AWACS" then
MESSAGE:New(message, 15):ToAll() MESSAGE:New("AWACS has been destroyed!", 15):ToRed()
end
if soundFile then end
--local sound = SOUND:New(soundFile)
--sound:ToAll()
end
end end
-- Define the patrol zone -- Handle the Hit event for Red AWACS
local patrolZone = ZONE:New("AWACS_PatrolZone") function RedAwacsEventHandler:OnEventHit(EventData)
if patrolZone then if EventData.IniDCSGroupName == "RED EWR AWACS" then
DebugMessage("Patrol zone created: " .. patrolZone:GetName()) MESSAGE:New("AWACS is under attack!", 15):ToRed()
else
DebugMessage("ERROR: Patrol zone 'AWACS_PatrolZone' not found. Check the mission editor.") end
return -- Exit if the patrol zone is not defined
end end
-- Create the Red AWACS spawn object
Red_Awacs = SPAWN:New("RED EWR AWACS")
:InitLimit(1, 99)
:SpawnScheduled(300, 0.5)
-- Add the event handler to the Red AWACS group
RedAwacsEventHandler:HandleEvent(EVENTS.Birth)
RedAwacsEventHandler:HandleEvent(EVENTS.Dead)
RedAwacsEventHandler:HandleEvent(EVENTS.Hit)
-- Define the AWACS spawn -- Define the event handler class for Blue AWACS
local awacsSpawn = SPAWN:New(awacsGroupName):InitLimit(1, 0) BlueAwacsEventHandler = EVENTHANDLER:New()
-- Function to spawn and attach escorts to AWACS -- Handle the Birth event for Blue AWACS
function spawnEscort(escortGroupName, awacsGroup) function BlueAwacsEventHandler:OnEventBirth(EventData)
if not escortGroupName or not awacsGroup then if EventData.IniDCSGroupName == "BLUE EWR AWACS" then
DebugMessage("ERROR: Invalid escort group name or AWACS group.") MESSAGE:New("AWACS has spawned!", 15):ToBlue()
return
end
DebugMessage("Spawning escort: " .. escortGroupName) end
Announce("Spawning escort for AWACS.", "escort_spawn.ogg")
local escortSpawn = SPAWN:New(escortGroupName):InitLimit(1, maxEscortSpawns)
escortSpawn:OnSpawnGroup(function(escortGroup)
if not escortGroup then
DebugMessage("ERROR: Escort group failed to spawn.")
return
end
DebugMessage("Escort spawned: " .. escortGroup:GetName())
-- Set the escort group to follow the AWACS
SCHEDULER:New(nil, function()
if awacsGroup:IsAlive() and escortGroup:IsAlive() then
escortGroup:TaskFollow(awacsGroup, escortFollowDistance)
DebugMessage("Escort assigned to follow AWACS.")
else
DebugMessage("AWACS or escort is not alive.")
end
end, {}, 3, respawnCheckInterval)
end):Spawn()
end end
-- Start AWACS in a patrol pattern within the patrol zone -- Handle the Dead event for Blue AWACS
awacsSpawn:InitRepeatOnEngineShutDown() function BlueAwacsEventHandler:OnEventDead(EventData)
:OnSpawnGroup(function(awacsGroup) if EventData.IniDCSGroupName == "BLUE EWR AWACS" then
if not awacsGroup then MESSAGE:New("AWACS has been destroyed!", 15):ToBlue()
DebugMessage("ERROR: AWACS group failed to spawn.")
return
end
DebugMessage("AWACS spawned: " .. awacsGroup:GetName()) end
Announce("AWACS is now airborne and patrolling.", "awacs_spawn.ogg") end
-- Create a patrol task for the AWACS in the defined zone -- Handle the Hit event for Blue AWACS
local patrolTask = AI_PATROL_ZONE:New(patrolZone, patrolAltMin, patrolAltMax) function BlueAwacsEventHandler:OnEventHit(EventData)
patrolTask:SetControllable(awacsGroup) if EventData.IniDCSGroupName == "BLUE EWR AWACS" then
patrolTask:__Start(1) MESSAGE:New("AWACS is under attack!", 15):ToBlue()
DebugMessage("Patrol task assigned to AWACS.")
-- Spawn and manage escorts end
spawnEscort(escortGroup1Name, awacsGroup) end
end)
:Spawn()
-- Create a scheduled task to check if AWACS is alive and respawn if destroyed -- Create the Blue AWACS spawn object
SCHEDULER:New(nil, function() Blue_Awacs = SPAWN:New("BLUE EWR AWACS")
local awacsGroup = awacsSpawn:GetLastAliveGroup() :InitLimit(1, 99)
if not awacsGroup or not awacsGroup:IsAlive() then :SpawnScheduled(300, 0.5)
DebugMessage("AWACS destroyed. Respawning...")
Announce("AWACS has been destroyed! Respawning...", "awacs_destroyed.ogg") -- Add the event handler to the Blue AWACS group
awacsSpawn:Spawn() BlueAwacsEventHandler:HandleEvent(EVENTS.Birth)
end BlueAwacsEventHandler:HandleEvent(EVENTS.Dead)
end, {}, 0, respawnCheckInterval) BlueAwacsEventHandler:HandleEvent(EVENTS.Hit)

View File

@ -0,0 +1,55 @@
-- Define the event handler class for Blue TANKER
BlueTankerEventHandler = EVENTHANDLER:New()
-- Handle the Birth event for Blue TANKER
function BlueTankerEventHandler:OnEventBirth(EventData)
if EventData.IniDCSGroupName == "TANKER 135" then
MESSAGE:New("TANKER has spawned!", 15):ToBlue()
elseif EventData.IniDCSGroupName == "TANKER 135 MPRS" then
MESSAGE:New("TANKER 135 MPRS has spawned!", 15):ToBlue()
end
end
-- Handle the Dead event for Blue TANKER
function BlueTankerEventHandler:OnEventDead(EventData)
if EventData.IniDCSGroupName == "TANKER 135" then
MESSAGE:New("TANKER has been destroyed!", 15):ToBlue()
elseif EventData.IniDCSGroupName == "TANKER 135 MPRS" then
MESSAGE:New("TANKER 135 MPRS has been destroyed!", 15):ToBlue()
end
end
-- Handle the Hit event for Blue TANKER
function BlueTankerEventHandler:OnEventHit(EventData)
if EventData.IniDCSGroupName == "TANKER 135" then
MESSAGE:New("TANKER is under attack!", 15):ToBlue()
elseif EventData.IniDCSGroupName == "TANKER 135 MPRS" then
MESSAGE:New("TANKER 135 MPRS is under attack!", 15):ToBlue()
end
end
-- Create the Blue TANKER spawn objects
Blue_Tanker = SPAWN:New("TANKER 135")
:InitLimit(1, 99)
Blue_Tanker_MPRS = SPAWN:New("TANKER 135 MPRS")
:InitLimit(1, 99)
-- Function to spawn the tankers
function SpawnTanker()
Blue_Tanker:Spawn()
end
function SpawnTankerMPRS()
Blue_Tanker_MPRS:Spawn()
end
-- Create a mission menu for requesting the tankers
MenuCoalitionBlue = MENU_COALITION:New(coalition.side.BLUE, "Request TANKER")
MenuCoalitionBlueTanker = MENU_COALITION_COMMAND:New(coalition.side.BLUE, "Launch TANKER 135", MenuCoalitionBlue, SpawnTanker)
MenuCoalitionBlueTankerMPRS = MENU_COALITION_COMMAND:New(coalition.side.BLUE, "Launch TANKER 135 MPRS", MenuCoalitionBlue, SpawnTankerMPRS)
-- Add the event handler to the Blue TANKER group
BlueTankerEventHandler:HandleEvent(EVENTS.Birth)
BlueTankerEventHandler:HandleEvent(EVENTS.Dead)
BlueTankerEventHandler:HandleEvent(EVENTS.Hit)