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

FSXA Animation start

Zeiten

Resource contributor
Messages
444
Country
norway
Hi.

Have made an animation that can adjust the position of the rudder pedals back and forth.

The only problem is that as always the sims starts with the animation at 0 so I'm trying to figure out a way for the animation to start at 50.

The code is as follows.

Code:
  <PartInfo>
  <Name>interior_pedals_adjustment</Name>
  <AnimLength>100</AnimLength>
  <Animation>
    <Parameter>
	<Code>
	  (L:interior pedal adjustment, number)
	</Code>
	<Lag>200</Lag>
    </Parameter>
  </Animation>
  <MouseRect>
    <Cursor>Hand</Cursor>
    <TooltipText>Rudder Pedal Adjusment</TooltipText>
    <MouseFlags>LeftSingle+LeftDrag</MouseFlags>
    <CallbackCode>
	(M:Event) 'LeftSingle' scmp 0 ==
	if{
	  (M:X) (&gt;L:MOUSEPOS, number)
	  quit
	}
	(M:Event) 'LeftDrag' scmp 0 ==
	if{
	  (M:X) (L:MOUSEPOS,number) - 0.1 * (L:interior pedal adjustment, number) + 0 max 100 min (&gt;L:interior pedal adjustment, number)
	  (M:X) (&gt;L:MOUSEPOS,number)
	}
    </CallbackCode>
  </MouseRect>
</PartInfo>
 
Easy to accomplish. Simply add 50 to the <Code> to offset the keyframes:

Code:
	<Code>
	  50 (L:interior pedal adjustment, number) +
	</Code>
What this does is "translate" your L:variable's value to a keyframe scale:
Code:
-50 + 50 = frame 0
  0 + 50 = frame 50 
 50 + 50 = frame 100

You will need to edit the min max values in your mouse script also:
Code:
(M:X) (L:MOUSEPOS,number) - 0.1 * (L:interior pedal adjustment, number) + -50 max 50 min (&gt;L:interior pedal adjustment, number)
 
Last edited:
Ah, thats what it was.

Can vaguely remember something like that when you helped me with the VSI needle.

Tried first with the 50 + but then the sim just ignored the first 50 frames :)

Btw, can you check my last topic.
Edit in a new question :o

Thanks :)
 
Back
Top