How is restart suppose to work?

Yes it’s a real question. I am having an issue with restart flight and dev mode. When I build a project the run once code works as expected. However if I do a restart flight, I expect my run once XML code to process, but it seems it does not.

So How does restart flight work, what is suppose to happen? I would assume any L:Vars are zeroed out, but that does not seem to be the case also.

As a way around, when you hit build… the run once RPN code will work…


yes I know that works but that’s not what a user will do - they can’t build my project

My understanding is that the run once code runs when the aircraft model is loaded. Restart Flight doesn’t appear to reload the aircraft model.

Hmm, I use this a lot and works fine, maybe on a non dev mode works as expected?

It’s just that run once does not “seem” to work. because I only set one LVAR - and it does not get set, unless I rebuild my project. So as far as I am concerned restart is not really restart, it’s “Redo with what you already have”

Since there is no way to see run once in the behaviors debug, because it all gets cleared out. and my XML is no longer the focus at the behaviors debug window.

      <UseTemplate Name="ASOBO_GT_Update">
        <UPDATE_CODE>(A:ATC ON PARKING SPOT, bool) 1 == if{ 0 (&gt;L:PILOT_VIZ,bool) } els{ 1 (&gt;L:PILOT_VIZ,bool) }</UPDATE_CODE>

PILOT_VIZ stays at zero and I watch A:ATC ON PARKING SPOT = 1 in simvarwatcher, So I expect PILOT_VIZ to go to zero. I’m spawning at a parking spot

I do experience some other issue which may be related.
By simconnect I do alter some aircraft and local variables at AircraftLoaded event (which happen on flight restart as well). But at some cases these changes erased by further loading process. Feels like scripts start to run at the end of loading process, but then default FLT values applied on top of changes were made moment before, including all unlisted LVars. Just a guess as it happen rarely.