[Added] DMG_EXPLOSION Flag Assignment for Explosions

Moderator: Developers

DMG_EXPLOSION Flag Assignment for Explosions

Postby Major Cooke » Wed Sep 12, 2018 9:52 am

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 10:03 am, edited 3 times in total.
User avatar
Major Cooke
The road to Hell is paved in the carrion she leaves behind.
 
Joined: 28 Jan 2007
Discord: Major Cooke#0846

Re: Explosion boolean/flag for DamageMobj virtual

Postby Matt » Wed Sep 12, 2018 10:34 am

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
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

Re: Explosion boolean/flag for DamageMobj virtual

Postby Major Cooke » Wed Sep 12, 2018 12:04 pm

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
Major Cooke
The road to Hell is paved in the carrion she leaves behind.
 
Joined: 28 Jan 2007
Discord: Major Cooke#0846

Re: Explosion boolean/flag for DamageMobj virtual

Postby Matt » Wed Sep 12, 2018 5:04 pm

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
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

Re: Explosion boolean/flag for DamageMobj virtual

Postby Major Cooke » Thu Sep 13, 2018 8:38 am

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
Major Cooke
The road to Hell is paved in the carrion she leaves behind.
 
Joined: 28 Jan 2007
Discord: Major Cooke#0846

Re: Explosion boolean/flag for DamageMobj virtual

Postby Marisa Kirisame » Thu Sep 13, 2018 8:55 am

In the case of missiles you'd use SpecialMissileHit instead of CanCollideWith.
User avatar
Marisa Kirisame
ZScript Magician
 
 
 
Joined: 08 Feb 2008
Location: Vigo, Galicia
Discord: Marisa Kirisame#4689
Twitch ID: magusmarisa

Re: DMG_EXPLOSION Flag Assignment for Explosions

Postby Major Cooke » Thu Sep 13, 2018 9:51 am

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
The road to Hell is paved in the carrion she leaves behind.
 
Joined: 28 Jan 2007
Discord: Major Cooke#0846

Re: DMG_EXPLOSION Flag Assignment for Explosions

Postby Major Cooke » Sat Sep 15, 2018 9:57 am

Thanks Graf. This can be closed.
User avatar
Major Cooke
The road to Hell is paved in the carrion she leaves behind.
 
Joined: 28 Jan 2007
Discord: Major Cooke#0846


Return to Closed Feature Suggestions

Who is online

Users browsing this forum: No registered users and 2 guests