I have an enemy that runs up to you and performs a slam. I want the attack to not hit if the player is in the air. Does anybody know the best way to script this?
how do you make an enemy receive damage while blocking?
The simplest way is to check player's altitude at beginning of slam animation. If the altitude is more than 0, change to non slam animation
Won't that defeat the point of blocking?
Anyways, how much damage you want enemy to take in this blocking state?
Do you have a sample or can you give me an idea on how to make the script?
anim follow1
@script
if(frame == 0){
void self = getlocalvar("self");
void target = getentityproperty(self, "opponent");
int Alti = getentityproperty(target, "a");
if(Alti > 0){
changeentityproperty(self, "animation", openborconstant("ANI_FOLLOW2"));
}
}
@end_script
...
Basically, I want the attack to receive damage but the animation be uninterrupted, unless hit by an attack with a certain amount of damage
Ah, why not use damage normal 10 ? Setting this will give enemy endurance to attacks whose damage is less than 10. Endurance means any received attack will not stop current animation
BTW is this endurance applicable only on this attack?
Yes, I want it just for this attack. I want the enemy to receive maybe half damage during this move and only higher damaging attacks can make the enemy go into pain animation.
anim attack1
@script
if(frame == 0){ // 1st frame
void self = getlocalvar("self");
changeentityproperty(self, "defense", openborconstant("ATK_NORMAL"), 1, 20);
}
if(frame == 5){ // 6th frame
void self = getlocalvar("self");
changeentityproperty(self, "defense", openborconstant("ATK_NORMAL"), 1, 0);
}
@end_script
...