Gamestudio Links
Zorro Links
Newest Posts
WFO Training with parallel cores Zorro64
by Martin_HH. 02/24/26 19:51
Zorro version 3.0 prerelease!
by TipmyPip. 02/24/26 17:09
ZorroGPT
by TipmyPip. 02/23/26 21:52
Camera always moves upwards?
by clonman. 02/21/26 09:29
Sam Foster Sound | Experienced Game Composer for Hire
by titanicpiano14. 02/19/26 13:22
AUM Magazine
Latest Screens
Dorifto samurai
Shadow 2
Rocker`s Revenge
Stug 3 Stormartillery
Who's Online Now
4 registered members (Martin_HH, TipmyPip, AndrewAMD, Grant), 5,825 guests, and 3 spiders.
Key: Admin, Global Mod, Mod
Newest Members
alx, ApprenticeInMuc, PatrickH90, USER0328, Sfrdragon
19199 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 1 of 2 1 2
ent_blend [help] #281157
07/25/09 18:04
07/25/09 18:04
Joined: May 2009
Posts: 5,377
Caucasus
3run Offline OP
Senior Expert
3run  Offline OP
Senior Expert

Joined: May 2009
Posts: 5,377
Caucasus
I'm trying to use ent_blend in my project here it is:
Code:
//animate.wdl
define animate skill31;
define animate2 skill32;
define animblend skill33;
define currentframe skill34;
define blendframe skill35;

define nullframe -2;
define blend -1;
define stand 0;
define walk_forward 1;
define walk_right 2;
define walk_back 3;
define walk_left 4;
define run_forward 5;
define run_right 6;
define run_back 7;
define run_left 8;


function handle_animation(animation_speed)
{
	 max_bones = 4;
    if (animation_speed <= 0) {animation_speed = 1;}
    
    if ((my.animblend != blend) && (my.blendframe != nullframe))
    {
        my.animate2 = 0;
        my.animblend = blend;
    }
    
    if (my.animblend == blend)
    {
        if (my.currentframe == stand) {ent_animate(player,"idle",my.animate,ANM_CYCLE);}
        if (my.currentframe == walk_forward) {ent_animate(player,"walk_forward",my.animate,ANM_CYCLE);}
        if (my.currentframe == walk_right) {ent_animate(player,"walk_right",my.animate,ANM_CYCLE);}
        if (my.currentframe == walk_back) {ent_animate(player,"walk_backward",my.animate,ANM_CYCLE);}
        if (my.currentframe == walk_left) {ent_animate(player,"walk_left",my.animate,ANM_CYCLE);}
        if (my.currentframe == run_forward) {ent_animate(player,"run_forward",my.animate,ANM_CYCLE);}
        if (my.currentframe == run_right) {ent_animate(player,"run_right",my.animate,ANM_CYCLE);}
        if (my.currentframe == run_back) {ent_animate(player,"run_backward",my.animate,ANM_CYCLE);}
        if (my.currentframe == run_left) {ent_animate(player,"run_left",my.animate,ANM_CYCLE);}
        if (my.blendframe == stand){ ent_blend("idle",0,my.animate2);}
        if (my.blendframe == walk_forward) {ent_blend("walk_forward",0,my.animate2);}
        if (my.blendframe == walk_right){ ent_blend("walk_right",0,my.animate2);}
        if (my.blendframe == walk_back) {ent_blend("walk_backward",0,my.animate2);}
        if (my.blendframe == walk_left) {ent_blend("walk_left",0,my.animate2);}
        if (my.blendframe == run_forward) {ent_blend("run_forward",0,my.animate2);}
        if (my.blendframe == run_right){ ent_blend("run_right",0,my.animate2);}
        if (my.blendframe == run_back) {ent_blend("run_backward",0,my.animate2);}
        if (my.blendframe == run_left) {ent_blend("run_left",0,my.animate2);}
        my.animate2 += 45 * time_step;
        
        if (my.animate2 >= 100)
        {
            my.animate = 0;
            my.animblend = my.blendframe;
            my.blendframe = nullframe;
        }
    }
    
    if (my.animblend == stand)
    {
        ent_animate(my,"idle",my.animate,ANM_CYCLE);
        my.animate += 1 * animation_speed * time_step;
        my.animate %= 100;
        my.currentframe = stand;
    }
    
    
    
    if (my.animblend == walk_forward)
    {
        ent_animate(my,"walk_forward",my.animate,ANM_CYCLE);
        my.animate += 8 * animation_speed * time_step;
        my.animate %= 100;
        my.currentframe = walk_forward;
    }
     
     if (my.animblend == walk_right)
    {
        ent_animate(my,"walk_right",my.animate,ANM_CYCLE);
        my.animate += 7 * animation_speed * time_step;
        my.animate %= 100;
        my.currentframe = walk_right;
    }
     
     if (my.animblend == walk_back)
    {
        ent_animate(my,"walk_backward",my.animate,ANM_CYCLE);
        my.animate += 8 * animation_speed * time_step;
        my.animate %= 100;
        my.currentframe = walk_back;
    }
    
     if (my.animblend == walk_left)
    {
        ent_animate(my,"walk_left",my.animate,ANM_CYCLE);
        my.animate += 7 * animation_speed * time_step;
        my.animate %= 100;
        my.currentframe = walk_left;
    }
     if (my.animblend == run_forward)
    {
        ent_animate(my,"run_forward",my.animate,ANM_CYCLE);
        my.animate += 7 * animation_speed * time_step;
        my.animate %= 100;
        my.currentframe = run_forward;
    }
    
     if (my.animblend == run_right)
    {
        ent_animate(my,"run_right",my.animate,ANM_CYCLE);
        my.animate += 7 * animation_speed * time_step;
        my.animate %= 100;
        my.currentframe = run_right;
    }
     if (my.animblend == run_back)
    {
        ent_animate(my,"run_back",my.animate,ANM_CYCLE);
        my.animate += 7 * animation_speed * time_step;
        my.animate %= 100;
        my.currentframe = run_back;
    }
     if (my.animblend == run_left)
    {
        ent_animate(my,"run_left",my.animate,ANM_CYCLE);
        my.animate += 7 * animation_speed * time_step;
        my.animate %= 100;
        my.currentframe = run_left;
    }
    
    

}


I'm trying to get it work by making a function:
Code:
//I call this function in players code
function move_anim
{
if ((dist.x != 0)||(dist.y != 0)) // if we are moving
{
if (my.animblend == stand) //if our current animation is stand 
{
if(key_w > 0)
{
my.blendframe = walk_forward;
}
if (key_s > 0) // if we are moving
{
my.blendframe = walk_back;
}
if (key_d > 0) // if we are moving
{
my.blendframe = walk_right;
}
if (key_a > 0) // if we are moving
{
my.blendframe = walk_left;
}
}
}
else
{
if (my.animblend > stand) //if we aren't moving 
{ 
my.blendframe = stand;
}
}
}


it work, but with some bugs... Here is my DEMO. You can see all bugs there... I need help to fix that bugs, all I want is to have animations for moving forward, left, right and backwards by walking and runing separately. I think all problems in my move_anim function, please help


Looking for free stuff?? Take a look here: http://badcom.at.ua
Support me on: https://boosty.to/3rung
Re: ent_blend [help] [Re: 3run] #281233
07/26/09 09:33
07/26/09 09:33
Joined: May 2009
Posts: 5,377
Caucasus
3run Offline OP
Senior Expert
3run  Offline OP
Senior Expert

Joined: May 2009
Posts: 5,377
Caucasus
any one?!


Looking for free stuff?? Take a look here: http://badcom.at.ua
Support me on: https://boosty.to/3rung
Re: ent_blend [help] [Re: 3run] #281295
07/26/09 16:20
07/26/09 16:20
Joined: May 2009
Posts: 5,377
Caucasus
3run Offline OP
Senior Expert
3run  Offline OP
Senior Expert

Joined: May 2009
Posts: 5,377
Caucasus
Damn! I need help!!!!


Looking for free stuff?? Take a look here: http://badcom.at.ua
Support me on: https://boosty.to/3rung
Re: ent_blend [help] [Re: 3run] #281305
07/26/09 17:16
07/26/09 17:16
Joined: Sep 2003
Posts: 5,900
Bielefeld, Germany
Pappenheimer Offline
Senior Expert
Pappenheimer  Offline
Senior Expert

Joined: Sep 2003
Posts: 5,900
Bielefeld, Germany
You should describe your problem, because the downloading is no fun.

From what I seen, one bug is that the last animation proceeds although the walk direction has started, if there is not a small pause between pushing the keys.

That's not quite surprising, because of this part of your code, where imbedded all keys in the condition that the player's animblend is stand
Code:
if (my.animblend == stand) //if our current animation is stand 
{
	if(key_w > 0)
	{
		my.blendframe = walk_forward;
	}
	if (key_s > 0) // if we are moving
	{
		my.blendframe = walk_back;
	}
	if (key_d > 0) // if we are moving
	{
		my.blendframe = walk_right;
	}
	if (key_a > 0) // if we are moving
	{
		my.blendframe = walk_left;
	}
}



Maybe, I'm wrong, but that's what I see at the moment.

Re: ent_blend [help] [Re: Pappenheimer] #281414
07/27/09 06:54
07/27/09 06:54
Joined: May 2009
Posts: 5,377
Caucasus
3run Offline OP
Senior Expert
3run  Offline OP
Senior Expert

Joined: May 2009
Posts: 5,377
Caucasus
Yeah man, you are right problem is in that part of code. I have no idea left in my mind how to animate player... I've tryed everything I know! I whant player to play "walk" animation when he moves with a shift key on, and run with out shift. All I've done is this:
Code:
if (my.animblend == stand) //if our current animation is stand 
{
	if(key_w > 0)
	{
		my.blendframe = walk_forward;
	}
	if (key_s > 0) // if we are moving
	{
		my.blendframe = walk_back;
	}
	if (key_d > 0) // if we are moving
	{
		my.blendframe = walk_right;
	}
	if (key_a > 0) // if we are moving
	{
		my.blendframe = walk_left;
	}
}


It's only walking animations, and as you sad, there is a problem, becouse of this -> "if (my.animblend == stand)" but if I change that animation doesn't work frown Any idea?


Looking for free stuff?? Take a look here: http://badcom.at.ua
Support me on: https://boosty.to/3rung
Re: ent_blend [help] [Re: 3run] #281687
07/28/09 06:52
07/28/09 06:52
Joined: May 2009
Posts: 5,377
Caucasus
3run Offline OP
Senior Expert
3run  Offline OP
Senior Expert

Joined: May 2009
Posts: 5,377
Caucasus
No idea?


Looking for free stuff?? Take a look here: http://badcom.at.ua
Support me on: https://boosty.to/3rung
Re: ent_blend [help] [Re: 3run] #281744
07/28/09 12:58
07/28/09 12:58
Joined: May 2009
Posts: 5,377
Caucasus
3run Offline OP
Senior Expert
3run  Offline OP
Senior Expert

Joined: May 2009
Posts: 5,377
Caucasus
Any one!!! I realy need help!!! I'v stucked in this part of my project!!! frown


Looking for free stuff?? Take a look here: http://badcom.at.ua
Support me on: https://boosty.to/3rung
Re: ent_blend [help] [Re: 3run] #281758
07/28/09 13:57
07/28/09 13:57
Joined: Sep 2003
Posts: 5,900
Bielefeld, Germany
Pappenheimer Offline
Senior Expert
Pappenheimer  Offline
Senior Expert

Joined: Sep 2003
Posts: 5,900
Bielefeld, Germany
That's not the way it works.
You should start a test code with a smaller task in smaller pieces to find the problem. None will do that for you.

Re: ent_blend [help] [Re: Pappenheimer] #281811
07/28/09 19:57
07/28/09 19:57
Joined: May 2009
Posts: 5,377
Caucasus
3run Offline OP
Senior Expert
3run  Offline OP
Senior Expert

Joined: May 2009
Posts: 5,377
Caucasus
I can animate player from stand in to walk! When there are only 2 animations, there is no problem.... but how can I have several animations?! please help me!


Looking for free stuff?? Take a look here: http://badcom.at.ua
Support me on: https://boosty.to/3rung
Re: ent_blend [help] [Re: 3run] #282055
07/30/09 05:58
07/30/09 05:58
Joined: May 2009
Posts: 5,377
Caucasus
3run Offline OP
Senior Expert
3run  Offline OP
Senior Expert

Joined: May 2009
Posts: 5,377
Caucasus
Some one! Please I'm stuked here! Is this so hard?


Looking for free stuff?? Take a look here: http://badcom.at.ua
Support me on: https://boosty.to/3rung
Page 1 of 2 1 2

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