DragonflightDesign
Resource contributor
- Messages
- 1,082
- Country
Sorry guys - really could not think of a good title for this. In the modeldef, if someone holds down the right mouse button while moving (say) throttle lever 1, I also want throttle lever 2 to move. Got this working perfectly in the 2D but the VC is just laughing at me. As the right mouse button is pressed, throttle two moves slightly and then stops.
Code:
<PartInfo>
<Name>vcT1State</Name>
<AnimLength>100</AnimLength>
<Animation>
<Parameter>
<Code>
(L:vcT1State, number)
</Code>
</Parameter>
</Animation>
<MouseRect>
<Cursor>Hand</Cursor>
<MouseFlags>LeftSingle+LeftDrag+RightDrag+RightSingle</MouseFlags>
<CallbackCode>
(L:ManifoldLock, bool) 0 == (L:vcT1Lock, number) 0 == and
if{
(M:Event) 'LeftSingle' scmp 0 ==
if{
(M:X) (>L:MouseX26, number)
(M:Y) (>L:MouseY26, number)
}
(M:Event) 'LeftDrag' scmp 0 ==
if{
(L:vcT1State, number) (M:X) (L:MouseX26, number) - 0.25 * + 0 max 100 min (>L:vcT1State, number) (M:X) (>L:MouseX26, number)
(L:vcT1State, number) (M:Y) (L:MouseY26, number) - -0.25 * + 0 max 100 min (>L:vcT1State, number) (M:Y) (>L:MouseY26, number)
}
<!-- Here. Trying to pass the current position of the throttle one lever to throttle two -->
(M:Event) 'RightSingle' scmp 0 == (M:Event) 'RightDrag' scmp 0 == or
if{
(L:vcT1State, number) (>L:vcT2State, number)
}
}
</CallbackCode>
</MouseRect>
</PartInfo>