Alternatives to ANIM FAINT?

oldyz

Well-known member
i would like some creatures to transform into others if they are damaged a certain percentage -

using ANIM FAINT does the job , but it seems that it is not reliable, especially if the character is in the process of being punched relentlessly.

does anyone have a script that Forces a transformation animation based on damage -no matter what?
 
Solution
I wrote a script for that

C:
void HealthSwitch(void Ani)
{// Changes Animation based on health
    void self = getlocalvar("self");
    int  Health = getentityproperty(self,"health");
   
    if(Health >= 1 && Health <30){ //Checks health range
    changeentityproperty(self, "animation", openborconstant(Ani)); //Change the animation
    }
}

use

@cmd HealthSwitch "ANI_FREESPECIAL21" # transform

I'd put in enemy's IDLE, WALK, PAIN or maybe even DEATH depending on your set up, Obviously the engine needs the check when to perform this so you can adjust accordingly.
I wrote a script for that

C:
void HealthSwitch(void Ani)
{// Changes Animation based on health
    void self = getlocalvar("self");
    int  Health = getentityproperty(self,"health");
   
    if(Health >= 1 && Health <30){ //Checks health range
    changeentityproperty(self, "animation", openborconstant(Ani)); //Change the animation
    }
}

use

@cmd HealthSwitch "ANI_FREESPECIAL21" # transform

I'd put in enemy's IDLE, WALK, PAIN or maybe even DEATH depending on your set up, Obviously the engine needs the check when to perform this so you can adjust accordingly.
 
Solution
I wrote a script for that

C:
void HealthSwitch(void Ani)
{// Changes Animation based on health
    void self = getlocalvar("self");
    int  Health = getentityproperty(self,"health");
 
    if(Health >= 1 && Health <30){ //Checks health range
    changeentityproperty(self, "animation", openborconstant(Ani)); //Change the animation
    }
}

use

@cmd HealthSwitch "ANI_FREESPECIAL21" # transform

I'd put in enemy's IDLE, WALK, PAIN or maybe even DEATH depending on your set up, Obviously the engine needs the check when to perform this so you can adjust accordingly.
couldnt this be used to have an enemy do a last desperation move when his health reaches the set amount given? only problem i see is it needs to only do this move one time only? thanks

just tested it and it works...but as i feared it keeps spamming it lol
 
Last edited:
only problem i see is it needs to only do this move one time only? thanks

It's possible if you add MP limit in the script and also spends MP in the move or when running this function, like this:
C:
void HealthSwitchMP(void Ani, int Limit)
{// Changes Animation based on health and MP
    void self = getlocalvar("self");
    int Health = getentityproperty(self,"health");
    int MP = getentityproperty(self,"mp");   
 
    if(Health >= 1 && Health < 30 && MP < Limit){ //Checks health range and MP
      changeentityproperty(self, "mp", MP-Limit);
      changeentityproperty(self, "animation", openborconstant(Ani)); //Change the animation
    }
}

The enemy should not have their MP regenerates to prevent reperforming the move again.
 
It's possible if you add MP limit in the script and also spends MP in the move or when running this function, like this:
C:
void HealthSwitchMP(void Ani, int Limit)
{// Changes Animation based on health and MP
    void self = getlocalvar("self");
    int Health = getentityproperty(self,"health");
    int MP = getentityproperty(self,"mp"); 
 
    if(Health >= 1 && Health < 30 && MP < Limit){ //Checks health range and MP
      changeentityproperty(self, "mp", MP-Limit);
      changeentityproperty(self, "animation", openborconstant(Ani)); //Change the animation
    }
}

The enemy should not have their MP regenerates to prevent reperforming the move again.
ok sadly i cant get it to work...i added mp to the enemys text file and still it will not use the attack...i set the attack to special and it uses it when grabbing the enemy but thats it and it uses it repeatedly lol
i also use energycost and mponly and still no dice..
not sure what am doing wrong :/
it seems to act as if the enemy does not recognize that it has any mp as it seems to ignore energy cost.
thank you very much always taking the time brother.
 
Last edited:
For you Alex!

C:
void HealthSwitchLimit(void Ani, int Limit)
{// Changes Animation based on health and MP
    void self = getlocalvar("self");
    int Health = getentityproperty(self,"health"); 
 
    if(Health >= 1 && Health < 30 && Health < Limit){ 
      changeentityproperty(self, "health", Health-Limit);
      changeentityproperty(self, "animation", openborconstant(Ani)); //Change the animation
    }
}

Code:
anim freespecial14
offset ..
......
@cmd HealthSwitchLimit "ANI_IDLE" 32
frame ....
frame ....
 
haha thanks maxman and bloodbane...maxman solution seems to work out.
again thank you all...danno bloodbane and maxman... amazing folks :)

on second thought this is almost working like it should....will use like it is if no other way around it...
problem now that it drains the life of the enemy with the 32 number here "@cmd HealthSwitchLimit "ANI_IDLE" 32"
i tried using energycost 0 and stuff and still drains its life.

hopefully someone can figure this out using mp as it would be ideal...again am really grateful for any help i can get, and mods feel free to move to its own thread i really didnt mean to hijack this thread...wasnt my intention :/
thanks

also eliminating that limit it just the same as the original script and the window for the move would have to be to small for the attack to come out,. and it will spam everytime he gets hit lol

last edit i promise lol
i manage to use maxmans by messing with the values and using steal hehe... so am satisfied with the results...again thanks for all the help and the work all of you do for the scene :)
 
Last edited:
Back
Top Bottom