• 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 Tutorials and example explanations.

Messages
1
Country
unitedkingdom
Hi all,
I'm new to writing gauges, but have got stuck. I am trying to create a gauge that will switch off the autopilot when the aircraft descends lower than 500'. The gauge is working with RADIO HEIGHT and, seems to work fine, but can not get the code right for switching off the AP, in fact I'm not even sure I have put the evaluation in the right place. Below is my code.

Code:
<?xml version="1.0" encoding="UTF-16"?>

<SimGauge.Gauge id="Radio Height Gauge" ArtDirectory="C:\Program Files\Games\Microsoft Flight Simulator X\Gauges\TestGauges">
    <FloatPosition>0.000,0.000</FloatPosition>
    <Element id="Fixed Text">
        <FloatPosition>5.000,10.000</FloatPosition>
        <GaugeText id="GaugeText">
            <FontColor>gold</FontColor>
            <FontFace>Arial</FontFace>
            <FontHeight>13</FontHeight>
            <GaugeString>Radio Height</GaugeString>
            <Size>90,15</Size>
            <Transparent>True</Transparent>
        </GaugeText>
    </Element>
    <Element id="Output Box">
        <FloatPosition>5.000,40.000</FloatPosition>
        <Rectangle id="Rectangle">
            <LineWidth>1</LineWidth>
            <Width>90</Width>
            <Height>24</Height>
            <LineColor>darkslateblue</LineColor>
            <FillColor>black</FillColor>
        </Rectangle>
    </Element>
    <Element id="Display Text">
        <FloatPosition>10.000,44.000</FloatPosition>
        <GaugeText id="GaugeText">
            <FontColor>red</FontColor>
            <FontFace>Courier</FontFace>
            <FontHeight>16</FontHeight>
            <GaugeString>%( (A:RADIO HEIGHT, feet) )%!5d!</GaugeString>
            <Size>90,16</Size>
            <Transparent>True</Transparent>
            <VerticalAlign>CENTER</VerticalAlign>
        </GaugeText>
    </Element>
    <Update id="Update">
        <Frequency>1</Frequency>
        <Script>%(A:RADIO HEIGHT, feet) (200) &lt;= if{ &gt;A:AUTOPILOT MASTER,bool)0 } </Script>
    </Update>
</SimGauge.Gauge>

I would be grateful for any pointers, and if someone could let me know where I can find simple and easy examples of interacting with FS, and some simple tutorials, that would be great, as I am new to not only XML, but this backward polish thingy as well! :)
 
Last edited:
I'm really no expert, but one thing that will never work is your syntax at the script.

Code:
 <Script>%(A:RADIO HEIGHT, feet) (200) &lt;= if{ &gt;A:AUTOPILOT MASTER,bool)0 } </Script>

Try with something like:

Code:
 <Script>%(A:RADIO HEIGHT, feet) 200 &lt;  if{ (>K:AUTOPILOT_OFF, bool) } </Script>

Remember A:vars you can only read from.
So you never turn off the autopilot using the (A:AUTOPILOT MASTER,bool).
You can only check if the autopilot is ON or OFF.

Turning on or off you need to use K:vars.
 
Back
Top