Shake during hit pause

I've been working on a mod in my spare time. I'm no stranger to coding so I've been able to figure out a lot just by looking at other mods and searching the forums. But I can't seem to figure out how to run a script during the hit pause period. What I want is to make the target shake when an attack connects. I figure I have to do something in the didhit script, but I'm having trouble figuring out how to determine if an entity is in the pause period. I've looked at the wiki, and various threads on these forums but I still haven't been able to determine how to get this information. Can someone point me in the right direction?
 
Welcome PendranomeCHAN!

I get what you are trying to do and it's a good idea. That said, there's no singular "on the ground, punched in the face" flag to speak of. It's a combination of logic with two flags and positioning checks. The first one is InPain. This flag is set TRUE when an entity is hit. It is set FALSE when they become idle or attack (the latter can only happen with a breakout special or script).

Code:
int stun = getentityproperty(<entity pointer>, "aiflag", "inpain");

You can probably see already the reason that won't do it alone - your script wouldn't know the difference between standing hitstun, flying through the air, or laying down. This is where the Falling flag comes in. It is TRUE when hit with an attack sufficient to knock down, and set FALSE when the entity switches to its rising animation:

Code:
int fall = getentityproperty(<entity pointer>, "aiflag", "falling");

Those two should handle your logic. If it were me, I'd still compare the Base position vs. Y position to make sure entity is on the ground, but if you know your way around code I think you can take it from here. Welcome to the community.

DC
 
O Ilusionista
Normally that would work just fine but I also added code that pushes the enemy back a bit when hit. The thing is that I don't want those to happen at the same time. I want the hit entity to shake first, and THEN get pushed back after they are done shaking.

Damon Caskey
Thanks for the warm welcome! I'll give it a go. I was looking at the wiki and I think it may be better to try this in the ondoattack script hook.
 
Back
Top Bottom