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

basic g1000 gear position handle boolean

Messages
28
Country
unitedkingdom
I used to run fsx some 6 years ago and as I have time to spare age 78 I started again!!
I am attempting my first gauge mod - its on the G1000 pfd in the baron
I have a number of elements working as gauges with gaugestrings, radio height, ap, nav, hdg, gear handle position etc.as a second bar below the top bar where it shows dist to waypoint etc.
I decided to add gauge with 2 images for the gear handle position -up as red image, down in green to place elsewhere.

This I cannot get it to change when raise or lower the gear at any height although the gaugestring in the second bar - gear handle position does change from 0 to 1 and vice versa. It is obviously the syntax in the image gauge. My code is below, I would welcome corrections or if on the wrong track entirely the code to achieve it. I have tried other variations using "value" to get a result instead of expression but still fail. I have seached google but all just seem to point to the sdk variables but not the syntax to use and have never used xml coding.

Code:
           <Element id="Gear Status">
                <FloatPosition>800.000,20.000</FloatPosition>

                    <Expression id="Expression">
                        <Script>(Gear Handle Position,Bool) 0 == if</Script>
                    </Expression>
                <Select>
                    <Case id="Case0">
                        <ExpressionResult>0</ExpressionResult>
                        <Image id="g1000_gear_u.bmp" Name="g1000_gear_u.bmp">
                            <Transparent>True</Transparent>
                        </Image>
                    </Case>
                    <Case id="Case1">
                        <ExpressionResult>1</ExpressionResult>
                        <Image id="g1000_gear_d.bmp" Name="g1000_gear_d.bmp">
                            <Transparent>True</Transparent>
                        </Image>
                    </Case>
                </Select>
            </Element>



regards
Brian B
 
Try taking the "if" out of the expression script
Code:
<Script>(Gear Handle Position,Bool) 0 == if</Script>
becomes -
Code:
<Script>(Gear Handle Position,Bool) 0 ==</Script>
 
Thanks for the reply spokes2112
removed "if" as sugested but get the same result, I always get the up bmp.
If I use 1 == I still get the up bmp
It looks as the expression is not being evaluated but always returns 0
Any further comments would be helpful or if anybody has this working
I would appreciate the code.
 
Thanks again
I have done both removed "if", removed "0 ==" but still only shows the "g1000_gear_u.bmp" image when the gear is down and does not change when moving the handle up or down.
To clarify code now is as follows
Code:
           <Element id="Gear Status">
                <FloatPosition>800.000,17.000</FloatPosition>
          <Expression id="Expression">
                        <Script>(A:Gear Handle Position,Bool)</Script>
                    </Expression>
                <Select>
                    <Case id="Case0">
                        <ExpressionResult>"0"</ExpressionResult>
                        <Image id="g1000_gear_u.bmp" Name="g1000_gear_u.bmp">
                            <Transparent>True</Transparent>
                        </Image>
                    </Case>
                    <Case id="Case1">
                        <ExpressionResult>"1"</ExpressionResult>
                        <Image id="g1000_gear_d.bmp" Name="g1000_gear_d.bmp">
                            <Transparent>True</Transparent>
                        </Image>
                    </Case>
                </Select>
            </Element>


Can anyone please try and replicate this fsx acceleration
 
Last edited:
Now i'd try to remove the quotes in the <ExpressionResult> s only. Quotes should only be used in attributes contained within a tag whereas the value(s) for the <ExpressionResult> are outside of tags and are considered data. In the FSX+ schema, of which I don't use, unless absolutely necessary, seems to have at least 2 decimal points following so (doubt it makes any difference) -
Code:
<ExpressionResult>"0"</ExpressionResult>
becomes
Code:
<ExpressionResult>0.00</ExpressionResult>
 
Thanks Spokes and all who helped
<ExpressionResult>0.00</ExpressionResult did not work,
but after more research I found you needed 3 decimal places
<ExpressionResult>0.000</ExpressionResult>
This works and changes on the handle position
I can now get on with more mods
 
...and now you know why most of us avoid the "FSX XML syntax" insanity! :rotfl:
 
Hi Bill I have just started doing this as stated above I have just started on xml
if you do not edit the xml files directly what do you use.
Now I am searching the baron g1000 panel.xml for the code that shows
the "aft door" is open in the annunciator, I cant find any code to light the annunciator.
Aft Door gauge is present in the panel cfg
Although shift E opens and closes it. anybody have that code.
 
Brian, I use Visual Studio or Notepad++ to create and/or edit XML scripts.
 
Bill, thanks I am using visual studio or an old copy of front page.
I thought from your comment above "avoid the "FSX XML syntax" insanity!"
There was a better way of doing this by using some other program
regards
brianb
 
No, there is a better way to do it using the other XML gauge format that FS accepts, the FS2004 format. Much easier and clearer to read.
 
Bill, thanks I am using visual studio or an old copy of front page.
I thought from your comment above "avoid the "FSX XML syntax" insanity!"
There was a better way of doing this by using some other program
regards
brianb
Tom nailed it. I use strictly the "old" FS9 XML syntax as it is much less verbose, and rationale. It's still bass-ackwards of course with it's "Reverse Polish" math, but overall it's less of a struggle than the newer "FSX syntax".
 
Thanks guys
Not having done this before I dived in, not knowing there was a simpler fs syntax for fs9
 
Just as a simple example, this is an FS9 syntax "case" type evaluation. Although there is only 1 "case" in this example, it's pretty easy to see just how 'uncomplicated' this is in relation to an FSX syntax version:
Code:
        <Element>
          <Visible>(L:gtct, enum) 3 == (L:gtxof,enum) 0 == &amp;&amp;</Visible>
          <Element>
            <Position X="334" Y="51"/>
            <Select>
              <Case Value="0">
                <Image Name="GTX 330_rect.bmp" Bright="Yes" ImageSizes="8,14" />
              </Case>
            </Select>
          </Element>
 
I am attempting my first gauge mod - its on the G1000 pfd in the baron
...and now you know why most of us avoid the "FSX XML syntax" insanity! :rotfl:

Just keep in mind - You can't mix the 2 syntax's. If you are making separate gauges(s) that are being placed "on top" of the G1000 that'll be ok using the FS9 syntax. If you're modifying the G1000 internally then you'll have to stick with the FSX+ syntax - "may the force be with you".
 
Good point, Roman! I spent several weeks "translating" the default G1000 scripts to FS9 syntax just to avoid this very issue. :stirthepo
 
Unfortunately Edi this was done while working for Eaglesoft Development Group so I cannot share them. :(
 
Back
Top