Question about loading initial aircraft

Is there a simple way to set specific variables when the aircraft loads. For example, aircraft always loads with Nav Lights ON but Wing Lights OFF I'd like to set both to be in sync with one another but so far I've been unsuccessful. Any help.. greatly appreciated.

Thanks
 

DragonflightDesign

Resource contributor
XML or C? The aircraft actually loads twice during the flight load screen and it's relatively easy to trap the second load by making use of the fact that FS stores gauge calls until the end of the second load and then releases them all at once. I think it was rcbarend that wrote an XML trap; I can give you C-code but I'm useless with XML.
 
Yeah, that was Rob's trick, full code here:

 
Maybe?

XML:
<Gauge Name="Initialize Vars" version="1.0">
   <Element>
      <Select>
         <Value>
<!-- cycle the seatbelt command until sim is ready -->
        (G:Var1) ! if{
            (>K:CABIN_SEATBELTS_ALERT_SWITCH_TOGGLE)
            (A:CABIN SEATBELTS ALERT SWITCH,bool) if{
                1 (>G:Var1)
            }
        }
        els{
            (G:Var2) ! if{
<!-- sim is ready, do stuff only once -->
                (A:LIGHT NAV, bool) (A:LIGHT WING, bool) != if{
                    (>K:TOGGLE_WING_LIGHTS)
                }           
                1 (>G:Var2)           
            }
        }
         </Value>
      </Select>
   </Element>
</Gauge>
 
Top