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

Fenix Variable from MDCU Perf page

@Misho It used to be in FSX/P3D that the FlightLoaded event arrived a long time before the aircraft was actually fully loaded. Does the same still apply in MSFS?
 
@Misho It used to be in FSX/P3D that the FlightLoaded event arrived a long time before the aircraft was actually fully loaded. Does the same still apply in MSFS?
You are talking about 2 different events. There is an event for "AircraftLoaded" and "FlightLoaded". Yes, "FlightLoaded" will happen first, because aircraft to be loaded is defined in the FLT file.
 
Looks like Asobo have fixed/changed the definition then. P3D has this to say:

AircraftLoaded Requests the full path name of the last loaded aircraft flight dynamics file. These files have a .AIR extension.

Great. More confusion :rotfl:
 
Looks like Asobo have fixed/changed the definition then. P3D has this to say:

AircraftLoadedRequests the full path name of the last loaded aircraft flight dynamics file. These files have a .AIR extension.

Great. More confusion :rotfl:
No. This was implemented and working since first Simconnect for FSX.
 
Right. Good to know. I know that you are aware of all that follows; it's really just for anyone who isn't aware of the annoying gotchas.

- FlightLoaded occurs a long time before the aircraft is loaded
- AircraftLoaded occurs before the sim is ready to fly. It also doesn't necessarily tell you which aircraft is loaded because the same .air file can be used for multiple aircraft.
- To get the actual aircraft that is loaded, you need to retrieve the Title via SimConnect.
- To find out when the sim is ready to fly; that's a bit more difficult. It's been known for a long time that key_events stack and won't fire until the sim is ready to fly. It's been common to use the seatbelt light key_event as a test event; this is the FSX/P3D code that lets you know when it's good to go (thanks to Rob Barendregt who originally figured it out):
Code:
// Global variable
// Load complete
int loadComplete = 0;

// module vars
MODULE_VAR seatbelt_lights =    { CABIN_SEATBELTS_ALERT_SWITCH };
MODULE_VAR currtick18 =    { TICK18 };

//---------------------------------------------------------------------------
// Gauge callback
//---------------------------------------------------------------------------
void FSAPI    your_gauge_update(PGAUGEHDR pgauge, int service_id, PUSERDATA extra_data)
{
    static double startTimer = -1;

    switch (service_id)
    {
        case PANEL_SERVICE_PRE_UPDATE:

        //----------------------------------------------------------------------
        // Check for startup complete by monitoring the seatbelts demand queue
        if(loadComplete == 0)
        {
            lookup_var(&seatbelt_lights);
            lookup_var(&currtick18);
            if (seatbelt_lights.var_value.n == 0 && startTimer == -1)
            {
                trigger_key_event(KEY_CABIN_SEATBELTS_ALERT_SWITCH_TOGGLE, 0);
                startTimer = currtick18.var_value.n + 9;
            }
            else if (seatbelt_lights.var_value.n != 0 && loadComplete == 0)
            {
                loadComplete = 1;
            }
            if (currtick18.var_value.n >= startTimer)startTimer = -1;
        }
From here on in you can trap your critical startup information inside a ‘loadComplete’ block. A last note on this: the aircraft loads twice during the startup sequence, once at 8% and finally at 100%. As far as I have been able to tell, the variables are in the correct state after the second load.

One day I'll create a SimConnect version that should be completely sim-agnostic.
 
Last edited:
Yes, FlightLoaded Is received before AircraftLoaded.
But how to know when flight is stopped (return to FS main menu) ?

Not so simple to have a simple view like Flight started, Flight Pause. flight leaved.
 
To check for flight in progress i.e. the aircraft is moving on screen, ensure that SIM PAUSED and IS LATITUDE LONGITUDE FREEZE ON are both false. You may also want to check IS SLEW ACTIVE to ensure that slew mode is not engaged.
To check for flight paused, ensure that SIM PAUSED is true. KEY_FREEZE_LATITUDE_LONGITUDE_TOGGLE and its derivatives do not pause the flight.
When you return to the main menu, the current flight loaded is still active until you load a new scenario. That is the point at which the previous flight is unloaded. It is not unloaded when you return to the main menu.
 
Last edited:
Back
Top