Gamestudio Links
Zorro Links
Newest Posts
What are you working on?
by rayp. 10/15/25 20:44
Help!
by VoroneTZ. 10/14/25 05:04
Zorro 2.70
by jcl. 10/13/25 09:01
ZorroGPT
by TipmyPip. 10/12/25 13:58
Sam Foster Sound | Experienced Game Composer for Hire
by titanicpiano14. 10/11/25 18:45
Reality Check results on my strategy
by dBc. 10/11/25 06:15
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
4 registered members (TipmyPip, Quad, AndrewAMD, 1 invisible), 6,312 guests, and 2 spiders.
Key: Admin, Global Mod, Mod
Newest Members
joenxxx, Jota, krishna, DrissB, James168
19170 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Blend animation in easy way :) #455281
10/15/15 21:27
10/15/15 21:27
Joined: Feb 2012
Posts: 371
Dico Offline OP
Senior Member
Dico  Offline OP
Senior Member

Joined: Feb 2012
Posts: 371
Code:
#define speed_animation skill30
#define id_animation    skill31
#define id_per          skill32
var c_animate(ENTITY* ent,ENTITY* ent2,STRING* animation ,var percentage_speed ,var animation_speed)
{
   STRING* animation_act = "";	
   var animeperc;
	if(ent2)
	{
		if(my.id_animation == 2){me.id_animation=0;}
		
		if(str_cmpi(animation_act, animation) == 1)
		{
			ent_animatefrom(ent,ent2,animation_act,ent.speed_animation,ANM_CYCLE);
			ent.speed_animation += animation_speed * time_step;
		}
		else
		{
			if((ent.id_animation == 0)&&(str_cmpi(animation_act, animation) == 0))
			{
				ent.id_per = 0;
				ent.id_animation = 1;
			}
			if(ent.id_animation == 1)
			{
				animeperc = ent_animatefrom(ent,ent2,animation_act,ent.speed_animation,ANM_CYCLE);
				ent_blendframe(ent,ent2,animation,0,ent.id_per);
				ent.id_per += percentage_speed;
				if(ent.id_per >= 100)
				{
					str_cpy(animation_act, animation);
					ent.id_animation = 2;
					ent.speed_animation=0;
				}		
			}
		}
	}
	return animeperc;
	
}



use it like ent_animate :
Code:
c_animate(me,me,"stand",70,1);


Re: Blend animation in easy way :) [Re: Dico] #455283
10/15/15 21:32
10/15/15 21:32
Joined: Jul 2001
Posts: 4,801
netherlands
Realspawn Offline

Expert
Realspawn  Offline

Expert

Joined: Jul 2001
Posts: 4,801
netherlands
Good contribution laugh always nice to know this laugh


Find all my tutorials & Workshops at : www.rp-interactive.nl

Creativity starts in the brain

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

Gamestudio download | 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