DMG_EXPLOSION Flag Assignment for Explosions

Moderator: GZDoom Developers

Post Reply
User avatar
Major Cooke
Posts: 8170
Joined: Sun Jan 28, 2007 3:55 pm
Preferred Pronouns: He/Him
Location: QZDoom Maintenance Team

DMG_EXPLOSION Flag Assignment for Explosions

Post by Major Cooke »

Pull Request
P_RadiusAttack, along with blasted touchy actors, will now be given a flag passed to the DamageMobj function: DMG_EXPLOSION.

This is useful for mod compatibility and effects. Currently there is no way to check if damage is resulting from an explosion or not without using damage types. But this introduces incompatibilities with other mods that are supposed to be allowed running with the project.

Projectile damage is one thing, but explosions are another. I'm trying to make a 'concussion' upgrade that allows any explosion to the monster(s) to possibly be stunned. However this can be played with vanilla, and if another mod replaces Rocket, then it would be down to the developer of that mod to ensure their mods fall in compliance instead. This feature eliminates that need and ensures compatibility.

Furthermore, the use of damagetypes would necessitate more damagetype checking. This is a cumbersome aspect I wish to abolish.
Spoiler: Old Post
Last edited by Major Cooke on Thu Sep 13, 2018 9:03 am, edited 3 times in total.
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: Explosion boolean/flag for DamageMobj virtual

Post by Matt »

I've always just applied damage to the actor that's directly hit by the projectile first. What does this do that e.g. +hittracer (or A_Explode using its damagetype parameter) can't do more simply?
User avatar
Major Cooke
Posts: 8170
Joined: Sun Jan 28, 2007 3:55 pm
Preferred Pronouns: He/Him
Location: QZDoom Maintenance Team

Re: Explosion boolean/flag for DamageMobj virtual

Post by Major Cooke »

It's for the actor receiving damage, not the one that hits it.
Remember, monsters can cause explosion damage too.

If I have to include damage types just for explosions, that means potentially more maintenance all around, and the mod suffers potential incompatibility with other mods which might not assign damage types like this.
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: Explosion boolean/flag for DamageMobj virtual

Post by Matt »

In that case it seems like it could be done with a check to see if they're touching the inflictor (CanCollideWith or distance check).

This just seems to me like a very specific ad-hoc check that might be better done through existing scripts... surely one is not running enough explosions constantly for there to be a meaningful advantage in making this native code...
User avatar
Major Cooke
Posts: 8170
Joined: Sun Jan 28, 2007 3:55 pm
Preferred Pronouns: He/Him
Location: QZDoom Maintenance Team

Re: Explosion boolean/flag for DamageMobj virtual

Post by Major Cooke »

CanCollideWith only works on solid objects and projectiles never use that function.

And yes. I do use it a lot with my project. It suffers incompatibilities due to what I'm trying to achieve - a growing resistance to explosion damage by any mod, and any explosion in particular. RadiusDamageFactor will not work in this case because there's still no way to detect if it's an explosion. One thing I want some explosions to do, and NOT by projectile impact, is potentially inflict a stun effect - but only by certain explosions, and only upon them taking damage.

If someone wants to play vanilla with the set of monsters I'm making, I would expect the upgrade they can earn to affect the vanilla rocket launcher WITHOUT modifying it. I do not want to resort to using replacements because that too will break if someone tries to replace the base rocket with any mod.
User avatar
Marisa the Magician
Posts: 3886
Joined: Fri Feb 08, 2008 9:15 am
Preferred Pronouns: She/Her
Operating System Version (Optional): (btw I use) Arch
Graphics Processor: nVidia with Vulkan support
Location: Vigo, Galicia
Contact:

Re: Explosion boolean/flag for DamageMobj virtual

Post by Marisa the Magician »

In the case of missiles you'd use SpecialMissileHit instead of CanCollideWith.
User avatar
Major Cooke
Posts: 8170
Joined: Sun Jan 28, 2007 3:55 pm
Preferred Pronouns: He/Him
Location: QZDoom Maintenance Team

Re: DMG_EXPLOSION Flag Assignment for Explosions

Post by Major Cooke »

Indeed, but that still isn't enough.

Updated first post with submission.

Can a mod move this to the Coded Submissions please? Thanks Marisa!
User avatar
Major Cooke
Posts: 8170
Joined: Sun Jan 28, 2007 3:55 pm
Preferred Pronouns: He/Him
Location: QZDoom Maintenance Team

Re: DMG_EXPLOSION Flag Assignment for Explosions

Post by Major Cooke »

Thanks Graf. This can be closed.
Post Reply

Return to “Closed Feature Suggestions [GZDoom]”