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

FS2004 XML Luminous Bug/Feature - Solution

Messages
18
I thought I would post this problem/solution here for future reference.

ITEM 1
An ongoing issue during development of my TPA Panel Kit project in FS2004 had been as follows:

Lighting controlled by two switch choices: a light mode specific switch, and/or a master lighting (all modes toggled) switch.

Individually they work fine. But if the master switch is toggled ON, then OFF (thus toggling both instrument lights (A:LIGHT PANEL,bool), and separate panel lights (L:Var) controlled), and immediately afterward an (L:Var) panel light is individually toggled... The result is that not only the (L:Var) panel light comes on, but also the Luminous="Yes" (A:LIGHT PANEL,bool) lights for some gauges as well.

At first I thought this an issue with the master light switch, but repeated attempts to solve it were futile.

CAUSE:
Many of my gauge elements are built with the face being lit by Luminous="Yes" (A:LIGHT PANEL,bool) on the bitmap. Stacked later in the XML are some bezel elements which are toggled by the <Visible> tag.

I stumbled onto the key when I found that once a Luminous="Yes" has been lit and turned OFF, toggling any <Visible> tag higher in the stack (lower in the XML script) would "drag" the Luminous="Yes" element back to illumination.

An example of my XML construction:
Code:
<Element>
    <Position X="0" Y="0"/>
    <Image Name="dial_face.bmp" Luminous="Yes"/>
</Element>
<Element>
    <Visible>(L:PanelLights,bool)</Visible>
    <Position X="0" Y="0"/>
    <Image Name="bezel.bmp" Bright="Yes"/>
</Element>

Once the first element had been turned ON/OFF by the (A:LIGHT PANEL,bool) parameter, toggling the second element (L:Var) would drag the first element back into illumination.

SOLUTION: Double wrap element tags when using <Visible> tags.

Code:
<Element>
    <Position X="0" Y="0"/>
    <Image Name="dial_face.bmp" Luminous="Yes"/>
</Element>
<Element>
    <Visible>(L:PanelLights,bool)</Visible>
      <Element>
      <Position X="0" Y="0"/>
      <Image Name="bezel.bmp" Bright="Yes"/>
      </Element>
</Element>

And the problem is gone.

ITEM 2:

For my various layers of panel lighting, toggling the master lights on/off and then toggling on/off the "dome lights" (L:Var), the "panel edge lights" (L:Var) would illuminate out of nowhere. No Luminous bitmaps involved here.

Examining the XML showed that the bitmap which would erroneously appear was the LOWEST (listed first in the XML) in the stack.

Example code:
Code:
<Element>
    <Visible>(LVar1,bool)</Visible>
    <Position X="0" Y="0"/>
    <Image Name="panel_light1.bmp" Bright="Yes"/>
</Element>
<Element>
    <Visible>(LVar2,bool)</Visible>
    <Position X="0" Y="0"/>
    <Image Name="panel_light2.bmp" Bright="Yes"/>
</Element>
<Element>
    <Visible>(LVar3,bool)</Visible>
    <Position X="0" Y="0"/>
    <Image Name="panel_light3.bmp" Bright="Yes"/>
</Element>

CAUSE: Seems like the lowest bitmap in the stack will remain visible after a higher <visible> element is toggled, if there is nothing else below it. This based on swapping out bitmaps and the element order in the XML.

SOLUTION: Double wrap element tags when using <Visible> tags, same as above.

Sample code:
Code:
<Element>
    <Visible>(LVar1,bool)</Visible>
      <Element>
      <Position X="0" Y="0"/>
      <Image Name="panel_light1.bmp" Bright="Yes"/>
      </Element>
</Element>
<Element>
    <Visible>(LVar2,bool)</Visible>
      <Element>
      <Position X="0" Y="0"/>
      <Image Name="panel_light2.bmp" Bright="Yes"/>
      </Element>
</Element>
<Element>
    <Visible>(LVar3,bool)</Visible>
      <Element>
      <Position X="0" Y="0"/>
      <Image Name="panel_light3.bmp" Bright="Yes"/>
      </Element>
</Element>

Problem gone. All bitmaps hide when the they are commanded.

An interesting aside, both items above only seem to occur when their XML are loaded on the main panel (visible, anyway). On other popup panels and such which are initially NOT visible, I cannot recreate this oddity.
 
Hi,

Thanks for the info.

This is a similar solution to the problem of replacing text using the Visible statement in Text statements (FSX only) - often the replacement text will not appear. Interesting that both problems have similar cures.
 
Yes, having recently used that same fix for some FSX work is what led me to even attempt it for this FS2004 issue.
 
Back
Top