• 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 3d autopilot vspeed knob animation

Messages
18
Country
unitedkingdom
Hi I am having can't get the code pasted below to work it is for a 3d autopilot vspeed knob thanks in advance for any help.



<PartInfo>
<Name>knob_autopilot_vs</Name>
<AnimLength>100</AnimLength>
<Animation>
<Parameter>
<Sim>
<Variable>AUTOPILOT VERTICAL HOLD</Variable>
<Units>bool</Units>
<MinValue>0</MinValue>
<MaxValue>100</MaxValue>
<Scale>100</Scale>
</Sim>
</Parameter>
</Animation>
<MouseRect>
<Cursor>Hand</Cursor>
<TooltipID>TOOLTIPTEXT_AUTOPILOT_VSI_INDICATOR_FTMIN</TooltipID>
<MouseFlags>LeftSingle+LeftDrag+Wheel</MouseFlags>
<CallbackJumpDragging>
<XMovement>
<Delta>1</Delta>
<EventIdInc>AP_VS_VAR_INC</EventIdInc>
</XMovement>
</CallbackJumpDragging>
</MouseRect>
</PartInfo>
 
You are using the wrong variable!

Code:
<Variable>AUTOPILOT VERTICAL HOLD VAR</Variable>
<Units>ft/min</Units>
 
The "units" returned by that variable are ft/min, which is a bit difficult to convert to keyframes!

The simplest approach would be to rewrite the XML script to use a custom L:variable for the knob rotation. Something that is easily convertable to keyframes.

Perhaps something like this example. The custom L:var will control the knob's rotation from -25 to + 25 frames (total animation from frame 0 to frame 50).

You can adjust the numbers however you like to change the rotation. Note that this script allows for both increase and decrease in a single mouse point, which is very important for 3d modeled knobs that can only HAVE one mouse point! Left-click or Mouse Wheel Down for decrease; Right-click or Mouse Wheel Up for increase:
Code:
  <PartInfo>
    <Name>Autopilot_VS_knob</Name>
    <AnimLength>50</AnimLength>
    <Animation>
      <Parameter>
        <Code>
          25 (L:Autopilot_VS_knob, number) +
        </Code>
      </Parameter>
    </Animation>
    <MouseRect>
      <Cursor>Hand</Cursor>
      <MouseFlags>LeftSingle+RightSingle+Wheel+DownRepeat</MouseFlags>
      <CallbackCode>
        (M:Event) 'LeftSingle' scmp 0 ==
        (M:Event) 'WheelDown' scmp 0 == or
        if{ (L:Autopilot_VS_knob, enum) -- -25 max (>L:Autopilot_VS_knob, enum) (>K:AP_VS_VAR_DEC) }
        
        (M:Event) 'RightSingle' scmp 0 ==
        (M:Event) 'WheelUp' scmp 0 == or
        if{ (L:Autopilot_VS_knob, enum) ++  25 min (>L:Autopilot_VS_knob, enum) (>K:AP_VS_VAR_INC) }
      </CallbackCode>
    </MouseRect>
  </PartInfo>
 
Last edited:
Back
Top