SetActorState can cause ghosts

Archive of the old editing forum
Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. This forum is archived - please use this set of forums to ask new questions.
Locked
User avatar
Enjay
 
 
Posts: 26931
Joined: Tue Jul 15, 2003 4:58 pm
Location: Scotland
Contact:

SetActorState can cause ghosts

Post by Enjay »

I'm just flagging this up because it just happened to me and it possibly needs some consideration. I don't think it is a bug but it may be viewed as undesirable behaviour and, perhaps, Graf or Randy may want to treat it as a bug.


Anyway, I was messing with a script that did an enemy some damage and I wanted to make sure that the enemy (which has a very low pain chance) would go into its pain state. So, I used SetActorState to force the enemy into its pain state after damaging it. However, in the course of me messing around, I noticed that the enemy didn't die no matter how often I damaged it. Then I noticed that it had also become immune to "kill monsters" and MDK.

What happened (I think) is that the script killed the enemy but them immediately forced him into his pain state (which then went back to his see state) and the enemy had now become a ghost in the same style as those of an archvile-resurrected crushed body.

So, given that ghosts are generally viewed as being undesirable, I thought that it might be worth flagging up but, like I said, it's probably not a bug as such, more a case of "don't do that". It's something to be aware of though and it might be something that Graf or Randy will want to plug.
Gez
 
 
Posts: 17938
Joined: Fri Jul 06, 2007 3:22 pm

Re: SetActorState can cause ghosts

Post by Gez »

Enjay wrote:What happened (I think) is that the script killed the enemy but them immediately forced him into his pain state (which then went back to his see state) and the enemy had now become a ghost in the same style as those of an archvile-resurrected crushed body.
Don't think so, unless it passed through walls.
User avatar
NeuralStunner
 
 
Posts: 12328
Joined: Tue Jul 21, 2009 12:04 pm
Preferred Pronouns: No Preference
Operating System Version (Optional): Windows 11
Graphics Processor: nVidia with Vulkan support
Location: capital N, capital S, no space
Contact:

Re: SetActorState can cause ghosts

Post by NeuralStunner »

If it was killed but setnt back to Pain, it's likely walking around with 0 Health and the +CORPSE flag (among other things).
User avatar
Ceeb
Posts: 5125
Joined: Wed Jun 11, 2008 4:07 pm
Location: Castle Wut

Re: SetActorState can cause ghosts

Post by Ceeb »

Enjay wrote:it's probably not a bug as such, more a case of "don't do that".
My money is on that, it's a user problem, not the engine's fault. All it knows is that while the enemy is dead, it can't be killed again, but it's in it's see state. :shrug:
Gez
 
 
Posts: 17938
Joined: Fri Jul 06, 2007 3:22 pm

Re: SetActorState can cause ghosts

Post by Gez »

Well, the [wiki]SetActorState[/wiki] documentation does say "Note that you should refrain from using this function for any actors that use the monster AI, or unpredictable results could occur." :wink:
User avatar
Enjay
 
 
Posts: 26931
Joined: Tue Jul 15, 2003 4:58 pm
Location: Scotland
Contact:

Re: SetActorState can cause ghosts

Post by Enjay »

Gez wrote:Don't think so, unless it passed through walls.
Ah, right enough, it was still solid. Presumably it merely has 0 health and therefore can no longer be killed then.
Gez wrote:Well, the [wiki]SetActorState[/wiki] documentation does say "Note that you should refrain from using this function for any actors that use the monster AI, or unpredictable results could occur." :wink:
Fair enough. :)
Locked

Return to “Editing (Archive)”