Microsofts MSFS SDK Sample GaugeAircraft in Rust 🦀
Because I didn't want to write logic in Microsoft's cursed RPN language, XML or C++.

- Git for Windows (with Git Bash)
- Rust
- MSFS SDK
cd Sources/Rust
cargo build -v --target wasm32-wasip1 --release && wasm-opt -O1 --signext-lowering --enable-bulk-memory -o ../../Packages/mycompany-aircraft-wasm-gauge/SimObjects/Airplanes/MyCompany_Gauge_Aircraft/panel/gauge_logic.wasm target/wasm32-wasip1/release/gauge_logic.wasm
- Enable MSFS developer mode
- File -> Open Project -> open the rust_aircraft.xml project file in this repo
- Debug -> Console
- Disable the "Autoset" checkbox in the top right of the console and disable any filters
- Editors -> Project Editor
- Clear all messages in Console
- Press the "Build All" button in the Project Editor
- Search for the "Gauge Aircraft" to fly
- Change something in the Rust code and build using the command above
- Project Manager: File -> close project (optional but makes reload way faster)
- Tools -> Behaviours
- In the Behaviours window: "Quick reload" (rebuilds the project if it wasn't closed before. Rebuild only required if file naming or project structure changes)
- Start a flight with the "GaugeAicraft" that should now be available in the sim
- Debug -> Display WASM Debug Window
- Select the .wasm file from the dropdown
Microsoft Flight Simulator © Microsoft Corporation. This project was created under Microsoft's "Game Content Usage Rules" using assets from Microsoft Flight Simulator, and it is not endorsed by or affiliated with Microsoft.
The contents of distribution packages built from the sources in this repository are therefore licensed as follows: in the case of original source code from FBW or compiled artifacts generated from it, under GPLv3. in the case of assets covered by the "Game Content Usage Rules", under the license granted by those rules.