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

FSX Conditional visibility of element

Messages
17
Country
unitedkingdom
Hi again guys,

I am having a very frustrating time with display of labels in my RNAV gauge. The NS800 works in 4 basic modes, w.r.t VOR it has two modes standard VOR and VOR PAR (where course deviation is in nmiles not degrees to facilitate tracking parallel to a VOR).

I have variable L:NARCO_NS800_MODE where 0=standard VOR and 1=VOR PAR, other modes are 2=RNAV and 3=RNAV APR

The following works as expected to display the VOR label:

<Element>
<Position X="155" Y="10" />
<Visible>(L:NARCO_NS800_MODE,number) 2 &lt;</Visible>
<Text X="30" Y="20" Length="3" Fixed="Yes" Font="Arial" Color="#A70403" Bright="Yes">
<String>VOR</String>
<Failures>
<SYSTEM_ELECTRICAL_PANELS Action="0" />
<SYSTEM_ELECTRICAL_AVIONICS Action="0" />
</Failures>
</Text>
</Element>

And when L:NARCO_NS800_MODE is 2 or higher goes invisible as expected.
HOWEVER:

<Element>
<Position X="155" Y="32" />
<Visible>1 (L:NARCO_NS800_MODE,number) ==</Visible>
<Text X="30" Y="20" Length="3" Fixed="Yes" Font="Arial" Color="#A70403" Bright="Yes">
<String>PAR</String>
<Failures>
<SYSTEM_ELECTRICAL_PANELS Action="0" />
<SYSTEM_ELECTRICAL_AVIONICS Action="0" />
</Failures>
</Text>
</Element>

Does NOT work when L:NARCO_NS800_MODE is = 1, "PAR" label remains resolutely invisible. To ensure I am getting L:NARCO_NS800_MODE set correctly I have in the gauge:

<Element>
<Position X="195" Y="10" />
<Text X="30" Y="20" Length="1" Fixed="Yes" Font="Arial" Color="#A70403" Bright="Yes">
<String>%((L:NARCO_NS800_MODE,number))%!1d!</String>
<Failures>
<SYSTEM_ELECTRICAL_PANELS Action="0" />
<SYSTEM_ELECTRICAL_AVIONICS Action="0" />
</Failures>
</Text>
</Element>

The above IS correctly showing mode as 1, so I am struggling as to why
<Visible>1 (L:NARCO_NS800_MODE,number) ==</Visible>
doesn't work nor does:
<Visible>(L:NARCO_NS800_MODE,number) 1 ==</Visible>

What stupid error am I committing? Any suggestions would be much appreciated!
 
Perhaps the battery or avionics switch is turned off, so here is always zero because of 'failures' parameters regardless of the L:NARCO_NS800_MODE value?
 
Not that I am afraid

Hi Luka, not that I am afraid, as indicated the "VOR" label displays fine, for some reason I can't understand it seems that the expression is not evaluating as "True". Also, if I change the visibility line to:

<Visible>(L:NARCO_NS800_MODE,number) 2 &lt;</Visible>

Then the PAR label appears OK, however, it should only show when mode==1 - hence I am using <Visible>(L:NARCO_NS800_MODE,number) 1 ==</Visible>

But this doesn't work even when L:NARCO_NS800_MODE is = 1, I admit I am baffled.
 
Last edited:
Try inverting this:
<Visible>1 (L:NARCO_NS800_MODE,number) ==</Visible>

to this:
<Visible>(L:NARCO_NS800_MODE,number) 1 ==</Visible>
 
This may not tbe the solution but try testing for (L:NARCO_NS800_MODE,number) less than 1.01.

Generally, it's not a good idea to test for equality between numbers unless it's guaranteed that they are both integers.
 
Hi,

Tom's link is indeed what you need; be sure to read it.
 
Initially non-visible elements

Thanks Tom, kicking myself as I was already allowing for this with the gauge display as a whole as the real instruments have an on/off switch - so I had implemented this <Element> within an <Element> for the whole display screen but forgot it when it comes to child elements again.:o

Now works exactly as expected. Sometimes wish I had stuck with C++ rather than switch to XML!
 
Back
Top