Weird damagetype problem here.

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
User avatar
Ceeb
Posts: 5125
Joined: Wed Jun 11, 2008 4:07 pm
Location: Castle Wut

Weird damagetype problem here.

Post by Ceeb »

I have a flame thrower zombie in my WAD, and when killed, his fuel tank sometimes blows down (always if you set him on fire :P). Anyway, this explosion can engulf surrounding enemies, and it should light them on fire. Here's where it gets strange.

If you kill him with a regular weapon (shotgun, minigun, chainsaw, what have you) then, if he explodes, he'll severely damage everything around him, but it's regular old damage. Enemies are gibbed.

If you light him on fire, everything around him is struck with fire damage, lighting them ablaze. :| It should do fire damage anyway. Here's the code for the zombie, and a special version who blows up no matter what.

Code: Select all

ACTOR FlamethrowerZombie 25641
{
      Health 80
      Speed 9
      Radius 20
      Height 56
      Mass 100
      PainChance 200
      damagefactor "CrossbowBolt", 100
      MONSTER
      +FLOORCLIP
      +MISSILEMORE
      Damagetype "Fire"
      maxtargetrange 300
      SeeSound "grunt/sight" 
      PainSound "grunt/pain" 
      Deathsound "grunt/death" 
      ActiveSound "grunt/active"
      Obituary "%o was lit on fire by a marine!"
      States
      {
      Spawn:
         FLZM AB 10 A_Look
         Loop
      See:
         TNT1 A 0 A_PlaySoundEx("weapons/flameidle", "SoundSlot7",1)
         FLZM AABBCCDD 3 A_Chase
         Loop
      Missile:
         FLZM E 2 A_FaceTarget
         FLZM F 2 A_CustomMissile ("FlameMissile_", 32, 0, 0)
         FLZM F 2 A_SentinelRefire
         Goto Missile+1
      Pain:
         FLZM G 2
         FLZM G 4 A_Pain
         Goto See
      Death:
	 TNT1 A 0 A_Jump (175, "Burn")
         FLZM H 5 A_SpawnItem("WormFlamethrower")
         FLZM I 5 A_Scream
         FLZM J 5
         FLZM K 5 A_Fall
         TNT1 A 0 A_StopSoundEx("SoundSlot7")
         FLZM L -1
      XDeath:
         Goto Burn
      Crush:
    	 TNT1 A 0 A_NoBlocking
         TNT1 A 0 A_StopSoundEx("SoundSlot7")
    	 POL5 A -1 A_PlaySound("player/male/gibbed")
      Death.CrossbowBolt:
         TNT1 A 0 A_StopSoundEx("SoundSlot7")
	 FLZM O 10 A_PlaySoundEx("bolt/gag", "Voice")
	 FLZM P 60 A_SpawnItem("WormFlamethrower")
	 FLZM Q 10 A_NoBlocking
	 FLZM R 6 A_PlaySoundEx("bolt/splortch","SoundSlot7")
	 FLZM ST 6
         FLZM U -1
      Burn:
      	 TNT1 A 0 A_SpawnItemEx("64BossExplosion",0,0,60)
         TNT1 A 0 A_Explode(500,150)
	 TNT1 A 0 A_JumpIf(waterlevel == 3, "Death")
         TNT1 A 0 A_JumpIf(waterlevel == 2, "Death")
    	 TNT1 A 0 A_NoBlocking
    	 TNT1 A 1 A_SpawnItemEx("ZombieBurningDeath")
         TNT1 A 0 A_StopSoundEx("SoundSlot7")
    	 Stop
      Death.Disintigrate:
         TNT1 A 0 A_SpawnItemEx("ZombieDisintigrationDeath")
         TNT1 A 1 A_NoBlocking
         Stop
      Raise: 
         FLZM LKJIH 5 
         Goto See 
      }
}

ACTOR ReadyToBlowFlamethrowerZombie : FlamethrowerZombie 25642
{

States
{
Death:
Goto Burn
}
}
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49238
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: Weird damagetype problem here.

Post by Graf Zahl »

A monster's own damage type is overridden by the type of damage that kills it. This simply doesn't work.
Gez
 
 
Posts: 17946
Joined: Fri Jul 06, 2007 3:22 pm

Re: Weird damagetype problem here.

Post by Gez »

Interesting behavior. In practical terms, there's only A_Explode that's affected, isn't it? I don't think people typically use other attack functions in death states... Maybe a damage type parameter for A_Explode?
User avatar
Ceeb
Posts: 5125
Joined: Wed Jun 11, 2008 4:07 pm
Location: Castle Wut

Re: Weird damagetype problem here.

Post by Ceeb »

What am I supposed to do then? :blergh:

Maybe I should put a feature suggestion up for A_ExplodeEx or something...
Gez
 
 
Posts: 17946
Joined: Fri Jul 06, 2007 3:22 pm

Re: Weird damagetype problem here.

Post by Gez »

You can do this:

Code: Select all

Actor FlameThrowerZombieExplosion
{
   DamageType "Fire"
   States
   {
   Spawn:
      TNT1 A 0 // Obligatory empty frame
      TNT1 A 0 A_Explode(500,150)
      Stop
   }
}
Then in your zombie's burn state, replace

Code: Select all

TNT1 A 0 A_Explode(500,150)
with

Code: Select all

TNT1 A 0 A_SpawnItemEx("FlameThrowerZombieExplosion", 0, 0, 0, 0, 0, 0, 0, SXF_TRANSFERPOINTERS)
(The seven zeroes and the flag aren't especially necessary, but it's useful to make whoever killed the zombie responsible for the damage inflicted by the explosion, so that infighting and multiplayer crediting of kills are done correctly).
User avatar
Ceeb
Posts: 5125
Joined: Wed Jun 11, 2008 4:07 pm
Location: Castle Wut

Re: Weird damagetype problem here.

Post by Ceeb »

It actually occured to me to do that right before I re-checked this topic.

Nonetheless, thanks for trying, Gez. :) I'm gonna do that right now.

Edit:

That did the trick. BURN, assholes! :twisted:
Locked

Return to “Editing (Archive)”