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

B21 avatar image
B21 asked B21 edited

Another niche soaring question: any var or other way to detect usage of lift visualisation?

our multiplayer soaring group is up to a couple of thousand members obviously including inexperienced gliding folks and I've just learned some pilots are putting the 'visualise lift' setting on a hotkey as if it's a normal feature inside a glider.

We don't need to disable it but it would be hugely valuable to be able to detect when a player has used it in the same way we detect slews or the use of the engine. I can't find anything in the SDK that would provide any hook to work out whether that visualisation being used - does anyone know of a solution?

aircraft
10 |10000

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

FlyingRaccoon avatar image
FlyingRaccoon answered

Hello @B21

There is no simvar or key event for this at the moment.
However, if you check the Weather.js file in fs-base-ui/html_UI/JS/Services/ (it is used by the weather panel in the UI), you'll notice there is a JS_LISTENER_WEATHER you can register to and it exposes callbacks to get and set the thermal visualization.

I hope this helps.

Regards,
Sylvain

10 |10000

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

B21 avatar image
B21 answered B21 edited

thanks again for this advice. Including Weather.js and using example code from WeatherEditionMenu.js I've tried with:

class MyInstrument extends BaseInstrument {
    constructor() {
        super();
        this.weather_listener = RegisterWeatherListener();
        this.weather_listener.onUpdateToggleThermalVisualization(this.viz_toggle);
    }
    viz_toggle(viz, toggled, title) {
        console.log("weather_listener on_thermals_viz_toggle", viz, toggled, title);
    }


this.weather_listener.connected goes to true which is promising, but tragically I can't find a way that the viz_toggle callback actually gets called when I move the slider in UI during a flight. If there's something obvious I've missed I'd appreciate a hint in the right direction, but otherwise maybe this code will help others get started with weather callbacks.

10 |10000

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

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.