From 71001adc5e256fe49b90203819bffcd5aae88308 Mon Sep 17 00:00:00 2001 From: Frank Date: Thu, 21 Feb 2019 09:55:57 +0100 Subject: [PATCH] AIRBOSS v0.9.8 --- Moose Development/Moose/Core/Point.lua | 24 +- Moose Development/Moose/Ops/Airboss.lua | 403 ++++++++++++++++-------- 2 files changed, 300 insertions(+), 127 deletions(-) diff --git a/Moose Development/Moose/Core/Point.lua b/Moose Development/Moose/Core/Point.lua index 2a5c8d0ee..a0cebabb4 100644 --- a/Moose Development/Moose/Core/Point.lua +++ b/Moose Development/Moose/Core/Point.lua @@ -210,6 +210,7 @@ do -- COORDINATE FromParkingAreaHot = "From Parking Area Hot", FromRunway = "From Runway", Landing = "Landing", + LandingReFuAr = "LandingReFuAr", } --- @field COORDINATE.WaypointType @@ -219,6 +220,7 @@ do -- COORDINATE TakeOff = "TakeOffParkingHot", TurningPoint = "Turning Point", Land = "Land", + LandingReFuAr = "LandingReFuAr", } @@ -1027,8 +1029,9 @@ do -- COORDINATE -- @param Wrapper.Airbase#AIRBASE airbase The airbase for takeoff and landing points. -- @param #table DCSTasks A table of @{DCS#Task} items which are executed at the waypoint. -- @param #string description A text description of the waypoint, which will be shown on the F10 map. + -- @param #number timeReFuAr Time in minutes the aircraft stays at the airport for ReFueling and ReArming. -- @return #table The route point. - function COORDINATE:WaypointAir( AltType, Type, Action, Speed, SpeedLocked, airbase, DCSTasks, description ) + function COORDINATE:WaypointAir( AltType, Type, Action, Speed, SpeedLocked, airbase, DCSTasks, description, timeReFuAr ) self:F2( { AltType, Type, Action, Speed, SpeedLocked } ) -- Set alttype or "RADIO" which is AGL. @@ -1055,7 +1058,7 @@ do -- COORDINATE -- Waypoint type. RoutePoint.type = Type or nil - RoutePoint.action = Action or nil + RoutePoint.action = Action or nil -- Speed. RoutePoint.speed = Speed/3.6 @@ -1084,6 +1087,11 @@ do -- COORDINATE --self:MarkToAll(string.format("Landing waypoint at airbase %s, ID=%d, Category=%d", airbase:GetName(), AirbaseID, AirbaseCategory )) end + -- Time in minutes to stay at the airbase before resuming route. + if Type==COORDINATE.WaypointType.LandingReFuAr then + RoutePoint.timeReFuAr=timeReFuAr or 10 + end + -- Waypoint tasks. RoutePoint.task = {} RoutePoint.task.id = "ComboTask" @@ -1173,7 +1181,17 @@ do -- COORDINATE return self:WaypointAir(nil, COORDINATE.WaypointType.Land, COORDINATE.WaypointAction.Landing, Speed, false, airbase, DCSTasks, description) end - + --- Build a Waypoint Air "LandingReFuAr". Mimics the aircraft ReFueling and ReArming. + -- @param #COORDINATE self + -- @param DCS#Speed Speed Airspeed in km/h. + -- @param Wrapper.Airbase#AIRBASE airbase The airbase for takeoff and landing points. + -- @param #number timeReFuAr Time in minutes, the aircraft stays at the airbase. Default 10 min. + -- @param #table DCSTasks A table of @{DCS#Task} items which are executed at the waypoint. + -- @param #string description A text description of the waypoint, which will be shown on the F10 map. + -- @return #table The route point. + function COORDINATE:WaypointAirLandingReFu( Speed, airbase, timeReFuAr, DCSTasks, description ) + return self:WaypointAir(nil, COORDINATE.WaypointType.LandingReFuAr, COORDINATE.WaypointAction.LandingReFuAr, Speed, false, airbase, DCSTasks, description, timeReFuAr or 10) + end --- Build an ground type route point. diff --git a/Moose Development/Moose/Ops/Airboss.lua b/Moose Development/Moose/Ops/Airboss.lua index 7de0646ec..d706f01f0 100644 --- a/Moose Development/Moose/Ops/Airboss.lua +++ b/Moose Development/Moose/Ops/Airboss.lua @@ -82,6 +82,12 @@ -- * [DCS World - F/A-18 - Case I Carrier Recovery Tutorial](https://www.youtube.com/watch?v=lm-M3VUy-_I) -- * [DCS World - Case I Recovery Tutorial - Followup](https://www.youtube.com/watch?v=cW5R32Q6xC8) -- * [DCS World - CASE III Recovery Tutorial](https://www.youtube.com/watch?v=Lnfug5CVAvo) +-- +-- Wags DCS Hornet Videos: +-- +-- * [DCS: F/A-18C Hornet - Episode 9: CASE I Carrier Landing](https://www.youtube.com/watch?v=TuigBLhtAH8) +-- * [DCS: F/A-18C Hornet – Episode 16: CASE III Introduction](https://www.youtube.com/watch?v=DvlMHnLjbDQ) +-- * [DCS: F/A-18C Hornet Case I Carrier Landing Training Lesson Recording](https://www.youtube.com/watch?v=D33uM9q4xgA) -- -- ### Open Questions? -- @@ -363,6 +369,8 @@ -- -- All section members are supposed to follow. Player (or section lead) is removed from all other queues and automatically added to the landing pattern queue. -- +-- The mission designer can forbid this option my setting @{#AIRBOSS.SetEmergencyLandings}(false) in the script. +-- -- ### [Reset My Status] -- -- This will reset the current player status. If player is currently in a marshal stack, he will be removed from the marshal queue and the stack above will collapse. @@ -426,7 +434,7 @@ -- -- ### Subtitles On/Off -- --- This command toggles the display of radio message subtitles. By default subtitles are on. +-- This command toggles the display of radio message subtitles if no radio relay unit is used. By default subtitles are on. -- Note that subtitles for radio messages which do not have a complete voice over are always displayed. -- -- ## Kneeboard Menu @@ -892,12 +900,18 @@ -- Similarly, to the @{#AIRBOSS.SetExcludeAI} function, AI groups can be explicitly *included* via the @{#AIRBOSS.SetSquadronAI} function. If this is used, only the *included* groups are handled -- by the AIRBOSS. -- +-- ## Keep the Deck Clean +-- +-- Once the AI groups have landed on the carrier, they can be despawned automatically after they shut down their engines. This is achieved by the @{#AIRBOSS.SetDespawnOnEngineShutdown}() function. +-- -- ## Refueling -- -- AI groups in the marshal pattern can be send to refuel at the recovery tanker or if none is defined to the nearest divert airfield. This can be enabled by the @{AIRBOSS.SetRefuelAI}(*lowfuelthreshold*). -- The parameter *lowfuelthreshold* is the threshold of fuel in percent. If the fuel drops below this value, the group will go for refueling. If refueling is performed at the recovery tanker, -- the group will return to the marshal stack when done. The aircraft will not return from the divert airfield however. -- +-- Note that this feature is not enabled by default as there might be bugs in DCS that prevent a smooth refueling of the AI. Enable at your own risk. +-- -- ## Respawning - DCS Landing Bug -- -- AI groups that enter the CCA are usually guided to Marshal stack. However, due to DCS limitations they might not obey the landing task if they have another airfield as departure and/or destination in @@ -1268,29 +1282,20 @@ AIRBOSS.GroovePos={ --- LSO radio calls. -- @type AIRBOSS.LSOCalls --- @field #AIRBOSS.RadioCall RADIOCHECK "Paddles, radio check" call. --- @field #AIRBOSS.RadioCall RIGHTFORLINEUP "Right for line up" call. +-- @field #AIRBOSS.RadioCall BOLTER "Bolter, Bolter" call. +-- @field #AIRBOSS.RadioCall CALLTHEBALL "Call the Ball" call. +-- @field #AIRBOSS.RadioCall CHECK "CHECK" call. +-- @field #AIRBOSS.RadioCall CLEAREDTOLAND "Cleared to land" call. -- @field #AIRBOSS.RadioCall COMELEFT "Come left" call. --- @field #AIRBOSS.RadioCall HIGH "You're high" call. --- @field #AIRBOSS.RadioCall LOW "You're low" call. --- @field #AIRBOSS.RadioCall POWER "Power" call. --- @field #AIRBOSS.RadioCall FAST "You're fast" call. --- @field #AIRBOSS.RadioCall SLOW "You're slow" call. --- @field #AIRBOSS.RadioCall PADDLESCONTACT "Paddles, contact" call. --- @field #AIRBOSS.RadioCall CALLTHEBALL "Call the Ball" --- @field #AIRBOSS.RadioCall ROGERBALL "Roger ball" call. --- @field #AIRBOSS.RadioCall WAVEOFF "Wave off" call. --- @field #AIRBOSS.RadioCall BOLTER "Bolter, Bolter" call --- @field #AIRBOSS.RadioCall LONGINGROOVE "You're long in the groove" call. --- @field #AIRBOSS.RadioCall FOULDECK "Foul Deck" call. -- @field #AIRBOSS.RadioCall DEPARTANDREENTER "Depart and re-enter" call. --- @field #AIRBOSS.RadioCall WELCOMEABOARD "Welcome aboard" call. -- @field #AIRBOSS.RadioCall EXPECTHEAVYWAVEOFF "Expect heavy wavoff" call. -- @field #AIRBOSS.RadioCall EXPECTSPOT75 "Expect spot 7.5" call. --- @field #AIRBOSS.RadioCall CLEAREDTOLAND "Cleared to land" call. --- @field #AIRBOSS.RadioCall CHECK "CHECK" call. --- @field #AIRBOSS.RadioCall STABILIZED "Stabilized" call. +-- @field #AIRBOSS.RadioCall FAST "You're fast" call. +-- @field #AIRBOSS.RadioCall FOULDECK "Foul Deck" call. +-- @field #AIRBOSS.RadioCall HIGH "You're high" call. -- @field #AIRBOSS.RadioCall IDLE "Idle" call. +-- @field #AIRBOSS.RadioCall LONGINGROOVE "You're long in the groove" call. +-- @field #AIRBOSS.RadioCall LOW "You're low" call. -- @field #AIRBOSS.RadioCall N0 "Zero" call. -- @field #AIRBOSS.RadioCall N1 "One" call. -- @field #AIRBOSS.RadioCall N2 "Two" call. @@ -1301,14 +1306,25 @@ AIRBOSS.GroovePos={ -- @field #AIRBOSS.RadioCall N7 "Seven" call. -- @field #AIRBOSS.RadioCall N8 "Eight" call. -- @field #AIRBOSS.RadioCall N9 "Nine" call. +-- @field #AIRBOSS.RadioCall PADDLESCONTACT "Paddles, contact" call. +-- @field #AIRBOSS.RadioCall POWER "Power" call. +-- @field #AIRBOSS.RadioCall RADIOCHECK "Paddles, radio check" call. +-- @field #AIRBOSS.RadioCall RIGHTFORLINEUP "Right for line up" call. +-- @field #AIRBOSS.RadioCall ROGERBALL "Roger ball" call. +-- @field #AIRBOSS.RadioCall SLOW "You're slow" call. +-- @field #AIRBOSS.RadioCall STABILIZED "Stabilized" call. +-- @field #AIRBOSS.RadioCall WAVEOFF "Wave off" call. +-- @field #AIRBOSS.RadioCall WELCOMEABOARD "Welcome aboard" call. -- @field #AIRBOSS.RadioCall CLICK Radio end transmission click sound. -- @field #AIRBOSS.RadioCall NOISE Static noise sound. --- @field #AIRBOSS.RadioCall SKYHAWK "Skyhawk" sound. --- @field #AIRBOSS.RadioCall HARRIER "Harrier" sound. --- @field #AIRBOSS.RadioCall HAWKEYE "Hawkeye" sound. --- @field #AIRBOSS.RadioCall TOMCAT "Tomcat" sound. --- @field #AIRBOSS.RadioCall HORNET "Hornet" sound. --- @field #AIRBOSS.RadioCall BALL "Ball" sound. +-- @field #AIRBOSS.RadioCall BALL "Ball" call. +-- @field #AIRBOSS.RadioCall HARRIER "Harrier" call. +-- @field #AIRBOSS.RadioCall HAWKEYE "Hawkeye" call. +-- @field #AIRBOSS.RadioCall HORNET "Hornet" call. +-- @field #AIRBOSS.RadioCall SKYHAWK "Skyhawk" call. +-- @field #AIRBOSS.RadioCall TOMCAT "Tomcat" call. +-- @field #AIRBOSS.RadioCall VIKING "Viking" call. +-- @field #AIRBOSS.RadioCall SPINIT "Spin it" call. --- Marshal radio calls. -- @type AIRBOSS.MarshalCalls @@ -1347,12 +1363,15 @@ AIRBOSS.GroovePos={ -- @field #AIRBOSS.RadioCall RECOVERYPAUSEDRESUMED "Recovery paused and will be resumed at" call. -- @field #AIRBOSS.RadioCall RESUMERECOVERY "Resuming aircraft recovery" call. -- @field #AIRBOSS.RadioCall REPORTSEEME "Report see me" call. +-- @field #AIRBOSS.RadioCall ROGER "Roger" call. -- @field #AIRBOSS.RadioCall SAYNEEDLES "Say needles" call. -- @field #AIRBOSS.RadioCall STACKFULL "Marshal stack is currently full. Hold outside 10 NM zone and wait for further instructions" call. -- @field #AIRBOSS.RadioCall STARTINGRECOVERY "Starting aircraft recovery" call. -- @field #AIRBOSS.RadioCall CLICK Radio end transmission click sound. -- @field #AIRBOSS.RadioCall NOISE Static noise sound. - +-- @field #AIRBOSS.RadioCall BINGOFUEL "Bingo Fuel" call. +-- @field #AIRBOSS.RadioCall GASATDIVERT "Going for gas at the divert field" call. +-- @field #AIRBOSS.RadioCall GASATTANKER "Going for gas at the recovery tanker" call. --- Difficulty level. -- @type AIRBOSS.Difficulty @@ -2063,7 +2082,7 @@ function AIRBOSS:SetRecoveryCase(case) end --- Set holding pattern offset from final bearing for Case II/III recoveries. --- Usually, this is +-15 or +-30 degrees. You should not use and offet angle >= 90 degrees, because this will cause a devision by zero in some of the equations used to calculate the approach corridor. +-- Usually, this is +-15 or +-30 degrees. You should not use and offset angle >= 90 degrees, because this will cause a devision by zero in some of the equations used to calculate the approach corridor. -- So best stick to the defaults up to 30 degrees. -- @param #AIRBOSS self -- @param #number offset Offset angle in degrees. Default 0. @@ -2390,12 +2409,12 @@ end -- @param #number RIGHT -- @return #AIRBOSS self function AIRBOSS:SetLineupErrorThresholds(_max,_min, Left, LEFT, Right, RIGHT) - self.lue._max=_max or 0.5 - self.lue._min=_min or -0.5 - self.lue.Left=Left or -1.0 - self.lue.LEFT=LEFT or -3.0 - self.lue.Right=Right or 1.0 - self.lue.RIGHT=RIGHT or 3.0 + self.lue._max=_max or 0.5 + self.lue._min=_min or -0.5 + self.lue.Left=Left or -1.0 + self.lue.LEFT=LEFT or -3.0 + self.lue.Right=Right or 1.0 + self.lue.RIGHT=RIGHT or 3.0 return self end @@ -2512,10 +2531,10 @@ end --- Set beacon (TACAN/ICLS) time refresh interfal in case the beacons die. -- @param #AIRBOSS self --- @param #number interval Time interval in seconds. Default 300 sec = 5 min. +-- @param #number interval Time interval in seconds. Default 1200 sec = 20 min. -- @return #AIRBOSS self function AIRBOSS:SetBeaconRefresh(interval) - self.dTbeacon=interval or 300 + self.dTbeacon=interval or 20*60 return self end @@ -2865,11 +2884,13 @@ function AIRBOSS:_ActivateBeacons() -- Activate TACAN. if self.TACANon then + self:I(self.lid..string.format("Activating TACAN Channel %d%s (%s)", self.TACANchannel, self.TACANmode, self.TACANmorse)) self.beacon:ActivateTACAN(self.TACANchannel, self.TACANmode, self.TACANmorse, true) end -- Activate ICLS. if self.ICLSon then + self:I(self.lid..string.format("Activating ICLS Channel %d (%s)", self.ICLSchannel, self.ICLSmorse)) self.beacon:ActivateICLS(self.ICLSchannel, self.ICLSmorse) end @@ -3045,9 +3066,15 @@ function AIRBOSS:_CheckAIStatus() local text=string.format("Group %s fuel=%.1f %%", flight.groupname, fuel) self:T3(self.lid..text) - -- Send AI for refueling at tanker or divert field. + -- Check if flight is low on fuel and not yet refueling. if self.lowfuelAI and fuelglMax then - local text=string.format("Wave off due to glideslope error %.2f > %.1f degrees!", glideslopeError, glMax) + local text=string.format("\n- Waveoff due to glideslope error %.2f > %.1f degrees!", glideslopeError, glMax) self:T(self.lid..string.format("%s: %s", playerData.name, text)) self:_AddToDebrief(playerData, text) waveoff=true elseif glideslopeErrorluAbs then - local text=string.format("Wave off due to line up error |%.1f| > %.1f degrees!", lineupError, luAbs) + local text=string.format("\n- Waveoff due to line up error |%.1f| > %.1f degrees!", lineupError, luAbs) self:T(self.lid..string.format("%s: %s", playerData.name, text)) self:_AddToDebrief(playerData, text) waveoff=true @@ -8820,12 +8911,12 @@ function AIRBOSS:_CheckWaveOff(glideslopeError, lineupError, AoA, playerData) local aoaac=self:_GetAircraftAoA(playerData) -- Check too slow or too fast. if AoAaoaac.SLOW then - local text=string.format("Wave off due to AoA %.1f > %.1f!", AoA, aoaac.SLOW) + local text=string.format("\n- Waveoff due to AoA %.1f > %.1f!", AoA, aoaac.SLOW) self:T(self.lid..string.format("%s: %s", playerData.name, text)) self:_AddToDebrief(playerData, text) waveoff=true @@ -10638,36 +10729,34 @@ function AIRBOSS:_Flightdata2Text(playerData, groovestep) end -- Glideslope/altitude. Good [-0.3, 0.4] asymmetric! - -- TODO: introduce enumerator with GSE values. local A=nil - if GSE>1.5 then + if GSE>self.gle.HIGH then A=underline("H") - elseif GSE>0.8 then + elseif GSE>self.gle.High then A="H" - elseif GSE>0.4 then + elseif GSE>self.gle._max then A=little("H") - elseif GSE<-0.9 then + elseif GSE3 then + if LUE>self.lue.RIGHT then D=underline("LUL") - elseif LUE>1 then + elseif LUE>self.lue.Right then D="LUL" - elseif LUE>0.5 then + elseif LUE>self.lue._max then D=little("LUL") - elseif LUE<-3 then + elseif LUE