SimConnect functions like SimConnect_AICreateEnrouteATCAircraft() require path
to flight plan file. My WASM module creates flight plans at runtime and saves
them to \work folder. How should I express paths to flight plan files to use
them with SimConnect functions? I have not found a way to use relative paths,
nor a way to detect absolute path to \work folder from inside the WASM module.
Did you ever figure out how to do this? I’m interested in doing something
similar if you’d like to share the details
No, nor have I tried since posting to check if there has been any change (I
assume not). I used SimConnect_AICreateEnrouteATCAircraft in FSX and P3D to
spawn training aircraft at a small airport mostly used by a flight school, and
custom flightplans let me make them fly training routes that started and ended
at the same airport. This is not possible using the built-in AI traffic
scheduling.
Hello @Paavo @gregl83 , We are investigating this, I will let you know when I
have more information on this. Regards, Boris
Hello @Paavo @gregl83 , There was an issue that prevented wasm modules from
accessing the work/ and packages/ folder. This has been fixed for the next
SU11. Quick reminder about folder accessibility in wasm: - work\ → Write
and Read - package\ → Read only Regards, Boris
FWIW the html/js support has a Coherent.call(“GET_FLIGHTPLAN”) which is pretty
neat in that you get get a full-on Javascript object with all the flightplan
details in it, BUT you get a version of the flightplan after it has been
mangled by some kind of internal MSFS processing, probably for an assumed
Autopilot, so additional waypoints are injected and existing waypoints are
reset to assumed altitudes and the elevations within the .PLN file are
discarded. That would make sense for “GET_AUTOPILOT_PLAN” but is unfortunate
if you’re trying to get the details of the original .PLN file. So as WASM API
support improves, you might want to keep an eye on this issue if you simply
want the contents of the ‘original’ flightplan.