SimpleWasmAirport
The SimpleWasmAirport
sample illustrates an airport package for Microsoft Flight Simulator 2024 that uses a WebAssembly module (WASM) to output some data to the console. Note that this sample includes the absolute minimal set of files that are required to define the scenery and run the WASM.
You can expand the link below to see the SimpleWasmAirport
file and folder structure:
|---+ SimpleAirport |---+ PackageDefinitions | |---+ mycompany-wasm-airport | | |---+ ContentInfo | | |---- Thumbnail.jpg | |---- mycompany-wasm-airport.xml |---+ PackageSources | |---+ Airports | | |---- mynn.xml | |---+ materials | | |---+ Textures | | | |---- Asphalt01_Albedo.png | | | |---- Asphalt01_Albedo.png.FLAGS | | | |---- Asphalt01_COMP.png | | | |---- Asphalt01_COMP.png.FLAGS | | |---- myasphalt.material
| |---+ Sources
| |---+ Code
| |---+ SimpleWasmAirport
| |---- SimpleWasmAirport.cpp
| |---- SimpleWasmAirport.h
| |---- SimpleWasmAirport.sln
| |---- SimpleWasmAirport.vcxproj |---- WasmAirportProject.xml
Loading And Building The Project
In order to load and build the project in Microsoft Flight Simulator 2024, you must have previously enabled Developer Mode (see here for more information). Once enabled, simply follow these steps:
- Use the Open project... command from the File menu.
- Select the file
WasmAirportProject.xml
from theSimpleWasmAirport
sample project.
- The Project Editor should open automatically and show you the project
mycompany-airport
(if the Project Editor doesn't open, then you can open it from the Developer Mode Tools menu)
- At this point you can go ahead and click on the
Build All In Project
button to have the Project Editor build the project so it can be tested.
- When finished, you will have a package built from the files specified in the project. This package will be named
mycompany-airport
and will be output in the Packages folder created in the same directory asAirportProject.xml
:
- To get to the airport location, you will need to first start a free flight, and once in the simulation you can then right click on the
mywasmairport (Airport)
Asset Group, and selectLoad In Editor
:
- Once the Scenery Editor is open, you need to travel to the airport. This is done by simply double clicking on one of the runway objects listed in the main editor:
If you open The Console after having done this, you should see a message saying the WASM system module has been initialised, and then every second a new message is shown to let you know that the module is updating:
Related Topics