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

Wing Vortices

Messages
13
Country
ca-britishcolumbia
Hi. Newbie here to XML gauge programming. I've read some docs, SDK and examined other author's work. These are my parameters:

PLANE PITCH DEGREES greater than 10 degree
PLANE PITCH DEGREES less than 20 degree
SEA LEVEL PRESSURE less than 1012 mbar
PLANE ALT ABOVE GROUND less than 330 feet
GROUND VELOCITY less than 40 knots

The goal here is to turn on an effect for wing vortices if the aircraft pitch is between 10-20 degrees, the barometric pressure is below standard, the aircraft is either climbing or descending and not above 330 AGL. Finally this effect will not be active unless the aircraft is above 40 knots groundspeed.

I must say I am struggling and wondering now if that many parameters is possible. I've seen other similar gauges with fewer parameters. Reason for so many is other efforts have the effect come on while the aircraft is on the ground taxiing (hence the speed above 40 requirement) I don't want it to show when the aircraft is above 330 feet (some other author's effects seem to show anytime) and of course only to show when the aircraft is pitching up.

Any advice or guidance? I am continuing my research and testing but feel I may be missing something and if someone might provide a base for me to study I may find my error myself and actually learn something. Thanks in advance all comments welcome.
 
I've used that many parameters several times.

The variable names and units have NOT been checked in the SDK:

Code:
(A:PLANE PITCH DEGREES, degrees) 10 >
(A:PLANE PITCH DEGREES, degrees) 20 < and
(A:SEA LEVEL PRESSURE, mb) 1012 < and
(A:PLANE ALT ABOVE GROUND, feet) 30 > and
(A:GROUND VELOCITY, knots) 40 > and
if{  do your wing vortices here }
 
<Gauge Name="Wing Vortice
<Element>
<Select>
<Value>
(A: PLANE PITCH DEGREES, degree) 7 &gt;
(A: PLANE PITCH DEGREES, degree) 20 &lt; &amp;
(A:SEA LEVEL PRESSURE, mbar) 1012 &lt; &amp;
(A: PLANE ALT ABOVE GROUND, feet) 330 &lt; &amp;
(A:GROUND VELOCITY, knot) 100 &gt; |
if{
(A:LIGHT CABIN,bool) !
if{ (&gt;K:TOGGLE_CABIN_LIGHTS) }
}
els{
(A:LIGHT CABIN,bool)
if{ (&gt;K:TOGGLE_CABIN_LIGHTS) }
}
</Value>
</Select>
</Element>
</Gauge>

Okay with this, the effect starts when speed reaches 100 knots and does not shut off passing 330 feet AGL nor does pitch of the aircraft have any effect. Tinkering, reading, may resort to drinking soon ;-) {spaces after A: and P is only for appearance here otherise smiley tongue face appears :p furthermore the pressure parameter seems to have no effect. Must be getting warmer - I notice the last A: parameter is the only one affecting the light switch for the vortex effect.
 
Last edited:
Edi probably has the answer (above) you are looking for, but, a few more points:

Code:
<Gauge Name="Wing Vortice
    <Element>
      <Select>
        <Value>
          (A: PLANE PITCH DEGREES, degree) 7 &gt;
          (A: PLANE PITCH DEGREES, degree) 20 &lt; &amp;
          (A:SEA LEVEL PRESSURE, mbar) 1012 &lt; &amp;
          (A: PLANE ALT ABOVE GROUND, feet) 330 &lt; &amp;
          (A:GROUND VELOCITY, knot) 100 &gt; |
            if{
              (A:LIGHT CABIN,bool) !
               if{
                 (&gt;K:TOGGLE_CABIN_LIGHTS)
               }
            }
            els{
              (A:LIGHT CABIN,bool)
                if{
                 (&gt;K:TOGGLE_CABIN_LIGHTS)
                }
            }
        </Value>
      </Select>
    </Element>
</Gauge>

  • Check for the closing quote in the Gauge name. Undoubtedly a simple typo when you were copying to post this
  • Note the sign of PLANE PITCH DEGREES. When the plane's nose pitches up, then (A: PLANE PITCH DEGREES, degrees) is negative
  • The PLANE PITCH DEGREES part of your expression could have been written instead:
Code:
7 20 (A: PLANE PITCH DEGREES, degrees) rng
but the two lines you use accomplish the same thing (but note the comment on sign)
  • Just to double check your logic (it may indeed be what you intend, I'm just asking). As written, you have, if the Pitch, Pressure, and Alt meet certain conditions, or Ground Velocity is fast, AND, the Cabin Light is off, you turn it on. Else, if the Pitch, Pressure, and Alt conditions are not met, or the plane is slow, AND the Cabin Light is on, you turn it off. Is that what you intended?
Bob

Here's a version incorporating Edi's comment:

Code:
<Gauge Name="Wing Vortice"
    <Element>
      <Select>
        <Value>
          -20 -7 (A: PLANE PITCH DEGREES, degrees) rng
          (A:SEA LEVEL PRESSURE, mbar) 1012 &lt; and
          (A: PLANE ALT ABOVE GROUND, feet) 330 &lt; and
          (A:GROUND VELOCITY, knots) 100 &gt; or
            if{
              (A:LIGHT CABIN,bool) !
                if{
                  (>K:TOGGLE_CABIN_LIGHTS)
                }
            }
            els{
              (A:LIGHT CABIN,bool)
                if{
                 (>K:TOGGLE_CABIN_LIGHTS)
                }
            }
        </Value>
      </Select>
    </Element>
</Gauge>
 
Last edited:
I think in this case it does not matter whether you use "or,and" or "|,&amp;".
The lower part of the code can also be optimized:
Code:
<Value>
    -20 -7 (A: PLANE PITCH DEGREES, degrees) rng
    (A:SEA LEVEL PRESSURE, mbar) 1012 &lt; and
    (A: PLANE ALT ABOVE GROUND, feet) 330 &lt; and
    (A:GROUND VELOCITY, knots) 100 &gt; or
    (A:LIGHT CABIN,bool) != if{ (>K:TOGGLE_CABIN_LIGHTS) }
</Value>
 
Thank you all so much. I now have the effect working as desired.... Comments, refinements and observations were much appreciated. So much more to learn.
 
Yes, it does make a difference. But most people code in FS9 format for FS9 *and* FSX since FSX reads FS9 gauges OK (except for a very few differences in A: variables) and it's much easier to write. :)
 
Back
Top