header general

Hell Warrior's fixed (?) behaviour

  • JohnnyTheWolf
  • JohnnyTheWolf's Avatar Topic Author
  • Shotgunner
  • Shotgunner
More
2 years 7 months ago - 2 years 7 months ago #1 by JohnnyTheWolf
Hell Warrior's fixed (?) behaviour was created by JohnnyTheWolf
Hi,

First time posting here.

I have been making use of the Hell Warrior in a personal mod and I have come to realize that on occasions, the enemy becomes temporary invincible even when its guard is down and it does not appear to take any damage for a brief period. I was not sure what caused the issue to happen nor what caused it to stop; I thought hitting the enemy with different attacks was it, but apparently, it just stopped on its own. I asked for help on ZDoom forums, and user Enjay came up with the following solution:

I suspect I know what's happening. Several state sequences in the enemy set the monster to be invulnerable. However, it might be the case that one or more of these can be interrupted after invulnerability has been set but before it has used an "A_UnSetInvulnerable();" pointer. To be fair, the code looks OK, but I guess it must be happening. Perhaps if it starts a missile attack but then the player gets in close enough for a melee attack it might jump to the melee state label... maybe?

With a monster like this, a "belt and braces" approach would be to add an "A_UnSetInvulnerable()" pointer to the start of the "see" state sequence (and any other sequence where you definitely do not want it to be invulnerable) so that you can guarantee that whenever it goes to this sequence, it will be vulnerable. You could set it up to always run:

Code:
 See:     HWAR A 0 A_UnSetInvulnerable();    HWAR AABBCCDD 3 A_Chase();     Loop;
But it should only be needed once so
Code:
See:     HWAR A 0 A_UnSetInvulnerable();    HWAR AABBCCDD 3 A_Chase();     goto See+1;
should also be OK.

https://forum.zdoom.org/viewtopic.php?f=122&t=73751

So far, Enjay's proposed solution seems to have done the trick. As such, I felt like sharing this finding with the people at Realm667 so that an updated version of the monster could be uploaded.
Last edit: 2 years 7 months ago by JohnnyTheWolf.

Please Log in or Create an account to join the conversation.

  • Gothic
  • Gothic's Avatar
  • Moderator
  • Moderator
More
2 years 7 months ago #2 by Gothic

Please Log in or Create an account to join the conversation.

  • JohnnyTheWolf
  • JohnnyTheWolf's Avatar Topic Author
  • Shotgunner
  • Shotgunner
More
2 years 7 months ago #3 by JohnnyTheWolf
Replied by JohnnyTheWolf on topic Hell Warrior's fixed (?) behaviour
Awesome! Thank you!

Please Log in or Create an account to join the conversation.