In custom ZScript code, it's practically become a regular thing that every single call to DamageMobj needs a null check afterwards because some actors will simply stop existing and become null immediately as they have no Death state defined. Some people don't know this, and it ends up causing VM aborts, and it has to be patched up. Besides, something like this makes it difficult to perform other operations afterwards, such as spawning/tracing blood from the actor after it takes damage.
I don't understand why the base Actor class can't just have a simple Death state that's a single TNT1 A 1. Would that cause some sort of problem?
Please give actors a default Death state
Moderator: GZDoom Developers
-
- Posts: 3886
- Joined: Fri Feb 08, 2008 9:15 am
- Preferred Pronouns: She/Her
- Operating System Version (Optional): (btw I use) Arch
- Graphics Processor: nVidia with Vulkan support
- Location: Vigo, Galicia
-
- Lead GZDoom+Raze Developer
- Posts: 49183
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
Re: Please give actors a default Death state
A default death state cannot be added because some features check the presence of the state. What could be done is to switch to a dummy state if a null state would be set otherwise.
-
- Posts: 317
- Joined: Mon Jul 16, 2012 2:02 am
Re: Please give actors a default Death state
Would going in the other direction, namely making actors non-destroyable by regular damage by default not achieve the actually desired result, actors not being removed unless they are supposed to be killed?
-
- Posts: 2119
- Joined: Thu May 02, 2013 1:27 am
- Operating System Version (Optional): Windows 10
- Graphics Processor: nVidia with Vulkan support
- Location: Brazil
Re: Please give actors a default Death state
That's not what the issue is here. The issue is actors that are supposed to be destroyable, like monsters. It's not uncommon for monster mods with "fancier" effects to spawn something like an explosion effect for monsters like lost souls and instantly remove the monster actor, and that'll trigger this issue.
-
- Posts: 3886
- Joined: Fri Feb 08, 2008 9:15 am
- Preferred Pronouns: She/Her
- Operating System Version (Optional): (btw I use) Arch
- Graphics Processor: nVidia with Vulkan support
- Location: Vigo, Galicia
Re: Please give actors a default Death state
Honestly, the real issue is that any pointers to a shootable actor like this get instantly NULL'd within the call to DamageMobj so it's practically impossible to do anything with them after the fact.
-
- Lead GZDoom+Raze Developer
- Posts: 49183
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
Re: Please give actors a default Death state
In that case make it a habit to inherit from a custom actor that defines a death state.
We cannot change the original for backwards compatibility reasons.
We cannot change the original for backwards compatibility reasons.