• 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 Switch Animation

Messages
10,163
Country
us-arizona
Hey guys,

This 'works' fine, but the animation does not.

Can anyone tell me why the switch only moves about 10% of the way and then returns back to zero? It acts like a toggle that returns to its center point. I need it to flip up, stay, flip down, stay, like a normal switch.

It was at 100 * and I tried reducing it to 50 * as its 50 KeyFrames.




Code:
<PartInfo>
  <Name>f24_skirts_selector</Name>
    <Animation>
      <Parameter>
        <Code>
          (L:F24 PUSH SKIRTS SWITCHOUT,bool) 50 *
        </Code>
       <Lag>50</Lag>
      </Parameter>
    </Animation>
   <MouseRect>
  <Cursor>Hand</Cursor>
 <TooltipText>F24 Wheel Skirts Selector (%((L:F24 Make Skirts Disappear,enum))%{case}%{:0}ON)%{:1}OFF)%{End}</TooltipText>
<MouseFlags>LeftSingle+LeftRelease</MouseFlags>
<CallbackCode>(M:Event) 'LeftSingle' scmp 0 == if{ (L:F24 Make Skirts Disappear,enum) 1 + 2 % (>L:F24 Make Skirts Disappear,enum) 1 (>L:XMLSND4,enum) 1 (>L:F24 PUSH SKIRTS SWITCHOUT,bool) } (M:Event) 'LeftRelease' scmp 0 == if{ (>L:F24 PUSH SKIRTS SWITCHOUT,bool) }</CallbackCode>
</MouseRect>
</PartInfo>
 
Code:
<MouseFlags>LeftSingle</MouseFlags>
<CallbackCode>(L:F24 Make Skirts Disappear,bool) ! (>L:F24 Make Skirts Disappear,bool)</CallbackCode>

The just animate it with keyframe 0-15 = down, keyframe 15 to 35 (or so) = up, keyframe 35-50 = down.

Combined with an appropriate <Lag> value, you should get an animation lasting a few seconds without the hassle of your mouse script.

(What the user sees and what really happens is fairly irrelevant.)


K.I.S.S.!
 
Um, Bill... your script seems to have misplaced the <AnimLength> entry...

Code:
<PartInfo>
  <Name>f24_skirts_selector</Name>
[COLOR="Red"]    <AnimLength>50</AnimLength>[/COLOR]
    <Animation>
 
That didnt seem to do it either.

It moves a slight bit, then returns back to start.

XML... sigh...
 
Can anyone tell me why the switch only moves about 10% of the way and then returns back to zero? It acts like a toggle that returns to its center point. I need it to flip up, stay, flip down, stay, like a normal switch.

Because you coded it to perform as it does :)

When you release the mouse button, (L:F24 PUSH SKIRTS SWITCHOUT,bool) returns to 0. If you want to keep it on its current position, just modify the <MouseFlags> accordingly

Tom
 
arghh... Thanks Tom.

I was wondering what that was, what a mouse release would do...


arrigatto, gozi mashtah
 
Back
Top