• 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 L variable

Messages
10
Country
us-texas
XML Gauge Gurus,
I am experimenting with L vars and seem to be stuck
Why doesn't this work?

Code:
<Element>
        <Position X="20" Y="70" />
             
                0(>L:GS Fail, bool)
            <Select>
                <Value>(L:GS Fail)</Value>
                <Case Value="0">
                    <Image Name="HSI_Flag_Nav.bmp" />
                </Case>
        </Select>
   </Element>

Shouldn't the "GS Fail" variable be zero, since I set it as such right above?
Thanks for any help.
 
Ok, I know nothing about XML... but...

I think the issue is that you need at least two images... I could be wrong.... but that's how an ICON in C++ would work for FS. One image is a complete 'blank' and the other is the flag image.

However, If this is a instrument flag... they usually rotate in and out of view and thus you would probably want to use a rotation... but, that's just my thoughts.
 
if I change the line
Code:
 0(>L:GS Fail, bool)

to

Code:
 1(>L:GS Fail, bool)

now "GS Fail" is supposed to be a 1

It still loads the image which is supposed to only load when it is zero?

I don't think the "GS Fail" is actually getting set properly, is that the proper syntax?

Obviously I am totally new to XML Gauge programming but have many years in c/c++;c#;java;basic, etc....

Going through the tutorials and sdk documentation doesn't bring one up to speed very quickly....
 
Of course when I got to this section in the SDK doc:


The building and testing of gauges requires a lot of trial and error, so it is a good idea to set up the tools required to be very convenient for frequent use. You will find that you will be building gauges, testing them in the simulation, finding many errors, then repeating this process for some time. The following set up makes this process reasonably quick.


I should have ran the other way....

Thanks for responding though!
 
Hi jhl_iv,

I have been playing around with programming languages since 1975 or so... most of it was in paid employment so it wasn't too bad.

XML still manages to drive me nuts!

The good side is that when something does (finally) work, you can look at it and say to yourself "I made that happen".

The fact that you have lost 3 clumps of hair, 4 lbs of weight and bitten away 2 fingernails adds to the excitement. Plus spending hours of what should be valuable sleeping time hunched over your keyboard, working yourself into a frenzy over what turns out to be a missing comma! Or an un-reversed reversed polish notation!

And as for making dials rotate? Some people have the magic, others, including me, don't!

Its all good fun though!

Good luck with your coding, stay with it...

Walter
 
Code:
 0(>L:GS Fail, bool)

Code:
 1(>L:GS Fail, bool)

I note that there is no space between the value and the opening parentheses in the examples you show above.

0(>L:GS Fail, bool) needs to be 0 (>L:GS Fail, bool)

If your actual script does not include that space, then make the correction and see if that helps.

Bob
 
Hi,
in order to set L:GS Fail, bool to 1 you need to put that in an Element section.
Code:
<Element>
      <Select>
         <Value>1(>L:GS Fail, bool)</Value>
      </Select>
   </Element>

You can put that in front of your existing Element section and skip the 1(>L:GS Fail, bool) in there.
Also as far as i know you need to add the bool suffix in the second part.

Code:
<Select>
                <Value>(L:GS Fail, bool)</Value>
                <Case Value="0">
blablabla

Just giving you some food for thought so you can do the rest yourself.

grt
Willem
 
Last edited:
1. As noted, blank spaces are often required parts of the syntax!
2. Since you have only one image to display/hide, you should use a much simpler XML construct to accomplish the task, such as:

Code:
  <Element>
    <Visible>(L:GS Fail, bool) 0 ==</Visible>
    <Position X="20" Y="70"/>
    <Image Name="HSI_Flag_Nav.bmp"/>
  </Element>
The image will only be display when the L:var is equal to zero (which it will be on first loading the aircraft/panel system.

The use of <Case Value="x"> is only required if you have two or more images or text lines to display based on some variables value.
 
The use of <Case Value="x"> is only required if you have two or more images or text lines to display based on some variables value.
Now, that makes sense!
After all there is logic in xml...

Grt
willem
 
The thing I noticed about your code was this line:

<Value>(L:GS Fail)</Value>

This instead needs to be:

<Value>(L:GS Fail, bool)</Value>

Hope this helps,
 
Back
Top