A_Detonate takes DamageType into consideration
Moderator: GZDoom Developers
A_Detonate takes DamageType into consideration
So I was making some different kinds of barrels that do different types of damage, but I'm finding it difficult to do so because there's no code pointers or methods of attack that allow you to perform a radius attack which deals DamageType damage. Not sure how trivial this would be to implement, but it'd be pretty useful nonetheless.
Re: A_Detonate takes DamageType into consideration
Give a DamageType to the barrels themselves.
Re: A_Detonate takes DamageType into consideration
Already done that. It appears to have no effect.
- XutaWoo
- Posts: 4005
- Joined: Sat Dec 30, 2006 4:25 pm
- Location: beautiful hills of those who are friends
- Contact:
Re: A_Detonate takes DamageType into consideration
Why are you using A_Detonate instead of A_Explode.
While it probably shouldn't make a different, you're using a deprecated function, so it's entirely a possibility.
While it probably shouldn't make a different, you're using a deprecated function, so it's entirely a possibility.
Re: A_Detonate takes DamageType into consideration
There was nothing stating that A_Detonate was deprecated in the wiki, so I'll try A_Explode instead.
Edit:
Still not having the intended effect, here's what I've got in case I'm just messing up somehow:
In theory this should freeze and shatter the player, but it does not do this, even if the Damage puts the player below 0 Health.
Edit:
Still not having the intended effect, here's what I've got in case I'm just messing up somehow:
Code: Select all
// Ice Barrel
actor IceBarrel : ExplosiveBarrel
{
Damage 100
DamageType Ice
Translation Ice
States
{
Death:
BEXP A 5 BRIGHT
BEXP B 5 BRIGHT A_Scream
BEXP C 5 BRIGHT
BEXP D 5 BRIGHT A_Explode
BEXP E 10 BRIGHT
BEXP E 1050 BRIGHT A_BarrelDestroy
BEXP E 5 A_Respawn
Wait
}
}
-
- Posts: 5039
- Joined: Sun Nov 14, 2010 12:59 am
Re: A_Detonate takes DamageType into consideration
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
}
}
Re: A_Detonate takes DamageType into consideration
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.
You could try using [wiki]A_ChangeFlag[/wiki] to set the MISSILE flag just before it explodes.
- NeuralStunner
-
- Posts: 12328
- Joined: Tue Jul 21, 2009 12:04 pm
- Preferred Pronouns: No Preference
- Operating System Version (Optional): Windows 11
- Graphics Processor: nVidia with Vulkan support
- Location: capital N, capital S, no space
- Contact:
Re: A_Detonate takes DamageType into consideration
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.

Deprecation isn't just a tag, it's a "there's a much better method" situation.
Re: A_Detonate takes DamageType into consideration
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 } }
-
- Posts: 5039
- Joined: Sun Nov 14, 2010 12:59 am
Re: A_Detonate takes DamageType into consideration
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.Gez wrote:So, it works when it's a projectile?
I tried that, but it didn't seem work.You could try using [wiki]A_ChangeFlag[/wiki] to set the MISSILE flag just before it explodes.

Re: A_Detonate takes DamageType into consideration
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? 
It's generally safe practice to spawn a projectile and have that explode instead. That usually takes care of issues like this.

It's generally safe practice to spawn a projectile and have that explode instead. That usually takes care of issues like this.
-
- Posts: 17
- Joined: Wed Jun 20, 2012 6:18 pm
Re: A_Detonate takes DamageType into consideration
Barrels inherit the damagetype that killed them, so that's probably related.
-
- Posts: 5039
- Joined: Sun Nov 14, 2010 12:59 am
Re: A_Detonate takes DamageType into consideration
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
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.
- Ed the Bat
- Posts: 3060
- Joined: Thu May 03, 2012 1:18 pm
- Graphics Processor: nVidia with Vulkan support
- Location: Maryland, US
- Contact:
Re: A_Detonate takes DamageType into consideration
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.