Does anyone know if it’s possible to load any of the standard flt files that aircraft have via Javascript?
Currently if I want to put an aircraft into a shutdown state I have to manually send a bunch of single simvar commands to configure the state of the plane.
It would be better, and more consistent for each plane, if I could just load the appropriate FLT file such as apron.flt or ApronWithoutCovers.flt for Cold n’ Dark, or runway/runwaywater for takeoff.
Is it possible?
If not, can Asobo make it possible?
Use cases and context:
I just released Location Manager 2 for MSFS 2024/2020 Location Manager 2 for MSFS 2024/2020 - Sonicviz ( a rewrite of LM1, as the main map is now locked out of modification) and I would like better control over the aircraft state when a user teleports to a gate, runway, or other location, to place the aircraft in an aircraft consistent cold or hot state.
At the moment it’s quite a hacky solution and doesn’t provide a consistent a/c UX for transitioning to different states under user control. It would be better to utilize the system in place, which is just to reload the appropriate flt file for the state you want to place the plane in.
It’s something I’ve been looking to do for a while, but a customer just pinged me over it again, so here I am!
It seems like a basic no brainer function that should be available.
I remember looking for it in 2020 and never found it either.
Seriously, you still can’t seem to access the ability to load standard .flt state descriptor files from the aircraft folder?
It can’t be a security issue, you’re literally running it from a custom code base anyway, so that wouldn’t make sense. You could provide an API call that was restricted to the standard set of .flt files that describe state if you wanted to constrain it.
So you can’t call it directly from js it seems (even if it did work) you have to use the js to wasm, and build a separate Wasm module that does the simconnect_flighload
Is it possible just to make a straight call from js, without having to make a wasm module?
I think it’s a mistake not to call this what it is. MSFS has now accumulated 6 (SIX) programming environments with overlapping and inconsistent API’s:
model RPN
the model templates system
html/js
simconnect exe’s
WASM
node/typescript
None of those environments is simple except the one with most of your code in. We’re creeping into a situation where it’s normal for MSFS devs to say "ah, if you want this data, simple, just use my framework.
NodeJS nor Typescript are available in the sim. If you want to use typescript you have to transpile it to JS yourself. I suspect what you really mean is the avionics framework, which is a framework/library to help build HTML/JS instruments.
Having done my fair share of work with raw JS at FlyByWire I cannot wait until the last of it is gone and we’re fully typesafe (or at least as close as you can get, because Typescript is still limited by the JS it has to transpile to), as it makes life so much nicer with good IDE completions and hints, cuts out a lot of bugs, and gives you much more confidence when refactoring.
The OP is referring to triggering the load of a FLT file from within the MSFS system. The challenge isn’t about which is the best programming language for that, it’s that we have lots of programming languages/frameworks and it’s becoming necessary to know ALL of them if you’re the sole programmer on a complex aircraft. I.e. someone asks about doing the FLT load in the html/js ‘framework’, and the answer is to use the WASM ‘framework’ just for that function. Instead of tidying this up, we’re adding additional ‘frameworks’.