Headshot! It almost works!

Archive of the old editing forum
Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. This forum is archived - please use this set of forums to ask new questions.
Locked
CaptainToenail
Posts: 3975
Joined: Fri Jul 06, 2007 9:16 am

Headshot! It almost works!

Post by CaptainToenail »

I'm trying to make it so that a monster can only be killed by using a headshot, this is what I've got so far:
actor TestZombie
{
spawnid 4
obituary "%o was killed by a zombieman."
health 100000000000
radius 20
height 48
mass 100
speed 1
painchance 200
seesound "grunt/sight"
attacksound "grunt/attack"
painsound "grunt/pain"
deathsound "grunt/death"
activesound "grunt/active"
dropitem "Clip" 256
MONSTER
+FLOORCLIP
states
{
Spawn:
POSS A 1 A_Look
POSS A 0 A_SpawnItemEx (HeadTarget, 0, 0, 48, 0, 0, 0, 0, 48)
loop
See:
POSS A 1 A_Chase
POSS A 0 A_SpawnItemEx (HeadTarget, 0, 0, 48, 0, 0, 0, 0, 48)
loop
Death:
POSS H 5
POSS I 5 A_Scream
POSS J 5 A_NoBlocking
POSS K 5
POSS L -1
stop
}
}

Actor HeadTarget
{
radius 8
health 1
height 8
painchance 255
mass 1000000
alpha 1
bloodcolor green
+SHOOTABLE
+NOGRAVITY
+NOTELEPORT
states
{
Spawn:
TNT1 A 10
stop
Pain:
Death:
TNT1 A 1 A_KillMaster
stop
}
}
Unfortunately it doesn't kill the zombie :? You can tell your hitting the zombie's head becuase it gives off green blood, but it should kill the master which is the zombie but it doesn't :( Halp!
User avatar
Ghastly
... in rememberance ...
Posts: 6109
Joined: Fri Jul 06, 2007 2:34 pm

Re: Headshot! It almost works!

Post by Ghastly »

I don't think A_SpawnItemEx, by default, keeps the master/child system. The 16 flag (SXF_SETMASTER) passes on that data, though.

