From bdd9efa2cc0ab21a34a4739cb33148af056bcde4 Mon Sep 17 00:00:00 2001 From: Frank Date: Mon, 17 Jun 2024 18:08:45 +0200 Subject: [PATCH 1/2] Update FlightControl.lua - Added `FLIGHTCONTROL:SetTransmitOnlyWithPlayers()` --- Moose Development/Moose/Ops/FlightControl.lua | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/Moose Development/Moose/Ops/FlightControl.lua b/Moose Development/Moose/Ops/FlightControl.lua index bf37c4061..2db7c3942 100644 --- a/Moose Development/Moose/Ops/FlightControl.lua +++ b/Moose Development/Moose/Ops/FlightControl.lua @@ -332,7 +332,7 @@ FLIGHTCONTROL.FlightStatus={ --- FlightControl class version. -- @field #string version -FLIGHTCONTROL.version="0.7.6" +FLIGHTCONTROL.version="0.7.7" ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -- TODO list @@ -420,6 +420,9 @@ function FLIGHTCONTROL:New(AirbaseName, Frequency, Modulation, PathToSRS, Port, -- Init msrs queue. self.msrsqueue=MSRSQUEUE:New(self.alias) + -- Set that transmission is only if alive players on the server. + self:SetTransmitOnlyWithPlayers(true) + -- Init msrs bases local path = PathToSRS or MSRS.path local port = Port or MSRS.port or 5002 @@ -589,6 +592,16 @@ function FLIGHTCONTROL:SetRadioOnlyIfPlayers(Switch) end +--- Set whether to only transmit TTS messages if there are players on the server. +-- @param #FLIGHTCONTROL self +-- @param #boolean Switch If `true`, only send TTS messages if there are alive Players. If `false` or `nil`, transmission are done also if no players are on the server. +-- @return #FLIGHTCONTROL self +function FLIGHTCONTROL:SetTransmitOnlyWithPlayers(Switch) + self.msrsqueue:SetTransmitOnlyWithPlayers(Switch) + return self +end + + --- Set subtitles to appear on SRS TTS messages. -- @param #FLIGHTCONTROL self -- @return #FLIGHTCONTROL self From 3fac5ac9f0530c732e81a23c3f727c506998f7f3 Mon Sep 17 00:00:00 2001 From: Frank Date: Tue, 18 Jun 2024 23:15:50 +0200 Subject: [PATCH 2/2] Update FlightGroup.lua - Fixed refueling issue --- Moose Development/Moose/Ops/FlightGroup.lua | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/Moose Development/Moose/Ops/FlightGroup.lua b/Moose Development/Moose/Ops/FlightGroup.lua index e6471c2a4..dc1de53b4 100644 --- a/Moose Development/Moose/Ops/FlightGroup.lua +++ b/Moose Development/Moose/Ops/FlightGroup.lua @@ -2188,7 +2188,7 @@ function FLIGHTGROUP:onafterSpawned(From, Event, To) -- TODO: make this input. self:GetGroup():SetOption(AI.Option.Air.id.PROHIBIT_JETT, self.jettisonWeapons) self:GetGroup():SetOption(AI.Option.Air.id.PROHIBIT_AB, self.prohibitAB) -- Does not seem to work. AI still used the after burner. - self:GetGroup():SetOption(AI.Option.Air.id.RTB_ON_BINGO, false) + self:GetGroup():SetOption(AI.Option.Air.id.RTB_ON_BINGO, false) self:GetGroup():SetOption(AI.Option.Air.id.JETT_TANKS_IF_EMPTY, self.jettisonEmptyTanks) --self.group:SetOption(AI.Option.Air.id.RADAR_USING, AI.Option.Air.val.RADAR_USING.FOR_CONTINUOUS_SEARCH) @@ -2804,6 +2804,11 @@ function FLIGHTGROUP:_CheckGroupDone(delay, waittime) self:T(self.lid.."Engaging! Group NOT done...") return end + -- Check if group is going for fuel. + if self:IsGoing4Fuel() then + self:T(self.lid.."Going for FUEL! Group NOT done...") + return + end -- Number of tasks remaining. local nTasks=self:CountRemainingTasks() @@ -3419,6 +3424,9 @@ function FLIGHTGROUP:onafterRefuel(From, Event, To, Coordinate) local wp9=Coordinate:WaypointAir("BARO", COORDINATE.WaypointType.TurningPoint, COORDINATE.WaypointAction.TurningPoint, Speed, true, nil, DCSTasks, "Refuel") self:Route({wp0, wp9}, 1) + + -- Set RTB on Bingo option. Currently DCS does not execute the refueling task if RTB_ON_BINGO is set to "NO RTB ON BINGO" + self.group:SetOption(AI.Option.Air.id.RTB_ON_BINGO, true) end @@ -3432,6 +3440,9 @@ function FLIGHTGROUP:onafterRefueled(From, Event, To) -- Debug message. local text=string.format("Flight group finished refuelling") self:T(self.lid..text) + + -- Set RTB on Bingo option to "NO RTB ON BINGO" + self.group:SetOption(AI.Option.Air.id.RTB_ON_BINGO, false) -- Check if flight is done. self:_CheckGroupDone(1)