Fire animation acting glitchy?

Fire animation acting glitchy?

Discuss game development here, from a distinct game project to an accessible third-party mutator, down to the interaction and design of individual units if you like.

Moderator: Moderators

Post Reply
User avatar
smoth
Posts: 22309
Joined: 13 Jan 2005, 00:46

Fire animation acting glitchy?

Post by smoth »

So I am working on some kick back anims:
Image
nothing fancy, just something for fun.

Code: Select all

FirePrimary()
	{
		emit-sfx 		yellowbeammuzzle 		from flare;//first shot is actual weapon
		sleep 50;
		
		move right		to z-axis [-0.4] 	now;
		turn r_forearm	to x-axis <-60> 	now;
		turn r_arm		to x-axis <15> 		now;


		sleep 50;
			
		turn r_forearm	to x-axis <-45>	 	speed [0.5];	
		turn r_arm		to x-axis <0> 		speed [0.5];
		move right		to z-axis [0] 		speed [5];	
		
		Sleep 500;
	}
but occasionally it does this:

Image

WTF
That is a rotation as though I gave it a 0... it kicks DOWN for some reason. nothing in the code is a rotation below -45 yet occasionally I see it glitch this way. I should mention I don't use that smooth anim tag.
User avatar
knorke
Posts: 7971
Joined: 22 Feb 2006, 01:02

Re: Fire animation acting glitchy?

Post by knorke »

whats with the Sleep 500; at the end?
User avatar
smoth
Posts: 22309
Joined: 13 Jan 2005, 00:46

Re: Fire animation acting glitchy?

Post by smoth »

just 'cause.
User avatar
FLOZi
MC: Legacy & Spring 1944 Developer
Posts: 6242
Joined: 29 Apr 2005, 01:14

Re: Fire animation acting glitchy?

Post by FLOZi »

You shouldn't really use [] around speeds for turning (use <>). Not that it will cause your problem
User avatar
smoth
Posts: 22309
Joined: 13 Jan 2005, 00:46

Re: Fire animation acting glitchy?

Post by smoth »

what is the difference?
User avatar
knorke
Posts: 7971
Joined: 22 Feb 2006, 01:02

Re: Fire animation acting glitchy?

Post by knorke »

smoth wrote:just 'cause.
dont know excactly how animation works but if every shot starts a FirePrimary() thread then the Sleep could cause that the old thread is still running when a new one starts.
they try to move the same pieces->funky.
User avatar
FLOZi
MC: Legacy & Spring 1944 Developer
Posts: 6242
Joined: 29 Apr 2005, 01:14

Re: Fire animation acting glitchy?

Post by FLOZi »

smoth wrote:what is the difference?
The same as when used for the distance you are turning / moving...

Also agree with knorke, try dropping the sleep 500.
User avatar
smoth
Posts: 22309
Joined: 13 Jan 2005, 00:46

Re: Fire animation acting glitchy?

Post by smoth »

the last sleep didn't fix it.

emit-sfx yellowbeammuzzle from flare;
sleep 100;

move right to z-axis [-0.4] now;
turn r_forearm to x-axis <-60> now;
turn r_arm to x-axis <15> speed [0.1];


sleep 100;

move right to z-axis [0] speed [5];
turn r_forearm to x-axis <-45> speed [0.5];
turn r_arm to x-axis <0> speed [0.5];
fixed it but still doesn't explain why
User avatar
FLOZi
MC: Legacy & Spring 1944 Developer
Posts: 6242
Joined: 29 Apr 2005, 01:14

Re: Fire animation acting glitchy?

Post by FLOZi »

Sure it was the speed change and not the increased sleeps? (1 frame -> 3)
User avatar
smoth
Posts: 22309
Joined: 13 Jan 2005, 00:46

Re: Fire animation acting glitchy?

Post by smoth »

unsure, I did both at the same time and then moved on
User avatar
KDR_11k
Game Developer
Posts: 8293
Joined: 25 Jun 2006, 08:44

Re: Fire animation acting glitchy?

Post by KDR_11k »

[1] is 2.5 elmos (unless you changed your compiler to use 1 elmo instead), <1> is a 1┬░ angle. Giving speeds in <> notes them in degrees per second. I guess too high a rotation speed could mess with the rotation steps. [0.5] is 1.25 rotations per second, divide by 32 to get the increment per frame.

Alternatively it could be the weapon aiming animation interfering with the fire animation.
User avatar
zwzsg
Kernel Panic Co-Developer
Posts: 7052
Joined: 16 Nov 2004, 13:08

Re: Fire animation acting glitchy?

Post by zwzsg »

[..] multiply by 163840
<..> multiply by 182

That's the difference.*

* Technically, it depends on the constants you set in Scriptor, but I'll assume you use the usual ones
Post Reply

Return to “Game Development”