• 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 Automatic Folding Wings

When do you want the wings to fold?

You could use this command to fold/unfold the wings:

(K:TOGGLE_WING_FOLD)

and this variable to test if the wings are folded or not:

(A:FOLDING WING LEFT PERCENT, percent)
 
Last edited:
Thanks, I need to know how to detect an event (to be determined) and execute the corresponding one for fold wings. What could I use?
<Keys> <On Event = "" .....
 
Assuming you want to code this in an XML gauge:

You have to be a bit more specific in what you want to do: force fold/unfold the wings based on any "Condition" (using Avars/Lvars), or based on "trapping an event" (like with OnEvent)
And also depends if you want it to work for FSX-Accel ('Gold')/Steam or older versions of FSX (RTM/SP1/SP2)

Because to best force the wing fold state on/off, you should use an Avar (A:FOLDING WING HANDLE POSITION,bool); but that Avar is only available in FSX-Accel and up.

Furthermore, using OnEvent in FSX to trap an event, has a downside: it will not work if you are in e.g. SpotPlane view.
But there are ways to bypass that (the simplest one is to use Tom Aguino's XMLtools module, which solves that).

Again, you need to be more specific on what you are trying to code, and for which FSX version.

Regards, Rob
 
Thanks for your answer, I am new to these topics, I try to take my first steps between tutorials and a little practice. I'm trying to do a proof of concept. I want to enable (or disable) FOLD WINGS when an event occurs in FSX, say for example (for testing purposes) when A: LIGHT TAXI is enabled. Is the following code correct?

<Element>
<Value>
(A:LIGHT TAXI,bool),(&gt;K:TOGGLE_WING_FOLD, bool)
</Value>
</Element>

Thks
 
No.
Beside the syntax errors:
What this code does, is issue a ToggleWingfold command every 55 msec as long as LIGHT TAXI is True.
Not sure what you want, but most probably not this ;)

Now, first a bit on terminology.
When you talk about an "event" in FSX, this usually is understood as an "FSX-event/command" (like ToggleWIngfold is an FSX-event).
LIGHT TAXI is not an FSX- event/command, but the current state of an internal Avar.

So it's important to know what you mean with the word "event":
1. Detection of a state-change of a function (like in this example: Taxilights On/Off)
2. Detection of the FS-Event that causes a change a function (in this example: Taxilights state)

Ad1: you should code detection of a change in the Avar (A:LIGHT TAXI,bool)
Ad2: you should code detection of the FS-Events (using a trap function like OnEvent) that changes the Taxilight state.

Those are two distinct ways of coding what you want.
That's why I said: explain what you want to achieve in terms of functionality.
Because there is no generic way to code it.

As examples on how that's different:

Example-1: you want to toggle the Wingfold state each time the state of (A:LIGHT TAXI,bool) changes.
Example-2: you want to toggle the Wingfold state each time the FS-event TOGGLE_TAXI_LIGHTS is issued.
Example-3: you want the Wingfold state to follow the state of the Taxilights.

Three different specifications, with three different codings.

In Example-3, you could code it like this (only works in FSX-Accel and up):
XML:
(A:LIGHT TAXI,bool)
if{ (A:FOLDING WING HANDLE POSITION,bool) ! if{ (&gt;K:TOGGLE_WING_FOLD) } }
els{ (A:FOLDING WING HANDLE POSITION,bool) if{ (&gt;K:TOGGLE_WING_FOLD) } }

I hope you now understand why your request "I want to enable (or disable) FOLD WINGS when an event occurs in FSX ….." is too ambiguous to code.
And hope it points you in the right direction of what you are trying to achieve.

Regards, Rob
 
I think it should be something like:

XML:
   <Element>
      <Select>
         <Value>
               (A:LIGHT TAXI,bool)
                   if{ (A:FOLDING WING LEFT PERCENT, percent) 1 &lt; if{ (&gt;K:TOGGLE_WING_FOLD) } }
                   els{ (A:FOLDING WING LEFT PERCENT, percent) 99 &gt; if{ (&gt;K:TOGGLE_WING_FOLD) } }
         </Value>
      </Select>
   </Element>
 
Thank you very much, as I was saying I'm new to this topic, your explanation has been very helpful. I was looking for a functional starting code, for the creation of an automatic folding wing. I have managed to integrate it (for the first time too) and it runs. Now I will work on its evolution....
 
Back
Top