plane icon Welcome to Microsoft Flight Simulator’s SDK Q&A Platform!

You have questions regarding the SDK? DevMode Tools? SimConnect? You would like to submit an idea for future improvements, seek help or exchange knowledge? You’re in the right place.


Please take a moment to read the platform’s guidelines before you get started!


question

Simbol avatar image
Simbol asked Simbol commented

WASM standalone module

Dear Asobo,

I have successfully used WASM via the route of gauge callbacks, which works great, i am attached to the frame updates, etc. and the code gets called on each pre-render callback, etc.

However I am now involved with a project that requires a standalone module, and as I understand from the documentation, the module will be loaded automatically and call the module_init function, which on test last night worked fine.

However my question is, how do I register / link now to the pre-render callback when you work on standalone module? this is not clear in the documentation, the standalone module example provided with the SDK is only using SimConnect with a dispatcher and nothing else.

So what is the best standard practice for standalone modules? is it just using SimConnect with the callback dispatcher with a request to update data each simulation frame? or are we supposed to do something more advance and more efficient like for the "gauge" callback approach?

Thanks in advance for any help and information that can be provided regarding this.

Kind Regards,
Raul

wasm
10 |10000

Up to 5 attachments (including images) can be used with a maximum of 4.8 MiB each and 23.8 MiB total.

1 Answer

·
FlyingRaccoon avatar image
FlyingRaccoon answered Simbol commented

Hello @Simbol

As stated here: WebAssembly (flightsimulator.com) , only gauge module in a SimObject can have gauge callbacks.
So yes, Standalone module can only have the module init/deinit and simconnect callback.

What do you have in mind and what are you trying to do?

Regards,
Sylvain

1 comment
10 |10000

Up to 5 attachments (including images) can be used with a maximum of 4.8 MiB each and 23.8 MiB total.

Hi Sylvain,


Many thanks for the fast answer, I cannot reveal at this time more information due to NDAs in place at the moment with other 3rd parties. However your answer is extremely helpful and confirms what I suspected, I was just exploring if there were other ways or well know practices that we should be following for stand alone modules.

I can work with the SimConnect callback dispatcher for this project, so all good.


Thanks again for the clarification.

All the best,
Raul

1 Like 1 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 5 attachments (including images) can be used with a maximum of 19.1 MiB each and 23.8 MiB total.