mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2025-10-29 16:58:06 +00:00
#EasyGCICAP
* Added option for an AWACS patrol point and Squad * Added option to make Tanker and AWACS invisible
This commit is contained in:
parent
963b2f1b46
commit
98a11a8aad
@ -55,12 +55,14 @@
|
|||||||
-- @field #table ManagedSQ
|
-- @field #table ManagedSQ
|
||||||
-- @field #table ManagedCP
|
-- @field #table ManagedCP
|
||||||
-- @field #table ManagedTK
|
-- @field #table ManagedTK
|
||||||
|
-- @field #table ManagedEWR
|
||||||
-- @field #number MaxAliveMissions
|
-- @field #number MaxAliveMissions
|
||||||
-- @field #boolean debug
|
-- @field #boolean debug
|
||||||
-- @field #number repeatsonfailure
|
-- @field #number repeatsonfailure
|
||||||
-- @field Core.Set#SET_ZONE GoZoneSet
|
-- @field Core.Set#SET_ZONE GoZoneSet
|
||||||
-- @field Core.Set#SET_ZONE NoGoZoneSet
|
-- @field Core.Set#SET_ZONE NoGoZoneSet
|
||||||
-- @field #boolean Monitor
|
-- @field #boolean Monitor
|
||||||
|
-- @field #boolean TankerInvisible
|
||||||
-- @extends Core.Fsm#FSM
|
-- @extends Core.Fsm#FSM
|
||||||
|
|
||||||
--- *“Airspeed, altitude, and brains. Two are always needed to successfully complete the flight.”* -- Unknown.
|
--- *“Airspeed, altitude, and brains. Two are always needed to successfully complete the flight.”* -- Unknown.
|
||||||
@ -137,8 +139,15 @@
|
|||||||
-- -- **Note** If you need different tanker types, i.e. Boom and Drogue, set them up at different AirWings!
|
-- -- **Note** If you need different tanker types, i.e. Boom and Drogue, set them up at different AirWings!
|
||||||
-- -- Add a tanker point
|
-- -- Add a tanker point
|
||||||
-- mywing:AddPatrolPointTanker(AIRBASE.Caucasus.Kutaisi,ZONE:FindByName("Blue Zone Tanker"):GetCoordinate(),20000,280,270,50)
|
-- mywing:AddPatrolPointTanker(AIRBASE.Caucasus.Kutaisi,ZONE:FindByName("Blue Zone Tanker"):GetCoordinate(),20000,280,270,50)
|
||||||
-- -- Add a tanker squad
|
-- -- Add an AWACS squad - Radio 251 AM, TACAN 51Y
|
||||||
-- mywing:AddTankerSquadron("Blue Tanker","Tanker Ops Kutaisi",AIRBASE.Caucasus.Kutaisi,20,AI.Skill.EXCELLENT,602)
|
-- mywing:AddTankerSquadron("Blue Tanker","Tanker Ops Kutaisi",AIRBASE.Caucasus.Kutaisi,20,AI.Skill.EXCELLENT,602,nil,251,radio.modulation.AM,51)
|
||||||
|
--
|
||||||
|
-- ### Add an AWACS (optional)
|
||||||
|
--
|
||||||
|
-- -- Add an AWACS point
|
||||||
|
-- mywing:AddPatrolPointAwacs(AIRBASE.Caucasus.Kutaisi,ZONE:FindByName("Blue Zone AWACS"):GetCoordinate(),25000,300,270,50)
|
||||||
|
-- -- Add a tanker squad - Radio 251 AM, TACAN 51Y
|
||||||
|
-- mywing:AddAWACSSquadron("Blue AWACS","AWACS Ops Kutaisi",AIRBASE.Caucasus.Kutaisi,20,AI.Skill.AVERAGE,702,nil,271,radio.modulation.AM)
|
||||||
--
|
--
|
||||||
-- # Fine-Tuning
|
-- # Fine-Tuning
|
||||||
--
|
--
|
||||||
@ -153,8 +162,9 @@
|
|||||||
-- * @{#EASYGCICAP.SetDefaultMissionRange}: Set how many NM the planes can go from the home base, defaults to 100.
|
-- * @{#EASYGCICAP.SetDefaultMissionRange}: Set how many NM the planes can go from the home base, defaults to 100.
|
||||||
-- * @{#EASYGCICAP.SetDefaultNumberAlter5Standby}: Set how many planes will be spawned on cold standby (Alert5), default 2.
|
-- * @{#EASYGCICAP.SetDefaultNumberAlter5Standby}: Set how many planes will be spawned on cold standby (Alert5), default 2.
|
||||||
-- * @{#EASYGCICAP.SetDefaultEngageRange}: Set max engage range for CAP flights if they detect intruders, defaults to 50.
|
-- * @{#EASYGCICAP.SetDefaultEngageRange}: Set max engage range for CAP flights if they detect intruders, defaults to 50.
|
||||||
-- * @{#EASYGCICAP.SetMaxAliveMissions}: Set max parallel missions can be done (CAP+GCI+Alert5+Tanker), defaults to 6.
|
-- * @{#EASYGCICAP.SetMaxAliveMissions}: Set max parallel missions can be done (CAP+GCI+Alert5+Tanker+AWACS), defaults to 8.
|
||||||
-- * @{#EASYGCICAP.SetDefaultRepeatOnFailure}: Set max repeats on failure for intercepting/killing intruders, defaults to 3.
|
-- * @{#EASYGCICAP.SetDefaultRepeatOnFailure}: Set max repeats on failure for intercepting/killing intruders, defaults to 3.
|
||||||
|
-- * @{#EASYGCICAP.SetTankerAndAWACSInvisible}: Set Tanker and AWACS to be invisible to enemy AI eyes. Is set to `true` by default.
|
||||||
--
|
--
|
||||||
--
|
--
|
||||||
-- @field #EASYGCICAP
|
-- @field #EASYGCICAP
|
||||||
@ -181,13 +191,15 @@ EASYGCICAP = {
|
|||||||
ManagedSQ = {},
|
ManagedSQ = {},
|
||||||
ManagedCP = {},
|
ManagedCP = {},
|
||||||
ManagedTK = {},
|
ManagedTK = {},
|
||||||
MaxAliveMissions = 6,
|
ManagedEWR = {},
|
||||||
|
MaxAliveMissions = 8,
|
||||||
debug = false,
|
debug = false,
|
||||||
engagerange = 50,
|
engagerange = 50,
|
||||||
repeatsonfailure = 3,
|
repeatsonfailure = 3,
|
||||||
GoZoneSet = nil,
|
GoZoneSet = nil,
|
||||||
NoGoZoneSet = nil,
|
NoGoZoneSet = nil,
|
||||||
Monitor = false,
|
Monitor = false,
|
||||||
|
TankerInvisible = true,
|
||||||
}
|
}
|
||||||
|
|
||||||
--- Internal Squadron data type
|
--- Internal Squadron data type
|
||||||
@ -200,6 +212,10 @@ EASYGCICAP = {
|
|||||||
-- @field #string Modex
|
-- @field #string Modex
|
||||||
-- @field #string Livery
|
-- @field #string Livery
|
||||||
-- @field #boolean Tanker
|
-- @field #boolean Tanker
|
||||||
|
-- @field #boolean AWACS
|
||||||
|
-- @field #number Frequency
|
||||||
|
-- @field #number Modulation
|
||||||
|
-- @field #number TACAN
|
||||||
|
|
||||||
--- Internal Wing data type
|
--- Internal Wing data type
|
||||||
-- @type EASYGCICAP.Wing
|
-- @type EASYGCICAP.Wing
|
||||||
@ -218,7 +234,7 @@ EASYGCICAP = {
|
|||||||
|
|
||||||
--- EASYGCICAP class version.
|
--- EASYGCICAP class version.
|
||||||
-- @field #string version
|
-- @field #string version
|
||||||
EASYGCICAP.version="0.0.7"
|
EASYGCICAP.version="0.0.8"
|
||||||
|
|
||||||
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
-- TODO list
|
-- TODO list
|
||||||
@ -260,10 +276,11 @@ function EASYGCICAP:New(Alias, AirbaseName, Coalition, EWRName)
|
|||||||
self.capgrouping = 2
|
self.capgrouping = 2
|
||||||
self.missionrange = 100
|
self.missionrange = 100
|
||||||
self.noaltert5 = 2
|
self.noaltert5 = 2
|
||||||
self.MaxAliveMissions = 6
|
self.MaxAliveMissions = 8
|
||||||
self.engagerange = 50
|
self.engagerange = 50
|
||||||
self.repeatsonfailure = 3
|
self.repeatsonfailure = 3
|
||||||
self.Monitor = false
|
self.Monitor = false
|
||||||
|
self.TankerInvisible = true
|
||||||
|
|
||||||
-- Set some string id for output to DCS.log file.
|
-- Set some string id for output to DCS.log file.
|
||||||
self.lid=string.format("EASYGCICAP %s | ", self.alias)
|
self.lid=string.format("EASYGCICAP %s | ", self.alias)
|
||||||
@ -289,13 +306,23 @@ end
|
|||||||
-------------------------------------------------------------------------
|
-------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
|
--- Set Tanker and AWACS to be invisible to enemy AI eyes
|
||||||
|
-- @param #EASYGCICAP self
|
||||||
|
-- @param #boolean Switch Set to true or false, by default this is set to true already
|
||||||
|
-- @return #EASYGCICAP self
|
||||||
|
function EASYGCICAP:SetTankerAndAWACSInvisible(Switch)
|
||||||
|
self:T(self.lid.."SetTankerAndAWACSInvisible")
|
||||||
|
self.TankerInvisible = Switch
|
||||||
|
return self
|
||||||
|
end
|
||||||
|
|
||||||
--- Set Maximum of alive missions to stop airplanes spamming the map
|
--- Set Maximum of alive missions to stop airplanes spamming the map
|
||||||
-- @param #EASYGCICAP self
|
-- @param #EASYGCICAP self
|
||||||
-- @param #number Maxiumum Maxmimum number of parallel missions allowed. Count is Cap-Missions + Intercept-Missions + Alert5-Missionsm default is 6
|
-- @param #number Maxiumum Maxmimum number of parallel missions allowed. Count is Cap-Missions + Intercept-Missions + Alert5-Missionsm default is 6
|
||||||
-- @return #EASYGCICAP self
|
-- @return #EASYGCICAP self
|
||||||
function EASYGCICAP:SetMaxAliveMissions(Maxiumum)
|
function EASYGCICAP:SetMaxAliveMissions(Maxiumum)
|
||||||
self:T(self.lid.."SetDefaultResurrection")
|
self:T(self.lid.."SetDefaultResurrection")
|
||||||
self.MaxAliveMissions = Maxiumum or 6
|
self.MaxAliveMissions = Maxiumum or 8
|
||||||
return self
|
return self
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -450,6 +477,7 @@ function EASYGCICAP:_AddAirwing(Airbasename, Alias)
|
|||||||
CAP_Wing:SetNumberCAP(self.capgrouping)
|
CAP_Wing:SetNumberCAP(self.capgrouping)
|
||||||
CAP_Wing:SetNumberTankerBoom(1)
|
CAP_Wing:SetNumberTankerBoom(1)
|
||||||
CAP_Wing:SetNumberTankerProbe(1)
|
CAP_Wing:SetNumberTankerProbe(1)
|
||||||
|
CAP_Wing:SetNumberAWACS(1)
|
||||||
--local PatrolCoordinateKutaisi = ZONE:New(CapZoneName):GetCoordinate()
|
--local PatrolCoordinateKutaisi = ZONE:New(CapZoneName):GetCoordinate()
|
||||||
--CAP_Wing:AddPatrolPointCAP(PatrolCoordinateKutaisi,self.capalt,UTILS.KnotsToAltKIAS(self.capspeed,self.capalt),self.capdir,self.capleg)
|
--CAP_Wing:AddPatrolPointCAP(PatrolCoordinateKutaisi,self.capalt,UTILS.KnotsToAltKIAS(self.capspeed,self.capalt),self.capdir,self.capleg)
|
||||||
CAP_Wing:SetTakeoffHot()
|
CAP_Wing:SetTakeoffHot()
|
||||||
@ -459,20 +487,29 @@ function EASYGCICAP:_AddAirwing(Airbasename, Alias)
|
|||||||
|
|
||||||
local Intel = self.Intel
|
local Intel = self.Intel
|
||||||
|
|
||||||
|
local TankerInvisible = self.TankerInvisible
|
||||||
|
|
||||||
function CAP_Wing:OnAfterFlightOnMission(From, Event, To, Flightgroup, Mission)
|
function CAP_Wing:OnAfterFlightOnMission(From, Event, To, Flightgroup, Mission)
|
||||||
local flightgroup = Flightgroup -- Ops.FlightGroup#FLIGHTGROUP
|
local flightgroup = Flightgroup -- Ops.FlightGroup#FLIGHTGROUP
|
||||||
--flightgroup:SetDespawnAfterLanding()
|
--flightgroup:SetDespawnAfterLanding()
|
||||||
flightgroup:SetDespawnAfterHolding()
|
flightgroup:SetDespawnAfterHolding()
|
||||||
flightgroup:SetDestinationbase(AIRBASE:FindByName(Airbasename))
|
flightgroup:SetDestinationbase(AIRBASE:FindByName(Airbasename))
|
||||||
flightgroup:GetGroup():CommandEPLRS(true,5)
|
flightgroup:GetGroup():CommandEPLRS(true,5)
|
||||||
flightgroup:SetEngageDetectedOn(self.engagerange,{"Air"},self.GoZoneSet,self.NoGoZoneSet)
|
if Mission.type ~= AUFTRAG.Type.TANKER and Mission.type ~= AUFTRAG.Type.AWACS then
|
||||||
flightgroup:GetGroup():OptionROTEvadeFire()
|
flightgroup:SetEngageDetectedOn(self.engagerange,{"Air"},self.GoZoneSet,self.NoGoZoneSet)
|
||||||
flightgroup:SetOutOfAAMRTB()
|
flightgroup:SetOutOfAAMRTB()
|
||||||
|
end
|
||||||
|
if Mission.type == AUFTRAG.Type.TANKER or Mission.type == AUFTRAG.Type.AWACS then
|
||||||
|
if TankerInvisible then
|
||||||
|
flightgroup:GetGroup():SetCommandInvisible(true)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
flightgroup:GetGroup():OptionROTEvadeFire()
|
||||||
flightgroup:SetFuelLowRTB(true)
|
flightgroup:SetFuelLowRTB(true)
|
||||||
Intel:AddAgent(flightgroup)
|
Intel:AddAgent(flightgroup)
|
||||||
--function flightgroup:OnAfterHolding(From,Event,To)
|
function flightgroup:OnAfterHolding(From,Event,To)
|
||||||
--self:ClearToLand(5)
|
self:ClearToLand(5)
|
||||||
--end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -538,6 +575,31 @@ function EASYGCICAP:AddPatrolPointTanker(AirbaseName,Coordinate,Altitude,Speed,H
|
|||||||
return self
|
return self
|
||||||
end
|
end
|
||||||
|
|
||||||
|
--- Add an AWACS patrol point to a Wing
|
||||||
|
-- @param #EASYGCICAP self
|
||||||
|
-- @param #string AirbaseName Name of the Wing's airbase
|
||||||
|
-- @param Core.Point#COORDINATE Coordinate.
|
||||||
|
-- @param #number Altitude Defaults to 25000 feet.
|
||||||
|
-- @param #number Speed Defaults to 300 knots.
|
||||||
|
-- @param #number Heading Defaults to 90 degrees (East).
|
||||||
|
-- @param #number LegLength Defaults to 15 NM.
|
||||||
|
-- @return #EASYGCICAP self
|
||||||
|
function EASYGCICAP:AddPatrolPointAwacs(AirbaseName,Coordinate,Altitude,Speed,Heading,LegLength)
|
||||||
|
self:T(self.lid.."AddPatrolPointAwacs "..Coordinate:ToStringLLDDM())
|
||||||
|
local EntryCAP = {} -- #EASYGCICAP.CapPoint
|
||||||
|
EntryCAP.AirbaseName = AirbaseName
|
||||||
|
EntryCAP.Coordinate = Coordinate
|
||||||
|
EntryCAP.Altitude = Altitude or 25000
|
||||||
|
EntryCAP.Speed = Speed or 300
|
||||||
|
EntryCAP.Heading = Heading or 90
|
||||||
|
EntryCAP.LegLength = LegLength or 15
|
||||||
|
self.ManagedEWR[#self.ManagedEWR+1] = EntryCAP
|
||||||
|
if self.debug then
|
||||||
|
local mark = MARKER:New(Coordinate,self.lid.."Patrol Point AWACS"):ToAll()
|
||||||
|
end
|
||||||
|
return self
|
||||||
|
end
|
||||||
|
|
||||||
--- (Internal) Set actual Tanker Points from the list
|
--- (Internal) Set actual Tanker Points from the list
|
||||||
-- @param #EASYGCICAP self
|
-- @param #EASYGCICAP self
|
||||||
-- @return #EASYGCICAP self
|
-- @return #EASYGCICAP self
|
||||||
@ -557,6 +619,25 @@ function EASYGCICAP:_SetTankerPatrolPoints()
|
|||||||
return self
|
return self
|
||||||
end
|
end
|
||||||
|
|
||||||
|
--- (Internal) Set actual Awacs Points from the list
|
||||||
|
-- @param #EASYGCICAP self
|
||||||
|
-- @return #EASYGCICAP self
|
||||||
|
function EASYGCICAP:_SetAwacsPatrolPoints()
|
||||||
|
self:T(self.lid.."_SetAwacsPatrolPoints")
|
||||||
|
for _,_data in pairs(self.ManagedEWR) do
|
||||||
|
local data = _data --#EASYGCICAP.CapPoint
|
||||||
|
local Wing = self.wings[data.AirbaseName][1] -- Ops.AirWing#AIRWING
|
||||||
|
local Coordinate = data.Coordinate
|
||||||
|
local Altitude = data.Altitude
|
||||||
|
local Speed = data.Speed
|
||||||
|
local Heading = data.Heading
|
||||||
|
local LegLength = data.LegLength
|
||||||
|
Wing:AddPatrolPointAWACS(Coordinate,Altitude,Speed,Heading,LegLength)
|
||||||
|
end
|
||||||
|
|
||||||
|
return self
|
||||||
|
end
|
||||||
|
|
||||||
--- (Internal) Set actual PatrolPoints from the list
|
--- (Internal) Set actual PatrolPoints from the list
|
||||||
-- @param #EASYGCICAP self
|
-- @param #EASYGCICAP self
|
||||||
-- @return #EASYGCICAP self
|
-- @return #EASYGCICAP self
|
||||||
@ -612,8 +693,13 @@ function EASYGCICAP:_CreateSquads()
|
|||||||
local Skill = squad.Skill
|
local Skill = squad.Skill
|
||||||
local Modex = squad.Modex
|
local Modex = squad.Modex
|
||||||
local Livery = squad.Livery
|
local Livery = squad.Livery
|
||||||
|
local Frequeny = squad.Frequency
|
||||||
|
local Modulation = squad.Modulation
|
||||||
|
local TACAN = squad.TACAN
|
||||||
if squad.Tanker then
|
if squad.Tanker then
|
||||||
self:_AddTankerSquadron(TemplateName,SquadName,AirbaseName,AirFrames,Skill,Modex,Livery)
|
self:_AddTankerSquadron(TemplateName,SquadName,AirbaseName,AirFrames,Skill,Modex,Livery,Frequeny,Modulation,TACAN)
|
||||||
|
elseif squad.AWACS then
|
||||||
|
self:_AddAWACSSquadron(TemplateName,SquadName,AirbaseName,AirFrames,Skill,Modex,Livery,Frequeny,Modulation)
|
||||||
else
|
else
|
||||||
self:_AddSquadron(TemplateName,SquadName,AirbaseName,AirFrames,Skill,Modex,Livery)
|
self:_AddSquadron(TemplateName,SquadName,AirbaseName,AirFrames,Skill,Modex,Livery)
|
||||||
end
|
end
|
||||||
@ -657,8 +743,11 @@ end
|
|||||||
-- @param #string Skill(optional) Skill level, e.g. AI.Skill.AVERAGE
|
-- @param #string Skill(optional) Skill level, e.g. AI.Skill.AVERAGE
|
||||||
-- @param #string Modex (optional) Modex to be used,e.g. 402.
|
-- @param #string Modex (optional) Modex to be used,e.g. 402.
|
||||||
-- @param #string Livery (optional) Livery name to be used.
|
-- @param #string Livery (optional) Livery name to be used.
|
||||||
|
-- @param #number Frequency (optional) Radio Frequency to be used.
|
||||||
|
-- @param #number Modulation (optional) Radio Modulation to be used, e.g. radio.modulation.AM or radio.modulation.FM
|
||||||
|
-- @param #number TACAN (optional) TACAN channel, e.g. 71, resulting in Channel 71Y
|
||||||
-- @return #EASYGCICAP self
|
-- @return #EASYGCICAP self
|
||||||
function EASYGCICAP:AddTankerSquadron(TemplateName, SquadName, AirbaseName, AirFrames, Skill, Modex, Livery)
|
function EASYGCICAP:AddTankerSquadron(TemplateName, SquadName, AirbaseName, AirFrames, Skill, Modex, Livery, Frequency, Modulation, TACAN)
|
||||||
self:T(self.lid.."AddTankerSquadron "..SquadName)
|
self:T(self.lid.."AddTankerSquadron "..SquadName)
|
||||||
-- Add Squadron Data
|
-- Add Squadron Data
|
||||||
local EntrySQ = {} -- #EASYGCICAP.Squad
|
local EntrySQ = {} -- #EASYGCICAP.Squad
|
||||||
@ -667,8 +756,11 @@ function EASYGCICAP:AddTankerSquadron(TemplateName, SquadName, AirbaseName, AirF
|
|||||||
EntrySQ.AirbaseName = AirbaseName
|
EntrySQ.AirbaseName = AirbaseName
|
||||||
EntrySQ.AirFrames = AirFrames or 20
|
EntrySQ.AirFrames = AirFrames or 20
|
||||||
EntrySQ.Skill = Skill or AI.Skill.AVERAGE
|
EntrySQ.Skill = Skill or AI.Skill.AVERAGE
|
||||||
EntrySQ.Modex = Modex or 402
|
EntrySQ.Modex = Modex or 602
|
||||||
EntrySQ.Livery = Livery
|
EntrySQ.Livery = Livery
|
||||||
|
EntrySQ.Frequency = Frequency
|
||||||
|
EntrySQ.Modulation = Livery
|
||||||
|
EntrySQ.TACAN = TACAN
|
||||||
EntrySQ.Tanker = true
|
EntrySQ.Tanker = true
|
||||||
|
|
||||||
self.ManagedSQ[SquadName] = EntrySQ
|
self.ManagedSQ[SquadName] = EntrySQ
|
||||||
@ -676,6 +768,38 @@ function EASYGCICAP:AddTankerSquadron(TemplateName, SquadName, AirbaseName, AirF
|
|||||||
return self
|
return self
|
||||||
end
|
end
|
||||||
|
|
||||||
|
--- Add an AWACS Squadron to an Airwing of the manager
|
||||||
|
-- @param #EASYGCICAP self
|
||||||
|
-- @param #string TemplateName Name of the group template.
|
||||||
|
-- @param #string SquadName Squadron name - must be unique!
|
||||||
|
-- @param #string AirbaseName Name of the airbase the airwing resides on, e.g. AIRBASE.Caucasus.Kutaisi
|
||||||
|
-- @param #number AirFrames Number of available airframes, e.g. 20.
|
||||||
|
-- @param #string Skill(optional) Skill level, e.g. AI.Skill.AVERAGE
|
||||||
|
-- @param #string Modex (optional) Modex to be used,e.g. 402.
|
||||||
|
-- @param #string Livery (optional) Livery name to be used.
|
||||||
|
-- @param #number Frequency (optional) Radio Frequency to be used.
|
||||||
|
-- @param #number Modulation (optional) Radio Modulation to be used, e.g. radio.modulation.AM or radio.modulation.FM
|
||||||
|
-- @return #EASYGCICAP self
|
||||||
|
function EASYGCICAP:AddAWACSSquadron(TemplateName, SquadName, AirbaseName, AirFrames, Skill, Modex, Livery, Frequency, Modulation)
|
||||||
|
self:T(self.lid.."AddAWACSSquadron "..SquadName)
|
||||||
|
-- Add Squadron Data
|
||||||
|
local EntrySQ = {} -- #EASYGCICAP.Squad
|
||||||
|
EntrySQ.TemplateName = TemplateName
|
||||||
|
EntrySQ.SquadName = SquadName
|
||||||
|
EntrySQ.AirbaseName = AirbaseName
|
||||||
|
EntrySQ.AirFrames = AirFrames or 20
|
||||||
|
EntrySQ.Skill = Skill or AI.Skill.AVERAGE
|
||||||
|
EntrySQ.Modex = Modex or 702
|
||||||
|
EntrySQ.Livery = Livery
|
||||||
|
EntrySQ.Frequency = Frequency
|
||||||
|
EntrySQ.Modulation = Livery
|
||||||
|
EntrySQ.AWACS = true
|
||||||
|
|
||||||
|
self.ManagedSQ[SquadName] = EntrySQ
|
||||||
|
|
||||||
|
return self
|
||||||
|
end
|
||||||
|
|
||||||
--- (Internal) Add a Squadron to an Airwing of the manager
|
--- (Internal) Add a Squadron to an Airwing of the manager
|
||||||
-- @param #EASYGCICAP self
|
-- @param #EASYGCICAP self
|
||||||
-- @param #string TemplateName Name of the group template.
|
-- @param #string TemplateName Name of the group template.
|
||||||
@ -685,8 +809,10 @@ end
|
|||||||
-- @param #string Skill(optional) Skill level, e.g. AI.Skill.AVERAGE
|
-- @param #string Skill(optional) Skill level, e.g. AI.Skill.AVERAGE
|
||||||
-- @param #string Modex (optional) Modex to be used,e.g. 402.
|
-- @param #string Modex (optional) Modex to be used,e.g. 402.
|
||||||
-- @param #string Livery (optional) Livery name to be used.
|
-- @param #string Livery (optional) Livery name to be used.
|
||||||
|
-- @param #number Frequency (optional) Radio Frequency to be used.
|
||||||
|
-- @param #number Modulation (optional) Radio Modulation to be used, e.g. radio.modulation.AM or radio.modulation.FM
|
||||||
-- @return #EASYGCICAP self
|
-- @return #EASYGCICAP self
|
||||||
function EASYGCICAP:_AddSquadron(TemplateName, SquadName, AirbaseName, AirFrames, Skill, Modex, Livery)
|
function EASYGCICAP:_AddSquadron(TemplateName, SquadName, AirbaseName, AirFrames, Skill, Modex, Livery, Frequency, Modulation)
|
||||||
self:T(self.lid.."_AddSquadron "..SquadName)
|
self:T(self.lid.."_AddSquadron "..SquadName)
|
||||||
-- Add Squadrons
|
-- Add Squadrons
|
||||||
local Squadron_One = SQUADRON:New(TemplateName,AirFrames,SquadName)
|
local Squadron_One = SQUADRON:New(TemplateName,AirFrames,SquadName)
|
||||||
@ -716,8 +842,11 @@ end
|
|||||||
-- @param #string Skill(optional) Skill level, e.g. AI.Skill.AVERAGE
|
-- @param #string Skill(optional) Skill level, e.g. AI.Skill.AVERAGE
|
||||||
-- @param #string Modex (optional) Modex to be used,e.g. 402.
|
-- @param #string Modex (optional) Modex to be used,e.g. 402.
|
||||||
-- @param #string Livery (optional) Livery name to be used.
|
-- @param #string Livery (optional) Livery name to be used.
|
||||||
|
-- @param #number Frequency (optional) Radio frequency of the Tanker
|
||||||
|
-- @param #number Modulation (Optional) Radio modulation of the Tanker
|
||||||
|
-- @param #number TACAN (Optional) TACAN Channel to be used, will always be an "Y" channel
|
||||||
-- @return #EASYGCICAP self
|
-- @return #EASYGCICAP self
|
||||||
function EASYGCICAP:_AddTankerSquadron(TemplateName, SquadName, AirbaseName, AirFrames, Skill, Modex, Livery)
|
function EASYGCICAP:_AddTankerSquadron(TemplateName, SquadName, AirbaseName, AirFrames, Skill, Modex, Livery, Frequency, Modulation, TACAN)
|
||||||
self:T(self.lid.."_AddTankerSquadron "..SquadName)
|
self:T(self.lid.."_AddTankerSquadron "..SquadName)
|
||||||
-- Add Squadrons
|
-- Add Squadrons
|
||||||
local Squadron_One = SQUADRON:New(TemplateName,AirFrames,SquadName)
|
local Squadron_One = SQUADRON:New(TemplateName,AirFrames,SquadName)
|
||||||
@ -729,6 +858,8 @@ function EASYGCICAP:_AddTankerSquadron(TemplateName, SquadName, AirbaseName, Air
|
|||||||
Squadron_One:SetLivery(Livery)
|
Squadron_One:SetLivery(Livery)
|
||||||
Squadron_One:SetSkill(Skill or AI.Skill.AVERAGE)
|
Squadron_One:SetSkill(Skill or AI.Skill.AVERAGE)
|
||||||
Squadron_One:SetMissionRange(self.missionrange)
|
Squadron_One:SetMissionRange(self.missionrange)
|
||||||
|
Squadron_One:SetRadio(Frequency,Modulation)
|
||||||
|
Squadron_One:AddTacanChannel(TACAN,TACAN)
|
||||||
|
|
||||||
local wing = self.wings[AirbaseName][1] -- Ops.AirWing#AIRWING
|
local wing = self.wings[AirbaseName][1] -- Ops.AirWing#AIRWING
|
||||||
|
|
||||||
@ -738,6 +869,39 @@ function EASYGCICAP:_AddTankerSquadron(TemplateName, SquadName, AirbaseName, Air
|
|||||||
return self
|
return self
|
||||||
end
|
end
|
||||||
|
|
||||||
|
--- (Internal) Add a AWACS Squadron to an Airwing of the manager
|
||||||
|
-- @param #EASYGCICAP self
|
||||||
|
-- @param #string TemplateName Name of the group template.
|
||||||
|
-- @param #string SquadName Squadron name - must be unique!
|
||||||
|
-- @param #string AirbaseName Name of the airbase the airwing resides on, e.g. AIRBASE.Caucasus.Kutaisi
|
||||||
|
-- @param #number AirFrames Number of available airframes, e.g. 20.
|
||||||
|
-- @param #string Skill(optional) Skill level, e.g. AI.Skill.AVERAGE
|
||||||
|
-- @param #string Modex (optional) Modex to be used,e.g. 402.
|
||||||
|
-- @param #string Livery (optional) Livery name to be used.
|
||||||
|
-- @param #number Frequency (optional) Radio frequency of the AWACS
|
||||||
|
-- @param #number Modulation (Optional) Radio modulation of the AWACS
|
||||||
|
-- @return #EASYGCICAP self
|
||||||
|
function EASYGCICAP:_AddAWACSSquadron(TemplateName, SquadName, AirbaseName, AirFrames, Skill, Modex, Livery, Frequency, Modulation)
|
||||||
|
self:T(self.lid.."_AddAWACSSquadron "..SquadName)
|
||||||
|
-- Add Squadrons
|
||||||
|
local Squadron_One = SQUADRON:New(TemplateName,AirFrames,SquadName)
|
||||||
|
Squadron_One:AddMissionCapability({AUFTRAG.Type.AWACS})
|
||||||
|
--Squadron_One:SetFuelLowRefuel(true)
|
||||||
|
Squadron_One:SetFuelLowThreshold(0.3)
|
||||||
|
Squadron_One:SetTurnoverTime(10,20)
|
||||||
|
Squadron_One:SetModex(Modex)
|
||||||
|
Squadron_One:SetLivery(Livery)
|
||||||
|
Squadron_One:SetSkill(Skill or AI.Skill.AVERAGE)
|
||||||
|
Squadron_One:SetMissionRange(self.missionrange)
|
||||||
|
Squadron_One:SetRadio(Frequency,Modulation)
|
||||||
|
local wing = self.wings[AirbaseName][1] -- Ops.AirWing#AIRWING
|
||||||
|
|
||||||
|
wing:AddSquadron(Squadron_One)
|
||||||
|
wing:NewPayload(TemplateName,-1,{AUFTRAG.Type.AWACS},75)
|
||||||
|
|
||||||
|
return self
|
||||||
|
end
|
||||||
|
|
||||||
--- Add a zone to the accepted zones set.
|
--- Add a zone to the accepted zones set.
|
||||||
-- @param #EASYGCICAP self
|
-- @param #EASYGCICAP self
|
||||||
-- @param Core.Zone#ZONE_BASE Zone
|
-- @param Core.Zone#ZONE_BASE Zone
|
||||||
@ -809,7 +973,12 @@ function EASYGCICAP:_StartIntel()
|
|||||||
local clustersize = self:ClusterCountUnits(Cluster) or 1
|
local clustersize = self:ClusterCountUnits(Cluster) or 1
|
||||||
local wingsize = math.abs(overhead * (clustersize+1))
|
local wingsize = math.abs(overhead * (clustersize+1))
|
||||||
if wingsize > maxsize then wingsize = maxsize end
|
if wingsize > maxsize then wingsize = maxsize end
|
||||||
if (not Cluster.mission) and (wingsize > 0) then
|
-- existing mission, and if so - done?
|
||||||
|
local retrymission = true
|
||||||
|
if Cluster.mission and (not Cluster.mission:IsOver()) then
|
||||||
|
retrymission = false
|
||||||
|
end
|
||||||
|
if (retrymission) and (wingsize >= 1) then
|
||||||
MESSAGE:New(string.format("**** %s Interceptors need wingsize %d", UTILS.GetCoalitionName(self.coalition), wingsize),15,"CAPGCI"):ToAllIf(self.debug):ToLog()
|
MESSAGE:New(string.format("**** %s Interceptors need wingsize %d", UTILS.GetCoalitionName(self.coalition), wingsize),15,"CAPGCI"):ToAllIf(self.debug):ToLog()
|
||||||
for _,_data in pairs (wings) do
|
for _,_data in pairs (wings) do
|
||||||
local airwing = _data[1] -- Ops.AirWing#AIRWING
|
local airwing = _data[1] -- Ops.AirWing#AIRWING
|
||||||
@ -920,6 +1089,7 @@ function EASYGCICAP:onafterStart(From,Event,To)
|
|||||||
self:_CreateSquads()
|
self:_CreateSquads()
|
||||||
self:_SetCAPPatrolPoints()
|
self:_SetCAPPatrolPoints()
|
||||||
self:_SetTankerPatrolPoints()
|
self:_SetTankerPatrolPoints()
|
||||||
|
self:_SetAwacsPatrolPoints()
|
||||||
self:__Status(-10)
|
self:__Status(-10)
|
||||||
return self
|
return self
|
||||||
end
|
end
|
||||||
@ -970,7 +1140,7 @@ function EASYGCICAP:onafterStatus(From,Event,To)
|
|||||||
local threatcount = #self.Intel.Clusters or 0
|
local threatcount = #self.Intel.Clusters or 0
|
||||||
local text = "GCICAP "..self.alias
|
local text = "GCICAP "..self.alias
|
||||||
text = text.."\nWings: "..wings.."\nSquads: "..squads.."\nCapPoints: "..caps.."\nAssets on Mission: "..assets.."\nAssets in Stock: "..instock
|
text = text.."\nWings: "..wings.."\nSquads: "..squads.."\nCapPoints: "..caps.."\nAssets on Mission: "..assets.."\nAssets in Stock: "..instock
|
||||||
text = text.."\nThreats:"..threatcount
|
text = text.."\nThreats: "..threatcount
|
||||||
MESSAGE:New(text,15,"GCICAP"):ToAll():ToLogIf(self.debug)
|
MESSAGE:New(text,15,"GCICAP"):ToAll():ToLogIf(self.debug)
|
||||||
end
|
end
|
||||||
self:__Status(30)
|
self:__Status(30)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user