From 8bab24adbdb07b0f22bb4b23e6416e9fd0000b0a Mon Sep 17 00:00:00 2001 From: HawaiianRyan808 Date: Fri, 6 Feb 2026 13:54:12 -0600 Subject: [PATCH 1/2] Make RAT crudely predict where the ship will be at landing time instead of routing aircraft to where the ship is at spawn time. --- Moose Development/Moose/Functional/RAT.lua | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Moose Development/Moose/Functional/RAT.lua b/Moose Development/Moose/Functional/RAT.lua index 32946fee1..46d391c26 100644 --- a/Moose Development/Moose/Functional/RAT.lua +++ b/Moose Development/Moose/Functional/RAT.lua @@ -3042,6 +3042,14 @@ function RAT:_SetRoute(takeoff, landing, _departure, _destination, _waypoint) if landing==RAT.wp.air then local vec2=destination:GetRandomVec2() Pdestination=COORDINATE:NewFromVec2(vec2) + elseif destination:IsShip() then + -- Crudely predict where the ship will be + local _ship = UNIT:FindByName(destination:GetName()) + local _shipHeading = _ship:GetHeading() + Pdestination=destination:GetCoordinate() + local _transitTime = Pdeparture:Get2DDistance(Pdestination) / VxCruise + Pdestination.x = Pdestination.x + (_ship:GetGroundSpeed() * math.cos(math.rad(_shipHeading)) * _transitTime) + Pdestination.z = Pdestination.z + (_ship:GetGroundSpeed() * math.sin(math.rad(_shipHeading)) * _transitTime) else Pdestination=destination:GetCoordinate() end From 7ec43c991343783fb3532bb1d42ad51884d44124 Mon Sep 17 00:00:00 2001 From: Applevangelist Date: Sat, 7 Feb 2026 16:57:48 +0100 Subject: [PATCH 2/2] #CONTROLLABLE - Make waypoint function a bit more robust --- Moose Development/Moose/Wrapper/Controllable.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Moose Development/Moose/Wrapper/Controllable.lua b/Moose Development/Moose/Wrapper/Controllable.lua index dc8582ec6..379412b8c 100644 --- a/Moose Development/Moose/Wrapper/Controllable.lua +++ b/Moose Development/Moose/Wrapper/Controllable.lua @@ -2184,7 +2184,8 @@ function CONTROLLABLE:TaskFunction( FunctionString, ... ) local ArgumentKey = '_' .. tostring( arg ):match( "table: (.*)" ) self:SetState( self, ArgumentKey, arg ) DCSScript[#DCSScript + 1] = "local Arguments = MissionControllable:GetState( MissionControllable, '" .. ArgumentKey .. "' ) " - DCSScript[#DCSScript + 1] = FunctionString .. "( MissionControllable, unpack( Arguments ) )" + --DCSScript[#DCSScript + 1] = FunctionString .. "( MissionControllable, unpack( Arguments ) )" + DCSScript[#DCSScript + 1] = FunctionString .. "( MissionControllable, ((type(Arguments)=='table') and unpack(Arguments) or nil))" else DCSScript[#DCSScript + 1] = FunctionString .. "( MissionControllable )" end