Change defense nopain

Piccolo

Well-known member
Setting defense all 1 15 in an entity header makes this entity not play his pain animation when hit by attacks whose damage is less than 15.

Are there underlying entity properties than can be changed to modify this on an animation basis ?

I also tried to do it with doattack event, but I can't figure how to properly confirm the hit (damage, hitfx, hitflash) without interrupting defender current animation.
 
Hum it seems like the logical transcription of the command is working :

changeentityproperty(entity, "defense", type, factor, pain);

I'm still interested if someone know how to do it with doattack event though.
 
Setting defense all 1 15 in an entity header makes this entity not play his pain animation when hit by attacks whose damage is less than 15.

To be exact: entity won't play any reaction animation, that includes FALL animation too

I also tried to do it with doattack event, but I can't figure how to properly confirm the hit (damage, hitfx, hitflash) without interrupting defender current animation.

The function you posted above is correct but the question is why do you want to control defense properties on animation basis?
 
Bloodbane said:
To be exact: entity won't play any reaction animation, that includes FALL animation too

Actually (with these settings) it seems the entity does play his fall animation if hit by an attack with sufficient knockdown power.

The function you posted above is correct but the question is why do you want to control defense properties on animation basis?

It is to create moves that can't be interrupted easily. For example I gave some ennemies break-out, repulse moves with long start up. During these, player can still hit them with light attacks, but this won't interrupt the move (which means hitting them like this is not the right choice). But I don't want these enemies to have this "no pain" behavior on a global scope, only for some dangerous moves.
 
Defense is an entity level setting, you can't set it for a single animation. It's possible to make it work using your method by adjusting it on the fly during given animations, but I think for your purposes the doattack event is a better choice.

Using your method, you have to set it, set it back, and then include global check code elsewhere to ensure normal defense is restored should the action somehow get interrupted. Plus if you want to use defense for any other purposes you have to do some wonky math on every setting. That's a lot of complexity for such a limited subset.

Using doattack, you can check to see what animation is going on, perhaps compare it to the incoming attack power, and act from there whether to disable the incoming hit or not. Add in some impact effects, and boom - move specific super armor. Then you still have defense free to play with for things it was more tailored for.

DC
 
Ok thanks, that's about what I tried to do using this event.
So I still have to manually add impact effects if I disable the incoming hit ?
 
Yes you will. Disabling the hit tells the engine to cancel running all of its own hit handling code. It's as if the hit never happened. Still a lot simpler than trying to turn defense up and down for certain animations.

DC
 
Ok, it was just to be sure there weren't any existing intermediate status between accepting/rejecting a hit. Thanks.
 
Back
Top Bottom