I was so sure this would work, but it doesn`t;
(combo function full)
Click to reveal..
var combo = 1;
if(mouse_left == 1 && mouse_left_press == 0 && combo == 0)
{
mouse_left_press = 1;
player.animblend = attack_a;
}
if(player.animblend == attack_a && mouse_left_press == 1 && combo == 0)
{
combo = 1;
player.animblend = attack_a;
handle_sword_collision();
my.skill6 += 10 * time_step;
ent_animate(me,"attack_a",my.skill6,ANM_CYCLE);
my.skill6 %= 100;
while(my.skill6 < 100){wait(1);}
if(mouse_left == 1 && mouse_left_press == 1 && combo == 1)
{
if(my.skill6 == 100)
{
player.animblend = attack_b;
}
}
else
{
mouse_left_press = 0;
combo = 0;
player.animblend = blend;
}
DoCombat = FALSE;
}
if(player.animblend == attack_b && mouse_left_press == 1)
{
combo = 2;
player.animblend = attack_b;
handle_sword_collision();
my.skill7 += 10 * time_step;
ent_animate(me,"attack_b",my.skill7,ANM_CYCLE);
my.skill7 %= 100;
while(my.skill7 < 100){wait(1);}
if(mouse_left == 1 && mouse_left_press == 1 && combo == 2)
{
if(my.skill7 == 100)
{
player.animblend = attack_c;
}
}
else
{
mouse_left_press = 0;
combo = 0;
player.animblend = blend;
}
DoCombat = FALSE;
}
if(player.animblend == attack_c && mouse_left_press == 1)
{
combo = 0;
player.animblend = attack_c;
handle_sword_collision();
my.skill8 += 8 * time_step;
ent_animate(me,"attack_c",my.skill8,ANM_CYCLE);
my.skill8 %= 100;
while(my.skill8 < 100){wait(1);}
mouse_left_press = 0;
combo = 0;
player.animblend = blend;
DoCombat = FALSE;
}


(Combo function part by part)

When I press the left mouse butten, the player`s animblend should become attack_a.
Click to reveal..
if(mouse_left == 1 && mouse_left_press == 0 && combo == 0)
{
mouse_left_press = 1;
player.animblend = attack_a;
}


The player`s animblend has become attack_a now, so the player should beginn attacking with attack_a and wait until the animation is finished.
After the animation is finished and I press mouse left again, the player should play his next attack;
Click to reveal..
if(player.animblend == attack_a && mouse_left_press == 1 && combo == 0)
{
combo = 1;
player.animblend = attack_a;
handle_sword_collision();
my.skill6 += 10 * time_step;
ent_animate(me,"attack_a",my.skill6,ANM_CYCLE);
my.skill6 %= 100;
while(my.skill6 < 100){wait(1);}
//play attack_a and wait untill it`s finished
if(mouse_left == 1 && mouse_left_press == 1 && combo == 1 && my.skill6 < 100)
//If I press mous left again while the animation is playing
{
if(my.skill6 == 100)
//waituntil the animation is finished, to continue the combo
{
player.animblend = attack_b;
}
}
else
//If you didn`t press mouse left while the attack_a animation
{
mouse_left_press = 0;
combo = 0;
player.animblend = blend;
//Then stop the combo
}
DoCombat = FALSE;
}


Then the same game with attack b;
Click to reveal..
if(player.animblend == attack_b && mouse_left_press == 1)
{
combo = 2;
player.animblend = attack_b;
handle_sword_collision();
my.skill7 += 10 * time_step;
ent_animate(me,"attack_b",my.skill7,ANM_CYCLE);
my.skill7 %= 100;
while(my.skill7 < 100){wait(1);}
if(mouse_left == 1 && mouse_left_press == 1 && combo == 2)
{
if(my.skill7 == 100)
{
player.animblend = attack_c;
}
}
else
{
mouse_left_press = 0;
combo = 0;
player.animblend = blend;
}
DoCombat = FALSE;
}


Untill I reach attack f.

But what happens is;
When press mouse left, the player does nothing.

PS; everything else works fine.

Last edited by Random; 06/24/11 15:17.