Skip to content

Instantly share code, notes, and snippets.

@KSAMissionCtrl
Created April 6, 2017 23:47
Show Gist options
  • Save KSAMissionCtrl/2fd266b460390db11506013b0f644f52 to your computer and use it in GitHub Desktop.
Save KSAMissionCtrl/2fd266b460390db11506013b0f644f52 to your computer and use it in GitHub Desktop.
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