diff --git a/Moose Development/Moose/Ops/AirWing.lua b/Moose Development/Moose/Ops/AirWing.lua index ed166e23d..9d918e5d9 100644 --- a/Moose Development/Moose/Ops/AirWing.lua +++ b/Moose Development/Moose/Ops/AirWing.lua @@ -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) diff --git a/Moose Development/Moose/Ops/Auftrag.lua b/Moose Development/Moose/Ops/Auftrag.lua index c70ce6377..a1d234fbe 100644 --- a/Moose Development/Moose/Ops/Auftrag.lua +++ b/Moose Development/Moose/Ops/Auftrag.lua @@ -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. +-- @param #number Speed (Optional) Speed in knots. Defaults to 300kn. +-- @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 diff --git a/Moose Development/Moose/Ops/Cohort.lua b/Moose Development/Moose/Ops/Cohort.lua index 5ab2e97da..5ed60451c 100644 --- a/Moose Development/Moose/Ops/Cohort.lua +++ b/Moose Development/Moose/Ops/Cohort.lua @@ -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 ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- - diff --git a/Moose Development/Moose/Ops/EasyGCICAP.lua b/Moose Development/Moose/Ops/EasyGCICAP.lua index 248318fe7..0633f8b23 100644 --- a/Moose Development/Moose/Ops/EasyGCICAP.lua +++ b/Moose Development/Moose/Ops/EasyGCICAP.lua @@ -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 @@ -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 diff --git a/Moose Development/Moose/Ops/FlightGroup.lua b/Moose Development/Moose/Ops/FlightGroup.lua index 5800625df..1bbd1c8bb 100644 --- a/Moose Development/Moose/Ops/FlightGroup.lua +++ b/Moose Development/Moose/Ops/FlightGroup.lua @@ -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") diff --git a/Moose Development/Moose/Ops/Legion.lua b/Moose Development/Moose/Ops/Legion.lua index 7405fc02a..0f6535e99 100644 --- a/Moose Development/Moose/Ops/Legion.lua +++ b/Moose Development/Moose/Ops/Legion.lua @@ -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 diff --git a/Moose Development/Moose/Ops/OpsGroup.lua b/Moose Development/Moose/Ops/OpsGroup.lua index ba562e542..0ba09f730 100644 --- a/Moose Development/Moose/Ops/OpsGroup.lua +++ b/Moose Development/Moose/Ops/OpsGroup.lua @@ -4463,6 +4463,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,1) + end elseif Task.dcstask.id==AUFTRAG.SpecialTask.HOVER then