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

Wing Up-Flex

Messages
10,163
Country
us-arizona
I would like to use this for Wing Upflexing in my new plane. But wondering how to tune this.

It says mph) 10

Would this mean, 10 percent of MPH? Animation length is 70 KF's, so this must be for a 70 MPH plane? Its going over my head. Someone please tell me what its stating. Please.


<PartInfo>
<Name>needle_asi</Name>
<AnimLength>70</AnimLength>
<Animation>
<Parameter>
<Code>(A:AIRSPEED INDICATED, mph) 10 /</Code>
</Parameter>
</Animation>
<MouseRect>
<TooltipID>TOOLTIPTEXT_BACKUP_AIRSPEED_KNOTS</TooltipID>
</MouseRect>
</PartInfo>
 
I have re-written the code;

Code:
<part>
    <name>lhc_wing_bowing</name>
    <scale>100<scale>
    <animation>
      <parameter>
        <code>(A:AIRSPEED INDICATED, mph) 10 /</code>
      </parameter>
    </animation>
</part>


I just dont understand what 10 / means...

<code>(A:AIRSPEED INDICATED, mph) 10 /</code>
 
Scenery numpty here ...

Surely wingflex isn't dependent on horizontal speed alone, or is this variable referring to something else?

Feeble brain here would have thought wingflex was dependent on lift provided by wings, or vertical acceleration relative to gravity ...

some sort of F = m (a-g) type idea, where wingflex is proportional to F

(please excuse my aerodynamic ignorance)


Consider (for example) a high speed wing stall, wings would "unflex" even though horizontal speed is well above 70mph.
 
HCornea,

Many thanks for the interesting philosophies into the actual real world dynamics of wing flex phenomenon.

I just want them to begin flexing up as the speed grows. Simple GA aircraft here, so no high speed stalls of the wings.

So far, that code didnt work. I also tried the FS9 wing flex code at www.freeflightdesign.org and that didnt work either. I changed its parameters to 60 knots and that didnt work either. My thoughts are that at 45 knots, the wings should begin an upword movement. But alas, I cannot seem to find a way to make that happen.


That is one nice block of code though from FFD. Posting it below;




Code:
<part>
<name>fwt_wing_flex</name>
  <animation>
   <parameter>
    <code>
(A:VELOCITY BODY Z, knots) 100 <= 
if{ (A:G FORCE, gforce) 1 - 30 * /-/ 40 + } 
els{ (A:SIM ON GROUND, bool) 1 == 
if{ (A:VELOCITY BODY Z, knots) 160 <= 
if{ (A:G FORCE, gforce) 1 - 30 * /-/ 40 + (A:VELOCITY BODY Z, knots) 2 * + 200 - } 
els{ (A:G FORCE, gforce) 1 - 30 * /-/ 160 + } 
} 
els{ (A:VELOCITY BODY Z, knots) 160 <= 
if{ (A:G FORCE, gforce) 1 - 30 * 40 + (A:VELOCITY BODY Z, knots) 2 * + 200 - } 
els{ (A:G FORCE, gforce) 1 - 30 * 160 + } 
} 
} 
</code>
<lag>100</lag>
</parameter>
</animation>
</part>



Mind you, this is for a tubeline in these settings. But, it didnt work for me.
 
I found this quote:

Should work by copying-pasting it to the xml file with makemdl.

It also has the code that does the animation in reverse, basically if you have already animated wing flex attached to the gear, then just increase the keys to animate from 0 to 200 and you don't have to worry about reversing the animation.

----------

I think it's a bad copy of the code or the animations keys are not correct.....

DG:eek:
 
Hi,

I have re-written the code;
I just dont understand what 10 / means...

<code>(A:AIRSPEED INDICATED, mph) 10 /</code>

It means (A:AIRSPEED INDICATED, mph) divided by 10.

Once you get your head around it, it all makes sense.... :D

grt
Willem
 
Willem,

Can I take that out? The animation isnt working like I had hoped. I want the part to act like an ASI needle. When I take off, nothing appears to happen. Animated from 0 to 100 KF's, only two points, zero and 100, KF'd.



Bill
 
Remember this formula. Memorize it (or at least write it down!):

keyframes = simvariable * scalar + bias

Now, I'm not going to pretend that this is in anyway "realistic," but taking your own example, let's examine what needs to be done to flex your wings:

Code:
<part>
    <name>lhc_wing_bowing</name>
    <scale>100<scale>
    <animation>
      <parameter>
        <code>(A:AIRSPEED INDICATED, mph) 10 /</code>
      </parameter>
    </animation>
</part>

As written, it won't work as you've already discovered, because 70mph divided by 10 is only 7! You ain't gonna notice only seven frames of movement in a 100 frame animation!!!

To properly scale 100 frames to a 70mph max speed, simply divide 100/70 which equals 1.4285714. Let's round that to 1.43, which is close enough... :D

Now your script should be (simvariable * scalar):

Code:
<part>
    <name>lhc_wing_bowing</name>
    <scale>100<scale>
    <animation>
      <parameter>
        <code>(A:AIRSPEED INDICATED, mph) 1.43 *</code>
      </parameter>
    </animation>
</part>
 
Thanks Bill, and a thousand thanks for the how-too and break down on the formula. I have copied it over and saved.

Just out of curiosity, why on earth would they have that animation divided down to 1/10th? I just cant figure out why they would do that, unless they animated a needle massivly and didnt want to adjust it in Max/Gmax, so they adjusted it in the code, which still means they needed to recompile it over a few times...

Puzzled..

Bill
 
Well, if your plane goes 1000 mph, then 1/10 of that is 100 - just what you need. :)

You may not model supersonic aircraft, but others apparently do...
 
Ahhh.... Ok. I was thinking this one was for the smaller General aviation planes like the Mooney and Piper Cub.


Thanks Tom.
 
I dont know why, but this doesnt work. Crashes the XML part sheet.

Must be a mis-spelling... 2 days... arrgh. Time to take a break.


Bill
 
Solution

Hi Lionheart,

I suggest making a new scene with 2 simple objects as the wings. Then test that
to see if you can just make a simple object work. This way your original scene is exluded
as the problem. i do this when i am stuck.

DG:eek:
 
Back
Top