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

P3D v4 Drag Chute alternative variable for animation.

If Sim Reset does that; then was is the difference between that and:

KEY_SITUATION_RESET SITUATION_RESET Resets scenario

?

Just going off this list https://www.prepar3d.com/SDKv3/LearningCenter/utilities/variables/event_ids.html

But I do see also this key

KEY_REPAIR_AND_REFUELREPAIR_AND_REFUELFully repair and refuel the user aircraft. Ignored if flight realism is enforced.

So that is more likely the variable I would need to link in some how... Thanks!
 
Last edited:
But I was thinking something like this:

<Gauge Name="Chute Drag Control" Version="1.0">

<Update Frequency="6"/>

<Element>
<Select>
<Value>
(A:SPOILERS HANDLE POSITION,percent) near 0 ==
if{ 0 (>L:dragchute,bool) }
els{
(A:SPOILERS HANDLE POSITION,percent) near 100 ==
if{ 1 (>L:dragchute,bool) }
}

(>L:dragchute,bool) (A:SPOILERS HANDLE POSITION,percent) near 0 == and if {(A:SPOILER AVAILABLE, bool) 0==} else{1}
</Value>
</Select>
</Element>

</Gauge>

Where deploying spoilers the first time inserts a value of 100 for the gauge LVAR Dragcute bool. Then once dragchute bool is 100 it stays there and then retracting the spoiler handle makes the spoilers unavailable.... and the spoilers would only be available after resetting the aircraft state through "repair and refuel" sim command... Granted I think there are some elements missing to the code arguments in this case...
 
Last edited:
I have never used these events, but I believe (and I could be wrong) that SIM_RESET resets the sim to the default flight load, SITUATION_RESET resets to the loaded flight and the REFUEL AND REPAIR is new from L-M and does exactly what it implies. I could be wrong.
 
Ed: I can confirm that you are correct on SIM_RESET and SITUATION_RESET as I've used both in C/C++ projects, but never REPAIR_AND_REFUEL. By the description it looks as if it only applies to scenarios that have crash detect turned off.
 
Ok so my next question is... I did some research and there are a couple of SR-71s out there one freeware and of course we all know the Glowing Heat one... I have both on my system... Anyway, I remembered both of these aircraft modeled the TEB ignition system the real world aircraft has. Where each time you go in and out of AB or each time you restart an engine the counter counts down one shot and after you run out of shots you can no longer start / restart the engine or re-light the burners... So I looked at how these TEB counter gauges were made both the freeware and the pay-ware work about the same in concept (I can for the most part read xml (and comments) and get the idea)... Where the gauges start with a counter at the top and then each time one of the conditions is met it knocks one off the count until... Based on what I could see (keep in mind I am not a xml person) here is what I could come up with... It should start with a count of one after a single spoiler deployment the count should go to zero; and one at zero the spoilers are no longer available... Any of the .xml gurus out there want to take a look?!?!? Thanks!!

XML:
<Gauge Name="Drag Chute Control" Version="1.0">

 <Update Frequency="2">

 <!-- Drag Chute counter: -->

 (G:chute0) 0 == if{ 1 (&gt;G:chute1) }

<!-- Count Spoiler Deployment: -->
 
 (A:SPOILERS HANDLE POSITION, percent) near 100 ==
 (G:chute1) 0 &gt;
 &amp;&amp;
         if{ (G:chute1) -- (&gt;G:chute1) 1 (&gt;G:chute0)}

<!-- Disable Spoiler Deployment If count Zero: -->

(G:chute1) 0 ==
(A:SPOILERS HANDLE POSITION,percent) 0 &gt ==
&amp;&amp
if{(A:SPOILER AVAILABLE, bool) 0==}

</Gauge>
 
Last edited:
Also would adding in something like this cause the counter and spoiler availability to reset to 1 after refuel and repair command used, along with aircraft on ground and fully stopped???

XML:
(K:KEY_REPAIR_AND_REFUEL) 1==
(A:sim on ground, bool) 1==
(A:VELOCITY BODY Z, knots)
(A:BRAKE PARKING POSITION, bool) 1==
&amp;&amp; &amp;&amp; &amp;&amp;
if{(A:SPOILER AVAILABLE, bool) 1==
(G:chute1) 1==}


So my net gauge would look like:

XML:
<Gauge Name="Drag Chute Control" Version="1.0">

<Update Frequency="2">

<!-- Drag Chute counter: -->

(G:chute0) 0 == if{ 1 (&gt;G:chute1) }

<!-- Count Spoiler Deployment: -->

(A:SPOILERS HANDLE POSITION, percent) near 100 ==
(G:chute1) 0 &gt;
&amp;&amp;
if{ (G:chute1) -- (&gt;G:chute1) 1 (&gt;G:chute0)}

