Gamestudio Links
Zorro Links
Newest Posts
AlpacaZorroPlugin v1.3.0 Released
by kzhao. 05/19/24 18:45
Free Live Data for Zorro with Paper Trading?
by AbrahamR. 05/18/24 13:28
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
3 registered members (AndrewAMD, kzhao, 7th_zorro), 714 guests, and 7 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Hanky27, firatv, wandaluciaia, Mega_Rod, EternallyCurious
19051 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 | 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