StandaloneModule

This sample project illustrates how you can make a single, "stand alone" WASM module that connects to SimConnect SDK without being "attached" to an object within the simulation world. The important part of this sample is found in the Sources/Code folder, where you'll see a Visual Studio project that can then be compiled into a WASM module:

Once compiled the WASM module would be placed into the PackageSources folder to be copied as part of the project, as shown in this project.

 

You can expand the link below to see the StandaloneModule file and folder structure:

File OverviewFile Overview

|---+ StandaloneModule
    |---+ PackageDefinitions
  | |---+ mycompany-module-stabdalone
  | | |---+ ContentInfo
  | | |---- Thumbnail.jpg | |---- mycompany-module-standalone.xml |---+ PackageSources | |---+ modules | |---- standalonemodule.wasm |---+ Sources | |---+ Code | |---- Module.cpp | |---- Module.h | |---- StandaloneModule.sln | |---- StandaloneModule.vcxproj | |---- StandaloneModule.vcxproj.filters | |---- StandaloneModule.vcxproj.user |---- StandaloneModuleProject.xml

 

 

Loading And Building The Project

In order to load and build the project in Microsoft Flight Simulator, 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.

Developer Mode Open Project

 

  • Select the file StandaloneModuleProject.xml from the StandaloneModule sample project:
    The StandaloneModule XML File In The File Explorer

 

  • The Project Editor should open automatically and show you the project mycompany-module-standalone (if the Project Editor doesn't open, then you can open it from the Developer Mode Tools menu):
    The Standalone Module Package In The Project Editor

 

  • Clicking on the project in the Project Editor will open the Inspector Window, and here you need to click the Build Package button (if the Inspector Window does not open automatically, go to the View menu in the Project Editor and open it from there).
    The Build Package Button

 

  • This will build a package from the files specified in your project. This package will be named StandaloneModule.wasm and will be output in the Packages/mycompany-module-standalone/modules folder:
    The Standalone Module WASM Folder

 

  • At this point, you will need to add the entire package (so copy the folder mycompany-module-standalone) into The Community Folder and then restart the game.

 

  • Once your game has restarted you need to select a new flight and start it, then open The Console. Here you can do a search for "New Flight Loaded" (which is the message that the module should output if a flight ios succesfully started) and you should see the message listed:
    The Output From The Standalone Module