Hi there, I'm hoping someone can help me, as ever my .xml skills are poor at best.
A door needs animating: one click opens it just a little (say 5%), the next click opens it from there to all the way. The code below works ok, but needs to be slower. Right now, it just jumps to the two positions. Inserting a <lag> doesn't change anything.
Any suggestions?
Thanks!
A door needs animating: one click opens it just a little (say 5%), the next click opens it from there to all the way. The code below works ok, but needs to be slower. Right now, it just jumps to the two positions. Inserting a <lag> doesn't change anything.
Any suggestions?
Thanks!
Code:
<PartInfo>
<Name>door_latch</Name>
<AnimLength>100</AnimLength>
<Animation>
<Parameter>
<lag>25</lag>
<Code>50 (L:door_latch,enum) 50 * +</Code>
</Parameter>
</Animation>
<MouseRect>
<Cursor>Hand</Cursor>
<TooltipText>2 position door latch</TooltipText>
<MouseFlags>LeftSingle+RightSingle+Wheel</MouseFlags>
<CallbackCode>
(M:Event) 'LeftSingle' scmp 0 ==
if{ (L:door_latch, enum) -- 1 min
(>L:door_latch, enum) }
(M:Event) 'WheelDown' scmp 0 ==
if{ (L:door_latch, enum) -- 1 min
(>L:door_latch, enum) }
(M:Event) 'RightSingle' scmp 0 ==
if{ (L:door_latch, enum) ++ -1 max
(>L:door_latch, enum) }
(M:Event) 'WheelUp' scmp 0 ==
if{ (L:door_latch, enum) ++ -1 max
(>L:door_latch, enum) }
</CallbackCode>
</MouseRect>
</PartInfo>

