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

Reversed Animation; How?

Messages
10,163
Country
us-arizona
Hey all,

I was experimenting with gauge code, and wanted to try to use one that Jesse had made a couple of years ago, drooping hydraulics.

Oddly, the animation occurrs backwards. Can someone point out why this happens? I tried making the 1 == to 0 ==. If I use a different animation tag (in FS9 Gmax XML), like Tailhook (to test it) it animates properly, but with this code, it appears to reverse when you power up.

Code:
<part>  
<name>inner_door_ani</name>  
<animation>  
    <parameter>  
     <code>
     (A:SIM on GROUND, bool) 1 == if{ (A:ENG1 HYDRAULIC PRESSURE, psi) ! 100 * } els{ 0 }
     </code> 
   <lag>50</lag>
    </parameter>  
</animation>  
   </part>

Bill
 
Ok.. I may have found it. The Apostrophe.

! (unary operator) : logical NOT, toggles last stack entry from 1 to 0 or 0 to 1


So that must reverse the animation.
 
Well, the ! here is operating on a number, not a bool, so the effect here makes no sense. Can't you just fiddle the keyframes if it's happening backwards? Lower keyframes should be lower pressure in the system, without the !.
 
I was just trying to figure out how/why it does that. It has me baffled. This is the untouched version from FFDS/XML library. It works brilliant, but when I tried it on something else, the animation starts from the back. I would love to know what does that.


They say, sometimes the most basic things are the hardest to design. This short little code impresses me.
 
Why so complicated? This is what I've used for years:

Code:
   <part>
      <name>elevator_droop</name>
      <animation>
         <parameter>
            <sim>
               <variable>ENG1 HYDRAULIC PRESSURE</variable>
               <units>psi</units>
            </sim>
         </parameter>
         <maxvalue>2600</maxvalue>
      </animation>
   </part>

   <part>
   <name>aileron_droop</name>
      <animation>
         <parameter>
            <sim>
               <variable>ENG1 HYDRAULIC PRESSURE</variable>
               <units>psi</units>
            </sim>
         </parameter>
         <maxvalue>2600</maxvalue>
      </animation>
   </part>
 
Back
Top