- Messages
- 28
- Country

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.
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) ! (>L:FLCH_Active, bool)
<!-- If Activated -->
(L:FLCH_Active, bool) 1 == if{
(A:AIRSPEED INDICATED, knots) (>K:AP_SPD_VAR_SET) <!-- Sync Preselected Speed -->
(A:VERTICAL SPEED, feet per minute) (>K:AP_VS_VAR_SET_ENGLISH) <!-- Sync Current VS -->
(>K:AP_VS_HOLD_ON) <!-- Engage VS Hold -->
}
<!-- If Deactivated -->
(L:FLCH_Active, bool) 0 == if{
(>K:AP_VS_HOLD_OFF) <!-- Turn Off VS Hold -->
(>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) - (>L:FLCH_AirspeedDifference, number)
<!-- Apply Deadband -->
(L:FLCH_AirspeedDifference, number) abs 3 < if{
(A:VERTICAL SPEED, feet per minute) (>L:NewVS, number) <!-- Maintain current VS -->
}
els{
<!-- Scale Difference for VS Adjustment -->
(L:FLCH_AirspeedDifference, number) 100 * (A:VERTICAL SPEED, feet per minute) + (>L:NewVS, number)
}
<!-- Clamp VS to Limits -->
(L:NewVS, number) -4000 max 4000 min (>K:AP_VS_VAR_SET_ENGLISH)
}
</Script>
</Update>
</SimGauge.Gauge>
</SimBase.Document>