So I was trying to animate the elevator winches, like this (in the case script):
and
Pretty much copied from the Clonk's scaling animation, however, the winches won't turn. It works with
effect.animation_id = elevator -> PlayAnimation(anim, 5, GetWinchSpinAnimationPosition(anim), Anim_Linear(0, 0, 1000, 5, ANIM_Remove));
(inside an fx$effect$start)and
func GetWinchSpinAnimationPosition(string anim, int pos)
{
var dir = -1;
if(GetComDir() == COMD_Down) dir = +1;
return Anim_Y(pos, 0, GetAnimationLength(anim), 50*dir);
}
Pretty much copied from the Clonk's scaling animation, however, the winches won't turn. It works with
PlayAnimation("winchSpin", 5, Anim_Linear(0,0, GetAnimationLength("winchSpin"), 10, ANIM_Loop), Anim_Const(1000))
, and I checked all the functions were called, so what's the problem here?
Mh, you want to animate the base building using the Y position of the case, right?
I am not sure whether that works. Anim_Y itself is pretty context insensitive.
You could try moving the elevator base up and down with the mouse - if the winches start spinning, you are using the elevator bulding's position instead of the case's.
ck, does that work somehow?
I am not sure whether that works. Anim_Y itself is pretty context insensitive.
You could try moving the elevator base up and down with the mouse - if the winches start spinning, you are using the elevator bulding's position instead of the case's.
ck, does that work somehow?
It should work the way Andriel has it. Anim_Y takes the Y position of the calling object, not the Y position of the object whose mesh is being animated.
Why are you using
Anim_Linear(0, 0, 1000, 5, ANIM_Remove)
instead of Anim_Const(1000)
(as you have it in the working version) for the animation weight? This will remove the animation after only 5 frames.
I took it from the Clonk's scaling animation.
Even if the animation was played for just 5 frames, you would see the 5 frames. But it doesn't even start the animation.
Even if the animation was played for just 5 frames, you would see the 5 frames. But it doesn't even start the animation.
Can you send to me the modified elevator? I'll have a look.
The difference to the Clonk is that the Clonk is making a transition from another animation (walking/hangling/or whatever it was doing before climbing), and that transition takes 5 frames. After those 5 frames the previous animation is removed.
The difference to the Clonk is that the Clonk is making a transition from another animation (walking/hangling/or whatever it was doing before climbing), and that transition takes 5 frames. After those 5 frames the previous animation is removed.
Looks like I was wrong and Zapper was right after all -- it takes the Y position of the elevator, and not that of the elevator case. I thought it was different. In any case this should be easy to change... I'll do that
Does Anim_Y really take the y-position of an object for animation? It didn't work for me when I was moving a clonk in y-direction with SetPosition(). Only when I added SetYDir() it got animated.
Yes, it uses ydir to decide how much to advance the animation.
Powered by mwForum 2.29.7 © 1999-2015 Markus Wichitill