I’m using Python-SimConnect and am trying to detect whether we’re actually “in the game” or not, but I can’t seem to find any variable I can query on the Simuation Variables docs page that lets me check whether we loaded into the world or not. Is there a variable for this? Or if it’s an event, I can’t seem to find anything in the Event IDs pages either that sounds like it’d be useful. What am I missing?
There’s a few vars that “sort of” tell me whether we’re “probably” loaded in the sim by looking at things like GROUND_ALTITUDE being 0.0 but that’s also a real value when flying over water or even land that’s exactly at sea level so that’s not all that reliable, and I could look at AVIONICS_MASTER_SWITCH but that only tells me whether the plane’s active, not whether we’re in the sim or not. And things like AMBIENT_PRESSURE are set to a real value even when we’re not loaded into the sim, so that’s a no-go either.
I could use the combination of {AMBIENT_TEMPERATURE, AMBIENT_VISIBILITY, AMBIENT_WIND_DIRECTION} which seems to be {20.0,20000.0,225.0} while not in the game, with null/None values while loading, but that seems… fragile? If MSFS changes those defaults in any update, in-game detection based on ambient values will break. And it also ends up flagging as being in the game well before the loading screen is done, so that’s not ideal.