Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Set trim via joystick buttongs using Advanced Fly-By Wire mod
// unfortunately this doesn't work great. Trim setting is not shown by moving the flight tabs
// furthermore while AFBW obeys trim when set with keys, setting with kOS causes a re-center of control during input
set pitchTrim to 0.
set yawTrim to 0.
set ship:control:pitchtrim to pitchTrim.
set ship:control:yawtrim to yawTrim.
until false {
clearscreen.
on AG3 {
set pitchTrim to pitchTrim + 0.01.
if pitchTrim > 1 { set pitchTrim to 1. }
set ship:control:pitchtrim to pitchTrim.
preserve.
}
on AG4 {
set pitchTrim to pitchTrim - 0.01.
if pitchTrim < -1 { set pitchTrim to -1. }
set ship:control:pitchtrim to pitchTrim.
preserve.
}
on AG5 {
set yawTrim to yawTrim + 0.01.
if yawTrim > 1 { set yawTrim to 1. }
set ship:control:yawtrim to yawTrim.
preserve.
}
on AG6 {
set yawTrim to yawTrim - 0.01.
if yawTrim < -1 { set yawTrim to -1. }
set ship:control:yawtrim to yawTrim.
preserve.
}
on AG7 {
set pitchTrim to 0.
set yawTrim to 0.
set ship:control:pitchtrim to pitchTrim.
set ship:control:yawtrim to yawTrim.
}
print "Pitch Trim: " + pitchTrim.
print "Yaw Trim: " + yawTrim.
wait 1.
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.