16-bit Fighter
Active member
I wonder how to make a char change his MP when it's under a certain number. The best I have been able to do is :
It works but the problem is that in the Follow1 anim just the first frame is played (of course until MP is egal or over 10), so there is no loop with the other frames. Moreover, I'd prefer to create a function. I tried in the file animationscript with a function I call in the idle anim of the char but in this case, nothing happens. Here are the function I created:
Thanks in advance for any help!
Code:
anim idle
@script
void self = getlocalvar("self");
if (getentityproperty(self,"mp")<10)
{
setidle (self, openborconstant("ANI_FOLLOW1"));
}
@end_script
It works but the problem is that in the Follow1 anim just the first frame is played (of course until MP is egal or over 10), so there is no loop with the other frames. Moreover, I'd prefer to create a function. I tried in the file animationscript with a function I call in the idle anim of the char but in this case, nothing happens. Here are the function I created:
Code:
void mpidle ( int Cost)
{
void self = getlocalvar("self");
void MP = getentityproperty(self,"mp");
if(MP<Cost)
{
setidle (self, openborconstant("ANI_FOLLOW1"));
}
}
Thanks in advance for any help!