DamageType and death types

Discuss all aspects related to modding Zandronum here.
Post Reply
RobbyPants
 
Posts: 37
Joined: Wed Mar 13, 2013 12:53 am

DamageType and death types

#1

Post by RobbyPants » Sat Apr 20, 2013 2:00 am

So, I'm trying to make humans that turn into zombies if they're killed by the slime type, and that just die normally otherwise. If figured the way to do this would be to give them a Death.Slime: state and a Death: state, but it seems to always be triggering the slime state for some reason.

So, I decided to give all of my bullet puffs a special state (pierce) and have that trigger a normal death, and it seemed to work. The problem is, it's really cumbersome to do it that way, and other types (like fire) seem to trigger the slime death.

Is there something I'm missing? How do I get the default death to override the slime death?

Devonizer
New User
Posts: 10
Joined: Wed Jul 18, 2012 10:06 pm
Location: Canadia

RE: DamageType and death types

#2

Post by Devonizer » Sat Apr 20, 2013 6:23 am

That depends on if the "humans" are players or monsters I haven't done much with the custom deaths, but make sure you have damagefactor for slime in both the monster and puff/projectile, as well as damagetype slime set on the puff. The hackiest but likely the most reliable way to do it and not have other damagetypes trigger the one death state is using inventory items and jumpifinventory, having the pain state for slime give an item, or the puff give an item, or something like that, and then having a jumpifinventory check(s) in the death state to send the player to whichever death it needs to.

User avatar
President People
Forum Regular
Posts: 394
Joined: Tue Jun 05, 2012 8:12 am

RE: DamageType and death types

#3

Post by President People » Sat Apr 20, 2013 8:34 am

Do you have some example Decorate that you can show us?

By the sound of it, a simple Death.[damagetype] state should be working. Perhaps there's a typo, or maybe something that you forgot, but we can't know that unless we can see it.
Image
***MARATHON SKINS PACK V1.0.7***

I have been Roland, Beowulf, Achilles, Gilgamesh.
I have been called a hundred names and will be called
a thousand more before the world goes dim and cold.

RobbyPants
 
Posts: 37
Joined: Wed Mar 13, 2013 12:53 am

RE: DamageType and death types

#4

Post by RobbyPants » Mon Apr 22, 2013 12:47 am

President People wrote: Do you have some example Decorate that you can show us?
The human's death states in Decorate are:

Code: Select all

Death.Slime:
	POSS H 5
	POSS I 5 A_Scream
	POSS J 5 A_NoBlocking
	POSS K 5
	POSS L 0 A_SpawnItemEx("HumanCorpse1")
	Stop

Death:
	POSS H 5
	POSS I 5 A_Scream
	POSS J 5 A_NoBlocking
	POSS K 5
	POSS L -1
	Stop
			
XDeath:
	POSS M 5
	POSS N 5 A_XScream
	POSS O 5 A_NoBlocking
	POSS PQRST 5
	POSS U -1
	Stop
For the monsters I made sure I added the damage type to their melee attacks and to any "slime" missiles they fire.

Melee:

Code: Select all

Melee:
	POSS E 16 A_FaceTarget
	POSS F 8 A_CustomMeleeAttack(random(1,10)*2,"grunt/sight","","Slime")
	Goto See
Projectile

Code: Select all

actor SlimeBall : DoomImpBall
{
	Gravity 0.05
	Speed 12
	Damage 3
	-NOGRAVITY
	DamageType Slime
	SeeSound ""
	DeathSound ""
	States
	{
		Spawn:
			SLMS A 1 A_XScream
			Goto InFlight
			
		InFlight:
			SLMS AB 4
			Loop
			
		Death:
			SLMS C 6 A_XScream
			SLMS DEF 6
			Stop
	}
}

Watermelon
Zandrone
Posts: 1244
Joined: Thu Jun 28, 2012 9:07 pm
Location: Rwanda

RE: DamageType and death types

#5

Post by Watermelon » Fri Apr 26, 2013 12:53 am

As weird as it may sound, try putting the Death state above Death.Slime. It shouldn't make a difference but who knows. See if that works.

Try removing the Slime damage type from the Melee attack and see if that causes it to still work.

