DaveSCUSA Posted Saturday at 04:44 PM Report Posted Saturday at 04:44 PM I'm trying to determine when an aircraft is started or restarted (to reset Lua logic). Your offset status has a "Ready to Fly" flag (offset 0x3364). Zero if ready to fly. Also, the internet indicates that flag 16 - Ingame-RTC, is set when an aircraft is ready to fly. In your experience, which is more useful? Or is there another method to determine when an aircraft flight has started? Thanks
John Dowson Posted Saturday at 05:38 PM Report Posted Saturday at 05:38 PM 48 minutes ago, DaveSCUSA said: I'm trying to determine when an aircraft is started or restarted Can you clarify what you mean by this? 49 minutes ago, DaveSCUSA said: Also, the internet indicates that flag 16 - Ingame-RTC What does this mean? Do you have a reference? I'm not exactly sure what you are after, but maybe try logging the camera state offset, 0x026D. This will go through various values and then back to 2 (cockpit) (or maybe 3 - external/chase). If you log this offset, you can probably determine the value changes you need.
DaveSCUSA Posted Saturday at 05:52 PM Author Report Posted Saturday at 05:52 PM 6 minutes ago, John Dowson said: What does this mean? Do you have a reference? I am trying to find out any time a new flight starts in MSFS. A flight stars from the main menu after choosing the aircraft and airports and select Ready to Fly. Or one can restart a flight using the Esc key and selecting the Restart button. Thus starting a flight. I want to know when this occurs so a Lua plugin I created can reset its start logic. Thanks
John Dowson Posted Saturday at 07:09 PM Report Posted Saturday at 07:09 PM If you use lua auto-start, the lua is always started when the flight starts, and killed when the flight finishes. For restart, check the camera state, as advised. It will go through various values then back to 2 when the flight is ready. You should log the value of this to see what values it goes to on restart before back to 2.
John Dowson Posted Sunday at 10:57 AM Report Posted Sunday at 10:57 AM I have taken a quick look and offsets 0x3364 (ready-to-fly flag) and 0x3365 (in-menu/dialog flag) can't be used for this. The camera state offset 0x026D goes to 11 (waiting) then back to 2 when you restart a flight, so try that. I will look into updating the ready-to-fly offset 0x3364 to reflect the correct state, John
DaveSCUSA Posted Sunday at 09:02 PM Author Report Posted Sunday at 09:02 PM On 8/30/2025 at 3:09 PM, John Dowson said: If you use lua auto-start, the lua is always started when the flight starts, and killed when the flight finishes. I'm a bit confused. The Advanced User document states that Auto.C510 restarts the auto.start LUA when an aircraft is changed. Does it also start again if the flight with the same aircraft restarts? "to be executed, in order, automatically whenever the current aircraft is changed (or, indeed, first loaded), or a specific named aircraft (or Profile) is loaded."
John Dowson Posted yesterday at 07:24 AM Report Posted yesterday at 07:24 AM 10 hours ago, DaveSCUSA said: Does it also start again if the flight with the same aircraft restarts? No. As I have said, you need to use the camera state to see if there has been a restart. MSFS does not provide any events/information when a flight is restarted, so it was never possible to detect this in FSUIPC. However, since the addition of the camera state variable (in late 2022) you could use this, as I have said. 10 hours ago, DaveSCUSA said: "to be executed, in order, automatically whenever the current aircraft is changed (or, indeed, first loaded), or a specific named aircraft (or Profile) is loaded." This is basically correct although a little outdated. To be more precise, the luas are started in order on initial load of an aircraft and once the available lvars have been received and are available, and are stopped/killed whenever you go back to the main menu (i.e. end the flight).
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now