From f86b3505b26c322aaf649efb1ef6d40d3fdfc1ee Mon Sep 17 00:00:00 2001 From: Frank Date: Fri, 22 Dec 2023 10:36:25 +0100 Subject: [PATCH 1/2] Update Airboss.lua - Fixed Attitude Monitor --- Moose Development/Moose/Ops/Airboss.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Moose Development/Moose/Ops/Airboss.lua b/Moose Development/Moose/Ops/Airboss.lua index c8710d3bf..cb732bb4f 100644 --- a/Moose Development/Moose/Ops/Airboss.lua +++ b/Moose Development/Moose/Ops/Airboss.lua @@ -11196,7 +11196,7 @@ function AIRBOSS:_AttitudeMonitor( playerData ) end text = text .. string.format( "\nPitch=%.1f° | Roll=%.1f° | Yaw=%.1f°", pitch, roll, yaw ) text = text .. string.format( "\nClimb Angle=%.1f° | Rate=%d ft/min", unit:GetClimbAngle(), velo.y * 196.85 ) - local dist = self:_GetOptLandingCoordinate():Get3DDistance( playerData.unit ) + local dist = self:_GetOptLandingCoordinate():Get3DDistance( playerData.unit:GetVec3() ) -- Get player velocity in km/h. local vplayer = playerData.unit:GetVelocityKMH() -- Get carrier velocity in km/h. From e7fb073bab0364793c2c9cbf4e1dd282263a2bed Mon Sep 17 00:00:00 2001 From: Frank Date: Fri, 22 Dec 2023 21:11:30 +0100 Subject: [PATCH 2/2] Update RAT.lua - Removed restriction that zones need to be defined in the ME --- Moose Development/Moose/Functional/RAT.lua | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/Moose Development/Moose/Functional/RAT.lua b/Moose Development/Moose/Functional/RAT.lua index 57a0783da..ae6408d76 100644 --- a/Moose Development/Moose/Functional/RAT.lua +++ b/Moose Development/Moose/Functional/RAT.lua @@ -170,7 +170,7 @@ -- -- * A specific departure and/or destination airport can be chosen. -- * Valid coalitions can be set, e.g. only red, blue or neutral, all three "colours". --- * It is possible to start in air within a zone defined in the mission editor or within a zone above an airport of the map. +-- * It is possible to start in air within a zone or within a zone above an airport of the map. -- -- ## Flight Plan -- @@ -1179,13 +1179,13 @@ function RAT:SetTakeoffAir() return self end ---- Set possible departure ports. This can be an airport or a zone defined in the mission editor. +--- Set possible departure ports. This can be an airport or a zone. -- @param #RAT self -- @param #string departurenames Name or table of names of departure airports or zones. -- @return #RAT RAT self object. -- @usage RAT:SetDeparture("Sochi-Adler") will spawn RAT objects at Sochi-Adler airport. -- @usage RAT:SetDeparture({"Sochi-Adler", "Gudauta"}) will spawn RAT aircraft radomly at Sochi-Adler or Gudauta airport. --- @usage RAT:SetDeparture({"Zone A", "Gudauta"}) will spawn RAT aircraft in air randomly within Zone A, which has to be defined in the mission editor, or within a zone around Gudauta airport. Note that this also requires RAT:takeoff("air") to be set. +-- @usage RAT:SetDeparture({"Zone A", "Gudauta"}) will spawn RAT aircraft in air randomly within Zone A, or within a zone around Gudauta airport. Note that this also requires RAT:takeoff("air") to be set. function RAT:SetDeparture(departurenames) self:F2(departurenames) @@ -2537,7 +2537,7 @@ function RAT:_SetRoute(takeoff, landing, _departure, _destination, _waypoint) end elseif self:_ZoneExists(_departure) then -- If it's not an airport, check whether it's a zone. - departure=ZONE:New(_departure) + departure=ZONE:FindByName(_departure) else local text=string.format("ERROR! Specified departure airport %s does not exist for %s.", _departure, self.alias) self:E(RAT.id..text) @@ -2635,7 +2635,7 @@ function RAT:_SetRoute(takeoff, landing, _departure, _destination, _waypoint) end elseif self:_ZoneExists(_destination) then - destination=ZONE:New(_destination) + destination=ZONE:FindByName(_destination) else local text=string.format("ERROR: Specified destination airport/zone %s does not exist for %s!", _destination, self.alias) self:E(RAT.id.."ERROR: "..text) @@ -3142,7 +3142,7 @@ function RAT:_PickDeparture(takeoff) end elseif self:_ZoneExists(name) then if takeoff==RAT.wp.air then - dep=ZONE:New(name) + dep=ZONE:FindByName(name) else self:E(RAT.id..string.format("ERROR! Takeoff is not in air. Cannot use %s as departure.", name)) end @@ -3254,7 +3254,7 @@ function RAT:_PickDestination(departure, q, minrange, maxrange, random, landing) end elseif self:_ZoneExists(name) then if landing==RAT.wp.air then - dest=ZONE:New(name) + dest=ZONE:FindByName(name) else self:E(RAT.id..string.format("ERROR! Landing is not in air. Cannot use zone %s as destination!", name)) end @@ -4930,12 +4930,12 @@ function RAT:_AirportExists(name) return false end ---- Test if a trigger zone defined in the mission editor exists. +--- Test if a zone exists. -- @param #RAT self -- @param #string name -- @return #boolean True if zone exsits, false otherwise. function RAT:_ZoneExists(name) - local z=trigger.misc.getZone(name) + local z=ZONE:FindByName(name) --trigger.misc.getZone(name) as suggested by @Viking on MOOSE discord #rat if z then return true end