Startanimation problems with stopping it


(MadMaximus) #1

hi all,

i have a script_mover made of clips and a model2 for my model which has 20 frames of animations in it.

now, i can start the animation no problem in the script_mover routines, and it runs smooth as silk… but it won’t STOP!!!

anyone seen this problem before??

startanimation 1 19 19 nolerp noloop

ive tried all combinations of nolerp/noloop/norandom and it still wont stop after it runs its course. i want frames 1 to 19 to play in one second, hence the 19 for fps… it runs nice and smooth… but it continues to loop even with the noloop there.

is it because its not an actual misc_gamemodel? and just a model2 in a script_mover brush?

i’ll experiment with that idea now, but if anyone knows the answer, i’d appreciate it.

tia


(chavo_one) #2

Well, if you use the tank as an example, it appears that they call

startanimation 0 1 15 nolerp norandom

to end an animation loop. But basically that is one frame of animation from the tank’s resting position. So perhaps there is no way to stop the looping, only ways to make it invisible.

Look at how the tank fires it’s cannon (which is a non-looping animation).

	trigger startfire
	{
		startanimation 67 8 10 nolerp norandom
	}

	trigger stopfire
	{
		startanimation 0 1 15 nolerp norandom
	}

(MadMaximus) #3

thanks chavo

but shouldnt the noloop actually do what it says?? and not loop the animation?

it would be prefered…

i can stop the animation by locking it into a loop where it animates one frame only… but then why have an option for noloop if it doesnt work…
heh

thanks again… i’ll work around the problem with an idea i have… it ain’t pretty… but it will do… for now.


(chavo_one) #4

I looked at the code, and I’m confused. It doesn’t look to me like noloop has anything to do with looping.


	if(noloop) {
		ent->s.clientNum = 1;
	} else {
		ent->s.clientNum = 0;
	}

What does setting the model’s clientNum to 1 do?


(MadMaximus) #5

lol

EDIT: on a minor note… im going to start using my lang avatar here since i havent made one for sd forums yet… im lazy…


(Chruker) #6

I found a freezeanimation script command in the source code. However I haven’t tried if that works.

Chavo_one: The ‘startanimation 0 1 15 nolerp norandom’ in the stopfire command, essentially stops the animation since it sets the animation to only show frame 0 repeatedly.


(MadMaximus) #7

yeah…

so bascily i scrapped the noloop… if it doesnt work… and it seems it doesnt… iver worked around it…

play the anim, and force a stop with 0 1 1 or similar…

however, if that noloop did work, it would just own… make things more smoother than my animation jump to stop routine…


(No1_sonuk) #8

What does “nolerp” mean?


(No1_sonuk) #9

What does “nolerp” mean?

:bump:


(chavo_one) #10

I’m no expert on this as I am just now learning it myself. I didn’t even know what lerp meant until very recently.

From what I can understand from the code, a gamemodel’s animation frames are driven by the server. In order for the client to keep the animation smooth, it does linear interpolation between the frames. If you set “nolerp”, I imagine it turns lerping off, and the frames of animation are strictly played.

I guess this explanation will have to do until someone more knowledgeable comes by and corrects me.

EDIT: After more thought, I think nolerp actually turns lerping off between startanimation commands. IOW, with nolerp the model will jerk between the last frame of the previous startanimation command and the first frame of the next startanimation command. But with lerping, there would be a smooth transition between those same frames.


(No1_sonuk) #11

K, Thanks.