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

FSXA automatic Landing Lights

Code:
<?xml version="1.0" encoding="UTF-8"?>
<Gauge Name="autolandlights">
   <Element>
   <Shift>
   <Value>(A:INDICATED ALTITUDE,feet) 10000 &gt;
(A:LIGHT LANDING, bool) 1 ==
and
if{ (>K:LANDING_LIGHTS_OFF) }
els{ (>K:LANDING_LIGHTS_ON) }</Value>
   </Shift>
   </Element>
</Gauge>


still not working , yet . above 10k they go on and off 20 a second .
i wonder , should there be one , A , and one , B value , and two , if , and no ,els, ? i found somthing on ,lt, and ,gt, but still i dont now how to write it right.:D:eek::confused::)
 
Last edited:
just to say , whe have autopilot , autoland , auto spoilers , autobrakes, autoflaps , even auto anti ice , auto start and shutdown , but automatic landing lights euh , -.-
 
Okay, my mistake was using an els{ without any further validation checks...

This will work!

Code:
<?xml version="1.0" encoding="UTF-8"?>
<Gauge Name="autolandlights">
   <Element>
      <Value>
         (A:INDICATED ALTITUDE,feet) 10000 &gt;
         (A:LIGHT LANDING, bool) 1 ==
         and
         if{ (>K:LANDING_LIGHTS_OFF) }

         (A:INDICATED ALTITUDE,feet) 10000 &lt;=
         (A:LIGHT LANDING, bool) 0 ==
         and
         if{ (>K:LANDING_LIGHTS_ON) }
      </Value>
   </Element>
</Gauge>
 
n4gix's snippet works (without the extraneous =) as does this smpler one.

Code:
(A:INDICATED ALTITUDE,feet) 10000 &gt; 
    if{ (&gt;K:LANDING_LIGHTS_OFF) }
    els{ (&gt;K:LANDING_LIGHTS_ON) }

They both have the disadvantage that the user loses control of the lights - they can't be turned off on the ground. Of, course this can be overcome but then what next?
 
@MGH
Your code is simple, but it turns the already OFF lights OFF again every cycle. It is a problem in Multiplayer because Landing lights are visible to other players so the lights on/off command is broadcast every cycle and can be a frame rate killer. Same issue with lights being turned on every cycle even when they are already on.
Better practice is to only turn them off when they are already on and the altitude test passes in a climb. Similar though opposite effect in a descent. This is what Bill L did.

Roy
 
Code:
<?xml version="1.0" encoding="UTF-8"?>
<Gauge Name="autolandlights">
   <Element>
   <Shift>
   <Value>(A:INDICATED ALTITUDE,feet) 10000 &gt; 
    if{ (&gt;K:LANDING_LIGHTS_OFF) }
    els{ (&gt;K:LANDING_LIGHTS_ON) }
</Value>
   </Shift>
   </Element>
</Gauge>

this is the workin code , thnx . i wil never forget the landing lights ever while flying with vafs. thank you all for helping mé .

:D:D:D:D:D:D:D:D:D:D:D:D:D:D:D:D:D:D:D:D:D:D
 
Last edited:
now it gets more difficult , the gauge may only bé active when going faster then 50 knots indicated , so when i leave the taxiway i can set them manual to off or manual to on when abaut to take off. and if i ever forget them they will go on if i go faster then 50 knots , any ideas? thnx:D:D:o
 
@MGH
Your code is simple, but it turns the already OFF lights OFF again every cycle. It is a problem in Multiplayer because Landing lights are visible to other players so the lights on/off command is broadcast every cycle and can be a frame rate killer. Same issue with lights being turned on every cycle even when they are already on.
Better practice is to only turn them off when they are already on and the altitude test passes in a climb. Similar though opposite effect in a descent. This is what Bill L did.

Roy

so can you have a solution for that , example the gauge works between 9900 and 10100 , then the speed solution to turn the gauge off below 50 knots is not needed. or that the gauge gives the output command " light on or off , only once instead of cycle it constant.
 
Last edited:
@roy

A good point, but I've never used multiplayer so I wasn't concerned about it.

EDIT

On the other hand, the simpler code should be more efficient in non-multiplayer applications because it requires fewer operations/cycle.
 
Last edited:
Code:
<?xml version="1.0" encoding="UTF-8"?>
<Gauge Name="autolandlights">
   <Element>
   <Shift>
   <Value>(A:INDICATED ALTITUDE,feet) 10000 &gt; 
(A:AIRSPEED INDICATED, knots) 50 &gt;
and
    if{ (&gt;K:LANDING_LIGHTS_OFF) }
    els{ (&gt;K:LANDING_LIGHTS_ON) }
</Value>
   </Shift>
   </Element>
</Gauge>

I think that'd do.
 
Code:
<?xml version="1.0" encoding="UTF-8"?>
<Gauge Name="autolandlights">
   <Element>
   <Shift>
   <Value>(A:INDICATED ALTITUDE,feet) 10000 &gt; 
(A:AIRSPEED INDICATED, knots) 50 &gt;
and
    if{ (&gt;K:LANDING_LIGHTS_OFF) }
    els{ (&gt;K:LANDING_LIGHTS_ON) }
</Value>
   </Shift>
   </Element>
</Gauge>

I think that'd do.

lol L lights go off at 50 knots , lol
 
Hey CBA,

I think you almost have to make two different gauges, and you need to have more triggers. You need some basic logic.

Already you have some great parts of this modular gauge. What you need is to sort of 'map out' how it would work in all of its 'conditions'.

For instance, it needs to;
* Turn on when under 10,000 feet
* Be in flight
* Be above 50 knots
* If lights are already off

So we go into the SDK and find the conditions which will be in 'airframe' or 'A' conditions. We already have speed and altitude. So we need 'in flight'. RADIO HEIGHT is one way. We'll write something like 5 feet or higer, (5 &gt; )


Together, it would be like this;

Code:
<?xml version="1.0" encoding="UTF-8"?>
<Gauge Name="autolandlights">
   <Element>
   <Shift>
   <Value>(A:INDICATED ALTITUDE,feet) 10000 &lt; 
               (A:AIRSPEED INDICATED, knots) 50 &gt;
               (A:RADIO HEIGHT, feet) 5 &gt; 
               (A:LIGHT LANDING, bool) 0 ==
               and and and
    if{ (&gt;K:LANDING_LIGHTS_ON) }
    els{ (&gt;K:LANDING_LIGHTS_OFF) }
</Value>
   </Shift>
   </Element>
</Gauge>


This hasnt been tested and it might mess things up, but give it a try and see how it works. Might need a little tweaking.

You can see that I added 'lights off' to the conditions. Also note the 3 'and's in there. If you have say 6 conditions, then you would have 5 ands. If you have 3 condtions, you would have 2 ands. (one short of the total amount of conditions).


Once you learn the basics, this can be pretty cool. But... It has lots of little snags in comprehending how it all works. having a few gauges to study really helps you to get the basics of how things work. It took me a couple of years to fully comprehend all of this. There is soooooooooooo much to gauge programming, especially when you know ZERO programming.



Bill
 
lol L lights go off at 50 knots , lol

Code:
<?xml version="1.0" encoding="UTF-8"?>
<Gauge Name="autolandlights">
   <Element>
   <Shift>
   <Value>(A:INDICATED ALTITUDE,feet) 10000 &gt; 
(A:AIRSPEED INDICATED, knots) 50 &lt;
and
    if{ (&gt;K:LANDING_LIGHTS_OFF) }
    els{ (&gt;K:LANDING_LIGHTS_ON) }
</Value>
   </Shift>
   </Element>
</Gauge>
 
@MGH
Your code is simple, but it turns the already OFF lights OFF again every cycle. It is a problem....

Here you can add a comparison to on/off lights only when necessary:
Code:
(A:INDICATED ALTITUDE,feet) 10000 > 
(A:AIRSPEED INDICATED, knots) 50 &lt; or 
(A:LIGHT LANDING, bool) == 
if{ (>K:LANDING_LIGHTS_TOGGLE) }
 
Last edited:
i have been tryin all options code as displayed , one turned on the landing lights at 50 knots the second with the radar alt 5 feet olso but was not able to turn them on below 50 knots and higher then 5 feet r alt for both codes.
as i notice the > sign is not legit in xml and i have to use &gt; and olso the last code with toglle came out wrong , the LL started to toglle constand above 10K . fwiew , it gets difficult , i have been trying to use the == on several places but no effect . olso i have noticed if the bool thing is in the list then it goes wierd . but nevermind , i do have to say with the last one , that i had control over the L lights below 10K and above not anymore and started to toglle , wich is cool , becose the real thing would bé if the gauge toglles the switch just at 10K , wich would be the solution for the multiplayer problem . for mé its already ok , but example for fspassengers you need to turn the LL on if entering a runway and off above 10K and on below 10 K and off when leaving the runway , and some other online thirdparty games for fs require the LL to be on and off at surten places , and it must be user and multiplayer friendly , so thats why i dont give up yet to make the gauge perfect for everyone. but what i have working now , i am so proud of that ,its like i am a programmer , lol . first steps . lol a few things in the sdk i start to understand and hope i will understand more sooon.

i came olso with the idiea , what if i just send a warning sound if L lights are off below or on above 10K , wich is olso a solution to never forget the L lights. but hey , lets try to make the autolandinglights gauge perfect , i stand open for any ideas and will test it on my sim.
 
I think the confusion rises because you are not using a proper logic in the comparison.
Assuming the pilot has natural control of the lights, you need to decide what to do with them starting from its current state.
For example, if the lights are off, what condition would make them go on automatically, and vice versa.

This example is very explicit and should give an idea on where to start from:

Code:
<?xml version="1.0" encoding="UTF-8"?>
<Gauge Name="autolandlights">
   <Element>
     <Select>
       <Value>
           <!-- Lights are OFF, what makes them go on? -->
           (A:Light Landing,bool) 0 == 
           if{ 
                (A:Airspeed Indicated,knots) 50 &gt;
                (A:Indicated Altitude,feet) 10000 &lt; and 
                <!-- add here any other condition of your choice --> 
                if{ (&gt;K:LANDING_LIGHTS_ON) }
              } 
           <!-- Lights are ON, what makes them go off? -->
           (A:Light Landing,bool) 1 == 
           if{ 
                (A:Indicated Altitude,feet) 10000 &gt;=
                <!-- add here any other condition of your choice --> 
                if{ (&gt;K:LANDING_LIGHTS_OFF) }
               }

       </Value>
     </Select>
   </Element>
</Gauge>

Hope this helps.

Tom
 
Back
Top