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

Detect when "in flight" or in the main menu?

Messages
38
Country
israel
I have a simconnect application that tracks flights. Its been working for a while and is used by thousands of people (fstrak on flightsim.to).
I noticed that with msfs2024 it sometimes doesn't close the flight when switching to the main menu or restarting the flight (or starting a new flight), and this causes a discrepancy in the tracking of the flight.
How do you safely detect when a flight is active? I am using a mix of monitoring the pause state and check if a flight is loaded and/or the sim is on. But it seems something changed in msfs2024
 
You may find the messages from B21 helpful in this thread at dev support, if you haven't seen then yet (don't miss the last one):

(I also referenced your other post on the subject in there too, as you'll notice :-) )
 
You may find the messages from B21 helpful in this thread at dev support, if you haven't seen then yet (don't miss the last one):

(I also referenced your other post on the subject in there too, as you'll notice :) )
Thanks! I also use the canera state in combination with the pause events, but i never checked camera state 12!
sound like if I use it in addition to the current code and just terminate the flight in my app when 12 is hit, this will kill 99% of the nisses.
 
Set up a "FlightLoaded" event and track the names of the flights that are loading. There is as specific flight that is loaded every time you get into UI. I use it and it hasn't failed me yet. Here is the code:

Code:
case EVENT_FLIGHT_LOADED:
                    {
                        string strFileName = evt->szFileName;
                        if (strFileName == "flights\\other\\MainMenu.FLT")
                        {
                            ...
                        }
                        ...
                    }
                    break;

Hope this helps.
 
Set up a "FlightLoaded" event and track the names of the flights that are loading. There is as specific flight that is loaded every time you get into UI. I use it and it hasn't failed me yet. Here is the code:

Code:
case EVENT_FLIGHT_LOADED:
                    {
                        string strFileName = evt->szFileName;
                        if (strFileName == "flights\\other\\MainMenu.FLT")
                        {
                            ...
                        }
                        ...
                    }
                    break;

Hope this helps.
 
I was doing this - it worked on msfs2020. This doesn't work anymore in 2024 - when you switch to main menu the customfight.flt is loaded again.
 
I was doing this - it worked on msfs2020. This doesn't work anymore in 2024 - when you switch to main menu the customfight.flt is loaded again.
Ah ok, sorry. Yes, I have this going in 2020. Bummer to see they broke it :confused:
 
Back
Top