2019-01-26, 03:24 AM
Hi, I have the following LUA script in two vehicles.
prevPitch = 0
function Update(I)
currPitch = I:GetConstructPitch()
I:Log(currPitch)
pitchAcc = currPitch - prevPitch
I:Log(pitchAcc)
if pitchAcc<0 then
I:RequestThrustControl(4,-pitchAcc)
I:Log('Thrusters On')
else
I:RequestThrustControl(4,0)
I:Log('Thrusters Off')
end
prevPitch = currPitch
end
The point of this script is to make the upwards facing thrusters come on before the vehicle's pitch becomes positive. It works the way it's supposed to in the first vehicle, but on the second one, none of the propellers ever turn on, even though all upwards propellers on both vehicles are set to "thruster (reverse)".
Rocket Speed is the first vehicle; the Filthy Switt is the second.
prevPitch = 0
function Update(I)
currPitch = I:GetConstructPitch()
I:Log(currPitch)
pitchAcc = currPitch - prevPitch
I:Log(pitchAcc)
if pitchAcc<0 then
I:RequestThrustControl(4,-pitchAcc)
I:Log('Thrusters On')
else
I:RequestThrustControl(4,0)
I:Log('Thrusters Off')
end
prevPitch = currPitch
end
The point of this script is to make the upwards facing thrusters come on before the vehicle's pitch becomes positive. It works the way it's supposed to in the first vehicle, but on the second one, none of the propellers ever turn on, even though all upwards propellers on both vehicles are set to "thruster (reverse)".
Rocket Speed is the first vehicle; the Filthy Switt is the second.