"PainType" and "DeathType" properties
Moderator: GZDoom Developers
- Major Cooke
- Posts: 8206
- Joined: Sun Jan 28, 2007 3:55 pm
- Preferred Pronouns: He/Him
- Operating System Version (Optional): Windows 10
- Graphics Processor: nVidia with Vulkan support
- Location: GZBoomer Town
- Contact:
"PainType" and "DeathType" properties
First off: If it weren't for Gez, this wouldn't be happening right now. Big thanks to him for taking time out to help me with this and setting it straight.
-----
This here adds two new actor properties:
PainType: When specified, the projectile causes the monster to jump to the specified pain state when hurt instead of the defined DamageType.
DeathType: When specified, the projectile causes the monster to go to the death given in this field instead of the DamageType property.
This feature is now completed and ready to be delivered in full.
-----
This here adds two new actor properties:
PainType: When specified, the projectile causes the monster to jump to the specified pain state when hurt instead of the defined DamageType.
DeathType: When specified, the projectile causes the monster to go to the death given in this field instead of the DamageType property.
This feature is now completed and ready to be delivered in full.
- Attachments
-
paindeathtype4.zip
- Updated to work with the latest Zdoom revision.
- (1.21 KiB) Downloaded 44 times
Last edited by Major Cooke on Mon Jun 13, 2011 10:41 am, edited 6 times in total.
- DBThanatos
- Posts: 3101
- Joined: Fri Apr 14, 2006 3:17 pm
- Location: in "the darkness that lurks in our mind"
Re: "PainType" and "DeathType" properties
Is actually a great way to avoid creating specific "double" damage types.
- Major Cooke
- Posts: 8206
- Joined: Sun Jan 28, 2007 3:55 pm
- Preferred Pronouns: He/Him
- Operating System Version (Optional): Windows 10
- Graphics Processor: nVidia with Vulkan support
- Location: GZBoomer Town
- Contact:
Re: "PainType" and "DeathType" properties
Oh God, yes...
See, things like this:
...can now be cut down to...
See, things like this:
Code: Select all
Death.UnholyDisint:
Death.PlasmaDisint:
Disintegrate:
"####" "#" 0 Thing_SetTranslation(0,50)
"####" "#" 1 A_FadeOut(0.015)
"####" "#" 0 A_ChangeFlag("NOINTERACTION",1)
"####" "#" 0 A_Stop
"####" "#" 0 A_Fall
"####" "#" 0 A_SpawnItemEx("DisintegrateShadowMedium",0,0,30,0,0,0,0,32)
"####" "#" 0 A_SpawnItemEx("DisintegrateSparksMedium",0,0,30,0,0,0,0,32)
"####" "#" 2 A_FadeOut(0.03)
Goto Disintegrate+6
Code: Select all
Disintegrate:
"####" "#" 0 Thing_SetTranslation(0,50)
"####" "#" 1 A_FadeOut(0.015)
"####" "#" 0 A_ChangeFlag("NOINTERACTION",1)
"####" "#" 0 A_Stop
"####" "#" 0 A_Fall
"####" "#" 0 A_SpawnItemEx("DisintegrateShadowMedium",0,0,30,0,0,0,0,32)
"####" "#" 0 A_SpawnItemEx("DisintegrateSparksMedium",0,0,30,0,0,0,0,32)
"####" "#" 2 A_FadeOut(0.03)
Goto Disintegrate+6
Re: "PainType" and "DeathType" properties
Forgive me for being thick here but I don't see the advantage.
Perhaps I'm just not understanding this properly but, for example, the example you gave (bad sentence
) may be simpler but surely it would require entries of similar size to the saving in that one actor to be placed elsewhere (eg the projectile actor?). I'm not sure how to use this to actually save anything or do anything desperately different from before.
I'm not trying to be awkward. I'm sure there must be an advantage somewhere but I'm just not seeing it ATM.
Perhaps I'm just not understanding this properly but, for example, the example you gave (bad sentence