Also note that doing anything in the Death[.substate] state has very weird consequences if you try to turn a player from a Death state back to a living. There's huge potential for it to be messed up and not work properly. I advise trying to find another way if possible (maybe use ACS)

Lollipop
Zandrone
Posts: 1124
Joined: Tue Jul 24, 2012 10:34 am
Location: Denmark

RE: DamageType and death types

#6

Post by Lollipop » Sat Apr 27, 2013 4:52 pm

maybe use a powermorph?...
Combinebobnt wrote:i can see the forum league is taking off much better than the ctf ones
GalactusToday at 1:07 PM
are you getting uncomfortable jap
feeling something happen down there

RobbyPants
 
Posts: 37
Joined: Wed Mar 13, 2013 12:53 am

RE: DamageType and death types

#7

Post by RobbyPants » Tue Apr 30, 2013 1:11 am

Watermelon wrote: As weird as it may sound, try putting the Death state above Death.Slime. It shouldn't make a difference but who knows. See if that works.
I know that doesn't work because I already tried reversing the order.


That being said, perhaps I could do what I want with handing an inventory item to the creature if it's damaged by "slime", then check for it in the Death state. If I go this route, is there an easy way to make a projectile give an item to whoever it damages? Can I also do so with a melee attack?

Watermelon
Zandrone
Posts: 1244
Joined: Thu Jun 28, 2012 9:07 pm
Location: Rwanda

RE: DamageType and death types

#8

Post by Watermelon » Tue Apr 30, 2013 1:14 am

RobbyPants wrote:
Watermelon wrote: As weird as it may sound, try putting the Death state above Death.Slime. It shouldn't make a difference but who knows. See if that works.
I know that doesn't work because I already tried reversing the order.


That being said, perhaps I could do what I want with handing an inventory item to the creature if it's damaged by "slime", then check for it in the Death state. If I go this route, is there an easy way to make a projectile give an item to whoever it damages? Can I also do so with a melee attack?
Just so I haven't gotten confused along the way, are you trying to have the player technically die (enter the death state) and then come back to life as a zombie?

RobbyPants
 
Posts: 37
Joined: Wed Mar 13, 2013 12:53 am

RE: DamageType and death types

#9

Post by RobbyPants » Wed May 01, 2013 1:13 am

Watermelon wrote: Just so I haven't gotten confused along the way, are you trying to have the player technically die (enter the death state) and then come back to life as a zombie?
No, it's not the player; it's humans. I'm making three zombie actors (that replace the normal zombieman, shotgun guy, and chaingun guy). Then, I'm making three human actors that correspond to those zombie types. If the first type of human dies due to being hit by a zombie or slime (the zombies that replace imps and the mancubus shoot slime), then it rises as zombie type 1. If I shoot it (or it gets killed by a demon, or cultist, or whatever), then it just dies.

Does that make sense?

I actually have the whole dying and raising part down fairly well. It's just once I define a Death.slime: state, all methods of death activate it.

Watermelon
Zandrone
Posts: 1244
Joined: Thu Jun 28, 2012 9:07 pm
Location: Rwanda

RE: DamageType and death types

#10

Post by Watermelon » Wed May 01, 2013 2:57 am

RobbyPants wrote:
Watermelon wrote: Just so I haven't gotten confused along the way, are you trying to have the player technically die (enter the death state) and then come back to life as a zombie?
No, it's not the player; it's humans. I'm making three zombie actors (that replace the normal zombieman, shotgun guy, and chaingun guy). Then, I'm making three human actors that correspond to those zombie types. If the first type of human dies due to being hit by a zombie or slime (the zombies that replace imps and the mancubus shoot slime), then it rises as zombie type 1. If I shoot it (or it gets killed by a demon, or cultist, or whatever), then it just dies.

Does that make sense?

I actually have the whole dying and raising part down fairly well. It's just once I define a Death.slime: state, all methods of death activate it.
I think I got it now.

If its not working, one way you could do it is check the actor who killed it and see if they have a "PlayerItem" in their inventory. You can make one like:
Actor PlayerItem : Inventory { ... } and give it to players on start

