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.