Created
May 23, 2026 02:29
-
-
Save julianpoma/ac6c08833c4c482e2a18fd618bc3d537 to your computer and use it in GitHub Desktop.
X-Plane 12: simulates the new wheel brake axis for legacy aircrafts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| -- Mirror right toe brake axis to left toe brake axis | |
| -- For whitelisted aircraft only | |
| local SCRIPT_NAME = "wheel_brakes_legacy" | |
| -- Add supported .acf filenames here | |
| local whitelisted_acf = { | |
| "A330.acf", | |
| -- "Some_Other_Aircraft.acf", | |
| } | |
| -- X-Plane brake datarefs | |
| dataref("brake_l", "sim/flightmodel/controls/l_brake_add", "writable") | |
| dataref("brake_r", "sim/flightmodel/controls/r_brake_add") | |
| local enabled = false | |
| ------------------------------------------------------------ | |
| -- Aircraft whitelist | |
| ------------------------------------------------------------ | |
| local function is_whitelisted_aircraft() | |
| local current_acf = tostring(AIRCRAFT_FILENAME or "") | |
| for _, acf in ipairs(whitelisted_acf) do | |
| if current_acf == acf then | |
| return true | |
| end | |
| end | |
| return false | |
| end | |
| ------------------------------------------------------------ | |
| -- Enable only for whitelisted aircraft | |
| ------------------------------------------------------------ | |
| if is_whitelisted_aircraft() then | |
| enabled = true | |
| logMsg(SCRIPT_NAME .. ": enabled for " .. tostring(AIRCRAFT_FILENAME)) | |
| else | |
| enabled = false | |
| logMsg(SCRIPT_NAME .. ": disabled for " .. tostring(AIRCRAFT_FILENAME)) | |
| end | |
| ------------------------------------------------------------ | |
| -- Brake mirroring | |
| ------------------------------------------------------------ | |
| function jp_wheel_brake_legacy() | |
| if not enabled then return end | |
| brake_l = brake_r | |
| end | |
| do_every_frame("jp_wheel_brake_legacy()") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment