rafhot
Member
hi
i have set
maxidles 5
on my models.txt
and my player character have 5 different idle animations
i want change those idles in game
and to do this im using those functions to detect the level of my char and switch the animation:
everything works fine but the idle2 dont loop only the first frame of the idle2 animation is triggered and if i move the character it change normal to his walk animation and if i stop again it goes back to idle2 and again without execute the loop animation, only the first frame remain static
i notice too if i reach really close of an enemy the loop start to work, like it have some kind of range to trigger, but i tried to set custom ranges and then it stoped to trigger the loop even near enemies.
if i use follow animations or freespecial animations the same happend the custom idle dont loop
im doing something wrong? there is another change ani function to do this?
im little lost here
edit
i did some more tests and yes, the idles are triggered by range, so i need to make a fake idle animation using follow or freespecial but i dont know how to do it
i have set
maxidles 5
on my models.txt
and my player character have 5 different idle animations
i want change those idles in game
Code:
anim idle
@cmd lvAtt "ANI_IDLE2" 2 2
loop 1
delay 9
offset 640 231
bbox 626 127 33 97
frame data/chars/1robert/r_1-0.pcx
frame data/chars/1robert/r_1-1.pcx
frame data/chars/1robert/r_1-2.pcx
frame data/chars/1robert/r_1-3.pcx
frame data/chars/1robert/r_1-4.pcx
frame data/chars/1robert/r_1-5.pcx
frame data/chars/1robert/r_1-6.pcx
frame data/chars/1robert/r_1-7.pcx
frame data/chars/1robert/r_1-8.pcx
frame data/chars/1robert/r_1-9.pcx
and to do this im using those functions to detect the level of my char and switch the animation:
Code:
void changeAni(char ani)
{
void self = getlocalvar("self");
changeentityproperty(self, "animation", openborconstant(ani));
}
void lvAtt(char ani,int lv,int above)
{
void self = getlocalvar("self");
void ind = getentityproperty(self,"playerindex");
if (above){
if (getglobalvar("level."+ind)>=lv){changeAni(ani);}
}else{
if (getglobalvar("level."+ind)<lv){changeAni(ani);}
}
}
everything works fine but the idle2 dont loop only the first frame of the idle2 animation is triggered and if i move the character it change normal to his walk animation and if i stop again it goes back to idle2 and again without execute the loop animation, only the first frame remain static
i notice too if i reach really close of an enemy the loop start to work, like it have some kind of range to trigger, but i tried to set custom ranges and then it stoped to trigger the loop even near enemies.
if i use follow animations or freespecial animations the same happend the custom idle dont loop
im doing something wrong? there is another change ani function to do this?
im little lost here
edit
i did some more tests and yes, the idles are triggered by range, so i need to make a fake idle animation using follow or freespecial but i dont know how to do it