<!-- Disable Spoiler Deployment If count Zero: -->

(G:chute1) 0 ==
(A:SPOILERS HANDLE POSITION, percent) 0 &gt ==
&amp;&amp
if{(A:SPOILER AVAILABLE, bool) 0==}

<!-- Reset with refuel and repair command: -->

(K:KEY_REPAIR_AND_REFUEL) 1==
(A:sim on ground, bool) 1==
(A:VELOCITY BODY Z, knots)
(A:BRAKE PARKING POSITION, bool) 1==
&amp;&amp; &amp;&amp; &amp;&amp;
if{(A:SPOILER AVAILABLE, bool) 1==
(G:chute1) 1==}

</Gauge>
 
Last edited:
To make your posts readable when posting code, please use the vertical ellipsis (3 vertical dots) to drop down the "More options..." menu and select the "Code" option marked by "</>". Paste your code in the provided window and select the appropriate code language and it will format it accordingly.
 
I don't know that your code would "see" the repair and refuel event being active as it's a brief event, not something that is either 1 or 0.
 
Ok maybe something like this in place of that then??? I see this called for in a gauge using the "toggle logo lights key" just swapping out the command...

(K:KEY_REPAIR_AND_REFUEL)

Or

(&gt;K:KEY_REPAIR_AND_REFUEL)
 
Or to net it back together I am thinking either:

(A:sim on ground, bool) 1==
(A:VELOCITY BODY Z, knots)
(A:BRAKE PARKING POSITION, bool) 1==
(K:KEY_REPAIR_AND_REFUEL)
&amp;&amp; &amp;&amp; &amp;&amp;
if{(A:SPOILER AVAILABLE, bool) 1==
(G:chute1) 1==}

or

(A:sim on ground, bool) 1==
(A:VELOCITY BODY Z, knots)
(A:BRAKE PARKING POSITION, bool) 1==
(&gt; K:KEY_REPAIR_AND_REFUEL)
&amp;&amp; &amp;&amp; &amp;&amp;
if{(A:SPOILER AVAILABLE, bool) 1==
(G:chute1) 1==}
 
And for that matter did I at least write the first three blocks correctly??? (chute counter, spoiler deployment count, and disable on zero)
 
You can not change the value of SPOILER AVAILABLE according to the SDK. I am also not convinced you can see the KEY_REPAIR_AND_REFUEL event happening in XML. You can trigger the event, (>K:KEY_REPAIR_AND_REFUEL) would trigger that event in the sim.
 
The column "Settable" in that table tells you whether it is something you can change code-wise. The only thing you can probably do is if they try to redeploy the spoilers... set them back to retracted.
 
So with that in mind; if I wanted to have a difference between the handle used in the cockpit and the spoilers after the single use; then do I need to go back and assign the handle itself to another variable / function... IE the handle itself would be the tailhook or water rudder and use that portion of code on the previous page in conjunction with the counter code? This way since it is a two position handle; if I for example deployed the chute; then pushed it back in to release the chute (stow the spoilers); then pulled it back out again the spoilers would be zero; but the handle would still be allowed to be out / deployed position (basically simulating a dead lever at that point)? My concern is that if I just make it force the spoiler closed; that with the lever itself in sync with the spoiler it will also make the lever close instead of just acting like a "dead" lever after the single shot....
 
So here is my new effort for this example I used the tailhook handle; guess I could always "hijack" the water rudder; or another one I hear that the payware devs like to "hijack" is the smoke system... regardless if I wrote this correctly... It should start with a L:var for the counter and the initial count should be 1. This way I can also use the L:var to manipulate the model as well... as to my understanding G:vars are internal to the gauges and will not carry across the sim to be used by the model where L:vars will... So what I hope this does:

1. Lvar named "L:chute1" has an initial value of one; once the spoilers have been deployed it will have a value of zero until reset.

2. The spoilers now follow the tailhook:

a. if the tailhook is deployed and L:chute1 has a value of one (no previous spoiler deployments) then the spoilers will go to 100%

b. if the tailhook is stowed and L:chute1 has a value of one then spoilers are stowed and able to deploy upon commanding of the tailhook

c. if tailhook is in deployed position but L:chute1 has a value of zero then the spoilers will remain at zero percent / unable to deploy...


XML:
 <Gauge Name="Drag Chute Control" Version="1.0">

<Update Frequency="2">

<!-- Drag Chute counter: -->

(L:chute0) 0 == if{ 1 (&gt;L:chute1) }

<!-- Count Spoiler Deployment: -->

(A:SPOILERS HANDLE POSITION, percent) near 100 ==
(L:chute1) 0 &gt;
&amp;&amp;
if{ (L:chute1) -- (&gt;L:chute1) 1 (&gt;L:chute0)}