This way if they're killed by a player you can tell. From here you could make a hacky thing with ACS.
Though I'd like to see why what you have isn't working. Did you upload a test wad somewhere? I'd like to play around with it and see whats up when I get a free chance.

Powerman
Forum Regular
Posts: 106
Joined: Mon Jul 02, 2012 2:45 am
Location: Places

RE: DamageType and death types

#11

Post by Powerman » Wed May 01, 2013 3:44 pm

Not knowing entirely what's going on. DO you have a painchance for slime? or you may sadly have to use something like A_jumpif statements
Last edited by Powerman on Wed May 01, 2013 3:46 pm, edited 1 time in total.
http://brutaldoomwads.weebly.com/
Also Now Every Wednesday is Brutal doom Co-op! Just Look For powerman in the name!

RobbyPants
 
Posts: 37
Joined: Wed Mar 13, 2013 12:53 am

RE: DamageType and death types

#12

Post by RobbyPants » Thu May 02, 2013 1:30 am

Ha! It works! Okay, so it turns out I'm stupid and I have some explaining to do:

So, I want to use Translate to make palette swaps of my humans and zombies so I can get the biggest bang for my buck for my sprites (to make it look like there are lots of different humans/zombies). So, for the time being, I have four humans (Human1 - Human4) and four corresponding zombies (SlowZombie1 - SlowZombie4).

When HumanX dies from type Slime, it spawns HumanCorpseX, which sits there for a bit, then spawns SlowZombieX after going through a rising animation. This part worked pretty well.

