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

Trying to make a simple FLCH gauge (P3D)

Next issue... Now that I have a gauge I'm happy with (I've changed a couple of things since previous post), would anyone know how to get the FLCH bmp's to show up? I originally just had a single button so I could test the functionality, but now want to add a toggle button that lights up when the button is pressed. Presently, this is what I have. Can't seem to get anything to work beyond it:

Full disclosure, I might as well be honest in all of this... I DID use ChatGPT to work on the initial design of this. At the time, I had done as much reading of the SDK online as I could stomach, but when it comes to your first gauge, and we now have ChatGPT, man is it hard to learn on your own from reading an old webpage about how to code a simple clock... It's a lot more engaging to learn about coding when it involves something you enjoy coding!

I've learned more about XML coding from ChatGPT with respect to this gauge than I think I could ever glean from the SDK, simply because I was able to see how things changed over the process of changing the code, and now I can safely say that I have a pretty doggone good understanding of gauge logic. That OpenAI stuff is an incredible tool and timesaver, as much as I hate to say it. As for gauge bitmaps, not so much. AI isn't really helping with this one.

Hope I don't get ousted from this community! <hides>

The functionality of the gauge is wonderful. Don't adjust it too fast or it will cause the plane to oscillate quite a bit before it finally captures IAS. Wait for the vertical speed to stabilize every 3 knots worth of change.

For a default autopilot, this will make flying a busy departure on Vatsim in P3D so much easier to do without autothrottle!!!!!! Used the previous code mentioned last night on KLAN-KORD and it worked... mostly... like a charm. Minus the initial climb lol.


XML:
<SimBase.Document Type="AceXML" version="1,0" id="FLCH_Gauge">
    <Descr>Flight Level Change Gauge</Descr>
    <Filename>FLCH_Gauge_Debug.xml</Filename>
    <SimGauge.Gauge id="FLCH_Gauge" ArtDirectory="Gauges">
        <FloatPosition>0.000,0.000</FloatPosition>
        <Size>64,32</Size>

        <!-- Display Images -->
        <Element>
            <Position>0,0</Position>
            <Image Name="FLCH_Off.bmp">
                <Bright>(L:FLCH_Active, bool) 0 ==</Bright> <!-- Display FLCH_Off.bmp if FLCH_Active is 0 -->
            </Image>
            <Image Name="FLCH_On.bmp">
                <Bright>(L:FLCH_Active, bool) 1 ==</Bright> <!-- Display FLCH_On.bmp if FLCH_Active is 1 -->
            </Image>
        </Element>

        <!-- Mouse Interaction -->
        <MouseArea>
            <FloatPosition>0.000,0.000</FloatPosition>
            <Size>64,32</Size>
            <CursorType>Hand</CursorType>
            <Tooltip>FLCH Button</Tooltip>
            <MouseClick>
                <Script>
                    <!-- Toggle FLCH State -->
                    (L:FLCH_Active, bool) ! (&gt;L:FLCH_Active, bool)

                    <!-- If Activated -->
                    (L:FLCH_Active, bool) 1 == if{
                        (A:AIRSPEED INDICATED, knots) (&gt;K:AP_SPD_VAR_SET) <!-- Sync Preselected Speed -->
                        (A:VERTICAL SPEED, feet per minute) (&gt;K:AP_VS_VAR_SET_ENGLISH) <!-- Sync Current VS -->
                        (&gt;K:AP_VS_HOLD_ON) <!-- Engage VS Hold -->
                    }

                    <!-- If Deactivated -->
                    (L:FLCH_Active, bool) 0 == if{
                        (&gt;K:AP_VS_HOLD_OFF) <!-- Turn Off VS Hold -->
                        (&gt;K:PITCH_SYNC) <!-- Sync Pitch -->
                    }
                </Script>
            </MouseClick>
        </MouseArea>

        <!-- Update Logic -->
        <UpdateFrequency>20</UpdateFrequency>
        <Update>
            <Script>
                <!-- Only Adjust If FLCH is Active -->
                (L:FLCH_Active, bool) 1 == if{
                    <!-- Calculate Airspeed Difference -->
                    (A:AIRSPEED INDICATED, knots) (A:AUTOPILOT AIRSPEED HOLD VAR, knots) - (&gt;L:FLCH_AirspeedDifference, number)

                    <!-- Apply Deadband -->
                    (L:FLCH_AirspeedDifference, number) abs 3 &lt; if{
                        (A:VERTICAL SPEED, feet per minute) (&gt;L:NewVS, number) <!-- Maintain current VS -->
                    }
                    els{
                        <!-- Scale Difference for VS Adjustment -->
                        (L:FLCH_AirspeedDifference, number) 100 * (A:VERTICAL SPEED, feet per minute) + (&gt;L:NewVS, number)
                    }

                    <!-- Clamp VS to Limits -->
                    (L:NewVS, number) -4000 max 4000 min (&gt;K:AP_VS_VAR_SET_ENGLISH)
                }
            </Script>
        </Update>
    </SimGauge.Gauge>
</SimBase.Document>
 
Back
Top