16-bit Fighter
Active member
By helping myself thanks to a script @Kratus gave me I'm trying to do a new one. But OB shuts down once the character selection is supposed to appear.
The log tells me:
and
Here is my script :
The log tells me:
Code:
Script function 'changeentityproperty' returned an exception, check the manual for details.Script function 'changeentityproperty' returned an exception, check the manual for details.
Code:
There's an exception while executing script 'ondrawscript' data/chars/andy'/Andy'.txt
Here is my script :
Code:
void main()
{//Change mprate if running and according to the number or enemies and number of MP
void self = getlocalvar("self");
void ani = getentityproperty(self, "animationID"); //GET CURRENT ANIMATION
int mp = getentityproperty(self, "mp"); //GET CURRENT MP
int recover = getentityproperty(self, "mprate"); //GET MP RECOVER
int ecount = openborvariant("count_enemies"); //Get how many enemies are active
int pcount = openborvariant("count_players"); //Get how many players are active
if(getlocalvar("defaultMprate"+self) == NULL()){ //VARIABLE "DEFAULT MPRATE" IS NULL?? FIRST CHARACTER SPAWN IN THE GAME??
setlocalvar("defaultMprate"+self, recover); //CREATE A VARIABLE AND SAVE DEFAULT MPRATE
}
if (ecount < pcount && mp > 100) { // COUNT OF ENEMIES IS MORE THAN THIS OF PLAYERS AND MP IS MORE THAN 100??
changeentityproperty(self, "mprate", 0); // STOP MPRATE
}
if(ani == openborconstant("ANI_RUN")){ //IS IN RUNNING ANIMATION??
if(mp > 0){ //CHECK IF MP IS ZERO TO PAUSE SCRIPT EXECUTION WITH NO MP
changeentityproperty(self, "mprate", 0); // STOP MPRATE
}
}else{ //IS NOT IN RUNNING ANIMATION??
changeentityproperty(self, "mprate", getlocalvar("defaultMprate"+self)); //DEFAULT MPRATE
}
}