<!-- Deploy Spoiler with tailhook: -->
(A:TAILHOOK HANDLE,bool) 1==
(L:chute1) 1 ==
if{(A:SPOILERS HANDLE POSITION, percent) 100==}

(A:TAILHOOK HANDLE,bool) 0==
(L:chute1) 1 ==
&amp;&amp
if{(A:SPOILERS HANDLE POSITION, percent) 0==}

<!-- Disable Spoiler Deployment If count Zero: -->

(A:TAILHOOK HANDLE,bool) 1==
(L:chute1) 0 ==
&amp;&amp
if{(A:SPOILERS HANDLE POSITION, percent) 0==}

(L:chute1) 0 ==
if{(A:SPOILERS HANDLE POSITION, percent) 0==}

<!-- Reset with refuel and repair command: -->

(A:sim on ground, bool) 1==
(A:VELOCITY BODY Z, knots) 0==
(A:BRAKE PARKING POSITION, bool) 1==
(>K:KEY_REPAIR_AND_REFUEL)
&amp;&amp; &amp;&amp; &amp;&amp;
if{(L:chute1) 1==}

</Gauge>
 
So I just tried to test this an much to my chagrin... It did absolutely nothing...

1. I tried to load it into the Glowingheat SR-71 under VC08 as:

gauge23=dragchute!dragchute, 1,1,1,1

Didnt work...

so I

2. added the following to the aircraft.cfg so as to make the sim think it has a tailhook:

[tailhook]
cable_force_adjust = 0
tailhook_position = 0
tailhook_length = 0


In sim when I use the shift-q command (toggle tailhook) it does nothing; the dragchute handle rigged to the regular spoilers command doesn't move... and obviously my counter function doesn't work as I can still cycle the spoilers as much as I want and the dragchute keeps re-appearing... Can someone please tell me what am I doing wrong / why does my gauge do nothing??? and or actually show me how to tweak my code so it will actually work??? Thanks
 

Attachments

Also something else I just noticed... in these TEB counters; in the .xml coding the respective what I believe to be initial values show 16 (freeware) and 17 (glowing heat); however, when I load the aircraft in sim and look at the cockpits I see initial TEB counts displayed as 14 and 15 respectively... So is there some sort of programming math rule that for a count of one I would need to make my initial value for L:chute1 three?


So for example the freeware teb counter that I modeled after:

XML:
 <Update Frequency="2">
 <!-- L TEB counter: -->
 (G:Var5) 0 == if{ 16 (&gt;G:Var1) }

which results in the aircraft / cockpit loading with a TEB count value of 14

So Would I need to write:

XML:
 (L:chute0) 0 == if{ 3 (&gt;L:chute1) }

To generate an initial value of one???
 

Attachments

  • sr fw teb counter.JPG
    sr fw teb counter.JPG
    27.2 KB · Views: 147
  • sr gh teb counter.JPG
    sr gh teb counter.JPG
    37.7 KB · Views: 157
So after some help from my new robotic friend chatgpt... I am making some progress!!! But the reason to post at the moment is I did answer one major question that was posed:

I don't know that your code would "see" the repair and refuel event being active as it's a brief event, not something that is either 1 or 0.

And the answer is... Yes it does!!!

Using a VARWATCHER gauge that I found on the VRS Tacpack dev wiki I started watching parameters in sim to see if anything was reacting... Chatgpt had me do the opposite of what I was doing in terms of a counter in that it had me create a LVAR of (L:dragChuteDeployed, Bool) and start it at zero; and have it disable the spoilers if (L:dragChuteDeployed, Bool) equals 1... I put my new LVAR into VAR watcher and saw it does go to 1 with tailhook movement; and stays at 1 until my reset parameters are met... My reset code is:

XML:
<Element>
        <Select>
            <Value>
                (A:SIM ON GROUND, Bool) 1 ==  <!-- Aircraft on the ground -->
                (A:GROUND VELOCITY, Knots) 0 ==  <!-- Aircraft stopped -->
               (A:BRAKE PARKING POSITION, Bool) 1 ==  <!-- Parking brakes set -->
        (>K:KEY_REPAIR_AND_REFUEL)  <!-- Issue repair/refuel command -->

                if{
                    (L:DragChuteDeployed, Bool) 1 == if{
                        0 (>L:DragChuteDeployed, Bool)  <!-- Reset the deployment state -->
                      }
               
           </Value>
        </Select>
    </Element>

And with sim on ground; velocity zero; parking brake set; when I hit "crtl-shift-r" which is what I assigned as the refuel and repair key in my Prepar3d options; sure enough Varwatcher shows dragchuteployed go from 1 back to 0!!! This is certainly a step in the right direction!!!
 
Last edited:
Back
Top