Gamestudio Links
Zorro Links
Newest Posts
Blind Zorro Window
by Martin_HH. 09/11/26 08:01
Parent/child object
by 3run. 09/11/26 06:21
ZorroGPT
by TipmyPip. 09/09/26 14:35
[MED] Import from FBX (2010) missing!!!
by USER0328. 09/03/26 18:03
Purchase A8 full licence version
by ukgamer. 08/30/26 14:27
Retrieve optimize() variables order (edited)
by NorbertSz. 08/25/26 13:24
Max Number of Strategies in /Strategy folder
by Martin_HH. 08/17/26 07:54
AUM Magazine
Latest Screens
Dorifto samurai
Shadow 2
Rocker`s Revenge
Stug 3 Stormartillery
Who's Online Now
2 registered members (Martin_HH, 3run), 3,649 guests, and 2 spiders.
Key: Admin, Global Mod, Mod
Newest Members
speedx, liop, Bauer097, riggi89, shuhari
19233 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