"PainType" and "DeathType" properties

Moderator: GZDoom Developers

User avatar
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

Post by Major Cooke »

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.
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.
User avatar
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

Post by DBThanatos »

Is actually a great way to avoid creating specific "double" damage types.
User avatar
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

Post by Major Cooke »

Oh God, yes...

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
...can now be cut down to...

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
User avatar
Enjay
 
 
Posts: 26938
Joined: Tue Jul 15, 2003 4:58 pm
Location: Scotland
Contact:

Re: "PainType" and "DeathType" properties

Post by Enjay »

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 :P ) 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.
Gez
 
 
Posts: 17938
Joined: Fri Jul 06, 2007 3:22 pm

Re: "PainType" and "DeathType" properties

Post by Gez »

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.)
User avatar
Enjay
 
 
Posts: 26938
Joined: Tue Jul 15, 2003 4:58 pm
Location: Scotland
Contact:

Re: "PainType" and "DeathType" properties

Post by Enjay »

Gez wrote:The idea is that you can decouple damage factors, pain anim and death anims.
Ah, right. Now, that makes sense. Thanks.
User avatar
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

Post by Major Cooke »

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?
Gez
 
 
Posts: 17938
Joined: Fri Jul 06, 2007 3:22 pm

Re: "PainType" and "DeathType" properties

Post by Gez »

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.
User avatar
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

Post by Major Cooke »

I had to ensure that at least it wasn't just me first.
User avatar
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

Post by Major Cooke »

Fixed it. Please redownload.
User avatar
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

Post by Major Cooke »

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...
Gez
 
 
Posts: 17938
Joined: Fri Jul 06, 2007 3:22 pm

Re: "PainType" and "DeathType" properties

Post by Gez »

Fixed patch.
Last edited by Gez on Sat Feb 19, 2011 1:31 pm, edited 1 time in total.
User avatar
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

Post by Major Cooke »

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.
User avatar
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

Post by Major Cooke »

Okay, I think the last crashing obstacle has been flattened out.
User avatar
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

Post by Major Cooke »

Sorry for the bump but I figured I'd just say that this feature is finished and ready to go.
Post Reply

Return to “Closed Feature Suggestions [GZDoom]”