I'm not trying to be awkward. I'm sure there must be an advantage somewhere but I'm just not seeing it ATM.
Re: "PainType" and "DeathType" properties
The idea is that you can decouple damage factors, pain anim and death anims.
When you start using pain states for various effects, have a variety of death animations for various means of death, and use plenty of damage factors to control monsters' friendly fire and the likes, you can obtain silly things as a result. With the proliferation of combinations, you increase the likelihood that you'll forget to give a damage factor to one monster or something like that.
With these things, instead of having DamageType that governs both DamageFactor, PainState and DeathState, you have DamageType <--> DamageFactor, PainType <--> PainState, and DeathType <--> DeathState. (Of course, for backward compatibility reasons, DamageType is still the fallback if the latter two aren't defined.)
When you start using pain states for various effects, have a variety of death animations for various means of death, and use plenty of damage factors to control monsters' friendly fire and the likes, you can obtain silly things as a result. With the proliferation of combinations, you increase the likelihood that you'll forget to give a damage factor to one monster or something like that.
With these things, instead of having DamageType that governs both DamageFactor, PainState and DeathState, you have DamageType <--> DamageFactor, PainType <--> PainState, and DeathType <--> DeathState. (Of course, for backward compatibility reasons, DamageType is still the fallback if the latter two aren't defined.)
Re: "PainType" and "DeathType" properties
Ah, right. Now, that makes sense. Thanks.Gez wrote:The idea is that you can decouple damage factors, pain anim and death anims.
- Major Cooke
- Posts: 8206
- Joined: Sun Jan 28, 2007 3:55 pm
- Preferred Pronouns: He/Him
- Operating System Version (Optional): Windows 10
- Graphics Processor: nVidia with Vulkan support
- Location: GZBoomer Town
- Contact:
Re: "PainType" and "DeathType" properties
AEoD has countless numbers of monsters with coupled death states, for example... That's just a bloody nightmare.
Speaking of, Gez, you got my PM, right?
Speaking of, Gez, you got my PM, right?
Re: "PainType" and "DeathType" properties
The one about Thing_Destroy()? Yeah, I got it, but no, I haven't looked into it. You didn't tell me any useful info (like, does it happen with that patch or without). If it happens only with the patch, then why did you went ahead and suggested it as-is? If it happens also without, why didn't you make a bug report thread?
Anyway, presumably, all it's missing is a NULL pointer check.
Anyway, presumably, all it's missing is a NULL pointer check.
- Major Cooke
- Posts: 8206
- Joined: Sun Jan 28, 2007 3:55 pm
- Preferred Pronouns: He/Him
- Operating System Version (Optional): Windows 10
- Graphics Processor: nVidia with Vulkan support
- Location: GZBoomer Town
- Contact:
Re: "PainType" and "DeathType" properties
I had to ensure that at least it wasn't just me first.
- Major Cooke
- Posts: 8206
- Joined: Sun Jan 28, 2007 3:55 pm
- Preferred Pronouns: He/Him
- Operating System Version (Optional): Windows 10
- Graphics Processor: nVidia with Vulkan support
- Location: GZBoomer Town
- Contact:
Re: "PainType" and "DeathType" properties
Fixed it. Please redownload.
- Major Cooke
- Posts: 8206
- Joined: Sun Jan 28, 2007 3:55 pm
- Preferred Pronouns: He/Him
- Operating System Version (Optional): Windows 10
- Graphics Processor: nVidia with Vulkan support
- Location: GZBoomer Town
- Contact:
Re: "PainType" and "DeathType" properties
Found another bug: Receiving damage from damaging floors (i.e. slime pits, lava, etc.) causes the game to crash. I've gotten that sucker pinpointed, now to fix it...
Re: "PainType" and "DeathType" properties
Fixed patch.
Last edited by Gez on Sat Feb 19, 2011 1:31 pm, edited 1 time in total.
- Major Cooke
- Posts: 8206
- Joined: Sun Jan 28, 2007 3:55 pm
- Preferred Pronouns: He/Him
- Operating System Version (Optional): Windows 10
- Graphics Processor: nVidia with Vulkan support
- Location: GZBoomer Town
- Contact:
Re: "PainType" and "DeathType" properties
It didn't have the NULL pointer checks for Thing_Destroy when I used it, but I fixed it for you. It's in the first post now.
- Major Cooke
- Posts: 8206
- Joined: Sun Jan 28, 2007 3:55 pm
- Preferred Pronouns: He/Him
- Operating System Version (Optional): Windows 10
- Graphics Processor: nVidia with Vulkan support
- Location: GZBoomer Town
- Contact:
Re: "PainType" and "DeathType" properties
Okay, I think the last crashing obstacle has been flattened out.
- Major Cooke
- Posts: 8206
- Joined: Sun Jan 28, 2007 3:55 pm
- Preferred Pronouns: He/Him
- Operating System Version (Optional): Windows 10
- Graphics Processor: nVidia with Vulkan support
- Location: GZBoomer Town
- Contact:
Re: "PainType" and "DeathType" properties
Sorry for the bump but I figured I'd just say that this feature is finished and ready to go.