Another headshot zombie

Discuss anything ZDoom-related that doesn't fall into one of the other categories.

Another headshot zombie

Postby Matt » Thu May 31, 2007 12:35 am

Code: Select allExpand view
actor HeadZombie : ZombieMan replaces ZombieMan
{
   health 60
   height 40
   radius 16
   states
   {
   spawn:
      POSS E 0
      POSS A 0 A_SpawnItemEx ("ZombieHead", 6, 0, 40, 0, 0, 0, 0, 16)
      POSS A 4 A_Look
      POSS A 0 A_SpawnItemEx ("ZombieHead", 6, 0, 40, 0, 0, 0, 0, 16)
      POSS A 4 A_Look
      POSS B 0 A_SpawnItemEx ("ZombieHead", 6, 0, 40, 0, 0, 0, 0, 16)
      POSS B 4 A_Look
      POSS B 0 A_SpawnItemEx ("ZombieHead", 6, 0, 40, 0, 0, 0, 0, 16)
      POSS B 4 A_Look
      loop
   missile:
      POSS E 0 A_SpawnItemEx ("ZombieHead", -2, 0, 40, 0, 0, 0, 0, 16)
      POSS E 4 A_FaceTarget
      POSS E 0 A_SpawnItemEx ("ZombieHead", -2, 0, 40, 0, 0, 0, 0, 16)
      POSS E 4 A_FaceTarget
      POSS E 0 A_SpawnItemEx ("ZombieHead", -2, 0, 40, 0, 0, 0, 0, 16)
      POSS E 4 A_FaceTarget
      POSS F 0 A_SpawnItemEx ("ZombieHead", -2, 0, 40, 0, 0, 0, 0, 16)
      POSS F 4 bright A_PosAttack
      POSS E 0 A_SpawnItemEx ("ZombieHead", -2, 0, 40, 0, 0, 0, 0, 16)
      POSS E 4
      POSS E 0 A_SpawnItemEx ("ZombieHead", -2, 0, 40, 0, 0, 0, 0, 16)
      POSS E 4
      goto see
   pain:
      POSS E 0 A_SpawnItemEx ("ZombieHead", -2, 0, 40, 0, 0, 0, 0, 16)
      POSS E 4 HealThing (999)
      POSS E 0 A_SpawnItemEx ("ZombieHead", -2, 0, 40, 0, 0, 0, 0, 16)
      POSS E 4 A_Pain
      goto see
   see:
      POSS A 0 A_SpawnItemEx ("ZombieHead", 6, 0, 40, 2, 0, 0, 0, 16)
      POSS A 4 A_Chase
      POSS B 0 A_SpawnItemEx ("ZombieHead", 6, 0, 40, 2, 0, 0, 0, 16)
      POSS B 4 A_Chase
      POSS C 0 A_SpawnItemEx ("ZombieHead", 6, 0, 40, 2, 0, 0, 0, 16)
      POSS C 4 A_Chase
      POSS D 0 A_SpawnItemEx ("ZombieHead", 6, 0, 40, 2, 0, 0, 0, 16)
      POSS D 4 A_Chase
      loop
   }
}
actor ZombieHead
{
   +ismonster
   -countkill
   +shootable
   +nogravity
   +nodamagethrust
   +noradiusdmg
   health 10
   height 14
   radius 10
   states
   {
   spawn:
      TNT1 A 4
      stop
   death:
      TNT1 A 0 A_KillMaster
      TNT1 AAAAA 1 A_SpawnItemEx ("Blood", random(-2,2),random(-2,2),random(-4,6), random(-2,2),random(-2,2),random(2,6))
      stop
   }
}
Last edited by Matt on Thu May 31, 2007 1:23 am, edited 1 time in total.
User avatar
Matt
Putting the XD into *xdeath since 2007
 
Joined: 04 Jan 2004
Location: Gotham City SAR, Wyld-Lands of the Lotus People, Dominionist PetroConfederacy of Saudi Canadia

Postby XutaWoo » Thu May 31, 2007 12:43 am

Niiiice.
User avatar
XutaWoo
one day when going to see the rabbit, there was a previous visitor ...
 
