If a flying monster using A_SkullAttack() is stopped by a hitscan impact,
not slowed down or put into reverse but just
stopped, it stays motionless in the missile state loop and never exits. The wing animations (or whatever) still work, but it no longer moves.
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;
}
}
Steps:
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).
If a flying monster using A_SkullAttack() is stopped by a hitscan impact, [b][i]not[/i][/b] slowed down or put into reverse but just [i]stopped[/i], it stays motionless in the missile state loop and never exits. The wing animations (or whatever) still work, but it no longer moves.
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]class HeavyImp : HereticImp
{
Default
{
mass 1000;
}
}[/code]
[b]Steps[/b]:
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
[b]Expected result[/b]:
It flinches or even reverses, then resumes the attack.
[b]Actual result[/b]:
It stops moving (but not animating). It's essentially running, well flying, on the spot.
[b]Discussion[/b].
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 [b]#### # 0 { if (vel.x < 1.0) SetState(SeeState); } [/b]just before the [i]Loop[/i] statement).