mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2025-10-29 16:58:06 +00:00
Merge branch 'FF/Ops' of https://github.com/FlightControl-Master/MOOSE into FF/Ops
This commit is contained in:
@@ -54,7 +54,9 @@
|
||||
-- @field #string takeoffType Take of type.
|
||||
-- @field #boolean despawnAfterLanding Aircraft are despawned after landing.
|
||||
-- @field #boolean despawnAfterHolding Aircraft are despawned after holding.
|
||||
--
|
||||
-- @field #boolean capOptionPatrolRaceTrack Use closer patrol race track or standard orbit auftrag.
|
||||
-- @field #number capFormation If capOptionPatrolRaceTrack is true, set the formation, also.
|
||||
--
|
||||
-- @extends Ops.Legion#LEGION
|
||||
|
||||
--- *I fly because it releases my mind from the tyranny of petty things.* -- Antoine de Saint-Exupery
|
||||
@@ -128,6 +130,8 @@ AIRWING = {
|
||||
pointsAWACS = {},
|
||||
pointsRecon = {},
|
||||
markpoints = false,
|
||||
capOptionPatrolRaceTrack = false,
|
||||
capFormation = nil,
|
||||
}
|
||||
|
||||
--- Payload data.
|
||||
@@ -179,7 +183,7 @@ AIRWING = {
|
||||
|
||||
--- AIRWING class version.
|
||||
-- @field #string version
|
||||
AIRWING.version="0.9.3"
|
||||
AIRWING.version="0.9.4"
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
-- ToDo list
|
||||
@@ -699,6 +703,24 @@ function AIRWING:SetNumberCAP(n)
|
||||
return self
|
||||
end
|
||||
|
||||
--- Set CAP flight formation.
|
||||
-- @param #AIRWING self
|
||||
-- @param #number Formation Formation to take, e.g. ENUMS.Formation.FixedWing.Trail.Close, also see [Hoggit Wiki](https://wiki.hoggitworld.com/view/DCS_option_formation).
|
||||
-- @return #AIRWING self
|
||||
function AIRWING:SetCAPFormation(Formation)
|
||||
self.capFormation = Formation
|
||||
return self
|
||||
end
|
||||
|
||||
--- Set CAP close race track.We'll utilize the AUFTRAG PatrolRaceTrack instead of a standard race track orbit task.
|
||||
-- @param #AIRWING self
|
||||
-- @param #boolean OnOff If true, switch this on, else switch off. Off by default.
|
||||
-- @return #AIRWING self
|
||||
function AIRWING:SetCapCloseRaceTrack(OnOff)
|
||||
self.capOptionPatrolRaceTrack = OnOff
|
||||
return self
|
||||
end
|
||||
|
||||
--- Set number of TANKER flights with Boom constantly in the air.
|
||||
-- @param #AIRWING self
|
||||
-- @param #number Nboom Number of flights. Default 1.
|
||||
@@ -1112,13 +1134,14 @@ end
|
||||
-- @return #AIRWING self
|
||||
function AIRWING:CheckCAP()
|
||||
|
||||
local Ncap=0 --self:CountMissionsInQueue({AUFTRAG.Type.GCICAP, AUFTRAG.Type.INTERCEPT})
|
||||
local Ncap=0
|
||||
|
||||
|
||||
-- Count CAP missions.
|
||||
for _,_mission in pairs(self.missionqueue) do
|
||||
local mission=_mission --Ops.Auftrag#AUFTRAG
|
||||
|
||||
if mission:IsNotOver() and mission.type==AUFTRAG.Type.GCICAP and mission.patroldata then
|
||||
if mission:IsNotOver() and (mission.type==AUFTRAG.Type.GCICAP or mission.type == AUFTRAG.Type.PATROLRACETRACK) and mission.patroldata then
|
||||
Ncap=Ncap+1
|
||||
end
|
||||
|
||||
@@ -1130,8 +1153,18 @@ function AIRWING:CheckCAP()
|
||||
|
||||
local altitude=patrol.altitude+1000*patrol.noccupied
|
||||
|
||||
local missionCAP=AUFTRAG:NewGCICAP(patrol.coord, altitude, patrol.speed, patrol.heading, patrol.leg)
|
||||
|
||||
local missionCAP = nil -- Ops.Auftrag#AUFTRAG
|
||||
|
||||
if self.capOptionPatrolRaceTrack then
|
||||
|
||||
missionCAP=AUFTRAG:NewPATROL_RACETRACK(patrol.coord,altitude,patrol.speed,patrol.heading,patrol.leg, self.capFormation)
|
||||
|
||||
else
|
||||
|
||||
missionCAP=AUFTRAG:NewGCICAP(patrol.coord, altitude, patrol.speed, patrol.heading, patrol.leg)
|
||||
|
||||
end
|
||||
|
||||
missionCAP.patroldata=patrol
|
||||
|
||||
patrol.noccupied=patrol.noccupied+1
|
||||
@@ -1150,7 +1183,7 @@ end
|
||||
-- @return #AIRWING self
|
||||
function AIRWING:CheckRECON()
|
||||
|
||||
local Ncap=0 --self:CountMissionsInQueue({AUFTRAG.Type.GCICAP, AUFTRAG.Type.INTERCEPT})
|
||||
local Ncap=0
|
||||
|
||||
-- Count CAP missions.
|
||||
for _,_mission in pairs(self.missionqueue) do
|
||||
@@ -1278,7 +1311,6 @@ function AIRWING:CheckAWACS()
|
||||
|
||||
end
|
||||
|
||||
|
||||
for i=1,self.nflightsAWACS-N do
|
||||
|
||||
local patrol=self:_GetPatrolData(self.pointsAWACS)
|
||||
|
||||
@@ -443,6 +443,7 @@ _AUFTRAGSNR=0
|
||||
-- @field #string REARMING Rearming mission.
|
||||
-- @field #string CAPTUREZONE Capture zone mission.
|
||||
-- @field #string NOTHING Nothing.
|
||||
-- @field #string PATROLRACETRACK Patrol Racetrack.
|
||||
AUFTRAG.Type={
|
||||
ANTISHIP="Anti Ship",
|
||||
AWACS="AWACS",
|
||||
@@ -484,10 +485,10 @@ AUFTRAG.Type={
|
||||
RELOCATECOHORT="Relocate Cohort",
|
||||
AIRDEFENSE="Air Defence",
|
||||
EWR="Early Warning Radar",
|
||||
--RECOVERYTANKER="Recovery Tanker",
|
||||
REARMING="Rearming",
|
||||
CAPTUREZONE="Capture Zone",
|
||||
NOTHING="Nothing",
|
||||
PATROLRACETRACK="Patrol Racetrack",
|
||||
}
|
||||
|
||||
--- Special task description.
|
||||
@@ -511,6 +512,7 @@ AUFTRAG.Type={
|
||||
-- @field #string REARMING Rearming.
|
||||
-- @field #string CAPTUREZONE Capture OPS zone.
|
||||
-- @field #string NOTHING Nothing.
|
||||
-- @field #string PATROLRACETRACK Patrol Racetrack.
|
||||
AUFTRAG.SpecialTask={
|
||||
FORMATION="Formation",
|
||||
PATROLZONE="PatrolZone",
|
||||
@@ -532,6 +534,7 @@ AUFTRAG.SpecialTask={
|
||||
REARMING="Rearming",
|
||||
CAPTUREZONE="Capture Zone",
|
||||
NOTHING="Nothing",
|
||||
PATROLRACETRACK="Patrol Racetrack",
|
||||
}
|
||||
|
||||
--- Mission status.
|
||||
@@ -652,7 +655,7 @@ AUFTRAG.Category={
|
||||
|
||||
--- AUFTRAG class version.
|
||||
-- @field #string version
|
||||
AUFTRAG.version="1.2.0"
|
||||
AUFTRAG.version="1.2.1"
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
-- TODO list
|
||||
@@ -1017,7 +1020,7 @@ end
|
||||
-- @param #number Altitude Hover altitude in feet AGL. Default is 50 feet above ground.
|
||||
-- @param #number Time Time in seconds to hold the hover. Default 300 seconds.
|
||||
-- @param #number Speed Speed in knots to fly to the target coordinate. Default 150kn.
|
||||
-- @param #number MissionAlt Altitide to fly towards the mission in feet AGL. Default 1000ft.
|
||||
-- @param #number MissionAlt Altitude to fly towards the mission in feet AGL. Default 1000ft.
|
||||
-- @return #AUFTRAG self
|
||||
function AUFTRAG:NewHOVER(Coordinate, Altitude, Time, Speed, MissionAlt)
|
||||
|
||||
@@ -1049,6 +1052,58 @@ function AUFTRAG:NewHOVER(Coordinate, Altitude, Time, Speed, MissionAlt)
|
||||
return mission
|
||||
end
|
||||
|
||||
--- **[AIR]** Create an enhanced orbit race track mission. Planes will keep closer to the track.
|
||||
-- @param #AUFTRAG self
|
||||
-- @param Core.Point#COORDINATE Coordinate Where to start the race track.
|
||||
-- @param #number Altitude (Optional) Altitude in feet. Defaults to 20,000ft ASL.
|
||||
-- @param #number Speed (Optional) Speed in knots. Defaults to 300kn TAS.
|
||||
-- @param #number Heading (Optional) Heading in degrees, 0 to 360. Defaults to 90 degree (East).
|
||||
-- @param #number Leg (Optional) Leg of the race track in NM. Defaults to 10nm.
|
||||
-- @param #number Formation (Optional) Formation to take, e.g. ENUMS.Formation.FixedWing.Trail.Close, also see [Hoggit Wiki](https://wiki.hoggitworld.com/view/DCS_option_formation).
|
||||
-- @return #AUFTRAG self
|
||||
function AUFTRAG:NewPATROL_RACETRACK(Coordinate,Altitude,Speed,Heading,Leg,Formation)
|
||||
|
||||
local mission = AUFTRAG:New(AUFTRAG.Type.PATROLRACETRACK)
|
||||
|
||||
-- Target.
|
||||
mission:_TargetFromObject(Coordinate)
|
||||
|
||||
-- Set Altitude.
|
||||
if Altitude then
|
||||
mission.TrackAltitude=UTILS.FeetToMeters(Altitude)
|
||||
else
|
||||
mission.TrackAltitude=UTILS.FeetToMeters(20000)
|
||||
end
|
||||
|
||||
-- Points
|
||||
mission.TrackPoint1 = Coordinate
|
||||
|
||||
local leg = UTILS.NMToMeters(Leg) or UTILS.NMToMeters(10)
|
||||
|
||||
local heading = Heading or 90
|
||||
|
||||
if heading < 0 or heading > 360 then heading = 90 end
|
||||
|
||||
mission.TrackPoint2 = Coordinate:Translate(leg,heading,true)
|
||||
|
||||
-- Orbit speed in m/s TAS.
|
||||
mission.TrackSpeed = UTILS.IasToTas(UTILS.KnotsToKmph(Speed or 300), mission.TrackAltitude)
|
||||
|
||||
-- Mission speed in km/h and altitude
|
||||
mission.missionSpeed = UTILS.KnotsToKmph(Speed or 300)
|
||||
mission.missionAltitude = mission.TrackAltitude * 0.9
|
||||
mission.missionTask=ENUMS.MissionTask.CAP
|
||||
mission.optionROE=ENUMS.ROE.ReturnFire
|
||||
mission.optionROT=ENUMS.ROT.PassiveDefense
|
||||
|
||||
mission.categories={AUFTRAG.Category.AIRCRAFT}
|
||||
|
||||
mission.DCStask=mission:GetDCSMissionTask()
|
||||
|
||||
return mission
|
||||
end
|
||||
|
||||
|
||||
--- **[AIR]** Create an ORBIT mission, which can be either a circular orbit or a race-track pattern.
|
||||
-- @param #AUFTRAG self
|
||||
-- @param Core.Point#COORDINATE Coordinate Where to orbit.
|
||||
@@ -1181,7 +1236,7 @@ function AUFTRAG:NewORBIT_GROUP(Group, Altitude, Speed, Leg, Heading, OffsetVec2
|
||||
end
|
||||
|
||||
|
||||
--- **[AIR]** Create a Ground Controlled CAP (GCICAP) mission. Flights with this task are considered for A2A INTERCEPT missions by the CHIEF class. They will perform a compat air patrol but not engage by
|
||||
--- **[AIR]** Create a Ground Controlled CAP (GCICAP) mission. Flights with this task are considered for A2A INTERCEPT missions by the CHIEF class. They will perform a combat air patrol but not engage by
|
||||
-- themselfs. They wait for the CHIEF to tell them whom to engage.
|
||||
-- @param #AUFTRAG self
|
||||
-- @param Core.Point#COORDINATE Coordinate Where to orbit.
|
||||
@@ -2688,6 +2743,8 @@ function AUFTRAG:NewAUTO(EngageGroup)
|
||||
mission=AUFTRAG:NewTANKER(Coordinate,Altitude,Speed,Heading,Leg,RefuelSystem)
|
||||
elseif auftrag==AUFTRAG.Type.TROOPTRANSPORT then
|
||||
mission=AUFTRAG:NewTROOPTRANSPORT(TransportGroupSet,DropoffCoordinate,PickupCoordinate)
|
||||
elseif auftrag==AUFTRAG.Type.PATROLRACETRACK then
|
||||
mission=AUFTRAG:NewPATROL_RACETRACK(Coordinate,Altitude,Speed,Heading,Leg,Formation)
|
||||
else
|
||||
|
||||
end
|
||||
@@ -6343,8 +6400,32 @@ function AUFTRAG:GetDCSMissionTask()
|
||||
|
||||
DCStask.params=param
|
||||
|
||||
table.insert(DCStasks, DCStask)
|
||||
table.insert(DCStasks, DCStask)
|
||||
|
||||
elseif self.type==AUFTRAG.Type.PATROLRACETRACK then
|
||||
|
||||
---------------------
|
||||
-- Enhanced Orbit Racetrack --
|
||||
---------------------
|
||||
|
||||
local DCStask={}
|
||||
DCStask.id=AUFTRAG.SpecialTask.PATROLRACETRACK
|
||||
|
||||
local param={}
|
||||
-- ONTROLLABLE:PatrolRaceTrack(Point1, Point2, Altitude, Speed, Formation, Delay)
|
||||
|
||||
param.TrackAltitude = self.TrackAltitude
|
||||
param.TrackSpeed = self.TrackSpeed
|
||||
param.TrackPoint1 = self.TrackPoint1
|
||||
param.TrackPoint2 = self.TrackPoint2
|
||||
param.missionSpeed = self.missionSpeed
|
||||
param.missionAltitude = self.missionAltitude
|
||||
param.TrackFormation = self.TrackFormation
|
||||
|
||||
DCStask.params=param
|
||||
|
||||
table.insert(DCStasks, DCStask)
|
||||
|
||||
elseif self.type==AUFTRAG.Type.HOVER then
|
||||
|
||||
---------------------
|
||||
@@ -6619,6 +6700,8 @@ function AUFTRAG:GetMissionTaskforMissionType(MissionType)
|
||||
mtask=ENUMS.MissionTask.NOTHING
|
||||
elseif MissionType==AUFTRAG.Type.HOVER then
|
||||
mtask=ENUMS.MissionTask.NOTHING
|
||||
elseif MissionType==AUFTRAG.Type.PATROLRACETRACK then
|
||||
mtask=ENUMS.MissionTask.CAP
|
||||
end
|
||||
|
||||
return mtask
|
||||
|
||||
@@ -75,7 +75,7 @@ COHORT = {
|
||||
livery = nil,
|
||||
skill = nil,
|
||||
legion = nil,
|
||||
Ngroups = nil,
|
||||
--Ngroups = nil,
|
||||
Ngroups = 0,
|
||||
engageRange = nil,
|
||||
tacanChannel = {},
|
||||
@@ -1098,7 +1098,7 @@ function COHORT:RecruitAssets(MissionType, Npayloads)
|
||||
-- Assets on mission NOTHING are considered.
|
||||
table.insert(assets, asset)
|
||||
|
||||
elseif self.legion:IsAssetOnMission(asset, AUFTRAG.Type.GCICAP) and MissionType==AUFTRAG.Type.INTERCEPT then
|
||||
elseif self.legion:IsAssetOnMission(asset, {AUFTRAG.Type.GCICAP, AUFTRAG.Type.PATROLRACETRACK}) and MissionType==AUFTRAG.Type.INTERCEPT then
|
||||
|
||||
-- Check if the payload of this asset is compatible with the mission.
|
||||
-- Note: we do not check the payload as an asset that is on a GCICAP mission should be able to do an INTERCEPT as well!
|
||||
@@ -1595,4 +1595,3 @@ end
|
||||
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
|
||||
@@ -64,6 +64,7 @@
|
||||
-- @field Core.Set#SET_ZONE NoGoZoneSet
|
||||
-- @field #boolean Monitor
|
||||
-- @field #boolean TankerInvisible
|
||||
-- @field #number CapFormation
|
||||
-- @extends Core.Fsm#FSM
|
||||
|
||||
--- *“Airspeed, altitude, and brains. Two are always needed to successfully complete the flight.”* -- Unknown.
|
||||
@@ -207,6 +208,7 @@ EASYGCICAP = {
|
||||
NoGoZoneSet = nil,
|
||||
Monitor = false,
|
||||
TankerInvisible = true,
|
||||
CapFormation = nil,
|
||||
}
|
||||
|
||||
--- Internal Squadron data type
|
||||
@@ -242,7 +244,7 @@ EASYGCICAP = {
|
||||
|
||||
--- EASYGCICAP class version.
|
||||
-- @field #string version
|
||||
EASYGCICAP.version="0.0.8"
|
||||
EASYGCICAP.version="0.0.9"
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
-- TODO list
|
||||
@@ -289,6 +291,7 @@ function EASYGCICAP:New(Alias, AirbaseName, Coalition, EWRName)
|
||||
self.repeatsonfailure = 3
|
||||
self.Monitor = false
|
||||
self.TankerInvisible = true
|
||||
self.CapFormation = ENUMS.Formation.FixedWing.FingerFour.Group
|
||||
|
||||
-- Set some string id for output to DCS.log file.
|
||||
self.lid=string.format("EASYGCICAP %s | ", self.alias)
|
||||
@@ -313,6 +316,14 @@ end
|
||||
-- Functions
|
||||
-------------------------------------------------------------------------
|
||||
|
||||
--- Set CAP formation.
|
||||
-- @param #EASYGCICAP self
|
||||
-- @param #number Formation Formation to fly, defaults to ENUMS.Formation.FixedWing.FingerFour.Group
|
||||
-- @return #EASYGCICAP self
|
||||
function EASYGCICAP:SetCAPFormation(Formation)
|
||||
self.CapFormation = Formation
|
||||
return self
|
||||
end
|
||||
|
||||
--- Set Tanker and AWACS to be invisible to enemy AI eyes
|
||||
-- @param #EASYGCICAP self
|
||||
@@ -476,6 +487,8 @@ end
|
||||
function EASYGCICAP:_AddAirwing(Airbasename, Alias)
|
||||
self:T(self.lid.."_AddAirwing "..Airbasename)
|
||||
|
||||
local CapFormation = self.CapFormation
|
||||
|
||||
-- Create Airwing
|
||||
local CAP_Wing = AIRWING:New(Airbasename,Alias)
|
||||
CAP_Wing:SetVerbosityLevel(3)
|
||||
@@ -484,11 +497,15 @@ function EASYGCICAP:_AddAirwing(Airbasename, Alias)
|
||||
CAP_Wing:SetAirbase(AIRBASE:FindByName(Airbasename))
|
||||
CAP_Wing:SetRespawnAfterDestroyed()
|
||||
CAP_Wing:SetNumberCAP(self.capgrouping)
|
||||
CAP_Wing:SetCapCloseRaceTrack(true)
|
||||
if CapFormation then
|
||||
CAP_Wing:SetCAPFormation(CapFormation)
|
||||
end
|
||||
if #self.ManagedTK > 0 then
|
||||
CAP_Wing:SetNumberTankerBoom(1)
|
||||
CAP_Wing:SetNumberTankerProbe(1)
|
||||
end
|
||||
if #self.ManagedAW > 0 then
|
||||
if #self.ManagedEWR > 0 then
|
||||
CAP_Wing:SetNumberAWACS(1)
|
||||
end
|
||||
if #self.ManagedREC > 0 then
|
||||
@@ -515,6 +532,9 @@ function EASYGCICAP:_AddAirwing(Airbasename, Alias)
|
||||
flightgroup:SetDetection(true)
|
||||
flightgroup:SetEngageDetectedOn(self.engagerange,{"Air"},self.GoZoneSet,self.NoGoZoneSet)
|
||||
flightgroup:SetOutOfAAMRTB()
|
||||
if CapFormation then
|
||||
flightgroup:GetGroup():SetOption(AI.Option.Air.id.FORMATION,CapFormation)
|
||||
end
|
||||
end
|
||||
if Mission.type == AUFTRAG.Type.TANKER or Mission.type == AUFTRAG.Type.AWACS or Mission.type == AUFTRAG.Type.RECON then
|
||||
if TankerInvisible then
|
||||
@@ -549,8 +569,8 @@ end
|
||||
-- @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 Altitude Defaults to 25000 feet ASL.
|
||||
-- @param #number Speed Defaults to 300 knots TAS.
|
||||
-- @param #number Heading Defaults to 90 degrees (East).
|
||||
-- @param #number LegLength Defaults to 15 NM.
|
||||
-- @return #EASYGCICAP self
|
||||
@@ -888,7 +908,7 @@ function EASYGCICAP:_AddSquadron(TemplateName, SquadName, AirbaseName, AirFrames
|
||||
self:T(self.lid.."_AddSquadron "..SquadName)
|
||||
-- Add Squadrons
|
||||
local Squadron_One = SQUADRON:New(TemplateName,AirFrames,SquadName)
|
||||
Squadron_One:AddMissionCapability({AUFTRAG.Type.CAP, AUFTRAG.Type.GCICAP, AUFTRAG.Type.INTERCEPT, AUFTRAG.Type.ALERT5})
|
||||
Squadron_One:AddMissionCapability({AUFTRAG.Type.CAP, AUFTRAG.Type.GCICAP, AUFTRAG.Type.INTERCEPT, AUFTRAG.Type.PATROLRACETRACK, AUFTRAG.Type.ALERT5})
|
||||
--Squadron_One:SetFuelLowRefuel(true)
|
||||
Squadron_One:SetFuelLowThreshold(0.3)
|
||||
Squadron_One:SetTurnoverTime(10,20)
|
||||
@@ -900,7 +920,7 @@ function EASYGCICAP:_AddSquadron(TemplateName, SquadName, AirbaseName, AirFrames
|
||||
local wing = self.wings[AirbaseName][1] -- Ops.AirWing#AIRWING
|
||||
|
||||
wing:AddSquadron(Squadron_One)
|
||||
wing:NewPayload(TemplateName,-1,{AUFTRAG.Type.CAP, AUFTRAG.Type.GCICAP, AUFTRAG.Type.INTERCEPT, AUFTRAG.Type.ALERT5},75)
|
||||
wing:NewPayload(TemplateName,-1,{AUFTRAG.Type.CAP, AUFTRAG.Type.GCICAP, AUFTRAG.Type.INTERCEPT, AUFTRAG.Type.PATROLRACETRACK, AUFTRAG.Type.ALERT5},75)
|
||||
|
||||
return self
|
||||
end
|
||||
@@ -1234,12 +1254,16 @@ function EASYGCICAP:onafterStatus(From,Event,To)
|
||||
local capmission = 0
|
||||
local interceptmission = 0
|
||||
local reconmission = 0
|
||||
local awacsmission = 0
|
||||
local tankermission = 0
|
||||
for _,_wing in pairs(self.wings) do
|
||||
local count = _wing[1]:CountAssetsOnMission(MissionTypes,Cohort)
|
||||
local count2 = _wing[1]:CountAssets(true,MissionTypes,Attributes)
|
||||
capmission = capmission + _wing[1]:CountMissionsInQueue({AUFTRAG.Type.GCICAP})
|
||||
capmission = capmission + _wing[1]:CountMissionsInQueue({AUFTRAG.Type.GCICAP,AUFTRAG.Type.PATROLRACETRACK})
|
||||
interceptmission = interceptmission + _wing[1]:CountMissionsInQueue({AUFTRAG.Type.INTERCEPT})
|
||||
reconmission = reconmission + _wing[1]:CountMissionsInQueue({AUFTRAG.Type.RECON})
|
||||
awacsmission = awacsmission + _wing[1]:CountMissionsInQueue({AUFTRAG.Type.AWACS})
|
||||
tankermission = tankermission + _wing[1]:CountMissionsInQueue({AUFTRAG.Type.TANKER})
|
||||
assets = assets + count
|
||||
instock = instock + count2
|
||||
end
|
||||
@@ -1251,6 +1275,8 @@ function EASYGCICAP:onafterStatus(From,Event,To)
|
||||
text = text.."\nMissions: "..capmission+interceptmission
|
||||
text = text.."\n - CAP: "..capmission
|
||||
text = text.."\n - Intercept: "..interceptmission
|
||||
text = text.."\n - AWACS: "..awacsmission
|
||||
text = text.."\n - TANKER: "..tankermission
|
||||
text = text.."\n - Recon: "..reconmission
|
||||
MESSAGE:New(text,15,"GCICAP"):ToAll():ToLogIf(self.debug)
|
||||
end
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
--
|
||||
-- * Manage aircraft departure and arrival
|
||||
-- * Handles AI and human players
|
||||
-- * Limit number of AI groups taxiing, taking off and landing simultaniously
|
||||
-- * Limit number of AI groups taxiing, taking off and landing simultaneously
|
||||
-- * Immersive voice overs via SRS text-to-speech
|
||||
-- * Define holding patterns for airdromes
|
||||
--
|
||||
@@ -61,6 +61,7 @@
|
||||
-- @field #number runwaydestroyed Time stamp (abs), when runway was destroyed. If `nil`, runway is operational.
|
||||
-- @field #number runwayrepairtime Time in seconds until runway will be repaired after it was destroyed. Default is 3600 sec (one hour).
|
||||
-- @field #boolean markerParking If `true`, occupied parking spots are marked.
|
||||
-- @field #boolean nosubs If `true`, SRS TTS is without subtitles.
|
||||
-- @extends Core.Fsm#FSM
|
||||
|
||||
--- **Ground Control**: Airliner X, Good news, you are clear to taxi to the active.
|
||||
@@ -122,7 +123,7 @@
|
||||
-- * `Length` is the length of the pattern.
|
||||
-- * `FlightLevelMin` is the lowest altitude at which aircraft can hold.
|
||||
-- * `FlightLevelMax` is the highest altitude at which aircraft can hold.
|
||||
-- * `Prio` is the priority of this holdig stacks. If multiple patterns are defined, patterns with higher prio will be filled first.
|
||||
-- * `Prio` is the priority of this holding stacks. If multiple patterns are defined, patterns with higher prio will be filled first.
|
||||
--
|
||||
-- # Parking Guard
|
||||
--
|
||||
@@ -137,13 +138,13 @@
|
||||
--
|
||||
-- # Limits for Inbound and Outbound Flights
|
||||
--
|
||||
-- You can define limits on how many aircraft are simultaniously landing and taking off. This avoids (DCS) problems where taxiing aircraft cause a "traffic jam" on the taxi way(s)
|
||||
-- You can define limits on how many aircraft are simultaneously landing and taking off. This avoids (DCS) problems where taxiing aircraft cause a "traffic jam" on the taxi way(s)
|
||||
-- and bring the whole airbase effectively to a stand still.
|
||||
--
|
||||
-- ## Landing Limits
|
||||
--
|
||||
-- The number of groups getting landing clearance can be set with the @{#FLIGHTCONTROL.SetLimitLanding}(*Nlanding, Ntakeoff*) function.
|
||||
-- The first parameter, `Nlanding`, defines how many groups get clearance simultaniously.
|
||||
-- The first parameter, `Nlanding`, defines how many groups get clearance simultaneously.
|
||||
--
|
||||
-- The second parameter, `Ntakeoff`, sets a limit on how many flights can take off whilst inbound flights still get clearance. By default, this is set to zero because the runway can only be used for takeoff *or*
|
||||
-- landing. So if you have a flight taking off, inbound fights will have to wait until the runway is clear.
|
||||
@@ -155,7 +156,7 @@
|
||||
-- ## Taxiing/Takeoff Limits
|
||||
--
|
||||
-- The number of AI flight groups getting clearance to taxi to the runway can be set with the @{#FLIGHTCONTROL.SetLimitTaxi}(*Nlanding, Ntakeoff*) function.
|
||||
-- The first parameter, `Ntaxi`, defines how many groups are allowed to taxi to the runway simultaniously. Note that once the AI starts to taxi, we loose complete control over it.
|
||||
-- The first parameter, `Ntaxi`, defines how many groups are allowed to taxi to the runway simultaneously. Note that once the AI starts to taxi, we loose complete control over it.
|
||||
-- They will follow their internal logic to get the the runway and take off. Therefore, giving clearance to taxi is equivalent to giving them clearance for takeoff.
|
||||
--
|
||||
-- By default, the parameter only counts the number of flights taxiing *to* the runway. If you set the second parameter, `IncludeInbound`, to `true`, this will also count the flights
|
||||
@@ -237,9 +238,9 @@
|
||||
-- atcNellis:SetParkingGuardStatic("Static Generator F Template")
|
||||
-- -- Set taxi speed limit to 25 knots.
|
||||
-- atcNellis:SetSpeedLimitTaxi(25)
|
||||
-- -- Set that max 3 groups are allowed to taxi simultaniously.
|
||||
-- -- Set that max 3 groups are allowed to taxi simultaneously.
|
||||
-- atcNellis:SetLimitTaxi(3, false, 1)
|
||||
-- -- Set that max 2 groups are allowd to land simultaniously and unlimited number (99) groups can land, while other groups are taking off.
|
||||
-- -- Set that max 2 groups are allowd to land simultaneously and unlimited number (99) groups can land, while other groups are taking off.
|
||||
-- atcNellis:SetLimitLanding(2, 99)
|
||||
-- -- Use Google for text-to-speech.
|
||||
-- atcNellis:SetSRSTower(nil, nil, "en-AU-Standard-A", nil, nil, "D:\\Path To Google\\GoogleCredentials.json")
|
||||
@@ -270,6 +271,7 @@ FLIGHTCONTROL = {
|
||||
Nparkingspots = nil,
|
||||
holdingpatterns = {},
|
||||
hpcounter = 0,
|
||||
nosubs = false,
|
||||
}
|
||||
|
||||
--- Holding point. Contains holding stacks.
|
||||
@@ -327,7 +329,7 @@ FLIGHTCONTROL.FlightStatus={
|
||||
|
||||
--- FlightControl class version.
|
||||
-- @field #string version
|
||||
FLIGHTCONTROL.version="0.7.3"
|
||||
FLIGHTCONTROL.version="0.7.4"
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
-- TODO list
|
||||
@@ -407,6 +409,7 @@ function FLIGHTCONTROL:New(AirbaseName, Frequency, Modulation, PathToSRS, Port,
|
||||
self:SetFrequency(Frequency, Modulation)
|
||||
self:SetMarkHoldingPattern(true)
|
||||
self:SetRunwayRepairtime()
|
||||
self.nosubs = false
|
||||
|
||||
-- Set SRS Port
|
||||
self:SetSRSPort(Port or 5002)
|
||||
@@ -556,6 +559,22 @@ function FLIGHTCONTROL:SetVerbosity(VerbosityLevel)
|
||||
return self
|
||||
end
|
||||
|
||||
--- Set subtitles to appear on SRS TTS messages.
|
||||
-- @param #FLIGHTCONTROL self
|
||||
-- @return #FLIGHTCONTROL self
|
||||
function FLIGHTCONTROL:SwitchSubtitlesOn()
|
||||
self.nosubs = false
|
||||
return self
|
||||
end
|
||||
|
||||
--- Set subtitles to appear on SRS TTS messages.
|
||||
-- @param #FLIGHTCONTROL self
|
||||
-- @return #FLIGHTCONTROL self
|
||||
function FLIGHTCONTROL:SwitchSubtitlesOff()
|
||||
self.nosubs = true
|
||||
return self
|
||||
end
|
||||
|
||||
--- Set the tower frequency.
|
||||
-- @param #FLIGHTCONTROL self
|
||||
-- @param #number Frequency Frequency in MHz. Default 305 MHz.
|
||||
@@ -595,7 +614,7 @@ end
|
||||
-- @param #string Culture Culture, e.g. "en-GB" (default).
|
||||
-- @param #string Voice Specific voice. Overrides `Gender` and `Culture`.
|
||||
-- @param #number Volume Volume. Default 1.0.
|
||||
-- @param #string Label Name under which SRS transmitts.
|
||||
-- @param #string Label Name under which SRS transmits.
|
||||
-- @param #string PathToGoogleCredentials Path to google credentials json file.
|
||||
-- @param #number Port Server port for SRS
|
||||
-- @return #FLIGHTCONTROL self
|
||||
@@ -626,7 +645,7 @@ end
|
||||
-- @param #string Culture Culture, e.g. "en-GB" (default).
|
||||
-- @param #string Voice Specific voice. Overrides `Gender` and `Culture`. See [Google Voices](https://cloud.google.com/text-to-speech/docs/voices).
|
||||
-- @param #number Volume Volume. Default 1.0.
|
||||
-- @param #string Label Name under which SRS transmitts. Default `self.alias`.
|
||||
-- @param #string Label Name under which SRS transmits. Default `self.alias`.
|
||||
-- @param #string PathToGoogleCredentials Path to google credentials json file.
|
||||
-- @return #FLIGHTCONTROL self
|
||||
function FLIGHTCONTROL:SetSRSTower(Gender, Culture, Voice, Volume, Label, PathToGoogleCredentials)
|
||||
@@ -644,7 +663,7 @@ end
|
||||
-- @param #string Culture Culture, e.g. "en-US" (default).
|
||||
-- @param #string Voice Specific voice. Overrides `Gender` and `Culture`.
|
||||
-- @param #number Volume Volume. Default 1.0.
|
||||
-- @param #string Label Name under which SRS transmitts. Default "Pilot".
|
||||
-- @param #string Label Name under which SRS transmits. Default "Pilot".
|
||||
-- @param #string PathToGoogleCredentials Path to google credentials json file.
|
||||
-- @return #FLIGHTCONTROL self
|
||||
function FLIGHTCONTROL:SetSRSPilot(Gender, Culture, Voice, Volume, Label, PathToGoogleCredentials)
|
||||
@@ -657,17 +676,17 @@ function FLIGHTCONTROL:SetSRSPilot(Gender, Culture, Voice, Volume, Label, PathTo
|
||||
end
|
||||
|
||||
|
||||
--- Set the number of aircraft groups, that are allowed to land simultaniously.
|
||||
--- Set the number of aircraft groups, that are allowed to land simultaneously.
|
||||
-- Note that this restricts AI and human players.
|
||||
--
|
||||
-- By default, up to two groups get landing clearance. They are spaced out in time, i.e. after the first one got cleared, the second has to wait a bit.
|
||||
-- This
|
||||
--
|
||||
-- By default, landing clearance is only given when **no** other flight is taking off. You can adjust this for airports with more than one runway or
|
||||
-- in cases where simulatious takeoffs and landings are unproblematic. Note that only because there are multiple runways, it does not mean the AI uses them.
|
||||
-- in cases where simultaneous takeoffs and landings are unproblematic. Note that only because there are multiple runways, it does not mean the AI uses them.
|
||||
--
|
||||
-- @param #FLIGHTCONTROL self
|
||||
-- @param #number Nlanding Max number of aircraft landing simultaniously. Default 2.
|
||||
-- @param #number Nlanding Max number of aircraft landing simultaneously. Default 2.
|
||||
-- @param #number Ntakeoff Allowed number of aircraft taking off for groups to get landing clearance. Default 0.
|
||||
-- @return #FLIGHTCONTROL self
|
||||
function FLIGHTCONTROL:SetLimitLanding(Nlanding, Ntakeoff)
|
||||
@@ -691,7 +710,7 @@ function FLIGHTCONTROL:SetLandingInterval(dt)
|
||||
end
|
||||
|
||||
|
||||
--- Set the number of **AI** aircraft groups, that are allowed to taxi simultaniously.
|
||||
--- Set the number of **AI** aircraft groups, that are allowed to taxi simultaneously.
|
||||
-- If the limit is reached, other AI groups not get taxi clearance to taxi to the runway.
|
||||
--
|
||||
-- By default, this only counts the number of AI that taxi from their parking position to the runway.
|
||||
@@ -887,7 +906,7 @@ end
|
||||
-- Note that this is the time, the DCS engine uses not something we can control on a user level or we could get via scripting.
|
||||
-- You need to input the value. On the DCS forum it was stated that this is currently one hour. Hence this is the default value.
|
||||
-- @param #FLIGHTCONTROL self
|
||||
-- @param #number RepairTime Time in seconds until the runway is repaired. Default 3600 sec (one hour).
|
||||
-- @param #number RepairTime Time in seconds until the runway is repaired. Default 3600sec (one hour).
|
||||
-- @return #FLIGHTCONTROL self
|
||||
function FLIGHTCONTROL:SetRunwayRepairtime(RepairTime)
|
||||
self.runwayrepairtime=RepairTime or 3600
|
||||
@@ -1010,7 +1029,7 @@ function FLIGHTCONTROL:onbeforeStatusUpdate()
|
||||
if Tqueue>0 then
|
||||
-- Debug info.
|
||||
local text=string.format("Still got %d messages in the radio queue. Will call status again in %.1f sec", #self.msrsqueue, Tqueue)
|
||||
self:I(self.lid..text)
|
||||
self:T(self.lid..text)
|
||||
|
||||
-- Call status again in dt seconds.
|
||||
self:__StatusUpdate(-Tqueue)
|
||||
@@ -2753,9 +2772,10 @@ function FLIGHTCONTROL:_PlayerInfoATIS(groupname)
|
||||
if flight then
|
||||
|
||||
local text=string.format("Airbase %s ATIS:", self.airbasename)
|
||||
|
||||
local srstxt = string.format("Airbase %s ", self.airbasename)
|
||||
if self.atis then
|
||||
text=text..string.format("\nATIS %.3f MHz %s", self.atis.frequency, UTILS.GetModulationName(self.atis.modulation))
|
||||
srstxt=srstxt..string.format("ATIS %.3f Megahertz %s", self.atis.frequency, UTILS.GetModulationName(self.atis.modulation))
|
||||
if self.atis.towerfrequency then
|
||||
local tower=""
|
||||
for _,freq in pairs(self.atis.towerfrequency) do
|
||||
@@ -2779,7 +2799,17 @@ function FLIGHTCONTROL:_PlayerInfoATIS(groupname)
|
||||
end
|
||||
|
||||
-- Message to flight
|
||||
self:TextMessageToFlight(text, flight, 10, true)
|
||||
|
||||
--self:TextMessageToFlight(text, flight, 10, true)
|
||||
-- Call sign.
|
||||
local callsign=self:_GetCallsignName(flight)
|
||||
|
||||
-- Pilot calls inbound for landing.
|
||||
local rtext=string.format("%s, %s, request ATIS frequency.", self.alias, callsign)
|
||||
|
||||
-- Radio message.
|
||||
self:TransmissionPilot(rtext, flight)
|
||||
self:TransmissionTower(srstxt,flight,10)
|
||||
|
||||
else
|
||||
self:E(self.lid..string.format("Cannot find flight group %s.", tostring(groupname)))
|
||||
@@ -3390,7 +3420,7 @@ function FLIGHTCONTROL:_PlayerRequestDirectLanding(groupname)
|
||||
if nTakeoff>self.NlandingTakeoff then
|
||||
|
||||
-- Message text.
|
||||
local text=string.format("%s, negative! We have currently traffic taking off", callsign)
|
||||
local text=string.format("%s, negative! We have currently traffic taking off!", callsign)
|
||||
|
||||
-- Send message.
|
||||
self:TransmissionTower(text, flight, 10)
|
||||
@@ -3854,7 +3884,7 @@ function FLIGHTCONTROL:_PlayerArrived(groupname)
|
||||
else
|
||||
|
||||
-- Message text.
|
||||
local text=string.format("%s, %s, arrived at parking position", self.alias, callsign)
|
||||
local text=string.format("%s, %s, arrived at parking position.", self.alias, callsign)
|
||||
|
||||
-- Transmit message.
|
||||
self:TransmissionPilot(text, flight)
|
||||
@@ -4277,7 +4307,7 @@ function FLIGHTCONTROL:TransmissionTower(Text, Flight, Delay)
|
||||
local subgroups=nil
|
||||
if Flight and not Flight.isAI then
|
||||
local playerData=Flight:_GetPlayerData()
|
||||
if playerData.subtitles then
|
||||
if playerData.subtitles and (not self.nosubs) then
|
||||
subgroups=subgroups or {}
|
||||
table.insert(subgroups, Flight.group)
|
||||
end
|
||||
@@ -4324,7 +4354,7 @@ function FLIGHTCONTROL:TransmissionPilot(Text, Flight, Delay)
|
||||
local subgroups=nil
|
||||
if Flight and not Flight.isAI then
|
||||
local playerData=Flight:_GetPlayerData()
|
||||
if playerData.subtitles then
|
||||
if playerData.subtitles and (not self.nosubs) then
|
||||
subgroups=subgroups or {}
|
||||
table.insert(subgroups, Flight.group)
|
||||
end
|
||||
|
||||
@@ -2605,6 +2605,9 @@ function FLIGHTGROUP:onbeforeUpdateRoute(From, Event, To, n, N)
|
||||
elseif task.dcstask.id==AUFTRAG.SpecialTask.RECON then
|
||||
-- For recon missions, we need to allow the update as we insert new waypoints.
|
||||
self:T2(self.lid.."Allowing update route for Task: ReconMission")
|
||||
elseif task.dcstask.id==AUFTRAG.SpecialTask.PATROLRACETRACK then
|
||||
-- For recon missions, we need to allow the update as we insert new waypoints.
|
||||
self:T2(self.lid.."Allowing update route for Task: Patrol Race Track")
|
||||
elseif task.dcstask.id==AUFTRAG.SpecialTask.HOVER then
|
||||
-- For recon missions, we need to allow the update as we insert new waypoints.
|
||||
self:T2(self.lid.."Allowing update route for Task: Hover")
|
||||
|
||||
@@ -965,7 +965,7 @@ function LEGION:onafterMissionRequest(From, Event, To, Mission, Assets)
|
||||
local pause=false
|
||||
|
||||
-- Check if mission is INTERCEPT and asset is currently on GCI mission. If so, GCI is paused.
|
||||
if currM.type==AUFTRAG.Type.GCICAP and Mission.type==AUFTRAG.Type.INTERCEPT then
|
||||
if (currM.type==AUFTRAG.Type.GCICAP or currM.type==AUFTRAG.Type.PATROLRACETRACK) and Mission.type==AUFTRAG.Type.INTERCEPT then
|
||||
pause=true
|
||||
elseif (currM.type==AUFTRAG.Type.ONGUARD or currM.type==AUFTRAG.Type.PATROLZONE) and (Mission.type==AUFTRAG.Type.ARTY or Mission.type==AUFTRAG.Type.GROUNDATTACK) then
|
||||
pause=true
|
||||
@@ -1445,7 +1445,7 @@ end
|
||||
-- @param Functional.Warehouse#WAREHOUSE.Assetitem Asset The asset that returned.
|
||||
function LEGION:onafterLegionAssetReturned(From, Event, To, Cohort, Asset)
|
||||
-- Debug message.
|
||||
self:I(self.lid..string.format("Asset %s from Cohort %s returned! asset.assignment=\"%s\"", Asset.spawngroupname, Cohort.name, tostring(Asset.assignment)))
|
||||
self:T(self.lid..string.format("Asset %s from Cohort %s returned! asset.assignment=\"%s\"", Asset.spawngroupname, Cohort.name, tostring(Asset.assignment)))
|
||||
|
||||
-- Stop flightgroup.
|
||||
if Asset.flightgroup and not Asset.flightgroup:IsStopped() then
|
||||
@@ -2557,9 +2557,10 @@ function LEGION._CohortCan(Cohort, MissionType, Categories, Attributes, Properti
|
||||
|
||||
-- Distance to target.
|
||||
local TargetDistance=TargetVec2 and UTILS.VecDist2D(TargetVec2, cohort.legion:GetVec2()) or 0
|
||||
|
||||
|
||||
-- Is in range?
|
||||
local Rmax=cohort:GetMissionRange(WeaponTypes)
|
||||
local RangeMax = RangeMax or 0
|
||||
local InRange=(RangeMax and math.max(RangeMax, Rmax) or Rmax) >= TargetDistance
|
||||
|
||||
return InRange
|
||||
@@ -2610,6 +2611,7 @@ function LEGION._CohortCan(Cohort, MissionType, Categories, Attributes, Properti
|
||||
-- Is capable of the mission type?
|
||||
local can=AUFTRAG.CheckMissionCapability(MissionType, Cohort.missiontypes)
|
||||
|
||||
|
||||
if can then
|
||||
can=CheckCategory(Cohort)
|
||||
else
|
||||
@@ -2687,7 +2689,7 @@ function LEGION._CohortCan(Cohort, MissionType, Categories, Attributes, Properti
|
||||
return nil
|
||||
end
|
||||
|
||||
--- Recruit assets from Cohorts for the given parameters. **NOTE** that we set the `asset.isReserved=true` flag so it cant be recruited by anyone else.
|
||||
--- Recruit assets from Cohorts for the given parameters. **NOTE** that we set the `asset.isReserved=true` flag so it cannot be recruited by anyone else.
|
||||
-- @param #table Cohorts Cohorts included.
|
||||
-- @param #string MissionTypeRecruit Mission type for recruiting the cohort assets.
|
||||
-- @param #string MissionTypeOpt Mission type for which the assets are optimized. Default is the same as `MissionTypeRecruit`.
|
||||
@@ -3181,7 +3183,7 @@ function LEGION.CalculateAssetMissionScore(asset, MissionType, TargetVec2, Inclu
|
||||
if currmission.type==AUFTRAG.Type.ALERT5 and currmission.alert5MissionType==MissionType then
|
||||
-- Prefer assets that are on ALERT5 for this mission type.
|
||||
score=score+25
|
||||
elseif currmission.type==AUFTRAG.Type.GCICAP and MissionType==AUFTRAG.Type.INTERCEPT then
|
||||
elseif (currmission.type==AUFTRAG.Type.GCICAP or currmission.type==AUFTRAG.Type.PATROLRACETRACK) and MissionType==AUFTRAG.Type.INTERCEPT then
|
||||
-- Prefer assets that are on GCICAP to perform INTERCEPTS. We set this even higher than alert5 because they are already in the air.
|
||||
score=score+35
|
||||
elseif (currmission.type==AUFTRAG.Type.ONGUARD or currmission.type==AUFTRAG.Type.PATROLZONE) and (MissionType==AUFTRAG.Type.ARTY or MissionType==AUFTRAG.Type.GROUNDATTACK) then
|
||||
|
||||
@@ -4467,6 +4467,26 @@ function OPSGROUP:_UpdateTask(Task, Mission)
|
||||
if target then
|
||||
self:EngageTarget(target, speed, Task.dcstask.params.formation)
|
||||
end
|
||||
|
||||
elseif Task.dcstask.id==AUFTRAG.SpecialTask.PATROLRACETRACK then
|
||||
|
||||
---
|
||||
-- Task "Patrol Race Track" Mission.
|
||||
---
|
||||
|
||||
if self.isFlightgroup then
|
||||
self:T("We are Special Auftrag Patrol Race Track, starting now ...")
|
||||
--self:I({Task.dcstask.params})
|
||||
--[[
|
||||
Task.dcstask.params.TrackAltitude = self.TrackAltitude
|
||||
Task.dcstask.params.TrackSpeed = self.TrackSpeed
|
||||
Task.dcstask.params.TrackPoint1 = self.TrackPoint1
|
||||
Task.dcstask.params.TrackPoint2 = self.TrackPoint2
|
||||
Task.dcstask.params.TrackFormation = self.TrackFormation
|
||||
--]]
|
||||
local aircraft = self:GetGroup()
|
||||
aircraft:PatrolRaceTrack(Task.dcstask.params.TrackPoint1,Task.dcstask.params.TrackPoint2,Task.dcstask.params.TrackAltitude,Task.dcstask.params.TrackSpeed,Task.dcstask.params.TrackFormation,false,1)
|
||||
end
|
||||
|
||||
elseif Task.dcstask.id==AUFTRAG.SpecialTask.HOVER then
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
-- ===
|
||||
-- @module Ops.PlayerTask
|
||||
-- @image OPS_PlayerTask.jpg
|
||||
-- @date Last Update Sept 2023
|
||||
-- @date Last Update Oct 2023
|
||||
|
||||
|
||||
do
|
||||
@@ -98,7 +98,7 @@ PLAYERTASK = {
|
||||
|
||||
--- PLAYERTASK class version.
|
||||
-- @field #string version
|
||||
PLAYERTASK.version="0.1.20"
|
||||
PLAYERTASK.version="0.1.21"
|
||||
|
||||
--- Generic task condition.
|
||||
-- @type PLAYERTASK.Condition
|
||||
@@ -470,10 +470,11 @@ end
|
||||
--- [User] Remove a client from this task
|
||||
-- @param #PLAYERTASK self
|
||||
-- @param Wrapper.Client#CLIENT Client
|
||||
-- @param #string Name Name of the client
|
||||
-- @return #PLAYERTASK self
|
||||
function PLAYERTASK:RemoveClient(Client)
|
||||
function PLAYERTASK:RemoveClient(Client,Name)
|
||||
self:T(self.lid.."RemoveClient")
|
||||
local name = Client:GetPlayerName()
|
||||
local name = Name or Client:GetPlayerName()
|
||||
if self.Clients:HasUniqueID(name) then
|
||||
self.Clients:PullByID(name)
|
||||
if self.verbose then
|
||||
@@ -1551,7 +1552,7 @@ PLAYERTASKCONTROLLER.Messages = {
|
||||
|
||||
--- PLAYERTASK class version.
|
||||
-- @field #string version
|
||||
PLAYERTASKCONTROLLER.version="0.1.61"
|
||||
PLAYERTASKCONTROLLER.version="0.1.62"
|
||||
|
||||
--- Create and run a new TASKCONTROLLER instance.
|
||||
-- @param #PLAYERTASKCONTROLLER self
|
||||
@@ -2186,6 +2187,10 @@ function PLAYERTASKCONTROLLER:_EventHandler(EventData)
|
||||
task:RemoveClient(Client)
|
||||
--text = "Task aborted!"
|
||||
text = self.gettext:GetEntry("TASKABORT",self.locale)
|
||||
else
|
||||
task:RemoveClient(nil,EventData.IniPlayerName)
|
||||
--text = "Task aborted!"
|
||||
text = self.gettext:GetEntry("TASKABORT",self.locale)
|
||||
end
|
||||
else
|
||||
--text = "No active task!"
|
||||
|
||||
Reference in New Issue
Block a user