Joined: 30 Dec 2006
Location: beautiful hills of those who are friends

Postby Nash » Thu May 31, 2007 1:04 am

Nice. The Z coordinate has to be adjusted a bit, but still nice.
User avatar
Nash
 
 
 
Joined: 27 Oct 2003
Location: Kuala Lumpur, Malaysia
Github ID: nashmuhandes

Postby Matt » Thu May 31, 2007 1:12 am

I'm more concerned about the X myself... testing this out in freeze mode I notice a few situations where the target area is a little behind where the head is on the sprite... nothing a 6-8-unit shift forward shouldn't fix though.
User avatar
Matt
Putting the XD into *xdeath since 2007
 
Joined: 04 Jan 2004
Location: Gotham City SAR, Wyld-Lands of the Lotus People, Dominionist PetroConfederacy of Saudi Canadia

Postby Nash » Thu May 31, 2007 1:14 am

How well would this work for much faster monsters?
User avatar
Nash
 
 
 
Joined: 27 Oct 2003
Location: Kuala Lumpur, Malaysia
Github ID: nashmuhandes

Postby Matt » Thu May 31, 2007 1:25 am

I haven't tried, though it shouldn't be much more than creating a shorter-lived head actor and repeating the spawn more often. And possibly increasing the forward momentum given to the head in the see state...

Also, I've just edited the original to make it a little easier. Still not easy, but better than spraying with the chaingun hoping one will land...
User avatar
Matt
Putting the XD into *xdeath since 2007
 
Joined: 04 Jan 2004
Location: Gotham City SAR, Wyld-Lands of the Lotus People, Dominionist PetroConfederacy of Saudi Canadia

Postby TheDarkArchon » Thu May 31, 2007 4:24 am

However, Caligari (I think) did headshots by a similar method ages ago. http://forum.zdoom.org/potato.php?t=6905&start=0
User avatar
TheDarkArchon
OUT!
 
Joined: 07 Aug 2004
Location: Some cold place

Postby Nash » Thu May 31, 2007 4:50 am

Caligari's method wasn't too fancy becaused it required TIDs.

Lilwhitemouse's, while much nicer, required using ACS and if I'm not mistaken, also TIDs.

Vaecrius' is nice but it does look a little tedious because of all the spawning in between.
User avatar
Nash
 
 
 
Joined: 27 Oct 2003
Location: Kuala Lumpur, Malaysia
Github ID: nashmuhandes

Postby Ryan Cordell » Thu May 31, 2007 8:29 am

Although nice, I still plan on staying with ACS, since I'm a bit of a supporter for the 'clean and effective' style of coding, and looking at the way the actor is jumbled with A_SpawnItemEx -es for it, I'll go through the ACS routine, but it was a nice take on it.
User avatar
Ryan Cordell
PDA Man
 
Joined: 06 Feb 2005
Location: Capital of Explodistan
Operating System: Windows 10/8.1/8/201x 64-bit
Graphics Processor: nVidia (Modern GZDoom)

Postby Matt » Thu May 31, 2007 10:24 am

The vastly cleaner alternative I originally had in mind was to give TIDs to the zombies which spawn a single head with the same TID + 1000, then have the head repeatedly jump to the zombie's location.

This was just a lot easier to type up in ten minutes in the middle of the night. :mrgreen:
User avatar
Matt
Putting the XD into *xdeath since 2007
 
Joined: 04 Jan 2004
Location: Gotham City SAR, Wyld-Lands of the Lotus People, Dominionist PetroConfederacy of Saudi Canadia

Postby Ryan Cordell » Thu May 31, 2007 11:14 am

Wouldn't it be better (and cleaner) to just write it like this?

