Gamestudio Links
Zorro Links
Newest Posts
Help with plotting multiple ZigZag
by degenerate_762. 04/30/24 23:23
M1 Oversampling
by 11honza11. 04/30/24 08:16
Trading Journey
by howardR. 04/28/24 09:55
Zorro Trader GPT
by TipmyPip. 04/27/24 13:50
Data from CSV not parsed correctly
by jcl. 04/26/24 11:18
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (7th_zorro, 1 invisible), 942 guests, and 7 spiders.
Key: Admin, Global Mod, Mod
Newest Members
firatv, wandaluciaia, Mega_Rod, EternallyCurious, howardR
19050 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Animation bledning problem #425013
06/25/13 14:37
06/25/13 14:37
Joined: Oct 2011
Posts: 1,082
Germany
C
Ch40zzC0d3r Offline OP
Serious User
Ch40zzC0d3r  Offline OP
Serious User
C

Joined: Oct 2011
Posts: 1,082
Germany
Hey guys.
Today I tried to blend my animations to get a better result in endgame. However, in firstperson I got everything to work but in thirdperson it doesnt work, because I use ANM_ADD too:
Code:
if(mv_lastMode != 1) mv_fpsBlend = 0;
mv_lastMode = 1;
ent_blendframe(pLocal, pLocal, "stand", 0, mv_fpsBlend);
mv_fpsBlend = clamp(mv_fpsBlend + 4*time_step, 0, 100);
if(mv_fpsBlend >= 25)
{
	ent_animate(pLocal, "stand", mv_fpsAnim, ANM_CYCLE);
	mv_fpsAnim += 3*time_step;
}
else
{
	mv_fpsAnim = 0;
}

.......

ent_animate(pLocal, "r_pose", 0, ANM_ADD); //<- this results in a weird behaaviour while the first 25% of the frame is blending :(



I hope someone can help me a little laugh
Thanks in advance!

Re: Animation bledning problem [Re: Ch40zzC0d3r] #425043
06/25/13 19:37
06/25/13 19:37

M
Malice
Unregistered
Malice
Unregistered
M



manual
Quote:
ent_animate(entity,NULL,0,0) resets all bones poses of the entity


manual ent_animate code example
Code:
// reset skeletion and then compose the animation (order is important): 
      ent_animate(me,NULL,0,0); // reset all bones
// first, shake the arms during running
      ent_animate(me,"run_torso",my.skill1,ANM_CYCLE);
// then blend over to, or blend back from shooting (only affects the arms)
      if (my.skill3 > 0) { ent_blend("shoot",0,my.skill3); }
// finally animate the legs (only affects the legs)
      ent_animate(me,"run_legs",my.skill2,ANM_CYCLE+ANM_ADD);




Of course I'm still half asleep so I might misunderstand your question.

Re: Animation bledning problem [Re: ] #425089
06/26/13 14:53
06/26/13 14:53
Joined: Oct 2011
Posts: 1,082
Germany
C
Ch40zzC0d3r Offline OP
Serious User
Ch40zzC0d3r  Offline OP
Serious User
C

Joined: Oct 2011
Posts: 1,082
Germany
Doesnt work frown
Here is a ready to use example:
http://www.mediafire.com/?sufdhy9syhk5uu6

Re: Animation bledning problem [Re: Ch40zzC0d3r] #425095
06/26/13 17:40
06/26/13 17:40

M
Malice
Unregistered
Malice
Unregistered
M



It works just like it should, But there is a little odd pop in it, that I think would be fixed by putting the blend into a if() block.


Code:
while(1)
	{
		ent_animate(me,NULL,0,0); 
		if(key_w)
		{
			mv_lastMode = 2;
			ent_animate(me, "walk", animationCount, ANM_CYCLE);
			animationCount += 5*time_step;
		}
		else
		{
			//ent_animate(me,NULL,0,0);/// NOT NEEDED 
			ent_animate(me, "walk", animationCount, ANM_CYCLE);
			if(mv_lastMode != 1) mv_fpsBlend = 0;
			mv_lastMode = 1;
			ent_blendframe(me, me, "stand", 0, mv_fpsBlend);
			mv_fpsBlend = clamp(mv_fpsBlend + 3*time_step, 0, 100);
			
			if(mv_fpsBlend >= 25)
			{
				ent_animate(me, "stand", mv_fpsAnim, ANM_CYCLE);
				mv_fpsAnim += 3*time_step;
			}
			else
			{
				mv_fpsAnim = 0;
			}
		}
		
		 ent_animate(me, "r_pose", 0, ANM_ADD); //Comment out this line to see the expected result
		
		
		wait(1);
	}




EDITED

Last edited by Malice; 06/26/13 18:23.
Re: Animation bledning problem [Re: ] #425097
06/26/13 18:10
06/26/13 18:10
Joined: Oct 2011
Posts: 1,082
Germany
C
Ch40zzC0d3r Offline OP
Serious User
Ch40zzC0d3r  Offline OP
Serious User
C

Joined: Oct 2011
Posts: 1,082
Germany
Thanks, I tried exactly the same code before and it didnt work as expected xD
However, now its working tongue

Re: Animation bledning problem [Re: Ch40zzC0d3r] #425098
06/26/13 18:30
06/26/13 18:30

M
Malice
Unregistered
Malice
Unregistered
M



Your welcome , It seemed a odd question. You already knew the answer.

You can remove the second empty ent_animate() inside the else. Also I didn't try but you should be able to do the logic on the animation variables in the if()else() blocks and then put all the animation instructions in a block at the end with a little logic, like the example from ent_animate.

EDIT* Looking at the manual I think the ent_blendpose() would end up being better as you can compose pose layers. It looks like you are going to end up with many ANM_ADD's like Shooting, Reloading, Middle-finger-in-the-air grin , ect...

Last edited by Malice; 06/26/13 19:03.

Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1