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.
SetActorState can cause ghosts
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.
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.
Re: SetActorState can cause ghosts
Don't think so, unless it passed through walls.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.
- 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
If it was killed but setnt back to Pain, it's likely walking around with 0 Health and the +CORPSE flag (among other things).
Re: SetActorState can cause ghosts
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.Enjay wrote:it's probably not a bug as such, more a case of "don't do that".

Re: SetActorState can cause ghosts
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." 

Re: SetActorState can cause ghosts
Ah, right enough, it was still solid. Presumably it merely has 0 health and therefore can no longer be killed then.Gez wrote:Don't think so, unless it passed through walls.
Fair enough.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."