I also discovered while working on the updated Balor that for A_KillMaster and A_KillChildren to work, the master/child has to be killable (Doesn't look like a problem, in your case).
CaptainToenail
Posts: 3975
Joined: Fri Jul 06, 2007 9:16 am

Re: Headshot! It almost works!

Post by CaptainToenail »

I'm using flag 16 and flag 32
combined as needed by adding the numbers together,
it still doesn't work, even though the flag is there, that's the problem :x
User avatar
Nash
 
 
Posts: 17439
Joined: Mon Oct 27, 2003 12:07 am
Location: Kuala Lumpur, Malaysia
Contact:

Re: Headshot! It almost works!

Post by Nash »

Not trying to nitpick, but I just noticed that you didn't enclose the HeadTarget actor with quotes in your A_SpawnItemEx functions. Is this supposed to even work in the first place?

At any rate, it seems that you've done everything correctly but the master/children information doesn't seem to exist. :/

How about trying to spawn a small projectile that kills only the actor below it? Give the zombie a custom damage type that is weak to that custom projectile.
User avatar
Risen
Posts: 5263
Joined: Thu Jan 08, 2004 1:02 pm
Location: N44°30' W073°05'

Re: Headshot! It almost works!

Post by Risen »

Are you trying to do this with DECORATE only? If not, there are some solutions available to you via ACS.
User avatar
Cutmanmike
Posts: 11336
Joined: Mon Oct 06, 2003 3:41 pm
Operating System Version (Optional): Windows 10
Location: United Kingdom
Contact:

Re: Headshot! It almost works!

Post by Cutmanmike »

For a hack, you could have the head spawn a actor that uses A_Explode with a tiny damage radius and give it a damagetype that instantly kills the zombie but doesn't do any damage to anything else (including players)
CaptainToenail
Posts: 3975
Joined: Fri Jul 06, 2007 9:16 am

Re: Headshot! It almost works!

Post by CaptainToenail »

Hmm, yes, I'll try that, hopefully if this works my "Behead the Undead" project may become a reality, here's what it's based on:

http://www.youtube.com/watch?v=HBzM1nMg4PI

(this guy sucks, he's not using the crosshair! I got just above a million points on this challenge then I got fed up :lol: )

Edit: It works!!!!!! and no messy ACS either!
actor TestZombie
{
spawnid 4
obituary "%o was killed by a zombieman."
health 500
radius 20
height 48
mass 100
speed 1
painchance 200
seesound "grunt/sight"
attacksound "grunt/attack"
painsound "grunt/pain"
deathsound "grunt/death"
activesound "grunt/active"
dropitem "Clip" 256
damagefactor "HeadShot", 100
MONSTER
+FLOORCLIP
states
{
Spawn:
POSS A 1 A_Look
POSS A 0 A_SpawnItemEx ("HeadTarget", 0, 0, 48, 0, 0, 0, 0, 16)
loop
See:
POSS A 1 A_Chase
POSS A 0 A_SpawnItemEx ("HeadTarget", 0, 0, 48, 0, 0, 0, 0, 16)
loop
Death:
POSS H 5
POSS I 5 A_Scream
POSS J 5 A_NoBlocking
POSS K 5
POSS L -1
stop
}
}

Actor HeadTarget
{
radius 8
health 1
height 8
painchance 255
mass 1000000
alpha 1
bloodcolor green
DamageType HeadShot
+SHOOTABLE
+NOGRAVITY
+NOTELEPORT
+NODAMAGETHRUST
states
{
Spawn:
TNT1 A 10
stop
Pain:
Death:
TNT1 A 1 A_Explode(500,2,0)
stop
}
}

Actor NewDoomPlayer : DoomPlayer replaces Doomplayer
{
damagefactor "HeadShot", 0
}
User avatar
Cutmanmike
Posts: 11336
Joined: Mon Oct 06, 2003 3:41 pm
Operating System Version (Optional): Windows 10
Location: United Kingdom
Contact:

Re: Headshot! It almost works!

Post by Cutmanmike »

Now you just have to give him some animation ;)
CaptainToenail
Posts: 3975
Joined: Fri Jul 06, 2007 9:16 am

Re: Headshot! It almost works!

Post by CaptainToenail »

Yep, already have, the obvious choice was the Blood axe zombie, I shamelessly ripped the sprites from ZBlood, and I'll add some sounds possibly from Doom 3, does anyone have any good axe swing and hit sounds, and any decapitation sounds (you'll have to use your imagination here :lol: )

Hmm, and now I have to build the haunted mansion hall :x and make the shotgun, does anyone have those old Freedoom double barrel shotgun graphics? The silver ones.
User avatar
Kinsie
Posts: 7401
Joined: Fri Oct 22, 2004 9:22 am
Graphics Processor: nVidia with Vulkan support
Location: MAP33
Contact:

Re: Headshot! It almost works!

Post by Kinsie »

CaptainToenail wrote:does anyone have any good axe swing and hit sounds, and any decapitation sounds (you'll have to use your imagination here :lol: )
Here ya go.
CaptainToenail
Posts: 3975
Joined: Fri Jul 06, 2007 9:16 am

Re: Headshot! It almost works!

Post by CaptainToenail »

Perfect, thanks Kinsie
User avatar
Matt
Posts: 9696
Joined: Sun Jan 04, 2004 5:37 pm
Preferred Pronouns: They/Them
Operating System Version (Optional): Debian Bullseye
Location: Gotham City SAR, Wyld-Lands of the Lotus People, Dominionist PetroConfederacy of Saudi Canadia
Contact:

Re: Headshot! It almost works!

Post by Matt »

Maybe I'm a bit late, but IIRC what you've got in the OP should work without any explosions if the head target has the +ismonster flag.
Locked

Return to “Editing (Archive)”