Drone Delivery - Lua 159 error

Xypez
Posts: 1
Joined: Wed Apr 03, 2024 11:31 am

Drone Delivery - Lua 159 error

Post by Xypez »

After purchase and linked, the drone delivers 1 pack of wool and goes back to its storage station, then the error appears and locks the players movement and all other keybindings due to 10.000 commands being sent to the game.

From the log: /My Games/FarmingSimulator2022/mods/FS22_DroneDelivery/scripts/misc/droneActionPhase.lua:159: attempt to index field 'owner' (a nil value)
2024-04-03 11:13 Error: Running LUA method 'update'.

From the lua script in the mod folder: -- interpolates a target quaternion if has one
if self.targetQuat ~= nil then

self.quaternionAlpha = MathUtil.clamp(self.quaternionAlpha + ((self.rotationSpeed * sDt) / self.toTargetDegrees),0,1)

quatX,quatY,quatZ,quatW = MathUtil.slerpQuaternion(self.startQuat.x, self.startQuat.y, self.startQuat.z, self.startQuat.w,self.targetQuat.x, self.targetQuat.y, self.targetQuat.z, self.targetQuat.w,self.quaternionAlpha)

-- slerpQuaternion might give NaN values need to filter out
if tostring(quatX) == "nan" or tostring(quatY) == "nan" or tostring(quatZ) == "nan" or tostring(quatW) == "nan" then
quatX,quatY,quatZ,quatW = getWorldQuaternion(self.owner.rootNode)
end

if self.quaternionAlpha < 1 then
bFinalRotation = false
end


Help...