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

Event for "End Flight"

Messages
6
Country
trinidad-tobago
Pressing the ESC key during a flight brings up a window allowing the user to choose between:

1) End Flight
2) Continue Flying
3) View Flight Analysis

Does anyone know of an FSX system event that corresponds to the user selecting "End Flight"?

The "Sim" and "SimStop" system events are triggered the moment the user presses "ESC" but the user may choose to continue flying so I don't want to use these.

Thanks!

rle
 
Are you trying to create your own exit dialog? Perhaps the Dialog example can help you.
 
Thanks for the reply Ron :)

What I'm doing is saving aircraft data to a file while the user is flying. I would like to signal the end of this data recording when the user selects "End Flight". Then if the user begins a whole new flight, the whole process can start again without the user having to quit and restart Flight Simulator.

rle
 
rle,

It looks like you need to know the button that is pushed in the end dialog. If you get a program that decompiles the spb files to xml, you can examine the dialogs in the dialog directory in FSX.

You would then need to "hook" into FSX to see that, so most likely you program needs to be a dll and be in the same process as FSX. That is a little beyond my abilities, but there is a thread here at FSDeveloper that has looked at FSX in that way.

on the other hand,

Perhaps you could save some "state" data in your program when simconnect stops (by pressing esc), say lat/long/alt/actype. If the user returns to FS then compare your saved "state" data to the continuation - if the same - continue your recording - if not then have the user press a button on your app to do what ever in your app.

I have found that simconnect disconnects itself when you press esc. - correct me if I am wrong, but I keep seeing FS Connected message when I run all the test apps after pressing esc.
 
Hi,

Try requesting the 'FlightLoaded' system event. FSX loads "Previous Flight.FLT" when the free flight screen starts, and this happens after the 'Esc' key is pressed.

Cheers,
Jim
 
Thanks a lot for those replies. Ron, I think your "state" idea was really helpful and I'm going to use it for something else. For the "End Flight" issue I ended up using Jim's suggestion to request the 'FlightLoaded' system event.

rle
 
I've needed something similar (I write a flight log at the end of the flight), and even the FlightLoaded event is not enough. If a user is flying a mission there is no FlightLoaded event at the end when the user quits back to the mission menu.

In practice I'm monitoring for a variety of events (and other detectable situations) e.g. FlightLoaded, MissionCompleted, 'quit', and SIM ON GROUND after a sufficient period of the user airborne.

Basically we're missing a FlightExit event to compliment the FlightLoaded.

B21
 
I just wanted to throw what may be a ridiculous idea out there reading the above.

It seems to me that you should be able to look at new events that occur as an indication that a state you are looking for is no longer valid.

By this, I mean you may be able to look for a set of events fired (eg, when a new flight is loaded, or the simulator pauses or enters dialog mode, or stops firing panel updates) as an indication the previous flight or mission has terminated.

I'd probably look at PAUSED (fired whenever the sim ends), followed by a call to read state or simvar information, perhaps on a timer, to see what's going on without relying on an even to fire).

Again, just an idea, I haven't tried this. Another thing may be to look at the actual directX window state (FS98MAIN) and see if it's rendering anything, but that gets very low level and requires you run in the same process space as FS.

Etienne
 
Back
Top