• 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.

Simple gauge question

Messages
516
I've never created gauges before and am just starting to trawl through that specific part of the FSX SDK. One immediate question I have is:

Does gauge code only run if the gauge is visible? i.e. while the user is in the 2D cockpit or VC?

If not, and your gauge does something fancy like trigger an alarm sound, or set some internal variable, how do you prevent it from doing it twice simulataneously if the user were in spot view, (or any other non-cockpit view)?

Sorry if this question is a bit "noddy", as gauge programming is a whole new wide world for me.

Thanks,

Si
 
It depends on how the gauge is programmed...

Typically though, the gauge is "called" into action either when the panel (2d or 3d, wherever the gauge is located) is first loaded or when the aircraft is first loaded. Also, some gauges can run multiple instances or some will still only run one instance of itself even if more than one is displayed...

The basic "straight out of the SDK" examples will load when the panel loads. If you load your plane in spot view, they won't go active until you cycle into the panel view.

So...how's that for a waffling, non-commiting reply? :) (I hate to call it an answer.)
 
Ok, that's a bit clearer. So after a gauge has loaded, the code continues to run if the user then switches to an external view?

Is there a secret to getting a gauge to load *before* the panel is displayed? i.e. if a flight is loaded in spot view?

Thanks,

Si
 
Ok, that's a bit clearer. So after a gauge has loaded, the code continues to run if the user then switches to an external view?

Is there a secret to getting a gauge to load *before* the panel is displayed? i.e. if a flight is loaded in spot view?

Thanks,

Si

Once it's called, a "regular" gauge once loaded will continue to run until a new plane is loaded even when you're not in a view displaying the gauge.

This can be modified by changing how you set up your gauge's GAUGE_CALLBACK (info somewhere around line 4400 in the gauges.h file). I haven't used it very much myself so I really don't fully understand all the ins/outs of the gauge callback and how to use it.
 
Back
Top