Code: Select allExpand view
   spawn:
      POSS A 0
      POSS AABB 4 A_Look
      POSS AABB 0 A_SpawnItemEx ("ZombieHead", 6, 0, 40, 0, 0, 0, 0, 16)
      loop
   missile:
      POSS EEE 4 A_FaceTarget
      POSS EEE 0 A_SpawnItemEx ("ZombieHead", -2, 0, 40, 0, 0, 0, 0, 16)
      POSS F 4 bright A_PosAttack
      POSS F 0 A_SpawnItemEx ("ZombieHead", -2, 0, 40, 0, 0, 0, 0, 16)
      POSS EE 4 A_SpawnItemEx ("ZombieHead", -2, 0, 40, 0, 0, 0, 0, 16)
      goto see
   pain:
      POSS E 0 A_SpawnItemEx ("ZombieHead", -2, 0, 40, 0, 0, 0, 0, 16)
      POSS E 4 HealThing (999)
      POSS E 0 A_SpawnItemEx ("ZombieHead", -2, 0, 40, 0, 0, 0, 0, 16)
      POSS E 4 A_Pain
      goto see
   see:
      POSS ABCD 4 A_Chase
      POSS ABCD 0 A_SpawnItemEx ("ZombieHead", 6, 0, 40, 2, 0, 0, 0, 16)
      loop
User avatar
Ryan Cordell
PDA Man
 
Joined: 06 Feb 2005
Location: Capital of Explodistan
Operating System: Windows 10/8.1/8/201x 64-bit
Graphics Processor: nVidia (Modern GZDoom)

Postby masterofpsi » Thu May 31, 2007 11:14 am

This would be great for a survival kind of mod. Civilian weapons, really powerful zombies that only take damage to the head... It would be awesome.
User avatar
masterofpsi
I don't pirate games! I acquire undocumented ownership!!
 
Joined: 16 Jan 2005
Location: Rocking on.

Postby Ryan Cordell » Thu May 31, 2007 11:15 am

However easy this would be, this could bring up the amusing sight of gunning a Zombie to the crotch. :)
User avatar
Ryan Cordell
PDA Man
 
Joined: 06 Feb 2005
Location: Capital of Explodistan
Operating System: Windows 10/8.1/8/201x 64-bit
Graphics Processor: nVidia (Modern GZDoom)

Postby HotWax » Thu May 31, 2007 11:24 am

Blade Nightflame wrote:Wouldn't it be better (and cleaner) to just write it like this?

Code: Select allExpand view
   spawn:
      POSS A 0
      POSS AABB 4 A_Look
      POSS AABB 0 A_SpawnItemEx ("ZombieHead", 6, 0, 40, 0, 0, 0, 0, 16)
      loop

That's not how Decorate works.

The original version does this:

1: Spawn a head target.
2: Immediately display frame A for 4 tics, and look for a player to start chasing.
3: Repeat steps 1 & 2.
4: Spawn a head target.
5: Immediately display frame B for 4 tics, and look for a player to start chasing.
6: Repeat steps 4 and 5.
7: Loop.

Your version does this:

1: Display frame A for 4 tics, and look for a player to start chasing.
2: Repeat step 1.
3: Display frame B for 4 tics, and look for a player to start chasing.
4: Repeat step 3.
5: Spawn 4 head targets in the same tic.
6: Loop.

The original version has the effect that each frame is shown for 8 tics, however the enemy looks for a target to chase twice per frame (every 4 tics). Since the head target only lives for 4 tics, two head targets are also spawned per frame.

Your See state is even worse, since the enemy would chase after the player for 16 tics before spawning 4 heads at its location and repeating the process. As a result, the head target would lag well behind the moving enemy.
Last edited by HotWax on Thu May 31, 2007 12:54 pm, edited 1 time in total.
User avatar
HotWax
Do what you must, and pay the price later.
 
Joined: 19 Jul 2003
Location: Idaho Falls, ID

Postby Matt » Thu May 31, 2007 12:10 pm

I just noticed that this method needs a slight overlap between each new head or you'd get a gap between frames where a headshot is impossible... so in the above example the head's first spawn frame should be 5 rather than 4.

What was Caligari's method anyway? According to his OP it only worked for one angle...
User avatar
Matt
Putting the XD into *xdeath since 2007
 
Joined: 04 Jan 2004
Location: Gotham City SAR, Wyld-Lands of the Lotus People, Dominionist PetroConfederacy of Saudi Canadia

Next

Return to General

Who is online

Users browsing this forum: No registered users and 5 guests