Now, to keep me from having to put all of these different actors around the map (I plan on having at least 15 different palette swaps when I'm done), I made a RandomSpawner simply called "Human" that would spawn Human1 -Human4 with equal probability. I did the same for SlowZombie. So far so good.

My problem came from when I started mucking around with the damage types. I'd add Death.Slime to Human1, then test it out in the game by summoning Human (the RandomSpawner and not the actual actor that I had just modified in Slade). So, this meant that there was a 75% chance I was going to summon a human that didn't have Death.Slime defined.


TL;DR: I've had this working for quite some time and didn't know it! Thanks for your help and bearing with me on this, guys!
Watermelon wrote: If its not working, one way you could do it is check the actor who killed it and see if they have a "PlayerItem" in their inventory. You can make one like:
Actor PlayerItem : Inventory { ... } and give it to players on start
So, how do you do this exactly? I'm not sure how to figure out who damaged or killed something. Is this done via ACS or DECORATE?

Watermelon wrote:Though I'd like to see why what you have isn't working. Did you upload a test wad somewhere? I'd like to play around with it and see whats up when I get a free chance.
Right now it's very much a work in progress, but it's mostly functional and playable. I don't have any maps yet (I have a friend who wants to make them), so I'm working on the WAD and sprites. That being said, where do people tend to host these things?

___

By the way, for anyone who wants to see the code I have for the human and the corpse that makes a zombie, here it is:

Code: Select all

actor Human1 21801
{
	SpawnID 255
	+FRIENDLY
	-ISMONSTER
	+SHOOTABLE 
	+SOLID 
	+CANPUSHWALLS 
	+CANUSEWALLS 
	+CANPASS
	Translation "112:127=64:79", "128:143=64:79", "152:159=144:151"
	Speed 10
	Health 30
	Radius 16
	Height 56
	PainChance 200
	+FLOORCLIP
	SeeSound "grunt/sight"
	AttackSound "grunt/attack"
	ActiveSound "grunt/active"
	DeathSound "*death"
	PainSound "*death"
	DropItem ""
	States
	{
		Spawn:
			POSS AA 3 A_Wander
			POSS A 0 A_Look
			POSS BB 3 A_Wander
			POSS B 0 A_Look
			POSS CC 3 A_Wander
			POSS C 0 A_Look
			POSS DD 3 A_Wander
			POSS D 0 A_Look
			Loop
			
		See:
			POSS AABBCCDD 4 A_Chase
			Loop
			
		Melee:
			POSS A 0 A_Jump (170, "RunAway")
			POSS E 8 A_FaceTarget
			POSS F 8 A_CustomMeleeAttack(random(1,10)*2,"grunt/sight","")
			Goto RunAway
			
		Missile:
			Goto RunAway
			
		RunAway:
			POSS A 4 A_FaceTarget
			POSS A 0 A_Scream
			//turn 45 degrees four times
			POSS A 3 ACS_Execute(123, 0, 0, 0, 0)
			POSS B 3 ACS_Execute(123, 0, 0, 0, 0)
			POSS C 3 ACS_Execute(123, 0, 0, 0, 0)
			POSS D 3 ACS_Execute(123, 0, 0, 0, 0)
			//run
			POSS A 3 A_Recoil(-3)
			POSS B 3 A_Recoil(-3)
			POSS C 3 A_Recoil(-3)
			POSS D 3 A_Recoil(-3)
			POSS A 3 A_Recoil(-3)
			POSS B 3 A_Recoil(-3)
			POSS C 3 A_Recoil(-3)
			POSS D 3 A_Recoil(-3)
			Goto See
			
		Pain:
			POSS G 3
			POSS G 3 A_Pain
			Goto See
	
		Death:
			POSS H 5
			POSS I 5 A_Scream
			POSS J 5 A_NoBlocking
			POSS K 5
			POSS L -1
			Stop
			
		Death.Slime:
			POSS H 5
			POSS I 5 A_Scream
			POSS J 5 A_NoBlocking
			POSS K 5
			POSS L 0 A_SpawnItemEx("HumanCorpse1")
			Stop
			
		XDeath:
			POSS M 5
			POSS N 5 A_XScream
			POSS O 5 A_NoBlocking
			POSS PQRST 5
			POSS U -1
			Stop
			
		  Raise:
			POSS K 5
			POSS JIH 5
			Goto See
	}
}

actor HumanCorpse1 21901
{
	+SHOOTABLE
	+CANPASS
	+SOLID
	+LOOKALLAROUND
	Translation "112:127=64:79", "128:143=64:79", "152:159=144:151"
	Health 50
	Height 16
	Radius 20
	PainChance 255
	PainSound ""
	States
	{	
		Spawn:
			POSS L 10 A_Look
			Loop
			
		See:
			POSS L 35
			POSS A 0 A_Jump (51, "RiseAsZombie")
			Loop
			
		RiseAsZombie:
			POSS K 5
			POSS JIH 5
			POSS H 1 A_NoBlocking
			POSS H 0 A_SpawnItemEx("SlowZombie1")
			Stop
		
		Pain:
			POSS K 3
			POSS K 3 A_Pain
			Goto Spawn
		
		Death:
			POSS ST 5
			POSS U -1
			Stop
	}
}
For the time being, I'm using existing zombieman sprites just for a proof of concept. I'm working on making the zombie sprites currently.
Last edited by RobbyPants on Thu May 02, 2013 1:36 am, edited 1 time in total.

Watermelon
Zandrone
Posts: 1244
Joined: Thu Jun 28, 2012 9:07 pm
Location: Rwanda

RE: DamageType and death types

#13

Post by Watermelon » Thu May 02, 2013 2:20 am

Glad to see you got it working. Don't know if this will be of any help anymore but here we go:
RobbyPants wrote:
Watermelon wrote: If its not working, one way you could do it is check the actor who killed it and see if they have a "PlayerItem" in their inventory. You can make one like:
Actor PlayerItem : Inventory { ... } and give it to players on start
So, how do you do this exactly? I'm not sure how to figure out who damaged or killed something. Is this done via ACS or DECORATE?
On second thought, I don't know if zandronum has A_JumpIfInTargetInventory available. There is a hacky workaround but it's a complete mess.
This is what I get for working with zdoom too much

Lollipop
Zandrone
Posts: 1124
Joined: Tue Jul 24, 2012 10:34 am
Location: Denmark

RE: DamageType and death types

#14

Post by Lollipop » Thu May 02, 2013 4:03 pm

well, last I used that command it worked, so I cant see how zan don't support it :razz:
Combinebobnt wrote:i can see the forum league is taking off much better than the ctf ones
GalactusToday at 1:07 PM
are you getting uncomfortable jap
feeling something happen down there

Post Reply