• 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 Flaps, flaps, flaps !

Messages
61
Country
france
Hello everyone,
I wish to make a flaps control in the Virtual Cockpit. It is a 3 positions switch :
• When the switch is on neutral, nothing happens.
• When it is switched forward the flaps go back in for as long as the switch is kept in the forward position.
• When it is switched backward, the flaps come out for as long as the switch is kept in the backward positions.
• Finally, when you let go the switch, it must go back on neutral.


In the modeldef, I have created this code:

<PartInfo>
<Name>000-NORATLAS_Volets </Name>
<AnimLength>100</AnimLength>
<Animation>
<Parameter>
<Code>
(L:Volets,number) 100 *
</Code>
<Lag>400</Lag>
</Parameter>
</Animation>
<MouseRect>
<Cursor>Hand</Cursor>
<MouseFlags>LeftSingle+LeftRelease</MouseFlags>
<TooltipText>Rentrer Volets</TooltipText>
<CallbackCode>(L:Volets,number) ! (&gt;L:Volets,number); (FLAPS_DECR)</CallbackCode>
</MouseRect>
</PartInfo>


However:

• The switch is only a 2 positions one : neutral forwards and back.
• The flaps don’t move.

This is far from being IT.

Thank you for your help.
 
FS doesn't support incremental flaps, but a three position, center off spring return switch is simple enough. Animated 0 - 50 - 100 frames:

Code:
  <PartInfo>
    <Name>T38_toggle_Flaps</Name>
    <AnimLength>100</AnimLength>
    <Animation>
      <Parameter>
        <Code>
          50 (L:FlapToggle,enum) 50 * +
        </Code>
        <Lag>200</Lag>
      </Parameter>
    </Animation>
    <MouseRect>
      <Cursor>Hand</Cursor>
      <TooltipText>Flap Lever</TooltipText>
      <MouseFlags>LeftSingle+RightSingle+LeftRelease+RightRelease</MouseFlags>
      <CallbackCode>
        (M:Event) 'LeftSingle' scmp 0 ==
        if{ -1 (>L:FlapToggle, enum) (>K:FLAPS_INCR) (P:local time, seconds) 0.5 + (>L:Flap_reset) }
        (M:Event) 'RightSingle' scmp 0 ==
        if{ 1 (>L:FlapToggle, enum) (>K:FLAPS_DECR) (P:local time, seconds) 0.5 + (>L:Flap_reset) }
      </CallbackCode>
    </MouseRect>
  </PartInfo>

Note that a timer (L:Flap_reset) is created that allows for a 1/2 second delay before returning to the center position. This is needed because if the mouse "Hand" slips off the lever before the button is released, the lever will be "stuck" in either up or down!

So, you need to provide some logic to "test and reset" the timer. Now you need something in your model on which to hang this <Visibility> script, so simply create a tiny triangle polygon hidden somewhere, and place any script you want to execute in this area. In fact, you can put all your XML logic in this one area!

Code:
  <PartInfo>
    <Name>T38_Logic</Name>
    <Visibility>
      <Parameter>
        <Code>
          <!-- RESET FLAP LEVER TO NEUTRAL -->
          (L:Flap_reset) (P:local time, seconds) &gt;
          if{ }
          els{ 0 (>L:FlapToggle,enum) }
        </Code>
      </Parameter>
    </Visibility>
  </PartInfo>
 
Last edited:
Incremental Flaps

Bill,
Not sure what you mean about FS not supporting incremental flaps. I thought incremental in this context meant they were adjusted to somewhere between fully up and fully down. Surely your code does this?

Roy
 
The flap positions are defined in aircraft.cfg, are not fully variable and the code will only move them from one position to another.

For example, an airliner might have four different flap settings plus fully up, a Spitfire has only fully up or fully down: the code will work on either scenario.
 
Incremental flaps

Exactly. Incremental flaps can be selected to any of the defined positions, not just fully up or down. Hunter has 8 positions for example.

Roy
 
Bill,
Not sure what you mean about FS not supporting incremental flaps. I thought incremental in this context meant they were adjusted to somewhere between fully up and fully down. Surely your code does this?

Roy

Roy, "fully incremental flaps" in this context refers to systems such as that used by the T-38 where the flaps may be set to any percentage of extension based on how long the pilot holds the flap lever up or down, which of course is why the lever is spring loaded, center return. :D

Even the key_event (>K:FLAPS_SET) will only set the flap handle to closest increment (0 – 16383), which is what is defined in the aircraft.cfg file. Granted one could define increments in 10º steps, but that would simply make flap management a nightmare!
 
Fbrte = fbvlv

Excuse me for the delay to thank you. I had some problems to be logged with FBVLV.

Your code works perfectly

You are the best
 
Fully incremental flaps

Bill,
Thanks for the explanation. Quite a few aircraft have a "neutral" position for the flap lever, reason is it shuts off hydraulic pressure to the flaps and prevents loss of fluid and pressure for other systems should the flaps have a hydraulic leak. Better to land flaps up than wheels up!

Roy
 
Excuse me for the delay to thank you. I had some problems to be logged with FBVLV.

Your code works perfectly

You are the best

You are most welcome. I'm delighted to share whatever I can. :D
 
Back
Top