• 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 Simconnect & Menu Bar Icon and Name

Well there may in fact be Coherent hooks or whatever they call them to achieve the aircraft and giraffe (dunno about the truck :). I'm really not that familiar with the JS side, partly due to the wonderful docs. I tried to make a "persistent gauge" at one point which would somehow load with every aircraft (so I could get to their B vars via a WASM gauge) but I had a similar experience to yours.... "now what?"

But to achieve your heart's desire you could... (this may be a dumb idea mind you):

Create a WASM module which does your SimConnect work, which as you said would be pretty much the same as what any other SimConnect client would look like.
Create an HTML/JS UI with the basic buttons or whatnot.
Use the Communication API to talk between the two. It's brand new... what could go wrong?

(Check the devs forums for bugs related to the Comm. API though... did I mention it's new?)

Again, maybe there's a way to hook directly into SimConnect from Coherent, but I've not come across any mention of that until yours. And seems like all the core Coherent stuff is in some DLLs, so no sources to look at... :(

-Max
From the Coherent.js link I provided, which is in the MSFS2020 SDK Documentation, a direct quote, literally the first paragraph:

"...designed to permit you to integrate C++ engine calls in your HTML/JS/CSS instruments within Microsoft Flight Simulator..."
The way I read this is, you can literally call functions in your C++ modules from HTML/JS/CSS instruments. And by "Instruments", I assume any in-game UI that can be displayed on the screen, including overlay gauges and interactive dialogs. After that paragraph, a table with Coherent.js functions:


After that, no description or any explanation, just documentation stubs...
 
Last edited:
"...designed to permit you to integrate C++ engine calls in your HTML/JS/CSS instruments within Microsoft Flight Simulator..."
I think they mean their "C++ engine." But yea I can see how that could be interpreted a number of ways.
 
I wonder if a WASM "stub" can be used to implicitly link a P3D/FSX style SimConnect DLL? 🤔
This is in the P3D HTML documentation:

HTML5 Overview
The JavaScript Interface allows for developers to send and receive data directly to and from Prepar3D. The most familiar, as well as most useful, functions are VarGet and VarSet which allow the developer to access Prepar3D's parameters. These functions will be the most utilized when creating Scenario Content and Panel Content.


I've no idea if the MSFS SDK allows access in the same way, but I'd be surprised (well, maybe not!) if it doesn't allow you. I'm away to check...

[Edit]. Yuk. You're right about the total uselessness of the MSFS SDK in that area. When I was experimenting with MSFS about a year ago, I created a WASM SimConnect interface and did all the systems work in an external console. On the face of it, it looked good but the need for various Transmit/ReceiveEvents racked up way too much additional code way too quickly. Are you running P3Dv6? The SDK docs have a shedload more info in them.
 
Last edited:
This is in the P3D HTML documentation:

HTML5 Overview
The JavaScript Interface allows for developers to send and receive data directly to and from Prepar3D. The most familiar, as well as most useful, functions are VarGet and VarSet which allow the developer to access Prepar3D's parameters. These functions will be the most utilized when creating Scenario Content and Panel Content.


I've no idea if the MSFS SDK allows access in the same way, but I'd be surprised (well, maybe not!) if it doesn't allow you. I'm away to check...
It does, through Simvar.js:

MethodDescription
GetSimVarValue(name, unit, dataSource = "")Get the value of a given SimVar using the supplied units.
SetSimVarValue(name, unit, value, dataSource = "")Set the value of a given SimVar using the supplied units and value.

Example with code here.
 
'Page not found'. Maybe it's run away?

[EDIT] which link doesn't work SDK Docs or the GitHub?

huh? This is the link:


And I just clicked on it and it works... hmmmm. Try going to the docs and search for "Simvar.js"

This is the page:

1699040868725.png
 
Back
Top