I’m wanting to create a little plugin to cover a gap in some addons. Effectively playing set audio files when certain parameters are met (eg speed, altitude etc).
Where would I start? Are there some helpful demos or tutorials. Not new to programming but I am new to doing it in MSFS…
Well, first decision is where you want this app to run. There are effectively 3 ways to integrate:
- External application using SimConnect client to communicate with sim’s SimConnect API.
- If choosing this route, the next decision is which language do you prefer to use, C++ or C#? Functionality is the same in both flavors.
- EDIT: actually one could use the Managed version of SimConnect in any environment which can utilize .NET assemblies, such as Python, Node, etc, (typically with an adapter library layer).
- In-sim panel (eg. accessible from the in-flight toolbar) using JavaScript API. (That docs link won’t really help you directly though… best too look at some examples or helpers, eg. https://github.com/parallel42/msfs-toolbar-interop)
- In-game “standalone” type WebAssmebly module using various WASM APIs. This is C++ only, using a WASM-specific subset of C++ 17 standard (very sandboxed, no Win API, no threads, etc). Probably not useful for something like playing sounds since three’s no functionality for that specifically.
“Traditionally” one would reach for SimConnect and build an external application. But the HTML/JS integration option does offer some interesting possibilities. Both methods will have a learning curve, but the HTML/JS API docs are basically half-baked, at best, so it can be more challenging to work with (to put it mildly).
Cheers,
-Max
Simplest and fastest to iterate/test would be event driven C# standalone.
Have a look through GitHub - bm98/FS20_HudBar: Display essential MSFS Information as Bar at the bottom of the primary screen as an example (complex one)