• Which the release of FS2020 we see an explosition of activity on the forun and of course we are very happy to see this. But having all questions about FS2020 in one forum becomes a bit messy. So therefore we would like to ask you all to use the following guidelines when posting your questions:

    • Tag FS2020 specific questions with the MSFS2020 tag.
    • Questions about making 3D assets can be posted in the 3D asset design forum. Either post them in the subforum of the modelling tool you use or in the general forum if they are general.
    • Questions about aircraft design can be posted in the Aircraft design forum
    • Questions about airport design can be posted in the FS2020 airport design forum. Once airport development tools have been updated for FS2020 you can post tool speciifc questions in the subforums of those tools as well of course.
    • Questions about terrain design can be posted in the FS2020 terrain design forum.
    • Questions about SimConnect can be posted in the SimConnect forum.

    Any other question that is not specific to an aspect of development or tool can be posted in the General chat forum.

    By following these guidelines we make sure that the forums remain easy to read for everybody and also that the right people can find your post to answer it.

MSFS20 How do I actually produce a "MSFS WASM Module", install it, get it loaded, and debug it?

tml

Messages
89
Country
finland
New and clean machine, VS2019 (Community Edition), MSFS2020, and the current MSFS SDK installed. In VS2019: Create a new project. Use template "MSFS WASM Module", call it "T1". Create it in C:\Users\tml\src\T1. Build > Build Solution. "Build: 1 succeeded, 0 failed, 0 up-to-date, 0 skipped." I end up with these files in the project's (not solution's) output folder (C:\Users\tml\src\T1\T1\MSFS\Debug): T1.Build.CppClean.log, T1.log, T1.obj, T1.tlog, T1.vcxproj.FileListAbsolute.txt, and T1.wasm.recipe.

No .wasm file. And even if there was, what am I supposed to do with it, to get MSFS to load it at run-time? And what is a .wasm.recipe file? It contains:

<?xml version="1.0" encoding="utf-8"?>
<Project>
<ProjectOutputs>C:\Users\tml\src\T1\MSFS\Debug\T1.wasm</ProjectOutputs>
<ContentFiles></ContentFiles>
<SatelliteDlls></SatelliteDlls>
<NonRecipeFileRefs></NonRecipeFileRefs>
</Project>


Note that it says the T1.wasm would be in the solution's MSFS\Debug folder, but that one is empty.

--tml
 
Last edited:
Ha! I had to change the "Configuration Type" for the project from "WasmModule" to "<Inherit from parent or project defaults>". Then the type changes to "WASM Module (.wasm)." Then building it did produce a .wasm file in the solution's MSFS\Debug folder. Now I just need to figure out what surrounding boilerplate is needed to make MSFS actually use it.

--tml
 
Eventually, I did manage to build the GaugeAircraft sample, built it in VS, then in MSFS's Dev Mode, and I did end up with an aircraft I could load in MSFS, and when I then attached the MSFS process in VS, I could set breakpoints in the C++ code of GaugeAircraft (which had been compiled to WASM, and then JITted by MSFS's built-in web engine), yay!

--tml
 
I'd ask if you'd care to share the steps you took to get there, but I'm not there yet to the point of building aircraft. Others might like to know, though.
 
I would like to see real WASM code and compare it to VB and VBA code.
WASM is like machine code, not like VB or VBA at all. And in the MSFS context, the language that you compile to WASM is C++.
 
Back
Top