Hello, I’m trying to create a pushback tool for Flow (JavaScript). I only have
access to MSFS events and variables. Everything is working well, except when I
attempt to turn left or right. My issue is that the tug doesn’t face the
correct direction. When I simply move backward (by setting “VELOCITY BODY Z”
to a negative value), everything is fine. The “PUSHBACK ANGLE” remains at 0.
However, when I try to turn, I set the “ROTATION VELOCITY BODY Y” variable,
and then the “PUSHBACK ANGLE” continuously fluctuates between -0.35 and 0.35
(even if I always turn in the same direction). Consequently, the tug sometimes
faces the wrong direction. Furthermore, after I stop turning, the
PUSHBACK_ANGLE retains a value of -0.35 or 0.35. As a result, the tug ends up
pushing the aircraft sideways. I attempted to set the TUG_HEADING using the
following value:
(PLANE HEADING DEGREES TRUE * 4,294,967,296 / 360)
However, it doesn’t seem to have any effect. Is TUG_HEADING still in use? How
can I resolve this problem? Thank you. EDIT: I’ve figured out what happened. I
need to use KEY_TUG_HEADING instead. However, there is a problem with MSFS (or
Simconnect) regarding how it handles numbers from JavaScript. For
KEY_TUG_HEADING, we require a 32-bit UNSIGNED value. If I send a value greater
than 2,147,483,647 (31 bits), Simconnect treats it as a negative value. How
can I resolve this issue? Thank you.