Hi, I'm trying to implement a Quake-esque hitmarker sound on enemies by giving all the enemies a 100% pain chance, but it's messing with their movement and I'm not sure how to fix it.
Code: Select all
ACTOR GorePinky : Demon replaces Demon
{
Painchance 256
states
{
Pain:
TNT1 a 0 a_playsound("gore/hitmarker", 0, 0.8, false, 0.3, false)
TNT1 a 0 a_jump(180, "TruePain")
goto see
TruePain:
SARG H 2 Fast
SARG H 2 Fast A_Pain
Goto See
This pinky has a 100% pain chance so that the sound will always play, but in order to retain the pinky's original pain behavior, there's a jump at the end which can stun, or not stun the pinky. Just like normal. The problem is that with all these checks and state jumps, the pinky is now less responsive when coming out of Pain. When I hit the pinky with lots of projectiles at once, like in a shotgun blast, the pinky will stutter and jump to a new position while doing the painstate calculations. Sometimes I'll kill a pinky and his death animation will appear several feet away from where I shot him. I'm not sure how to keep the hitmarker functionality while retaining smooth movement for the monster. Any ideas?