A_Detonate takes DamageType into consideration

Post a reply

Smilies
:D :) :( :o :shock: :? 8-) :lol: :x :P :oops: :cry: :evil: :twisted: :roll: :wink: :geek: :ugeek: :!: :?: :idea: :arrow: :| :mrgreen: :3: :wub: >:( :blergh:
View more smilies

BBCode is OFF
Smilies are ON

Topic review
   

Expand view Topic review: A_Detonate takes DamageType into consideration

Re: A_Detonate takes DamageType into consideration

by Graf Zahl » Mon Jul 02, 2012 12:55 am

... and btw, A_Detonate does take DamageType into consideration, so this suggestion won't cure any of the perceived problems.

Re: A_Detonate takes DamageType into consideration

by Kyle873 » Sun Jul 01, 2012 12:40 pm

Graf Zahl wrote:The real problem here is that any damaging attack transfers its damage type to its victim. This is needed to handle damage type specific actions. As a result the barrel will lose its own damage type. This is an inherent limitation of how Doom works. Sorry about it.
Ok that makes a lot more sense then, thanks for clearing that one up.

Re: A_Detonate takes DamageType into consideration

by Ghastly » Sat Jun 30, 2012 7:10 am

Graf Zahl wrote:The real problem here is that any damaging attack transfers its damage type to its victim. This is needed to handle damage type specific actions.
Oh, wow, so this is how we get damagetype-specific pain and death states; it simply checks the actor's current damagetype before before jumping to the related state? Some things are making more sense now. :P

Re: A_Detonate takes DamageType into consideration

by Graf Zahl » Fri Jun 29, 2012 1:13 pm

The real problem here is that any damaging attack transfers its damage type to its victim. This is needed to handle damage type specific actions. As a result the barrel will lose its own damage type. This is an inherent limitation of how Doom works. Sorry about it.

Re: A_Detonate takes DamageType into consideration

by ChronoSeth » Fri Jun 29, 2012 6:13 am

IIRC it's because projectiles always have the shooter as their "target", and A_Explode assumes that whatever is calling it is a projectile.

Re: A_Detonate takes DamageType into consideration

by Ed the Bat » Fri Jun 29, 2012 5:22 am

The exploding barrel transfers a lot of properties from the killer's attack into its own explosion, doesn't it? Things such as damage thrust, among others. I played an old DeHackEd mod which had a monster that exploded as soon as it saw the player, using the barrel's codepointers. The explosion used the properties of whatever weapon the player was holding (even if the player didn't actually attack it) because the player was the barrel's target when it exploded.

Re: A_Detonate takes DamageType into consideration

by Kyle873 » Fri Jun 29, 2012 2:52 am

I implemented Blue Shadow's method and it appears to work the way I'd like it to, thank you for that. Although I'm still in the belief that we need a more flexible way to do this instead of the current behavior.

Re: A_Detonate takes DamageType into consideration

by Blue Shadow » Thu Jun 28, 2012 9:38 pm

I'm inclined to say that it's related; I did a test where I killed myself with a barrel using a weapon that its projectile does ice damage. I died as if I, myself, was killed with an ice-type attack.

Re: A_Detonate takes DamageType into consideration

by NotAGoodName » Thu Jun 28, 2012 8:03 pm

Barrels inherit the damagetype that killed them, so that's probably related.

Re: A_Detonate takes DamageType into consideration

by Xaser » Thu Jun 28, 2012 7:29 pm

This is probably a symptom of "A_Explode (and variants) don't work well with non-projectiles." They never have -- remember the early versions of Doom where enemies that injured themselves with barrels would proceed to commit suicide? :P

It's generally safe practice to spawn a projectile and have that explode instead. That usually takes care of issues like this.

Re: A_Detonate takes DamageType into consideration

by Blue Shadow » Thu Jun 28, 2012 7:12 pm

Gez wrote:So, it works when it's a projectile?
I wasn't sure whether adding the projectile combo flag on the "BarrelBoom" actor was needed or not, but it seems to function fine without it.
You could try using [wiki]A_ChangeFlag[/wiki] to set the MISSILE flag just before it explodes.
I tried that, but it didn't seem work. :?

Re: A_Detonate takes DamageType into consideration

by Gez » Thu Jun 28, 2012 6:15 pm

Kyle873 wrote:I'll try A_Explode instead.

Edit:
Still not having the intended effect
Blue Shadow wrote:This's how I got around this issue in a mod of mine:

Code: Select all

<snip>
    BEXP D 5 Bright A_SpawnItemEx("NC_BarrelBoom", 0, 0, 0, 0, 0, 0, 0, SXF_TRANSFERPOINTERS)
<snip>

ACTOR NC_BarrelBoom
{
  DamageType "Boom"
<snip>
  Projectile
<snip>
  States
  {
  Spawn:
  Death:
    TNT1 A 0
    TNT1 A 0 A_Explode
    Stop
  }
}

Re: A_Detonate takes DamageType into consideration

by NeuralStunner » Thu Jun 28, 2012 6:11 pm

Or you could use the more functional [wiki]A_Explode[/wiki] instead. :?

Deprecation isn't just a tag, it's a "there's a much better method" situation.

Re: A_Detonate takes DamageType into consideration

by Gez » Thu Jun 28, 2012 6:07 pm

So, it works when it's a projectile?

You could try using [wiki]A_ChangeFlag[/wiki] to set the MISSILE flag just before it explodes.

Re: A_Detonate takes DamageType into consideration

by Blue Shadow » Thu Jun 28, 2012 4:01 pm

This's how I got around this issue in a mod of mine:

Code: Select all

ACTOR NC_ExplosiveBarrel : ExplosiveBarrel replaces ExplosiveBarrel
{
  States
  {
  Death:
    BEXP A 5 Bright
    BEXP B 5 Bright A_Scream
    BEXP C 5 Bright
    BEXP D 5 Bright A_SpawnItemEx("NC_BarrelBoom", 0, 0, 0, 0, 0, 0, 0, SXF_TRANSFERPOINTERS)
    BEXP E 10 Bright
    BEXP E 1050 Bright A_BarrelDestroy
    BEXP E 5 A_Respawn
    Wait
  }
}

ACTOR NC_BarrelBoom
{
  DamageType "Boom"
  DeathSound "world/barrelx"
  Height 34
  Obituary "$OB_BARREL"
  Projectile
  Radius 10
  +OLDRADIUSDMG
  States
  {
  Spawn:
  Death:
    TNT1 A 0
    TNT1 A 0 A_Explode
    Stop
  }
}

Top