n4gix
Resource contributor
- Messages
- 11,674
- Country
-
I have a set of power levers that I have animated for thrust control (0 to 100). Because I need the lever(s) to stop at "Idle" I have the animation <Code> set as: 50 (L: Power_Lever:1,enum) + (I had to add a space after L: to stop the silly emojies)
In Max I have the full animation set for 0 to 150 frames, with idle position at frame 50.
I wish to use RightClick to allow the lever(s) to move from frame 50 to frame 0, representing reverse thrust from 0% to 100%.
The forward thrust works perfectly, but nothing I've tried will allow me to activate the reverse thrust animation. Anyone with ideas?
In Max I have the full animation set for 0 to 150 frames, with idle position at frame 50.
I wish to use RightClick to allow the lever(s) to move from frame 50 to frame 0, representing reverse thrust from 0% to 100%.
The forward thrust works perfectly, but nothing I've tried will allow me to activate the reverse thrust animation. Anyone with ideas?
Code:
<PartInfo>
<Name>PED_lever_throttle0</Name>
<AnimLength>100</AnimLength>
<Animation>
<Parameter>
<Code>
50 (L:Power_Lever:1,enum) +
</Code>
</Parameter>
</Animation>
<MouseRect>
<Cursor>Hand</Cursor>
<TooltipText>L Power %((L:Power_Lever:1,enum))%!d!</TooltipText>
<MouseFlags>LeftSingle+LeftDrag+MoveRepeat+Wheel+RightDrag+RightRelease</MouseFlags>
<CallbackCode>
<!-- FORWARD THRUST -->
(M:Event) 'LeftSingle' scmp 0 !=
if{
(L:PowerPosLeftX, position) s0 0 !=
if{
(L:Power_Lever:1,enum) (M:X) l0 <
if{ 2 + 100 min } els{ l0 (M:X) < if{ 2 - 0 max } }
(>L:Power_Lever:1,enum)
} quit
}
(M:Event) 'RightSingle' scmp 0 !=
<!-- REVERSER SCRIPT HERE -->
(M:X) (>L:PowerPosLeftX, position)
</CallbackCode>
</MouseRect>
</PartInfo>