mirror of
https://github.com/iTracerFacer/DCS_MissionDev.git
synced 2025-12-03 04:14:46 +00:00
Updated Insurgentsandtorm
This commit is contained in:
parent
9ce92421e6
commit
a14979ed2d
0
.metadata/.lock
Normal file
0
.metadata/.lock
Normal file
@ -0,0 +1 @@
|
||||
|
||||
@ -0,0 +1 @@
|
||||
|
||||
BIN
.metadata/.plugins/org.eclipse.core.resources/.root/1.tree
Normal file
BIN
.metadata/.plugins/org.eclipse.core.resources/.root/1.tree
Normal file
Binary file not shown.
Binary file not shown.
@ -0,0 +1,2 @@
|
||||
eclipse.preferences.version=1
|
||||
version=1
|
||||
@ -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
|
||||
@ -0,0 +1,5 @@
|
||||
eclipse.preferences.version=1
|
||||
sourceHoverBackgroundColor=255,255,225
|
||||
sourceHoverBackgroundColor.SystemDefault=true
|
||||
useAnnotationsPrefPage=true
|
||||
useQuickDiffPrefPage=true
|
||||
@ -0,0 +1,5 @@
|
||||
PROBLEMS_FILTERS_MIGRATE=true
|
||||
eclipse.preferences.version=1
|
||||
platformState=1645898269583
|
||||
quickStart=false
|
||||
tipsAndTricks=true
|
||||
@ -0,0 +1,2 @@
|
||||
eclipse.preferences.version=1
|
||||
showIntro=false
|
||||
@ -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
|
||||
BIN
.metadata/.plugins/org.eclipse.dltk.core/Containers.dat
Normal file
BIN
.metadata/.plugins/org.eclipse.dltk.core/Containers.dat
Normal file
Binary file not shown.
10
.metadata/.plugins/org.eclipse.dltk.ui/dialog_settings.xml
Normal file
10
.metadata/.plugins/org.eclipse.dltk.ui/dialog_settings.xml
Normal 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="<?xml version="1.0" encoding="UTF-8"?>
<scriptExplorer group_libraries="1" isWindowWorkingSet="false" layout="1" linkWithEditor="0" rootMode="1" workingSetName="">
<customFilters userDefinedPatternsEnabled="false">
<xmlDefinedFilters>
<child filterId="org.eclipse.dltk.ui.ScriptExplorer.NonScriptProjectsFilter" isEnabled="false"/>
<child filterId="org.eclipse.dltk.internal.ui.PackageExplorer.EmptyInnerPackageFilter" isEnabled="true"/>
<child filterId="org.eclipse.dltk.internal.ui.PackageExplorer.DotFilesFilter" isEnabled="true"/>
<child filterId="org.eclipse.dltk.ui.ScriptExplorer.PackageDeclarationFilter" isEnabled="true"/>
<child filterId="org.eclipse.dltk.internal.ui.PackageExplorer.EmptyPackageFilter" isEnabled="false"/>
<child filterId="org.eclipse.dltk.ui.ScriptExplorer.NonScriptElementFilter" isEnabled="false"/>
<child filterId="org.eclipse.dltk.internal.ui.PackageExplorer.ContainMembersFilter" isEnabled="false"/>
<child filterId="org.eclipse.dltk.ui.ScriptExplorer.SyntheticMembersFilter" isEnabled="true"/>
<child filterId="org.eclipse.dltk.ui.ScriptExplorer.FieldsFilter" isEnabled="false"/>
<child filterId="org.eclipse.dltk.ui.ScriptExplorer.ClosedProjectsFilter" isEnabled="false"/>
<child filterId="org.eclipse.dltk.ui.ScriptExplorer.SMFileFilter" isEnabled="false"/>
<child filterId="org.eclipse.dltk.ui.ScriptExplorer.ImportDeclarationFilter" isEnabled="true"/>
<child filterId="org.eclipse.dltk.ui.ScriptExplorer.NonSharedProjectsFilter" isEnabled="false"/>
<child filterId="org.eclipse.dltk.ui.ScriptExplorer.LibraryFilter" isEnabled="false"/>
<child filterId="org.eclipse.dltk.ui.ScriptExplorer.ContainedLibraryFilter" isEnabled="false"/>
</xmlDefinedFilters>
</customFilters>
</scriptExplorer>" key="memento"/>
|
||||
<item value="1" key="rootMode"/>
|
||||
<item value="false" key="linkWithEditor"/>
|
||||
</section>
|
||||
</section>
|
||||
1396
.metadata/.plugins/org.eclipse.e4.workbench/workbench.xmi
Normal file
1396
.metadata/.plugins/org.eclipse.e4.workbench/workbench.xmi
Normal file
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,3 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<section name="Workbench">
|
||||
</section>
|
||||
@ -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>
|
||||
@ -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
3
.metadata/version.ini
Normal 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
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -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.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 = 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.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.
|
||||
@ -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.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 = 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.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.
|
||||
@ -114,8 +114,8 @@ blue_ctld.EngineerSearch = 2000 -- Search radius for engineers.
|
||||
--]]
|
||||
|
||||
-- Custom Capabilities
|
||||
blue_ctld:SetUnitCapabilities("UH-1H", true, true, 1, 10, 15, 4000)
|
||||
red_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, 6000)
|
||||
|
||||
|
||||
|
||||
|
||||
@ -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_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" )
|
||||
@ -22,8 +23,8 @@ RU_Score:SetMessagesScore(false)
|
||||
|
||||
|
||||
-- How many red/blue aircraft are in the air by default.
|
||||
local RedA2ADefaultOverhead = 2
|
||||
local BlueA2ADefaultOverhead = 2
|
||||
local RedA2ADefaultOverhead = 1.5
|
||||
local BlueA2ADefaultOverhead = 1
|
||||
|
||||
|
||||
PlayerClients = SET_PLAYER:New():FilterStart()
|
||||
@ -92,37 +93,28 @@ local RED_AA_ZONES = {
|
||||
|
||||
}
|
||||
|
||||
|
||||
--[[]
|
||||
-- Schedule RED AA spawns using the calculated frequencies
|
||||
RED_SA08 = SPAWN:New("SA08")
|
||||
RED_SA08 = SPAWN:New("RED EWR SA08")
|
||||
:InitRandomizeZones(RED_AA_ZONES)
|
||||
:InitLimit(5, 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.
|
||||
RED_SA10 = SPAWN:New("RED-AA-SA10-1")
|
||||
RED_SA10 = SPAWN:New("RED EWR AA-SA10-1")
|
||||
:InitRandomizeZones(RED_AA_ZONES)
|
||||
:InitLimit(60, 60)
|
||||
: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
|
||||
RED_SA11 = SPAWN:New("RED-AA-SA112-1")
|
||||
RED_SA11 = SPAWN:New("RED EWR AA SA112-1")
|
||||
:InitRandomizeZones(RED_AA_ZONES)
|
||||
:InitLimit(48, 48)
|
||||
:SpawnScheduled(1, 0.5)
|
||||
|
||||
-- Setup AI A2A Dispatchers
|
||||
--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
|
||||
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:SetDefaultTakeoffFromParkingHot()
|
||||
BLUEA2ADispatcher:SetBorderZone( BLUEBorderZone )
|
||||
BLUEA2ADispatcher:SetTacticalDisplay(false)
|
||||
BLUEA2ADispatcher:SetTacticalDisplay(TAC_DISPLAY)
|
||||
BLUEA2ADispatcher:SetDefaultFuelThreshold( 0.20 )
|
||||
BLUEA2ADispatcher:SetRefreshTimeInterval( 300 )
|
||||
BLUEA2ADispatcher:SetDefaultOverhead(BlueA2ADefaultOverhead)
|
||||
|
||||
--Red
|
||||
DwyerBorderZone = ZONE_POLYGON:New( "DwyerBorderZone", GROUP:FindByName( "DwyerBorderZone" ) )
|
||||
DwyerBorderZone = AI_A2A_GCICAP:New( { "RED EWR" }, { "DwyerBorderCAP" }, { "DwyerBorderZone" }, DwyerBorderZone )
|
||||
DwyerBorderZone:SetDefaultLandingAtEngineShutdown()
|
||||
DwyerBorderZone:SetDefaultTakeoffFromParkingHot()
|
||||
DwyerBorderZone:SetBorderZone( BLUEBorderZone )
|
||||
DwyerBorderZone:SetTacticalDisplay(false)
|
||||
DwyerBorderZone:SetDefaultFuelThreshold( 0.20 )
|
||||
DwyerBorderZone:SetRefreshTimeInterval( 300 )
|
||||
DwyerBorderZone:SetDefaultOverhead(BlueA2ADefaultOverhead)
|
||||
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(TAC_DISPLAY)
|
||||
RedA2ADispatcher:SetDefaultFuelThreshold( 0.20 )
|
||||
RedA2ADispatcher:SetRefreshTimeInterval( 300 )
|
||||
RedA2ADispatcher:SetDefaultOverhead(RedA2ADefaultOverhead)
|
||||
|
||||
|
||||
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 = AI_A2A_GCICAP:New( { "RED EWR" }, { "BostBorderCAP" }, { "BostBorderZone" }, BostBorderZone )
|
||||
BostZone:SetDefaultLandingAtEngineShutdown()
|
||||
BostZone:SetDefaultTakeoffFromParkingHot()
|
||||
BostZone:SetBorderZone( BLUEBorderZone )
|
||||
BostZone:SetTacticalDisplay(false)
|
||||
BostZone:SetDefaultFuelThreshold( 0.20 )
|
||||
BostZone:SetRefreshTimeInterval( 300 )
|
||||
BostZone:SetDefaultOverhead(BlueA2ADefaultOverhead)
|
||||
BostDispatcher = AI_A2A_GCICAP:New( { "RED EWR" }, { "BostBorderCAP" }, { "BostBorderZone" }, BostZone )
|
||||
BostDispatcher:SetDefaultLandingAtEngineShutdown()
|
||||
BostDispatcher:SetDefaultTakeoffFromParkingHot()
|
||||
BostDispatcher:SetBorderZone(BostZone)
|
||||
BostDispatcher:SetTacticalDisplay(TAC_DISPLAY)
|
||||
BostDispatcher:SetDefaultFuelThreshold( 0.20 )
|
||||
BostDispatcher:SetRefreshTimeInterval( 300 )
|
||||
BostDispatcher:SetDefaultOverhead(BlueA2ADefaultOverhead)
|
||||
|
||||
|
||||
|
||||
Blue_Drone = SPAWN:New("BLUE DRONE")
|
||||
:InitLimit(1, 25)
|
||||
:SpawnScheduled(600, 0.5)
|
||||
|
||||
|
||||
|
||||
@ -1,109 +1,73 @@
|
||||
-- Debugging flag
|
||||
local DEBUG = true
|
||||
-- Define the event handler class for Red AWACS
|
||||
RedAwacsEventHandler = EVENTHANDLER:New()
|
||||
|
||||
-- Define AWACS and its escorts
|
||||
local awacsGroupName = "BLUE EWR AWACS"
|
||||
local escortGroup1Name = "BlueAWACS_Escort_Group1"
|
||||
|
||||
-- Configuration parameters
|
||||
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
|
||||
-- Handle the Birth event for Red AWACS
|
||||
function RedAwacsEventHandler:OnEventBirth(EventData)
|
||||
if EventData.IniDCSGroupName == "RED EWR AWACS" then
|
||||
MESSAGE:New("AWACS has spawned!", 15):ToRed()
|
||||
|
||||
end
|
||||
end
|
||||
|
||||
-- Function to send a message to all players
|
||||
local function Announce(message, soundFile)
|
||||
if message then
|
||||
MESSAGE:New(message, 15):ToAll()
|
||||
end
|
||||
if soundFile then
|
||||
--local sound = SOUND:New(soundFile)
|
||||
--sound:ToAll()
|
||||
end
|
||||
-- Handle the Dead event for Red AWACS
|
||||
function RedAwacsEventHandler:OnEventDead(EventData)
|
||||
if EventData.IniDCSGroupName == "RED EWR AWACS" then
|
||||
MESSAGE:New("AWACS has been destroyed!", 15):ToRed()
|
||||
|
||||
end
|
||||
end
|
||||
|
||||
-- Define the patrol zone
|
||||
local patrolZone = ZONE:New("AWACS_PatrolZone")
|
||||
if patrolZone then
|
||||
DebugMessage("Patrol zone created: " .. patrolZone:GetName())
|
||||
else
|
||||
DebugMessage("ERROR: Patrol zone 'AWACS_PatrolZone' not found. Check the mission editor.")
|
||||
return -- Exit if the patrol zone is not defined
|
||||
-- Handle the Hit event for Red AWACS
|
||||
function RedAwacsEventHandler:OnEventHit(EventData)
|
||||
if EventData.IniDCSGroupName == "RED EWR AWACS" then
|
||||
MESSAGE:New("AWACS is under attack!", 15):ToRed()
|
||||
|
||||
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
|
||||
local awacsSpawn = SPAWN:New(awacsGroupName):InitLimit(1, 0)
|
||||
-- Define the event handler class for Blue AWACS
|
||||
BlueAwacsEventHandler = EVENTHANDLER:New()
|
||||
|
||||
-- Function to spawn and attach escorts to AWACS
|
||||
function spawnEscort(escortGroupName, awacsGroup)
|
||||
if not escortGroupName or not awacsGroup then
|
||||
DebugMessage("ERROR: Invalid escort group name or AWACS group.")
|
||||
return
|
||||
end
|
||||
|
||||
DebugMessage("Spawning escort: " .. escortGroupName)
|
||||
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()
|
||||
-- Handle the Birth event for Blue AWACS
|
||||
function BlueAwacsEventHandler:OnEventBirth(EventData)
|
||||
if EventData.IniDCSGroupName == "BLUE EWR AWACS" then
|
||||
MESSAGE:New("AWACS has spawned!", 15):ToBlue()
|
||||
|
||||
end
|
||||
end
|
||||
|
||||
-- Start AWACS in a patrol pattern within the patrol zone
|
||||
awacsSpawn:InitRepeatOnEngineShutDown()
|
||||
:OnSpawnGroup(function(awacsGroup)
|
||||
if not awacsGroup then
|
||||
DebugMessage("ERROR: AWACS group failed to spawn.")
|
||||
return
|
||||
end
|
||||
-- Handle the Dead event for Blue AWACS
|
||||
function BlueAwacsEventHandler:OnEventDead(EventData)
|
||||
if EventData.IniDCSGroupName == "BLUE EWR AWACS" then
|
||||
MESSAGE:New("AWACS has been destroyed!", 15):ToBlue()
|
||||
|
||||
end
|
||||
end
|
||||
|
||||
DebugMessage("AWACS spawned: " .. awacsGroup:GetName())
|
||||
Announce("AWACS is now airborne and patrolling.", "awacs_spawn.ogg")
|
||||
-- Handle the Hit event for Blue AWACS
|
||||
function BlueAwacsEventHandler:OnEventHit(EventData)
|
||||
if EventData.IniDCSGroupName == "BLUE EWR AWACS" then
|
||||
MESSAGE:New("AWACS is under attack!", 15):ToBlue()
|
||||
|
||||
end
|
||||
end
|
||||
|
||||
-- Create a patrol task for the AWACS in the defined zone
|
||||
local patrolTask = AI_PATROL_ZONE:New(patrolZone, patrolAltMin, patrolAltMax)
|
||||
patrolTask:SetControllable(awacsGroup)
|
||||
patrolTask:__Start(1)
|
||||
DebugMessage("Patrol task assigned to AWACS.")
|
||||
-- Create the Blue AWACS spawn object
|
||||
Blue_Awacs = SPAWN:New("BLUE EWR AWACS")
|
||||
:InitLimit(1, 99)
|
||||
:SpawnScheduled(300, 0.5)
|
||||
|
||||
-- Spawn and manage escorts
|
||||
spawnEscort(escortGroup1Name, awacsGroup)
|
||||
end)
|
||||
:Spawn()
|
||||
|
||||
-- Create a scheduled task to check if AWACS is alive and respawn if destroyed
|
||||
SCHEDULER:New(nil, function()
|
||||
local awacsGroup = awacsSpawn:GetLastAliveGroup()
|
||||
if not awacsGroup or not awacsGroup:IsAlive() then
|
||||
DebugMessage("AWACS destroyed. Respawning...")
|
||||
Announce("AWACS has been destroyed! Respawning...", "awacs_destroyed.ogg")
|
||||
awacsSpawn:Spawn()
|
||||
end
|
||||
end, {}, 0, respawnCheckInterval)
|
||||
-- Add the event handler to the Blue AWACS group
|
||||
BlueAwacsEventHandler:HandleEvent(EVENTS.Birth)
|
||||
BlueAwacsEventHandler:HandleEvent(EVENTS.Dead)
|
||||
BlueAwacsEventHandler:HandleEvent(EVENTS.Hit)
|
||||
55
DCS_Afgainistan/Insurgent_Sandstorm/Moose_Tanker.lua
Normal file
55
DCS_Afgainistan/Insurgent_Sandstorm/Moose_Tanker.lua
Normal 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)
|
||||
Loading…
x
Reference in New Issue
Block a user