Computer: AMD Ryzen Threadripper PRO 5955WX, Linux Mint 22.1, NVIDIA RTX A4000
Game: Heretic
Loaded Modules: The attached (FrozenChargeAttack.pk3), containing only the following zscript.zs
Code: Select all
class HeavyImp : HereticImp
{
Default
{
mass 1000;
}
}
1 Start Heretic, loading the above ZScript module on the command line with -file
2 Start the game at E1M1
3 Use the console to kill all monsters
4 Navigate to an open area in the water and summon a HeavyImp
5 When it charges you, shoot it with the Elven Wand, make sure you hit it dead on
Expected result:
It flinches or even reverses, then resumes the attack.
Actual result:
It stops moving (but not animating). It's essentially running, well flying, on the spot.
Discussion.
A_SkullAttack requires the actor to have velocity to work. If the velocity becomes zero, presumably this doesn't happen. With standard Gargoyles and Lost Souls, this isn't a problem; they don't weigh much and a bullet or wand strike usually pushes them back or simply slows them down. But with a heavy monster, such as the one I am making, I have found repeatedly that a hitscan impact can reduce their velocity to zero (or at any rate < 1.0). Thus it just stops moving. Thus it never gets a chance to return to the See state or otherwise leave the missile state.
(My current work around is to include #### # 0 { if (vel.x < 1.0) SetState(SeeState); } just before the Loop statement).