Thanks frazzle i found another solution to bring it to work.
Now i got a new big problem -.- Sorry for that guys!
Code:
function attackit
{
ani_attack1 = 0;
anilauft = 0;
//randomize();
my.attack_choose = 0;
while(anilauft != 1)
{
if(my.attack_choose == 0)
{
ent_animate(my,NULL,0,0);
ani_attack1 += (8 * time_step)%100; // Ani Speed
ent_animate(my, "attack", ani_attack1,anm_cycle+anm_add); // Ani Bfehl
if(ani_attack1 >= 100)
{
ent_animate(my,NULL,0,0);
ani_attack1 = 0;
anilauft = 1;
}
}
wait(1);
}
}
////////////////Action///////////////
action Player_Function
{
...
while(1) // Lebensenergie_Player > 0
{
//Tastatureingabe
Tastatur.x = (key_w - key_s);
Tastatur.y = (key_a - key_d);
//Animation
if(abs(Tastatur.x) == 0 && abs(Tastatur.y) == 0 && abs(Tastatur.z) == 0)
{
ani_stand = (ani_stand + 1*time_step)%100;
ent_animate(my,"stand",ani_stand,anm_cycle);
}
if(abs(Tastatur.x) == 1)
{
ani_walk = (ani_walk + Tastatur.x*time_step*6)%100;
ent_animate(my,"walk",ani_walk,anm_cycle);
}
if(mouse_left && proc_status(attackit) == 0)
{
attackit();
}
I forgot to say that i´m using bones and i think also a vertex animation ^^
The "walk" and "stand" animation works fine. I want to add the "attack" animation with "anm_add". The Problem is it doesn´t work. If i click on my left mouse button nothing happens. Only the walk or stand animation works but the attack animation don´t work. If i jump or walk left or right i didn´t create an animation yet. In this moment the attack animation works fine.
Why isn´t it working in combination with the animation and why is it working without animation?
Please help i´m going to kill myself!! Oo